Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

BStream.h

Go to the documentation of this file.
00001 //
00002 // Copyright (c) 2000 by Tech Soft America, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft America, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft America 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 America, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Header: /Components/Internal/DWF Toolkit/v7.0.1/develop/global/src/dwf/w3dtk/BStream.h 5     3/24/05 4:23p Evansg $
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 //
00038 // Required for non-Win32 builds
00039 // This pulls in the ./configure settings
00040 //
00041 #ifdef  HAVE_CONFIG_H
00042 #include "dwf/config.h"
00043 #endif
00044 
00045 
00047 //
00048 // Recognize the newer DWF Toolkit pre-processor macros
00049 // 
00050 //
00051 #ifdef  DWFTK_STATIC
00052 #ifndef BSTREAM_STATIC_LIB
00053 #define BSTREAM_STATIC_LIB
00054 #endif
00055 #ifndef HOOPSUTILITY_STATIC_LIB
00056 #define HOOPSUTILITY_STATIC_LIB
00057 #endif
00058 #endif
00059 
00060 #ifdef  DWFTK_READ_ONLY
00061 #ifndef BSTREAM_READONLY
00062 #define BSTREAM_READONLY
00063 #endif
00064 #endif
00065 
00066 #ifdef  DWFTK_EXPORT_API
00067 #ifndef BBINFILETK_EXPORTS
00068 #define BBINFILETK_EXPORTS
00069 #endif
00070 #ifndef HOOPSUTILITY_EXPORTS
00071 #define HOOPSUTILITY_EXPORTS
00072 #endif
00073 #endif
00074 
00075 //
00076 // For DWF, we want this disabled always!
00077 //
00078 #ifndef BSTREAM_DISABLE_REPULSE_COMPRESSION
00079 #define BSTREAM_DISABLE_REPULSE_COMPRESSION
00080 #endif
00081 
00082 
00083 
00084 
00087 #ifdef _MSC_VER
00088     #ifndef BSTREAM_STATIC_LIB
00089         #ifdef BBINFILETK_EXPORTS
00090             #define BBINFILETK_API  __declspec (dllexport)
00091         #else
00092             #define BBINFILETK_API  __declspec (dllimport)
00093         #endif
00094     #else
00095         #define BBINFILETK_API
00096     #endif
00097 #else
00098     #define BBINFILETK_API
00099 #endif
00100 
00104 #define TK_File_Format_Version       1000   // 10.00
00105 
00107 //    but are mentioned in the spec as test points for format changes)
00108 #ifdef CREATE_FILE_FORMAT_HISTORY_TABLE
00109     BBINFILETK_API int TK_File_Format_History[] = {
00110        //  Format   Release     Notes
00111        //------------------------------------------------------------------------------------------
00112            1000,    // 1000
00113        //   908     //          threshold type in LOD options
00114        //   907     //          polar normals
00115        //   906     //          edgebreaker changes
00116        //   905     //          hlr silhouette cleanup, unicode_options
00117             900,    //  900
00118        //   806     //          bounding box inheritance, cut geometry options, fast hidden line,
00119                     //              hidden line render faces, depth range, gradient window patterns,
00120                     //              additional NURBS surface controls
00121        //   805     //          polycylinder attributes, ExRef, URL
00122             800,    //  800
00123             710,    //  760     new transparency controls, dictionary format 2
00124        //   705,    //          PolyCylinder, Extended Heuristics, XML, LoD collections, Shell Regions
00125        //   702,    //          PolyPolypoint
00126             700,    //  700
00127        //   652,    //          null shell
00128             651,    //  661
00129        //   650,    //          NURBS Surface, Cylinder, Extended Rendering_Options, Defined Fonts, Selectability
00130                     //              extensive polyhedron data & compression changes
00131        //   610,    //          View
00132        //   600,    //          Stream version generally synched to Hoops version
00133        //   601,    //          support longer text string
00134             105,    //  600     Generate_Dictionary changed to Suppress_Dictionary
00135             100,    //  500     Initial release
00136             0       //          [list termination]
00137     };
00138 #else
00139     extern BBINFILETK_API int TK_File_Format_History[];
00140 #endif
00141 
00142 
00143 #define TK_DEFAULT_BUFFER_SIZE     32768    
00144 
00145 
00146 
00147 #ifdef HSTREAM_READONLY
00148     #ifndef BSTREAM_READONLY
00149         #define BSTREAM_READONLY
00150     #endif
00151 #endif
00152 #ifdef BSTREAM_READONLY
00153     extern char const stream_readonly[];
00154 #endif
00155 #ifdef BSTREAM_DISABLE_QUANTIZATION
00156     extern char const stream_disable_quantization[];
00157 #endif
00158 #ifdef BSTREAM_DISABLE_EDGEBREAKER
00159     extern char const stream_disable_edgebreaker[];
00160 #endif
00161 #ifdef BSTREAM_DISABLE_REPULSE_COMPRESSION
00162     extern char const stream_disable_repulse_compression[];
00163 #endif
00164 
00165 
00166 #include <math.h>
00167 #include <string.h>
00168 #include <stdio.h>
00169 
00170 #ifdef NEED_BOOL_TYPE
00171     #undef NEED_BOOL_TYPE
00172     typedef int bool;
00173 
00174     const bool true = !0;
00175     const bool false = 0;
00176 #endif
00177 
00178 
00183 #ifdef _M_IA64
00184 #   define  ID_Key      __int64
00185 #else
00186 #   define  ID_Key      long
00187 #endif
00188 
00189 
00190 #ifndef alter
00191 #   define alter        
00192 #endif
00193 
00194 
00196 
00200 enum TK_Status {
00201     TK_Normal,      
00202     TK_Error,       
00203     TK_Pause,       
00204     TK_Single,      
00205     TK_Pending,     
00206     TK_Revisit,     
00207     TK_Complete,    
00208     TK_Version,     
00209     TK_NotFound,    
00210     TK_Abort        
00211 };
00212 
00213 
00215 
00221 enum TK_File_Write_Options {
00222     TK_Suppress_LOD               = 0x00000002, 
00223     TK_Full_Resolution_Vertices   = 0x00000004, 
00224     TK_Full_Resolution_Normals    = 0x00000008, 
00225     TK_Full_Resolution = (TK_Full_Resolution_Vertices|TK_Full_Resolution_Normals), 
00226     TK_First_LOD_Is_Bounding_Box  = 0x00000010, 
00227     TK_Force_Tags                 = 0x00000020, 
00228     TK_Disable_Priority_Heuristic = 0x00000040, 
00229     TK_Disable_Global_Compression = 0x00000100, 
00230     TK_Disable_Instancing         = 0x00000200, 
00231     TK_Generate_Dictionary        = 0x00000400, 
00232     TK_Connectivity_Compression   = 0x00000800, 
00233     TK_Disable_Tristrips          = 0x00001000, 
00234     TK_Disable_Compound_Primitives = 0x00002000, 
00235     TK_Global_Quantization         = 0x00004000  
00236 };
00237 
00241 enum TK_Dictionary_Options {
00242     TK_Dictionary_Bounding_Volumes  = 0x00000001
00243 };
00244 
00245 
00249 enum TK_File_Read_Options {
00250     TK_Flag_Unhandled_Opcodes     = 0x00000001,  
00251     TK_Ignore_Version             = 0x00000002,  
00252     TK_Skip_External_References   = 0x00000004   
00253 };
00254 
00255 
00256 
00260 enum TK_Debug_Logging_Options {
00261     TK_Logging_Sequence           = 0x00000001,  
00262     TK_Logging_Tagging            = 0x00000002   
00263 };
00264 
00265 
00266 
00267 #include "BOpcodeHandler.h"
00268 #include "BStreamFileToolkit.h"
00269 
00270 
00272 
00282 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, BStreamFileToolkit * tk);
00283 
00285 
00294 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, int flags = 0);
00295 
00296 
00298 
00305 TK_Status BBINFILETK_API TK_Read_Stream_File  (char const * filename, int flags, BStreamFileToolkit * tk);
00306 
00307 
00308 #endif
00309 

Generated on Tue May 17 12:06:00 2005 for Autodesk DWF 3D Toolkit by  doxygen 1.4.1