gmio_stl: move stl_io options into stl_io_options.h

This commit is contained in:
Hugues Delorme 2015-04-02 17:00:49 +02:00
parent 38c444e7b0
commit f0e4c41ed3
2 changed files with 66 additions and 41 deletions

View File

@ -24,6 +24,7 @@
#include "stl_format.h" #include "stl_format.h"
#include "stl_mesh.h" #include "stl_mesh.h"
#include "stl_mesh_creator.h" #include "stl_mesh_creator.h"
#include "stl_io_options.h"
#include "../gmio_core/buffer.h" #include "../gmio_core/buffer.h"
#include "../gmio_core/endian.h" #include "../gmio_core/endian.h"
#include "../gmio_core/transfer.h" #include "../gmio_core/transfer.h"
@ -123,26 +124,6 @@ int gmio_stla_read(
gmio_transfer_t* trsf, gmio_transfer_t* trsf,
gmio_stl_mesh_creator_t* creator); gmio_stl_mesh_creator_t* creator);
/*! Options for gmio_stla_write() */
struct gmio_stla_write_options
{
/*! Name of the solid to appear in "solid <name> \n facet normal ..."
*
* Defaulted to an empty string "" when :
* \li calling gmio_stla_write() with <tt>options == NULL</tt>
* \li OR <tt>solid_name == NULL</tt>
*/
const char* solid_name;
/*! The maximum number of significant digits to write float values
*
* Defaulted to \c 9 when calling gmio_stla_write() with \c options==NULL
*/
uint8_t float32_prec;
};
typedef struct gmio_stla_write_options gmio_stla_write_options_t;
/*! Writes geometry in the STL ascii format /*! Writes geometry in the STL ascii format
* *
* \param mesh Defines the mesh to write * \param mesh Defines the mesh to write
@ -180,27 +161,6 @@ int gmio_stlb_read(
gmio_stl_mesh_creator_t* creator, gmio_stl_mesh_creator_t* creator,
gmio_endianness_t byte_order); gmio_endianness_t byte_order);
/*! Options for gmio_stlb_write() */
struct gmio_stlb_write_options
{
/*! Header data consisting of 80 bytes
*
* Defaulted to an array containing 0 when :
* \li calling gmio_stlb_write() with <tt>options == NULL</tt>
* \li OR <tt>header_data == NULL</tt>
*/
const uint8_t* header_data;
/*! Byte order of the output STL binary data
*
* Defaulted to host's endianness when calling gmio_stlb_write()
* with \c options==NULL
*/
gmio_endianness_t byte_order;
};
typedef struct gmio_stlb_write_options gmio_stlb_write_options_t;
/*! Writes geometry in the STL binary format /*! Writes geometry in the STL binary format
* *
* \param mesh Defines the mesh to write * \param mesh Defines the mesh to write

View File

@ -0,0 +1,65 @@
/****************************************************************************
** GeomIO Library
** Copyright FougSys (2 Mar. 2015)
** contact@fougsys.fr
**
** 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
*/
#ifndef GMIO_STL_IO_OPTIONS_H
#define GMIO_STL_IO_OPTIONS_H
#include "stl_global.h"
#include "../gmio_core/endian.h"
/*! Options for gmio_stla_write() */
struct gmio_stla_write_options
{
/*! Name of the solid to appear in "solid <name> \n facet normal ..."
*
* Defaulted to an empty string "" when :
* \li calling gmio_stla_write() with <tt>options == NULL</tt>
* \li OR <tt>solid_name == NULL</tt>
*/
const char* solid_name;
/*! The maximum number of significant digits to write float values
*
* Defaulted to \c 9 when calling gmio_stla_write() with \c options==NULL
*/
uint8_t float32_prec;
};
typedef struct gmio_stla_write_options gmio_stla_write_options_t;
/*! Options for gmio_stlb_write() */
struct gmio_stlb_write_options
{
/*! Header data consisting of 80 bytes
*
* Defaulted to an array containing 0 when :
* \li calling gmio_stlb_write() with <tt>options == NULL</tt>
* \li OR <tt>header_data == NULL</tt>
*/
const uint8_t* header_data;
/*! Byte order of the output STL binary data
*
* Defaulted to host's endianness when calling gmio_stlb_write()
* with \c options==NULL
*/
gmio_endianness_t byte_order;
};
typedef struct gmio_stlb_write_options gmio_stlb_write_options_t;
#endif /* GMIO_STL_IO_OPTIONS_H */