BStream.h
Go to the documentation of this file.
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
11 
16 #ifndef BBINFILETKHEADER
17 #define BBINFILETKHEADER
18 
19 #ifndef _MSC_VER
20 #define __wchar_t wchar_t
21 #endif
22 
23 #ifdef __ia64
24  #ifndef __HP_aCC
25  #error C++ compiler required
26  #endif
27 #else
28  #ifndef __cplusplus
29  #error C++ compiler required
30  #endif
31 #endif
32 
37 #if defined(_MSC_VER) && !defined(BSTREAM_STATIC_LIB)
38  #ifdef BBINFILETK_EXPORTS
39  #define BBINFILETK_API2 __declspec (dllexport)
40  #else
41  #define BBINFILETK_API2 __declspec (dllimport)
42  #endif
43 #endif
44 
45 #if defined(LINUX_SYSTEM) && !defined(BSTREAM_STATIC_LIB)
46  #ifdef BBINFILETK_EXPORTS
47  #define BBINFILETK_API2 __attribute__ ((visibility ("default")))
48  #else
49  #define BBINFILETK_API2
50  #endif
51 #endif
52 
53 #ifndef BBINFILETK_API2
54  #define BBINFILETK_API2
55 #endif
56 
60 #define BBINFILETK_API BBINFILETK_API2
61 
62 
66 #define TK_File_Format_Version 2085
67 
69 // but are mentioned in the spec as test points for format changes)
70 #ifdef CREATE_FILE_FORMAT_HISTORY_TABLE
71  BBINFILETK_API int TK_File_Format_History[] = {
72  // Format Release Notes
73  //------------------------------------------------------------------------------------------
74  // 2085 // static_conditions, cut geometry usage
75  // 2080 // PBR, cutting visualization
76  // 2075 // glyph rotation rendering option
77  // 2070 // TK_UTF8_Strings general flag
78  // 2065 // hidden line sorting
79  // 2060 // selection sorting heuristic
80  // 2055 // geometry options: coordinate systems
81  // 2050 // eye dome lighting back color
82  // 2045 // individual frame buffer effects toggles
83  // 2040 // Support NURBS Surface Trim Start and End parameters
84  // 2035 // window and screen_range offsets
85  // 2030 // cut geometry edge weight/pattern
86  // 2025 // text background, shapes, & leaders
87  // 2020 // separate texture channel locking
88  // 2015 // selection bias
89  // 2010 // complex clip region
90  2005, // selection culling, handling for max distance and view volume culling
91  2000, // depth peeling algorithm
92  1980, // 1980 initial 20 release
93  // 1975 // double precision
94  // 1950 // text font layout
95  1910, // mask transform "offset"
96  1905, // object space clip region
97  1900, // 1900
98  // 1840 // text region fitting
99  // 1835 // png and texture source dimensions
100  // 1830 // texture camera
101  // 1825 // conditional actions
102  // 1820 // separate edge join cutoff
103  // 1815 // named styles
104  // 1810 // material shaders
105  // 1805 // compressed images directly supported in graphics system (jpeg, targa, dxt, luminance8)
106  1800, // 1800
107  // 1790 // hlr transparency cutoff
108  // 1785 // contour and isoline options, diffuse texture tint, diffuse color tint
109  // 1780 // new indexed user data
110  // 1775 // new text alignment format, explicit patterns
111  // 1770 // text character color & horizontal offset, vertex displacement, hlr render text, max extent level
112  // 1765 // force defer, vertex decimation, model type
113  // 1760 // transparency depth writing
114  // 1755 // rgba vertex colors
115  // 1750 // hard extent culling
116  1715, // 17.1 vertex displacement backport
117  1710, // ignore subsegment locks
118  1700, // 1700
119  // 1660 // camera relative lights
120  // 1655 // reflection visibility
121  // 1650 // ambient up vector, separate ambient colors, gooch options, marker index interpolation
122  1615, // anti-alias
123  1610, // 1610
124  // 1605 // infinite ray, zsort options, geometry options
125  1600, // 1600
126  // 1555 // fix to some color types
127  // 1550 // colors can now have Geo_Extended2, shadow map/simple reflection rendering options
128  // 1520 // geometry reference
129  // 1515 // shadow map options, selection level, display list levels, simple reflection, infinite line opcode
130  // 1510 // maximum extent mode
131  // 1505 // screen range, depth images
132  1500, // 1500
133  // 1415 // obscuration use octree
134  // 1410 // simple shadow opacity, anisotropic texture filter
135  // 1405 // join cutoff angle, ordered drawing heuristics
136  1401, // 1410 internal polyline selection limit
137  1400, // 1400
138  // 1345 // string format color maps
139  // 1340 // rgba image compression
140  // 1335 // general displacement
141  // 1330 // priority
142  // 1325 // text greeking mode, extended text renderer & text preference
143  // 1320 // Heuristic_Detail_Selection, nonculled edge visibility
144  // 1315 // distance threshold LOD option, new fallback type "bounding none"
145  // 1310 // depth peeling
146  // 1305 // cutting section, adjacent edge visibility, force grayscale
147  1300, // 1300
148  // 1220 // font bold/italic/renderer, cut geometry color locks
149  // 1215 // circular center
150  // 1210 // geometry-level attributes, text character attributes, unicode32, image tint
151  // 1205 // obscuration pixel threshold, subpixel culling, hard edge angle
152  1200, // 1200
153  // 1175 // explicit parameter width, uncompressed parameters
154  // 1170 // camera relative lights, simple shadow mode
155  // 1165 // extended texture definitions
156  // 1160 // glyph definitions & line styles
157  // 1155 // spheres, texture downsamping, compressed dictionary, image reference
158  // 1150 // conditions, new hlr options (color, weight)
159  1105, // additional polyhedron attributes
160  1100, // 1100
161  // 1002 // simple shadow options, text region
162  // 1001 // camera near_limit, mask transform, image size/scale, new texture options
163  1000, // 1000
164  // 908 // threshold type in LOD options
165  // 907 // polar normals
166  // 906 // edgebreaker changes
167  // 905 // hlr silhouette cleanup, unicode_options
168  900, // 900
169  // 806 // bounding box inheritance, cut geometry options, fast hidden line,
170  // hidden line render faces, depth range, gradient window patterns,
171  // additional NURBS surface controls
172  // 805 // polycylinder attributes, ExRef, URL
173  800, // 800
174  710, // 760 new transparency controls, dictionary format 2
175  // 705, // PolyCylinder, Extended Heuristics, XML, LoD collections, Shell Regions
176  // 702, // PolyPolypoint
177  700, // 700
178  // 652, // null shell
179  651, // 661
180  // 650, // NURBS Surface, Cylinder, Extended Rendering_Options, Defined Fonts, Selectability
181  // extensive polyhedron data & compression changes
182  // 610, // View
183  // 600, // Stream version generally synched to Hoops version
184  // 601, // support longer text string
185  105, // 600 Generate_Dictionary changed to Suppress_Dictionary
186  100, // 500 Initial release
187  0 // [list termination]
188  };
189 #else
190  extern BBINFILETK_API int TK_File_Format_History[];
191 #endif
192 
193 
194 #define TK_DEFAULT_BUFFER_SIZE 32768
195 
196 
197 
198 #ifdef HSTREAM_READONLY
199  #ifndef BSTREAM_READONLY
200  #define BSTREAM_READONLY
201  #endif
202 #endif
203 #ifdef BSTREAM_READONLY
204  extern char const stream_readonly[];
205 #endif
206 #ifdef BSTREAM_DISABLE_QUANTIZATION
207  extern char const stream_disable_quantization[];
208 #endif
209 #ifdef BSTREAM_DISABLE_EDGEBREAKER
210  extern char const stream_disable_edgebreaker[];
211 #endif
212 #ifdef BSTREAM_DISABLE_REPULSE_COMPRESSION
213  extern char const stream_disable_repulse_compression[];
214 #endif
215 #ifdef BSTREAM_DISABLE_ASCII
216  extern char const stream_disable_ascii[];
217 #endif
218 
219 
220 #ifdef _MSC_VER
221 # pragma warning ( push )
222 # pragma warning (disable: 4577) // 'noexcept' used with no exception handling mode specified;
223 #endif
224 
225 #include <cmath>
226 
227 #ifdef _MSC_VER
228 # pragma warning ( pop )
229 #endif
230 
231 #include <cstring>
232 #include <cstdio>
233 
234 #ifdef NEED_BOOL_TYPE
235  #undef NEED_BOOL_TYPE
236  typedef int bool;
237 
238  const bool true = !0;
239  const bool false = 0;
240 #endif
241 
242 
247 #ifndef SWIG
248 #if defined(WIN64) || defined(_WIN64)
249 # define ID_Key __int64
250 #else
251 # define ID_Key long
252 #endif
253 #endif
254 
255 
256 #ifndef alter
257 # define alter
258 #endif
259 
260 
261 #ifndef HPS_CORE_BUILD
262 template <typename T> void Swap (T & a, T & b) { T tmp = a; a = b; b = tmp; }
263 #endif
264 
265 
270 
275 enum TK_Status {
276  TK_Normal = 0,
277  TK_Error = 1,
278  TK_Pause = 2,
279  TK_Single = 3,
285  TK_Abort = 9,
287 };
291 
299  TK_Suppress_LOD = 0x00000002,
303  TK_Force_Tags = 0x00000020,
306  TK_Disable_Instancing = 0x00000200,
307  TK_Generate_Dictionary = 0x00000400,
309  TK_Disable_Tristrips = 0x00001000,
311  TK_Global_Quantization = 0x00004000,
315  TK_Communicator_Mode = 0x00040000,
317 };
318 
319 
325 };
326 
327 
333  TK_Ignore_Version = 0x00000002,
335  TK_Ignore_Bounding_LODs = 0x00000008,
336  TK_Disable_Deferal = 0x00000010
337 };
338 
343  TK_Logging_Sequence = 0x00000001,
344  TK_Logging_Tagging = 0x00000002,
346 };
347 
348 
353  // for Geometries and some attributes
355 
356  // for includes and styles
358  TK_Has_Filter = 0x02,
359  TK_Has_Custody = 0x04,
361 };
362 
363 
364 #include "BOpcodeHandler.h"
365 #include "BStreamFileToolkit.h"
366 
372 
383 #ifndef SWIG
384 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, BStreamFileToolkit * tk);
385 #endif
386 
388 
397 #ifndef SWIG
398 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, int flags = 0);
399 #endif
400 
401 
402 
403 
405 TK_Status BBINFILETK_API TK_Read_Stream_File (__wchar_t const * filename, BStreamFileToolkit * tk);
406 #ifdef _MSC_VER
407 TK_Status BBINFILETK_API TK_Read_Stream_File (unsigned short const * filename, BStreamFileToolkit * tk);
408 #endif
409 
411 TK_Status BBINFILETK_API TK_Read_Stream_File (__wchar_t const * filename, int flags = 0);
412 #ifdef _MSC_VER
413 TK_Status BBINFILETK_API TK_Read_Stream_File (unsigned short const * filename, int flags = 0);
414 #endif
415 
416 
418 
425 #ifndef SWIG
426 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, int flags, BStreamFileToolkit * tk);
427 #endif
428 
430 #endif
431 
Definition: BStream.h:283
entity has an owning interest in its referee
Definition: BStream.h:359
Definition: BStream.h:306
TK_File_Read_Options
Definition: BStream.h:331
Definition: BStream.h:310
Contains data types which are used by BBaseOpcodeHandler.
Definition: BStream.h:309
TK_Debug_Logging_Options
Definition: BStream.h:342
Definition: BStream.h:343
entity string(s) are UTF8 rather than (presumably) ISO Latin-1
Definition: BStream.h:360
Definition: BStream.h:280
The BStreamFileToolkit class provides support for importing/exporting HOOPS Stream File information...
Definition: BStreamFileToolkit.h:367
Definition: BStream.h:332
TK_Dictionary_Options
Definition: BStream.h:323
Definition: BStream.h:311
Definition: BStream.h:303
Definition: BStream.h:277
Definition: BStream.h:336
TK_Status BBINFILETK_API TK_Read_Stream_File(char const *filename, BStreamFileToolkit *tk)
Reads a HOOPS Stream File.
Definition: BStream.h:301
Definition: BStream.h:316
BBINFILETK_API int TK_File_Format_History[]
Table of format changes, commented values are informational (were never included in a release...
Definition: BStream.h:334
Definition: BStream.h:281
Definition: BStream.h:300
Definition: BStream.h:276
Definition: BStream.h:299
Definition: BStream.h:278
entity has an associated condition
Definition: BStream.h:357
TK_File_Write_Options
Options which control how the HOOPS Stream File is generated.
Definition: BStream.h:298
Definition: BStream.h:344
TK_General_Flags
Definition: BStream.h:352
Definition: BStream.h:312
Definition: BStream.h:305
entity has an associated filter
Definition: BStream.h:358
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:275
Definition: BStream.h:313
dictionary entries include bounding volume info
Definition: BStream.h:324
Definition: BStream.h:345
Definition: BStream.h:308
Definition: BStream.h:285
Definition: BStream.h:304
Definition: BStream.h:286
Definition: BStream.h:284
Definition: BStream.h:279
Definition: BStream.h:335
Definition: BStream.h:333
Definition: BStream.h:315
Definition: BStream.h:314
Definition: BStream.h:307
Definition: BStream.h:282
Definition: BStream.h:302
entity is double precision
Definition: BStream.h:354