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