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