v0.1.0
Fast, portable C library for geometry input/output
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
stl_io.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** gmio
3 ** Copyright Fougue (24 Jun. 2016)
4 ** contact@fougue.pro
5 **
6 ** This software is a reusable library whose purpose is to provide complete
7 ** I/O support for various CAD file formats (eg. STL)
8 **
9 ** This software is governed by the CeCILL-B license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-B
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
14 ****************************************************************************/
15 
23 #ifndef GMIO_STL_IO_H
24 #define GMIO_STL_IO_H
25 
26 #include "stl_global.h"
27 
28 #include "stl_format.h"
29 #include "stl_io_options.h"
30 #include "stl_mesh.h"
31 #include "stl_mesh_creator.h"
32 #include "../gmio_core/stream.h"
33 #include "../gmio_core/endian.h"
34 
36 
56  struct gmio_stream* stream,
57  struct gmio_stl_mesh_creator* mesh_creator,
58  const struct gmio_stl_read_options* options);
59 
77  const char* filepath,
78  struct gmio_stl_mesh_creator* mesh_creator,
79  const struct gmio_stl_read_options* options);
80 
93  struct gmio_stream* stream,
94  struct gmio_stl_mesh_creator* mesh_creator,
95  const struct gmio_stl_read_options* options);
96 
111  struct gmio_stream* stream,
112  struct gmio_stl_mesh_creator* mesh_creator,
113  enum gmio_endianness byte_order,
114  const struct gmio_stl_read_options* options);
115 
128  enum gmio_stl_format format,
129  struct gmio_stream* stream,
130  const struct gmio_stl_mesh* mesh,
131  const struct gmio_stl_write_options* options);
132 
148  enum gmio_stl_format format,
149  const char* filepath,
150  const struct gmio_stl_mesh* mesh,
151  const struct gmio_stl_write_options* options);
152 
165  struct gmio_stream* stream,
166  enum gmio_endianness byte_order,
167  const struct gmio_stlb_header* header,
168  uint32_t facet_count
169 );
170 
172 
173 #endif /* GMIO_STL_IO_H */
174 
Options of function gmio_stl_read()
Definition: stl_io_options.h:34
int gmio_stl_read(struct gmio_stream *stream, struct gmio_stl_mesh_creator *mesh_creator, const struct gmio_stl_read_options *options)
Reads STL mesh from stream, format is automatically guessed.
Declaration of gmio_stl_mesh.
#define GMIO_API
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL...
Definition: global.h:76
Detection of STL format from input stream.
80-byte data at the beginning of any STL binary file
Definition: stlb_header.h:30
gmio_stl_format
This enums defines the various STL formats.
Definition: stl_format.h:34
int gmio_stl_write_file(enum gmio_stl_format format, const char *filepath, const struct gmio_stl_mesh *mesh, const struct gmio_stl_write_options *options)
Writes STL mesh to stream.
#define GMIO_C_LINKAGE_BEGIN
Expands to extern "C" { when building with a C++ compiler.
Definition: global.h:181
gmio_endianness
This enum identifies common endianness (byte order) of computer memory.
Definition: endian.h:29
Provides an interface for accessing the underlying(hidden) user mesh.
Definition: stl_mesh.h:30
int gmio_stl_write(enum gmio_stl_format format, struct gmio_stream *stream, const struct gmio_stl_mesh *mesh, const struct gmio_stl_write_options *options)
Writes STL mesh to stream.
Global declarations for the STL module.
Options of function gmio_stl_write()
Definition: stl_io_options.h:65
int gmio_stl_read_file(const char *filepath, struct gmio_stl_mesh_creator *mesh_creator, const struct gmio_stl_read_options *options)
Reads STL mesh from a file, format is automatically guessed.
#define GMIO_C_LINKAGE_END
Expands to } when building with a C++ compiler.
Definition: global.h:183
int gmio_stla_read(struct gmio_stream *stream, struct gmio_stl_mesh_creator *mesh_creator, const struct gmio_stl_read_options *options)
Reads mesh from STL ascii stream.
Declaration of gmio_stl_mesh_creator.
Provides an interface for the creation of the underlying(hidden) user mesh.
Definition: stl_mesh_creator.h:71
Stream that can get input from an arbitrary data source or can write output to an arbitrary data sink...
Definition: stream.h:65
Options for STL read/write functions.
int gmio_stlb_header_write(struct gmio_stream *stream, enum gmio_endianness byte_order, const struct gmio_stlb_header *header, uint32_t facet_count)
Writes STL binary header data to stream.
int gmio_stlb_read(struct gmio_stream *stream, struct gmio_stl_mesh_creator *mesh_creator, enum gmio_endianness byte_order, const struct gmio_stl_read_options *options)
Reads mesh from STL binary stream.
Fougue © 2016