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