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 // $Id: 6957b81f4a335975c48c941b1d27b284e1e19b2f $ 00013 // 00014 00015 #ifndef BPOLYPOLY 00016 #define BPOLYPOLY 00017 00018 #ifndef BBINFILETK_TOOLKIT 00019 #include "BStreamFileToolkit.h" 00020 #endif 00021 00023 00042 class BBINFILETK_API TK_PolyPolypoint : public BBaseOpcodeHandler { 00043 protected: 00044 int m_point_count; 00045 int m_points_allocated; 00046 float * m_points; 00047 double * m_dpoints; 00048 int m_points_num_floats; 00049 int m_points_num_dimensions; 00050 int m_primitive_count; 00051 int m_lengths_allocated; 00052 int * m_lengths; 00053 float m_bbox[6]; 00054 float m_dbbox[6]; 00055 int m_templen; 00056 float m_temprange[2]; 00057 float m_dtemprange[2]; 00058 unsigned short m_subop; 00059 unsigned char m_compression_scheme; 00060 unsigned char * m_workspace; 00061 int m_workspace_used; 00062 int m_workspace_allocated; 00063 int m_bits_per_sample; 00064 int m_substage; 00065 int m_progress; 00066 00069 TK_Status analyze_dimensionality( BStreamFileToolkit & tk ); 00072 TK_Status figure_num_floats (BStreamFileToolkit & tk); 00075 TK_Status validate_primitive_count (BStreamFileToolkit & tk); 00078 TK_Status expand_lengths (BStreamFileToolkit & tk); 00081 TK_Status mangle (BStreamFileToolkit & tk); 00084 TK_Status unmangle (BStreamFileToolkit & tk); 00087 TK_Status compute_trivial_points (BStreamFileToolkit & tk); 00090 TK_Status process_trivial_points (BStreamFileToolkit & tk); 00093 TK_Status compute_line_extend_points (BStreamFileToolkit & tk); 00096 TK_Status process_line_extend_points (BStreamFileToolkit & tk); 00099 TK_Status write_compressed_points (BStreamFileToolkit & tk); 00102 TK_Status read_compressed_points (BStreamFileToolkit & tk); 00105 TK_Status write_trivial_leftovers (BStreamFileToolkit & tk); 00108 TK_Status read_trivial_leftovers (BStreamFileToolkit & tk); 00109 00110 public: 00112 TK_PolyPolypoint (unsigned char opcode); 00113 ~TK_PolyPolypoint (); 00114 00115 TK_Status Read (BStreamFileToolkit & tk); 00116 TK_Status Write (BStreamFileToolkit & tk); 00117 TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const; 00118 00119 TK_Status ReadAscii (BStreamFileToolkit & tk); 00120 TK_Status WriteAscii (BStreamFileToolkit & tk); 00121 00122 TK_Status Execute (BStreamFileToolkit & tk); /* non-default for tag processing */ 00123 void Reset (); 00124 00130 TK_Status SetPoints (int point_count, float const * points = 0); 00136 TK_Status SetDPoints (int point_count, double const * points = 0); 00144 TK_Status SetLengths (int primitive_count, int const * lengths = 0); 00145 00148 enum Suboptions { 00149 TKPP_COMPRESSED = 0x0001, 00150 TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT = 0x0002, 00151 TKPP_ONE_PRIMITIVE_ONLY = 0x0004, 00152 TKPP_GLOBAL_QUANTIZATION = 0x0008, 00153 //break in sequence 00154 TKPP_ZERO_X = 0x0100, 00155 TKPP_SAME_X = 0x0200, 00156 TKPP_PER_PRIMITIVE_X = 0x0300, //multibit 00157 TKPP_ZERO_Y = 0x0400, 00158 TKPP_SAME_Y = 0x0800, 00159 TKPP_PER_PRIMITIVE_Y = 0x0C00, //multibit 00160 TKPP_ZERO_Z = 0x1000, 00161 TKPP_SAME_Z = 0x2000, 00162 TKPP_PER_PRIMITIVE_Z = 0x3000, //multibit 00163 TKPP_EXPANDED = 0x8000 //reserved for future use 00164 }; 00165 #define TKPP_X_2D_MASK 0x0300 00166 #define TKPP_Y_2D_MASK 0x0C00 00167 #define TKPP_Z_2D_MASK 0x3000 00168 #define TKPP_ANY_2D_MASK 0x3F00 00169 #define TKPP_EXPLICIT_PRIMITIVE_MASK 0x0006 00170 }; 00171 00172 #endif //BPOLYPOLY 00173