v0.4.1
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) 2017, 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 #pragma once
38 
39 #include "stl_global.h"
40 #include "stl_format.h"
41 #include "stlb_header.h"
42 #include <stddef.h>
43 
46 {
49 
51  uint32_t facet_count;
52 
56 
61 
66 
69 };
70 
73 {
76 
79 
82 
85 
89 
92 
95 };
96 
99 {
102 
106 
110 };
111 
113 
131  struct gmio_stl_infos* infos,
132  struct gmio_stream* stream,
133  unsigned flags,
134  const struct gmio_stl_infos_probe_options* options);
135 
149  struct gmio_stl_infos* infos,
150  const char* filepath,
151  unsigned flags,
152  const struct gmio_stl_infos_probe_options* options);
153 
167  struct gmio_stream* stream,
168  struct gmio_memblock* stream_memblock);
169 
171 
Options of function gmio_stl_infos_probe()
Definition: stl_infos.h:98
uint32_t facet_count
Count of facets(triangles)
Definition: stl_infos.h:51
gmio_streamsize_t gmio_stla_infos_probe_streamsize(struct gmio_stream *stream, struct gmio_memblock *stream_memblock)
Returns the size(in bytes) of the next STL ascii solid in stream.
int gmio_stl_infos_probe_file(struct gmio_stl_infos *infos, const char *filepath, unsigned flags, const struct gmio_stl_infos_probe_options *options)
Finds informations about STL contents from a file.
-> gmio_stl_infos::format
Definition: stl_infos.h:91
char * stla_solidname
STL ascii only: name of the solid.
Definition: stl_infos.h:60
#define GMIO_API
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL...
Definition: global.h:89
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:68
size_t stla_solidname_maxlen
STL ascii only: maximum length(capacity) of stla_solidname.
Definition: stl_infos.h:65
-> gmio_stl_infos::stla_solidname or gmio_stl_infos::stlb_header
Definition: stl_infos.h:87
-> gmio_stl_infos::stla_solidname
Definition: stl_infos.h:81
80-byte data at the beginning of any STL binary file
Definition: stlb_header.h:43
-> gmio_stl_infos::facet_count
Definition: stl_infos.h:75
Declaration of gmio_stlb_header.
All infos.
Definition: stl_infos.h:94
gmio_stl_format
Various STL formats.
Definition: stl_format.h:47
-> gmio_stl_infos::size
Definition: stl_infos.h:78
#define GMIO_C_LINKAGE_BEGIN
Expands to extern "C" { when building with a C++ compiler.
Definition: global.h:203
-> gmio_stl_infos::stlb_header
Definition: stl_infos.h:84
Global declarations for the STL module.
gmio_streamsize_t size_limit
Restrict gmio_stl_infos_probe() to not read further this limit(in bytes)
Definition: stl_infos.h:109
enum gmio_stl_format format_hint
Assume STL input format, if GMIO_STL_FORMAT_UNKNOWN then it is automatically guessed.
Definition: stl_infos.h:105
Informations retrieved by gmio_stl_infos_probe()
Definition: stl_infos.h:45
#define GMIO_C_LINKAGE_END
Expands to } when building with a C++ compiler.
Definition: global.h:205
enum gmio_stl_format format
STL format of the input stream.
Definition: stl_infos.h:48
int64_or_long gmio_streamsize_t
Type able to represent the size(in bytes) of a stream.
Definition: stream.h:57
gmio_stl_info_flag
Flags(OR-combinations) for each STL info.
Definition: stl_infos.h:72
Stream that can get input from an arbitrary data source or can write output to an arbitrary data sink...
Definition: stream.h:78
Basic memory block.
Definition: memblock.h:57
int gmio_stl_infos_probe(struct gmio_stl_infos *infos, struct gmio_stream *stream, unsigned flags, const struct gmio_stl_infos_probe_options *options)
Finds informations about STL contents.
gmio_streamsize_t size
Size of the STL data in bytes.
Definition: stl_infos.h:55
struct gmio_memblock stream_memblock
See gmio_stl_read_options::stream_memblock.
Definition: stl_infos.h:101
Fougue © 2017