v0.3.0
Fast, portable C library for geometry input/output
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
stl_infos.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (c) 2016, Fougue Ltd. <http://www.fougue.pro>
3 ** All rights reserved.
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 **
9 ** 1. Redistributions of source code must retain the above copyright
10 ** notice, this list of conditions and the following disclaimer.
11 **
12 ** 2. Redistributions in binary form must reproduce the above
13 ** copyright notice, this list of conditions and the following
14 ** disclaimer in the documentation and/or other materials provided
15 ** with the distribution.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ****************************************************************************/
29 
37 #ifndef GMIO_STL_INFOS_H
38 #define GMIO_STL_INFOS_H
39 
40 #include "stl_global.h"
41 
42 #include "../gmio_core/internal/helper_stream.h"
43 
44 #include <stddef.h>
45 
46 #include "stl_format.h"
47 #include "stlb_header.h"
48 
51 {
54 
56  uint32_t facet_count;
57 
62 
69 
76 
79 };
80 
83 {
86 
89 
92 
95 
99 
102 
105 };
106 
109 {
112 
116 
122 };
123 
125 
141  struct gmio_stl_infos* infos,
142  struct gmio_stream* stream,
143  unsigned flags,
144  const struct gmio_stl_infos_get_options* options);
145 
159  struct gmio_stream* stream,
160  struct gmio_memblock* stream_memblock);
161 
163 
164 #endif /* GMIO_STL_INFOS_H */
165 
uint32_t facet_count
Count of facets(triangles)
Definition: stl_infos.h:56
-> gmio_stl_infos::format
Definition: stl_infos.h:101
char * stla_solidname
STL ascii only: name of the solid.
Definition: stl_infos.h:68
#define GMIO_API
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL...
Definition: global.h:90
Detection of STL format from input stream.
struct gmio_stlb_header stlb_header
STL binary only: header(80-bytes) of STL data.
Definition: stl_infos.h:78
size_t stla_solidname_maxlen
STL ascii only: maximum length(capacity) of stla_solidname.
Definition: stl_infos.h:75
Options of function gmio_stl_infos_get()
Definition: stl_infos.h:108
-> gmio_stl_infos::stla_solidname or gmio_stl_infos::stlb_header
Definition: stl_infos.h:97
-> gmio_stl_infos::stla_solidname
Definition: stl_infos.h:91
80-byte data at the beginning of any STL binary file
Definition: stlb_header.h:44
-> gmio_stl_infos::facet_count
Definition: stl_infos.h:85
Declaration of gmio_stlb_header.
All infos.
Definition: stl_infos.h:104
gmio_stl_format
This enums defines the various STL formats.
Definition: stl_format.h:48
gmio_streamsize_t gmio_stla_infos_get_streamsize(struct gmio_stream *stream, struct gmio_memblock *stream_memblock)
Returns the size(in bytes) of the next STL ascii solid in stream.
-> gmio_stl_infos::size
Definition: stl_infos.h:88
int gmio_stl_infos_get(struct gmio_stl_infos *infos, struct gmio_stream *stream, unsigned flags, const struct gmio_stl_infos_get_options *options)
Finds informations about STL contents.
#define GMIO_C_LINKAGE_BEGIN
Expands to extern "C" { when building with a C++ compiler.
Definition: global.h:195
-> gmio_stl_infos::stlb_header
Definition: stl_infos.h:94
Global declarations for the STL module.
Informations retrieved by gmio_stl_infos_get()
Definition: stl_infos.h:50
enum gmio_stl_format format_hint
Assume STL input format, if GMIO_STL_FORMAT_UNKNOWN then it is automatically guessed.
Definition: stl_infos.h:115
#define GMIO_C_LINKAGE_END
Expands to } when building with a C++ compiler.
Definition: global.h:197
enum gmio_stl_format format
STL format of the input stream.
Definition: stl_infos.h:53
int64_or_long gmio_streamsize_t
Type able to represent the size(in bytes) of a stream.
Definition: stream.h:58
struct gmio_memblock stream_memblock
See gmio_stl_read_options::stream_memblock.
Definition: stl_infos.h:111
gmio_stl_info_flag
Flags(OR-combinations) for each STL info.
Definition: stl_infos.h:82
Stream that can get input from an arbitrary data source or can write output to an arbitrary data sink...
Definition: stream.h:79
gmio_streamsize_t size_limit
Restrict gmio_stl_infos_get() to not read further this limit(in bytes)
Definition: stl_infos.h:121
Basic memory block.
Definition: memblock.h:59
gmio_streamsize_t size
Size of the STL data in bytes.
Definition: stl_infos.h:61
Fougue © 2016