2015-04-02 23:00:49 +08:00
|
|
|
/****************************************************************************
|
2015-05-28 15:40:24 +08:00
|
|
|
** gmio
|
2015-05-01 00:19:45 +08:00
|
|
|
** Copyright Fougue (2 Mar. 2015)
|
2015-07-13 17:42:03 +08:00
|
|
|
** contact@fougue.pro
|
2015-04-02 23:00:49 +08:00
|
|
|
**
|
|
|
|
** This software is a reusable library whose purpose is to provide complete
|
|
|
|
** I/O support for various CAD file formats (eg. STL)
|
|
|
|
**
|
|
|
|
** This software is governed by the CeCILL-B license under French law and
|
|
|
|
** abiding by the rules of distribution of free software. You can use,
|
|
|
|
** modify and/ or redistribute the software under the terms of the CeCILL-B
|
|
|
|
** license as circulated by CEA, CNRS and INRIA at the following URL
|
|
|
|
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*! \file stl_io_options.h
|
|
|
|
* Options for STL read/write functions
|
2015-09-09 17:44:34 +08:00
|
|
|
*
|
|
|
|
* \addtogroup gmio_stl
|
|
|
|
* @{
|
2015-04-02 23:00:49 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GMIO_STL_IO_OPTIONS_H
|
|
|
|
#define GMIO_STL_IO_OPTIONS_H
|
|
|
|
|
|
|
|
#include "stl_global.h"
|
2015-05-28 22:19:07 +08:00
|
|
|
#include "stlb_header.h"
|
2015-04-02 23:00:49 +08:00
|
|
|
#include "../gmio_core/endian.h"
|
2015-04-15 23:11:15 +08:00
|
|
|
#include "../gmio_core/text_format.h"
|
2015-04-02 23:00:49 +08:00
|
|
|
|
2015-04-02 23:59:02 +08:00
|
|
|
/*! Options for gmio_stl_write() */
|
|
|
|
struct gmio_stl_write_options
|
2015-04-02 23:00:49 +08:00
|
|
|
{
|
2015-05-27 23:29:48 +08:00
|
|
|
/*! Flag allowing to skip writting of any header/footer data, but just
|
|
|
|
* triangles
|
|
|
|
*
|
|
|
|
* If set to \c GMIO_TRUE then :
|
2015-09-09 16:56:42 +08:00
|
|
|
* \li for STL ASCII format, <tt>"solid [name]"</tt> and
|
2015-05-27 23:29:48 +08:00
|
|
|
* <tt>"endsolid"</tt> will no be written to output stream
|
2015-05-28 15:36:24 +08:00
|
|
|
* \li for STL binary format, the 80 bytes header followed by the mesh
|
2015-05-27 23:29:48 +08:00
|
|
|
* facet count (4bytes) will no be written to output stream
|
|
|
|
*/
|
|
|
|
gmio_bool_t stl_write_triangles_only;
|
|
|
|
|
2015-09-09 16:56:42 +08:00
|
|
|
/*! Name of the solid to appear in <tt>solid [name] facet normal ...</tt>
|
2015-04-02 23:00:49 +08:00
|
|
|
*
|
2015-04-02 23:59:02 +08:00
|
|
|
* Option useful only with STL ascii format (GMIO_STL_FORMAT_ASCII).
|
|
|
|
*
|
|
|
|
* Defaulted to an empty string \c "" when :
|
|
|
|
* \li calling gmio_stl_write() with <tt>options == NULL</tt>
|
|
|
|
* \li OR <tt>stla_solid_name == NULL</tt>
|
2015-04-02 23:00:49 +08:00
|
|
|
*/
|
2015-04-02 23:59:02 +08:00
|
|
|
const char* stla_solid_name;
|
2015-04-02 23:00:49 +08:00
|
|
|
|
2015-04-15 23:11:15 +08:00
|
|
|
/*! The format used when writting float values as strings
|
|
|
|
*
|
|
|
|
* Option useful only with STL ascii format (GMIO_STL_FORMAT_ASCII).
|
|
|
|
*
|
|
|
|
* Defaulted to \c GMIO_FLOAT_TEXT_FORMAT_DECIMAL_LOWERCASE when calling
|
|
|
|
* gmio_stl_write() with \c options==NULL
|
|
|
|
*/
|
|
|
|
gmio_float_text_format_t stla_float32_format;
|
|
|
|
|
2015-04-02 23:59:02 +08:00
|
|
|
/*! The maximum number of significant digits when writting float values
|
|
|
|
*
|
|
|
|
* Option useful only with STL ascii format (GMIO_STL_FORMAT_ASCII).
|
2015-04-02 23:00:49 +08:00
|
|
|
*
|
2015-04-02 23:59:02 +08:00
|
|
|
* Defaulted to \c 9 when calling gmio_stl_write() with \c options==NULL
|
2015-04-02 23:00:49 +08:00
|
|
|
*/
|
2015-04-02 23:59:02 +08:00
|
|
|
uint8_t stla_float32_prec;
|
2015-04-02 23:00:49 +08:00
|
|
|
|
2015-05-28 22:19:07 +08:00
|
|
|
/*! Header data(80-bytes)
|
2015-04-02 23:00:49 +08:00
|
|
|
*
|
2015-04-02 23:59:02 +08:00
|
|
|
* Option useful only with STL binary formats (GMIO_STL_FORMAT_BINARY_LE
|
|
|
|
* or GMIO_STL_FORMAT_BINARY_BE).
|
2015-04-02 23:00:49 +08:00
|
|
|
*
|
2015-04-02 23:59:02 +08:00
|
|
|
* Defaulted to an array containing 0 when :
|
|
|
|
* \li calling gmio_stl_write() with <tt>options == NULL</tt>
|
|
|
|
* \li OR <tt>stlb_header_data == NULL</tt>
|
2015-04-02 23:00:49 +08:00
|
|
|
*/
|
2015-05-28 22:19:07 +08:00
|
|
|
const gmio_stlb_header_t* stlb_header_data;
|
2015-04-02 23:00:49 +08:00
|
|
|
};
|
2015-04-02 23:59:02 +08:00
|
|
|
typedef struct gmio_stl_write_options gmio_stl_write_options_t;
|
2015-04-02 23:00:49 +08:00
|
|
|
|
|
|
|
#endif /* GMIO_STL_IO_OPTIONS_H */
|
2015-09-09 17:44:34 +08:00
|
|
|
/*! @} */
|