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