Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

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