Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BPolyPoly.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 #ifndef BPOLYPOLY
00011 #define BPOLYPOLY
00012 
00013 #ifndef BBINFILETK_TOOLKIT
00014     #include "BStreamFileToolkit.h"
00015 #endif
00016 
00018 
00037 class BBINFILETK_API TK_PolyPolypoint : public BBaseOpcodeHandler {
00038     protected:
00039         int             m_point_count;          
00040         int             m_points_allocated;     
00041         float *         m_points;               
00042         double *        m_dpoints;              
00043         int             m_points_num_floats;    
00044         int             m_points_num_dimensions;
00045         int             m_primitive_count;      
00046         int             m_lengths_allocated;    
00047         int *           m_lengths;              
00048         float           m_bbox[6];              
00049         float           m_dbbox[6];             
00050         int             m_templen;              
00051         float           m_temprange[2];         
00052         float           m_dtemprange[2];        
00053         unsigned short  m_subop;                
00054         unsigned char   m_compression_scheme;   
00055         unsigned char * m_workspace;            
00056         int             m_workspace_used;       
00057         int             m_workspace_allocated;  
00058         int             m_bits_per_sample;      
00059         int             m_substage;             
00060         int             m_progress;             
00061 
00064         TK_Status analyze_dimensionality( BStreamFileToolkit & tk );
00067         TK_Status figure_num_floats (BStreamFileToolkit & tk);
00070         TK_Status validate_primitive_count (BStreamFileToolkit & tk);
00073         TK_Status expand_lengths (BStreamFileToolkit & tk);
00076         TK_Status mangle (BStreamFileToolkit & tk);
00079         TK_Status unmangle (BStreamFileToolkit & tk);
00082         TK_Status compute_trivial_points (BStreamFileToolkit & tk);
00085         TK_Status process_trivial_points (BStreamFileToolkit & tk);
00088         TK_Status compute_line_extend_points (BStreamFileToolkit & tk);
00091         TK_Status process_line_extend_points (BStreamFileToolkit & tk);
00094         TK_Status write_compressed_points (BStreamFileToolkit & tk);
00097         TK_Status read_compressed_points (BStreamFileToolkit & tk);
00100         TK_Status write_trivial_leftovers (BStreamFileToolkit & tk);
00103         TK_Status read_trivial_leftovers (BStreamFileToolkit & tk);
00104 
00105     public:
00107         TK_PolyPolypoint (unsigned char opcode);
00108         ~TK_PolyPolypoint ();
00109 
00110         TK_Status   Read (BStreamFileToolkit & tk);
00111         TK_Status   Write (BStreamFileToolkit & tk);
00112         TK_Status   Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
00113 
00114         TK_Status   ReadAscii (BStreamFileToolkit & tk);
00115         TK_Status   WriteAscii (BStreamFileToolkit & tk);
00116 
00117         TK_Status   Execute (BStreamFileToolkit & tk);    /* non-default for tag processing */
00118         void        Reset ();
00119 
00125         TK_Status   SetPoints (int point_count, float const points[] = 0);
00131         TK_Status   SetDPoints (int point_count, double const points[] = 0);
00139         TK_Status   SetLengths (int primitive_count, int const lengths[] = 0);
00140 
00143         enum Suboptions {
00144             TKPP_COMPRESSED                     = 0x0001,
00145             TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT   = 0x0002,
00146             TKPP_ONE_PRIMITIVE_ONLY             = 0x0004,
00147             TKPP_GLOBAL_QUANTIZATION            = 0x0008,
00148             //break in sequence
00149             TKPP_ZERO_X                         = 0x0100,
00150             TKPP_SAME_X                         = 0x0200,
00151             TKPP_PER_PRIMITIVE_X                = 0x0300, //multibit
00152             TKPP_ZERO_Y                         = 0x0400,
00153             TKPP_SAME_Y                         = 0x0800,
00154             TKPP_PER_PRIMITIVE_Y                = 0x0C00, //multibit
00155             TKPP_ZERO_Z                         = 0x1000,
00156             TKPP_SAME_Z                         = 0x2000,
00157             TKPP_PER_PRIMITIVE_Z                = 0x3000, //multibit
00158             TKPP_EXPANDED                       = 0x8000  //reserved for future use
00159         };
00160         #define TKPP_X_2D_MASK 0x0300
00161         #define TKPP_Y_2D_MASK 0x0C00
00162         #define TKPP_Z_2D_MASK 0x3000
00163         #define TKPP_ANY_2D_MASK 0x3F00
00164         #define TKPP_EXPLICIT_PRIMITIVE_MASK 0x0006
00165 };
00166 
00167 #endif //BPOLYPOLY
00168