BStream.h

Go to the documentation of this file.
00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Header: //DWF/Working_Area/Willie.Zhu/w3dtk/BStream.h#1 $
00013 //
00014 
00016 
00021 #include "dwf/Toolkit.h"
00022 
00023 #ifndef BBINFILETKHEADER
00024 #define BBINFILETKHEADER
00025 
00026 #ifdef __ia64
00027     #ifndef __HP_aCC
00028         #error C++ compiler required
00029     #endif
00030 #else
00031     #ifndef __cplusplus
00032         #error C++ compiler required
00033     #endif
00034 #endif
00035 
00036 //
00037 // Required for non-Win32 builds
00038 // This pulls in the ./configure settings
00039 //
00040 #ifdef  HAVE_CONFIG_H
00041 #include "dwf/config.h"
00042 #endif
00043 
00044 #ifdef __APPLE_CC__
00045         #ifdef __i386__
00046                 #undef STREAM_BIGENDIAN
00047         #else
00048                 #define STREAM_BIGENDIAN
00049         #endif
00050 #endif
00051 
00052 
00054 //
00055 // Recognize the newer DWF Toolkit pre-processor macros
00056 // 
00057 //
00058 #ifdef  DWFTK_STATIC
00059 #ifndef BSTREAM_STATIC_LIB
00060 #define BSTREAM_STATIC_LIB
00061 #endif
00062 #ifndef HOOPSUTILITY_STATIC_LIB
00063 #define HOOPSUTILITY_STATIC_LIB
00064 #endif
00065 #endif
00066 
00067 #ifdef  DWFTK_READ_ONLY
00068 #ifndef BSTREAM_READONLY
00069 #define BSTREAM_READONLY
00070 #endif
00071 #endif
00072 
00073 #ifdef  DWFTK_EXPORT_API
00074 #ifndef BBINFILETK_EXPORTS
00075 #define BBINFILETK_EXPORTS
00076 #endif
00077 #ifndef HOOPSUTILITY_EXPORTS
00078 #define HOOPSUTILITY_EXPORTS
00079 #endif
00080 #endif
00081 
00082 //
00083 // For DWF, we want this disabled always!
00084 //
00085 #ifndef BSTREAM_DISABLE_REPULSE_COMPRESSION
00086 #define BSTREAM_DISABLE_REPULSE_COMPRESSION
00087 #endif
00088 
00089 
00090 
00095 #if defined(_MSC_VER) && !defined(BSTREAM_STATIC_LIB)
00096     #ifdef BBINFILETK_EXPORTS
00097         #define BBINFILETK_API2  __declspec (dllexport)
00098     #else
00099         #define BBINFILETK_API2  __declspec (dllimport)
00100     #endif
00101 #else
00102     #define BBINFILETK_API2
00103 #endif
00104 
00105 
00109 #ifdef TEST_RIG_1
00110     #define BBINFILETK_API
00111 #else
00112     #define BBINFILETK_API BBINFILETK_API2
00113 #endif
00114 
00115 
00119 #define TK_File_Format_Version       1555   // 15.55
00120 
00122 //    but are mentioned in the spec as test points for format changes)
00123 #ifdef CREATE_FILE_FORMAT_HISTORY_TABLE
00124     BBINFILETK_API int TK_File_Format_History[] = {
00125                 //  Format   Release     Notes
00126                 //------------------------------------------------------------------------------------------
00127                 //      1555    //                      fix to some color types
00128                 //      1550    //                      colors can now have Geo_Extended2, shadow map/simple reflection rendering options
00129                 //      1520    //                      geometry reference
00130                 //      1515    //                      shadow map options, selection level, display list levels, simple reflection, infinite line opcode
00131                 //      1510    //                      maximum extent mode
00132                 //      1505    //                      screen range, depth images
00133                         1500,   // 1500
00134                 //      1415    //                      obsscuration use octree
00135                 //      1410    //                      simple shadow opacity, anisotropic texture filter
00136                 //      1405    //                      join cutoff angle, ordered drawing heuristics
00137                         1401,   // 1410         internal polyline selection limit
00138                         1400,   // 1400
00139                 //      1345    //                      string format color maps
00140                 //      1340    //                      rgba image compression
00141                 //  1335        //                      general displacement
00142                 //      1330    //                      priority
00143                 //      1325    //                      text greeking mode, extended text renderer & text preference
00144                 //      1320    //                      Heuristic_Detail_Selection, nonculled edge visibility
00145                 //      1315    //                      distance threshold LOD option, new fallback type "bounding none"
00146                 //      1310    //                      depth peeling
00147                 //      1305    //                      cutting section, adjacent edge visibility, force grayscale
00148                         1300,   // 1300
00149                 //      1220    //                      font bold/italic/renderer, cut geometry color locks
00150                 //      1215    //                      circular center
00151                 //      1210    //                      geometry-level attributes, text character attributes, unicode32, image tint
00152                 //      1205    //                      obscuration pixel threshold, subpixel culling, hard edge angle
00153                         1200,   // 1200
00154                 //      1175    //                      explicit parameter width, uncompressed parameters
00155                 //      1170    //                      camera relative lights, simple shadow auto mode
00156                 //      1165    //                      extended texture definitions
00157                 //      1160    //                      glyph definitions & line styles
00158                 //      1155    //                      spheres, texture downsamping, compressed dictionary, image reference
00159                 //      1150    //                      conditions, new hlr options (color, weight)
00160                         1105,   //                      additional polyhedron attributes
00161                         1100,   // 1100
00162                 //      1002    //                      simple shadow options, text region
00163                 //      1001    //                      camera near_limit, mask transform, image size/scale, new texture options
00164                         1000,   // 1000
00165                 //       908    //                      threshold type in LOD options
00166                 //       907    //                      polar normals
00167                 //       906    //                      edgebreaker changes
00168                 //       905    //                      hlr silhouette cleanup, unicode_options
00169                          900,   //  900
00170                 //       806    //                      bounding box inheritance, cut geometry options, fast hidden line,
00171                 //                                              hidden line render faces, depth range, gradient window patterns,
00172                 //                                              additional NURBS surface controls
00173                 //       805    //                      polycylinder attributes, ExRef, URL
00174                          800,   //  800
00175                          710,   //  760         new transparency controls, dictionary format 2
00176                 //       705,   //                      PolyCylinder, Extended Heuristics, XML, LoD collections, Shell Regions
00177                 //       702,   //                      PolyPolypoint
00178                          700,   //  700
00179                 //       652,   //                      null shell
00180                          651,   //  661
00181                 //       650,   //                      NURBS Surface, Cylinder, Extended Rendering_Options, Defined Fonts, Selectability
00182                 //                                              extensive polyhedron data & compression changes
00183                 //       610,   //                      View
00184                 //       600,   //                      Stream version generally synched to Hoops version
00185                 //       601,   //                      support longer text string
00186                          105,   //  600         Generate_Dictionary changed to Suppress_Dictionary
00187                          100,   //  500         Initial release
00188                            0    //                      [list termination]
00189     };
00190 #else
00191     extern BBINFILETK_API int TK_File_Format_History[];
00192 #endif
00193 
00194 
00195 #define TK_DEFAULT_BUFFER_SIZE     32768    
00196 
00197 
00198 
00199 #ifdef HSTREAM_READONLY
00200     #ifndef BSTREAM_READONLY
00201         #define BSTREAM_READONLY
00202     #endif
00203 #endif
00204 #ifdef BSTREAM_READONLY
00205     extern char const stream_readonly[];
00206 #endif
00207 #ifdef BSTREAM_DISABLE_QUANTIZATION
00208     extern char const stream_disable_quantization[];
00209 #endif
00210 #ifdef BSTREAM_DISABLE_EDGEBREAKER
00211     extern char const stream_disable_edgebreaker[];
00212 #endif
00213 #ifdef BSTREAM_DISABLE_REPULSE_COMPRESSION
00214     extern char const stream_disable_repulse_compression[];
00215 #endif
00216 #ifdef BSTREAM_DISABLE_ASCII
00217         extern char const stream_disable_ascii[];
00218 #endif
00219 
00220 
00221 #include <math.h>
00222 #include <string.h>
00223 #include <stdio.h>
00224 
00225 #ifdef NEED_BOOL_TYPE
00226     #undef NEED_BOOL_TYPE
00227     typedef int bool;
00228 
00229     const bool true = !0;
00230     const bool false = 0;
00231 #endif
00232 
00233 
00238 #ifdef _WIN64
00239 #   define  ID_Key      __int64
00240 #else
00241 #   define  ID_Key      long
00242 #endif
00243 
00244 
00245 
00246 #ifndef alter
00247 #   define alter   
00248 #endif
00249 
00250 
00252 
00256 enum TK_Status {
00257     TK_Normal   = 0, 
00258     TK_Error    = 1, 
00259     TK_Pause    = 2, 
00260     TK_Single   = 3, 
00261     TK_Pending  = 4, 
00262     TK_Revisit  = 5, 
00263     TK_Complete = 6, 
00264     TK_Version  = 7, 
00265     TK_NotFound = 8, 
00266     TK_Abort    = 9  
00267 };
00268 
00269 
00271 
00277 enum TK_File_Write_Options {
00278     TK_Suppress_LOD               = 0x00000002, 
00279     TK_Full_Resolution_Vertices   = 0x00000004, 
00280     TK_Full_Resolution_Normals    = 0x00000008, 
00281     TK_First_LOD_Is_Bounding_Box  = 0x00000010, 
00282     TK_Force_Tags                 = 0x00000020, 
00283     TK_Disable_Priority_Heuristic = 0x00000040, 
00284     TK_Disable_Global_Compression = 0x00000100, 
00285     TK_Disable_Instancing         = 0x00000200, 
00286     TK_Generate_Dictionary        = 0x00000400, 
00287     TK_Connectivity_Compression   = 0x00000800, 
00288     TK_Disable_Tristrips          = 0x00001000, 
00289     TK_Disable_Compound_Primitives = 0x00002000, 
00290     TK_Global_Quantization         = 0x00004000,  
00291     TK_Full_Resolution_Parameters  = 0x00008000,  
00292     TK_Full_Resolution = (TK_Full_Resolution_Vertices|TK_Full_Resolution_Normals|TK_Full_Resolution_Parameters) 
00293 };
00294 
00295 
00299 enum TK_Dictionary_Options {
00300     TK_Dictionary_Bounding_Volumes  = 0x00000001  
00301 };
00302 
00303 
00307 enum TK_File_Read_Options {
00308     TK_Flag_Unhandled_Opcodes     = 0x00000001,  
00309     TK_Ignore_Version             = 0x00000002,  
00310     TK_Skip_External_References   = 0x00000004,  
00311     TK_Ignore_Bounding_LODs               = 0x00000008   
00312 };
00313 
00317 enum TK_Debug_Logging_Options {
00318     TK_Logging_Sequence           = 0x00000001,  
00319     TK_Logging_Tagging            = 0x00000002,  
00320     TK_Logging_Segment_Names      = 0x00000004   
00321 };
00322 
00323 
00324 
00325 #include "BOpcodeHandler.h"
00326 #include "BStreamFileToolkit.h"
00327 
00328 
00330 
00340 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, BStreamFileToolkit * tk);
00341 
00343 
00352 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, int flags = 0);
00353 
00355 TK_Status BBINFILETK_API TK_Read_Stream_File  (unsigned short const * filename, BStreamFileToolkit * tk);
00357 TK_Status BBINFILETK_API TK_Read_Stream_File  (unsigned short const * filename, int flags = 0);
00358 
00359 
00360 
00362 
00369 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, int flags, BStreamFileToolkit * tk);
00370 
00371 
00372 #endif
00373 

Generated on Tue Jan 6 22:41:37 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5