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 #ifdef TEST_RIG_1
61  #define BBINFILETK_API
62 #else
63  #define BBINFILETK_API BBINFILETK_API2
64 #endif
65 
66 
70 #define TK_File_Format_Version 2015 // 20.15
71 
73 // but are mentioned in the spec as test points for format changes)
74 #ifdef CREATE_FILE_FORMAT_HISTORY_TABLE
75  BBINFILETK_API int TK_File_Format_History[] = {
76  // Format Release Notes
77  //------------------------------------------------------------------------------------------
78  // 2015 // selection bias
79  // 2010 // complex clip region
80  2005, // selection culling, handling for max distance and view volume culling
81  2000, // depth peeling algorithm
82  1980, // 1980 initial 20 release
83  // 1975 // double precision
84  // 1950 // text font layout
85  1910, // mask transform "offset"
86  1905, // object space clip region
87  1900, // 1900
88  // 1840 // text region fitting
89  // 1835 // png and texture source dimensions
90  // 1830 // texture camera
91  // 1825 // conditional actions
92  // 1820 // separate edge join cutoff
93  // 1815 // named styles
94  // 1810 // material shaders
95  // 1805 // compressed images directly supported in graphics system (jpeg, targa, dxt, luminance8)
96  1800, // 1800
97  // 1790 // hlr transparency cutoff
98  // 1785 // contour and isoline options, diffuse texture tint, diffuse color tint
99  // 1780 // new indexed user data
100  // 1775 // new text alignment format, explicit patterns
101  // 1770 // text character color & horizontal offset, vertex displacement, hlr render text, max extent level
102  // 1765 // force defer, vertex decimation, model type
103  // 1760 // transparency depth writing
104  // 1755 // rgba vertex colors
105  // 1750 // hard extent culling
106  1715, // 17.1 vertex displacement backport
107  1710, // ignore subsegment locks
108  1700, // 1700
109  // 1660 // camera relative lights
110  // 1655 // reflection visibility
111  // 1650 // ambient up vector, separate ambient colors, gooch options, marker index interpolation
112  1615, // anti-alias
113  1610, // 1610
114  // 1605 // infinite ray, zsort options, geometry options
115  1600, // 1600
116  // 1555 // fix to some color types
117  // 1550 // colors can now have Geo_Extended2, shadow map/simple reflection rendering options
118  // 1520 // geometry reference
119  // 1515 // shadow map options, selection level, display list levels, simple reflection, infinite line opcode
120  // 1510 // maximum extent mode
121  // 1505 // screen range, depth images
122  1500, // 1500
123  // 1415 // obscuration use octree
124  // 1410 // simple shadow opacity, anisotropic texture filter
125  // 1405 // join cutoff angle, ordered drawing heuristics
126  1401, // 1410 internal polyline selection limit
127  1400, // 1400
128  // 1345 // string format color maps
129  // 1340 // rgba image compression
130  // 1335 // general displacement
131  // 1330 // priority
132  // 1325 // text greeking mode, extended text renderer & text preference
133  // 1320 // Heuristic_Detail_Selection, nonculled edge visibility
134  // 1315 // distance threshold LOD option, new fallback type "bounding none"
135  // 1310 // depth peeling
136  // 1305 // cutting section, adjacent edge visibility, force grayscale
137  1300, // 1300
138  // 1220 // font bold/italic/renderer, cut geometry color locks
139  // 1215 // circular center
140  // 1210 // geometry-level attributes, text character attributes, unicode32, image tint
141  // 1205 // obscuration pixel threshold, subpixel culling, hard edge angle
142  1200, // 1200
143  // 1175 // explicit parameter width, uncompressed parameters
144  // 1170 // camera relative lights, simple shadow mode
145  // 1165 // extended texture definitions
146  // 1160 // glyph definitions & line styles
147  // 1155 // spheres, texture downsamping, compressed dictionary, image reference
148  // 1150 // conditions, new hlr options (color, weight)
149  1105, // additional polyhedron attributes
150  1100, // 1100
151  // 1002 // simple shadow options, text region
152  // 1001 // camera near_limit, mask transform, image size/scale, new texture options
153  1000, // 1000
154  // 908 // threshold type in LOD options
155  // 907 // polar normals
156  // 906 // edgebreaker changes
157  // 905 // hlr silhouette cleanup, unicode_options
158  900, // 900
159  // 806 // bounding box inheritance, cut geometry options, fast hidden line,
160  // hidden line render faces, depth range, gradient window patterns,
161  // additional NURBS surface controls
162  // 805 // polycylinder attributes, ExRef, URL
163  800, // 800
164  710, // 760 new transparency controls, dictionary format 2
165  // 705, // PolyCylinder, Extended Heuristics, XML, LoD collections, Shell Regions
166  // 702, // PolyPolypoint
167  700, // 700
168  // 652, // null shell
169  651, // 661
170  // 650, // NURBS Surface, Cylinder, Extended Rendering_Options, Defined Fonts, Selectability
171  // extensive polyhedron data & compression changes
172  // 610, // View
173  // 600, // Stream version generally synched to Hoops version
174  // 601, // support longer text string
175  105, // 600 Generate_Dictionary changed to Suppress_Dictionary
176  100, // 500 Initial release
177  0 // [list termination]
178  };
179 #else
180  extern BBINFILETK_API int TK_File_Format_History[];
181 #endif
182 
183 
184 #define TK_DEFAULT_BUFFER_SIZE 32768
185 
186 
187 
188 #ifdef HSTREAM_READONLY
189  #ifndef BSTREAM_READONLY
190  #define BSTREAM_READONLY
191  #endif
192 #endif
193 #ifdef BSTREAM_READONLY
194  extern char const stream_readonly[];
195 #endif
196 #ifdef BSTREAM_DISABLE_QUANTIZATION
197  extern char const stream_disable_quantization[];
198 #endif
199 #ifdef BSTREAM_DISABLE_EDGEBREAKER
200  extern char const stream_disable_edgebreaker[];
201 #endif
202 #ifdef BSTREAM_DISABLE_REPULSE_COMPRESSION
203  extern char const stream_disable_repulse_compression[];
204 #endif
205 #ifdef BSTREAM_DISABLE_ASCII
206  extern char const stream_disable_ascii[];
207 #endif
208 
209 
210 #include <cmath>
211 #include <cstring>
212 #include <cstdio>
213 
214 #ifdef NEED_BOOL_TYPE
215  #undef NEED_BOOL_TYPE
216  typedef int bool;
217 
218  const bool true = !0;
219  const bool false = 0;
220 #endif
221 
222 
227 #if defined(WIN64) || defined(_WIN64)
228 # define ID_Key __int64
229 #else
230 # define ID_Key long
231 #endif
232 
233 
234 
235 #ifndef alter
236 # define alter
237 #endif
238 
239 
240 #ifndef HPS_CORE_BUILD
241 template <typename T> void Swap (T & a, T & b) { T tmp = a; a = b; b = tmp; }
242 #endif
243 
244 
249 
254 enum TK_Status {
255  TK_Normal = 0,
256  TK_Error = 1,
257  TK_Pause = 2,
258  TK_Single = 3,
264  TK_Abort = 9,
266 };
270 
278  TK_Suppress_LOD = 0x00000002,
282  TK_Force_Tags = 0x00000020,
285  TK_Disable_Instancing = 0x00000200,
286  TK_Generate_Dictionary = 0x00000400,
288  TK_Disable_Tristrips = 0x00001000,
290  TK_Global_Quantization = 0x00004000,
294  TK_Communicator_Mode = 0x00040000,
296 };
297 
298 
304 };
305 
306 
312  TK_Ignore_Version = 0x00000002,
314  TK_Ignore_Bounding_LODs = 0x00000008,
315  TK_Disable_Deferal = 0x00000010
316 };
317 
322  TK_Logging_Sequence = 0x00000001,
323  TK_Logging_Tagging = 0x00000002,
325 };
326 
327 
332  // for Geometryoes and some attributes
334 
335  // for includes and styles
338 };
339 
340 
341 #include "BOpcodeHandler.h"
342 #include "BStreamFileToolkit.h"
343 
349 
360 #ifndef SWIG
361 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, BStreamFileToolkit * tk);
362 #endif
363 
365 
374 #ifndef SWIG
375 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, int flags = 0);
376 #endif
377 
378 
379 
380 
382 TK_Status BBINFILETK_API TK_Read_Stream_File (__wchar_t const * filename, BStreamFileToolkit * tk);
383 #ifdef _MSC_VER
384 TK_Status BBINFILETK_API TK_Read_Stream_File (unsigned short const * filename, BStreamFileToolkit * tk);
385 #endif
386 
388 TK_Status BBINFILETK_API TK_Read_Stream_File (__wchar_t const * filename, int flags = 0);
389 #ifdef _MSC_VER
390 TK_Status BBINFILETK_API TK_Read_Stream_File (unsigned short const * filename, int flags = 0);
391 #endif
392 
393 
395 
402 #ifndef SWIG
403 TK_Status BBINFILETK_API TK_Read_Stream_File (char const * filename, int flags, BStreamFileToolkit * tk);
404 #endif
405 
407 #endif
408 
Definition: BStream.h:262
Definition: BStream.h:285
TK_File_Read_Options
Definition: BStream.h:310
Definition: BStream.h:289
Contains data types which are used by BBaseOpcodeHandler.
Definition: BStream.h:288
TK_Debug_Logging_Options
Definition: BStream.h:321
Definition: BStream.h:322
Definition: BStream.h:259
The BStreamFileToolkit class provides support for importing/exporting HOOPS Stream File information...
Definition: BStreamFileToolkit.h:367
Definition: BStream.h:311
TK_Dictionary_Options
Definition: BStream.h:302
Definition: BStream.h:290
Definition: BStream.h:282
Definition: BStream.h:256
Definition: BStream.h:315
TK_Status BBINFILETK_API TK_Read_Stream_File(char const *filename, BStreamFileToolkit *tk)
Reads a HOOPS Stream File.
Definition: BStream.h:280
Definition: BStream.h:295
BBINFILETK_API int TK_File_Format_History[]
Table of format changes, commented values are informational (were never included in a release...
Definition: BStream.h:313
Definition: BStream.h:260
Definition: BStream.h:279
Definition: BStream.h:255
Definition: BStream.h:278
Definition: BStream.h:257
entity has an associated condition
Definition: BStream.h:336
TK_File_Write_Options
Options which control how the HOOPS Stream File is generated.
Definition: BStream.h:277
Definition: BStream.h:323
TK_General_Flags
Definition: BStream.h:331
Definition: BStream.h:291
Definition: BStream.h:284
entity has an associated filter
Definition: BStream.h:337
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:254
Definition: BStream.h:292
dictionary entries include bounding volume info
Definition: BStream.h:303
Definition: BStream.h:324
Definition: BStream.h:287
Definition: BStream.h:264
Definition: BStream.h:283
Definition: BStream.h:265
Definition: BStream.h:263
Definition: BStream.h:258
Definition: BStream.h:314
Definition: BStream.h:312
Definition: BStream.h:294
Definition: BStream.h:293
Definition: BStream.h:286
Definition: BStream.h:261
Definition: BStream.h:281
entity is double precision
Definition: BStream.h:333