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: b030d4ef541cee06c309e67d052195c4c37bb090 $ 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 int m_points_num_floats; 00048 int m_points_num_dimensions; 00049 int m_primitive_count; 00050 int m_lengths_allocated; 00051 int * m_lengths; 00052 float m_bbox[6]; 00053 int m_templen; 00054 float m_temprange[2]; 00055 unsigned short m_subop; 00056 unsigned char m_compression_scheme; 00057 unsigned char * m_workspace; 00058 int m_workspace_used; 00059 int m_workspace_allocated; 00060 int m_bits_per_sample; 00061 int m_substage; 00062 int m_progress; 00063 00066 TK_Status analyze_dimensionality( BStreamFileToolkit & tk ) alter; 00069 TK_Status figure_num_floats (BStreamFileToolkit & tk) alter; 00072 TK_Status validate_primitive_count (BStreamFileToolkit & tk) alter; 00075 TK_Status expand_lengths (BStreamFileToolkit & tk) alter; 00078 TK_Status mangle (BStreamFileToolkit & tk) alter; 00081 TK_Status unmangle (BStreamFileToolkit & tk) alter; 00084 TK_Status compute_trivial_points (BStreamFileToolkit & tk) alter; 00087 TK_Status process_trivial_points (BStreamFileToolkit & tk) alter; 00090 TK_Status compute_line_extend_points (BStreamFileToolkit & tk) alter; 00093 TK_Status process_line_extend_points (BStreamFileToolkit & tk) alter; 00096 TK_Status write_compressed_points (BStreamFileToolkit & tk) alter; 00099 TK_Status read_compressed_points (BStreamFileToolkit & tk) alter; 00102 TK_Status write_trivial_leftovers (BStreamFileToolkit & tk) alter; 00105 TK_Status read_trivial_leftovers (BStreamFileToolkit & tk) alter; 00106 00107 public: 00109 TK_PolyPolypoint (unsigned char opcode); 00110 ~TK_PolyPolypoint (); 00111 00112 TK_Status Read (BStreamFileToolkit & tk) alter; 00113 TK_Status Write (BStreamFileToolkit & tk) alter; 00114 TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const; 00115 00116 TK_Status ReadAscii (BStreamFileToolkit & tk) alter; 00117 TK_Status WriteAscii (BStreamFileToolkit & tk) alter; 00118 00119 TK_Status Execute (BStreamFileToolkit & tk) alter; /* non-default for tag processing */ 00120 void Reset () alter; 00121 00127 TK_Status SetPoints (int point_count, float const * points = 0) alter; 00135 TK_Status SetLengths (int primitive_count, int const * lengths = 0) alter; 00136 00139 enum Suboptions { 00140 TKPP_COMPRESSED = 0x0001, 00141 TKPP_HAS_EXPLICIT_PRIMITIVE_COUNT = 0x0002, 00142 TKPP_ONE_PRIMITIVE_ONLY = 0x0004, 00143 TKPP_GLOBAL_QUANTIZATION = 0x0008, 00144 //break in sequence 00145 TKPP_ZERO_X = 0x0100, 00146 TKPP_SAME_X = 0x0200, 00147 TKPP_PER_PRIMITIVE_X = 0x0300, //multibit 00148 TKPP_ZERO_Y = 0x0400, 00149 TKPP_SAME_Y = 0x0800, 00150 TKPP_PER_PRIMITIVE_Y = 0x0C00, //multibit 00151 TKPP_ZERO_Z = 0x1000, 00152 TKPP_SAME_Z = 0x2000, 00153 TKPP_PER_PRIMITIVE_Z = 0x3000, //multibit 00154 TKPP_EXPANDED = 0x8000 //reserved for future use 00155 }; 00156 #define TKPP_X_2D_MASK 0x0300 00157 #define TKPP_Y_2D_MASK 0x0C00 00158 #define TKPP_Z_2D_MASK 0x3000 00159 #define TKPP_ANY_2D_MASK 0x3F00 00160 #define TKPP_EXPLICIT_PRIMITIVE_MASK 0x0006 00161 }; 00162 00163 #endif //BPOLYPOLY 00164