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: e0e98542edad236ff02d1833dd38caeb1f18b3f7 $ 00013 // 00014 #ifndef BBINFILETK_POLYHEDRON 00015 #define BBINFILETK_POLYHEDRON 00016 00017 00019 00025 class BBINFILETK_API TK_Polyhedron : public BBaseOpcodeHandler { 00026 public: 00027 00031 enum Exists { 00032 Vertex_None = 0x0000, 00033 Vertex_Normal = 0x0001, 00034 Vertex_Parameter = 0x0002, 00035 Vertex_Face_Color = 0x0004, 00036 Vertex_Edge_Color = 0x0008, 00037 Vertex_Marker_Color = 0x0010, 00038 Vertex_Face_Index = 0x0020, 00039 Vertex_Edge_Index = 0x0040, 00040 Vertex_Marker_Index = 0x0080, 00041 Vertex_Marker_Visibility= 0x0100, 00042 Vertex_Marker_Size = 0x0200, 00043 Vertex_Marker_Symbol = 0x0400, 00044 Vertex_Marker_RGBA = 0x0800, 00045 Vertex_Any_Color = 0x08FC 00046 }; 00047 00051 enum Face_Exists { 00052 Face_None = 0x0000, 00053 Face_Color = 0x0001, 00054 Face_Index = 0x0002, 00055 Face_Any_Color = 0x0003, 00056 Face_Normal = 0x0004, 00057 Face_Visibility = 0x0008, 00058 Face_Pattern = 0x0010 00059 }; 00060 00064 enum Edge_Exists { 00065 Edge_None = 0x0000, 00066 Edge_Color = 0x0001, 00067 Edge_Index = 0x0002, 00068 Edge_Any_Color = 0x0003, 00069 Edge_Normal = 0x0004, 00070 Edge_Visibility = 0x0008, 00071 Edge_Pattern = 0x0010, 00072 Edge_Weight = 0x0020, 00073 Fake_Edge = 0x8000 //for edges (if any) that do not exist on the write side, but will be introduced due to triangulation 00074 }; 00075 00079 enum Suboptions { 00080 TKSH_STANDARD = 0x00, 00081 TKSH_COMPRESSED_POINTS = 0x01, 00082 TKSH_COMPRESSED_FACES = 0x02, 00083 TKSH_TRISTRIPS = 0x04, 00084 TKSH_HAS_OPTIONALS = 0x08, 00085 TKSH_FIRSTPASS = 0x10, 00086 TKSH_BOUNDING_ONLY = 0x20, 00087 TKSH_CONNECTIVITY_COMPRESSION = 0x40, 00088 TKSH_EXPANDED = 0x80 00089 }; 00090 00095 enum Suboptions2 { 00096 TKSH2_COLLECTION = 0x0001, 00097 TKSH2_NULL = 0x0002, 00098 TKSH2_HAS_NEGATIVE_FACES = 0x0004, 00099 TKSH2_GLOBAL_QUANTIZATION = 0x0008 00100 }; 00101 00105 enum Opt_Opcode { 00106 OPT_TERMINATE = 0, 00107 OPT_ALL_NORMALS_COMPRESSED = 1, 00108 OPT_NORMALS_COMPRESSED = 2, 00109 OPT_ALL_PARAMETERS_COMPRESSED = 3, 00110 OPT_PARAMETERS_COMPRESSED = 4, 00111 OPT_ALL_VFCOLORS = 5, 00112 OPT_VERTEX_FCOLORS = 6, 00113 OPT_ALL_VECOLORS = 7, 00114 OPT_VERTEX_ECOLORS = 8, 00115 OPT_ALL_VMCOLORS = 9, 00116 OPT_VERTEX_MCOLORS = 10, 00117 OPT_ALL_VFINDICES = 11, 00118 OPT_VERTEX_FINDICES = 12, 00119 OPT_ALL_VEINDICES = 13, 00120 OPT_VERTEX_EINDICES = 14, 00121 OPT_ALL_VMINDICES = 15, 00122 OPT_VERTEX_MINDICES = 16, 00123 OPT_ALL_NORMALS = 17, 00124 OPT_NORMALS = 18, 00125 OPT_ALL_NORMALS_POLAR = 19, 00126 OPT_NORMALS_POLAR = 20, 00127 OPT_ALL_VMVISIBILITIES = 21, 00128 OPT_VERTEX_MARKER_VISIBILITIES = 22, 00129 OPT_ALL_VMSYMBOLS = 23, 00130 OPT_VERTEX_MARKER_SYMBOLS = 24, 00131 OPT_ALL_VMSIZES = 25, 00132 OPT_VERTEX_MARKER_SIZES = 26, 00133 OPT_PARAMETERS = 27, 00134 OPT_ALL_PARAMETERS = 28, 00135 OPT_ALL_VMRGBAS = 29, 00136 OPT_VERTEX_MRGBAS = 30, 00137 00138 OPT_ALL_FACE_COLORS = 33, 00139 OPT_FACE_COLORS = 34, 00140 OPT_ALL_FACE_INDICES = 35, 00141 OPT_FACE_INDICES = 36, 00142 OPT_ALL_FACE_NORMALS_POLAR = 37, 00143 OPT_FACE_NORMALS_POLAR = 38, 00144 OPT_ALL_FACE_VISIBILITIES = 39, 00145 OPT_FACE_VISIBILITIES = 40, 00146 OPT_ALL_FACE_PATTERNS = 41, 00147 OPT_FACE_PATTERNS = 42, 00148 00149 OPT_FACE_REGIONS = 51, 00150 00151 OPT_ALL_EDGE_COLORS = 71, 00152 OPT_EDGE_COLORS = 72, 00153 OPT_ALL_EDGE_INDICES = 73, 00154 OPT_EDGE_INDICES = 74, 00155 OPT_ALL_EDGE_NORMALS_POLAR = 75, 00156 OPT_EDGE_NORMALS_POLAR = 76, 00157 OPT_ALL_EDGE_VISIBILITIES = 77, 00158 OPT_EDGE_VISIBILITIES = 78, 00159 OPT_ALL_EDGE_PATTERNS = 79, 00160 OPT_EDGE_PATTERNS = 80, 00161 OPT_ALL_EDGE_WEIGHTS = 81, 00162 OPT_EDGE_WEIGHTS = 82, 00163 00164 OPT_RESERVED_SPATIAL = 90, 00165 OPT_ENTITY_ATTRIBUTES = 99 00166 }; 00167 00168 00169 //see TK_Shell for GetFacesLength, GetFaces, GetLodLevel, SetFaces, SetLodLevel 00170 00172 float const *GetPoints() const { return mp_points; }; 00174 float *GetPoints() { return mp_points; }; 00176 int GetPointCount() const { return mp_pointcount; }; 00178 unsigned int const *GetExists() const { return mp_exists; }; 00180 unsigned int *GetExists() { return mp_exists; }; 00182 unsigned int const *GetFaceExists() const { return mp_face_exists; }; 00184 unsigned int *GetFaceExists() { return mp_face_exists; }; 00186 ID_Key GetKey() const { return mp_key; }; 00188 unsigned char GetSubop() const { return mp_subop; }; 00190 unsigned short GetSubop2() const { return mp_subop2; }; 00192 const float *GetBounding() const { return mp_bbox; }; 00194 float const *GetVertexNormals() const { return mp_normals; }; 00196 float *GetVertexNormals() { return mp_normals; }; 00198 float const *GetVertexParameters() const { return mp_params; }; 00200 float *GetVertexParameters() { return mp_params; }; 00202 float const *GetVertexFaceColors() const { return mp_vfcolors; }; 00204 float *GetVertexFaceColors() { return mp_vfcolors; }; 00206 float const *GetVertexEdgeColors() const { return mp_vecolors; }; 00208 float *GetVertexEdgeColors() { return mp_vecolors; }; 00210 float const *GetVertexMarkerColors() const { return mp_vmcolors; }; 00212 float *GetVertexMarkerColors() { return mp_vmcolors; }; 00214 float const *GetVertexMarkerRGBAs() const { return mp_vmcolors; }; 00216 float *GetVertexMarkerRGBAs() { return mp_vmcolors; }; 00219 float const *GetVertexColors() const { 00220 if (mp_vmcolors != 0) return mp_vmcolors; 00221 else if (mp_vfcolors != 0) return mp_vfcolors; 00222 else if (mp_vecolors != 0) return mp_vecolors; 00223 else return 0; 00224 }; 00227 float *GetVertexColors() { 00228 if (mp_vmcolors != 0) return mp_vmcolors; 00229 else if (mp_vfcolors != 0) return mp_vfcolors; 00230 else if (mp_vecolors != 0) return mp_vecolors; 00231 else return 0; 00232 }; 00234 float const *GetVertexFaceIndices() const { return mp_vfindices; }; 00236 float *GetVertexFaceIndices() { return mp_vfindices; }; 00238 float const *GetVertexEdgeIndices() const { return mp_veindices; }; 00240 float *GetVertexEdgeIndices() { return mp_veindices; }; 00242 float const *GetVertexMarkerIndices() const { return mp_vmindices; }; 00244 float *GetVertexMarkerIndices() { return mp_vmindices; }; 00247 float const *GetVertexIndices() const { 00248 if (mp_vmindices != 0) return mp_vmindices; 00249 else if (mp_vfindices != 0) return mp_vfindices; 00250 else if (mp_veindices != 0) return mp_veindices; 00251 else return 0; 00252 }; 00255 float *GetVertexIndices() { 00256 if (mp_vmindices != 0) return mp_vmindices; 00257 else if (mp_vfindices != 0) return mp_vfindices; 00258 else if (mp_veindices != 0) return mp_veindices; 00259 else return 0; 00260 }; 00262 float const *GetFaceColors() const { return mp_fcolors; }; 00264 float *GetFaceColors() { return mp_fcolors; }; 00266 float const *GetFaceIndices() const { return mp_findices; }; 00268 float *GetFaceIndices() { return mp_findices; }; 00270 int const * GetFaceRegions() const { return mp_fregions; }; 00272 int alter * GetFaceRegions() alter { return mp_fregions; }; 00273 00275 TK_Status SetKey (BStreamFileToolkit &tk, ID_Key key) alter { set_last_key (tk, key); mp_key = key; return TK_Normal; }; 00278 TK_Status SetSubop (unsigned char subop) alter { mp_subop = subop; return TK_Normal; }; 00281 TK_Status SetSubop2 (unsigned short subop2) alter { mp_subop2 = subop2; return TK_Normal; }; 00286 TK_Status InitSubop (BStreamFileToolkit &tk, int lodlevel, bool is_firstpass) alter; 00289 TK_Status SetBounding (float const *bbox) alter { mp_bbox[0] = bbox[0]; mp_bbox[1] = bbox[1]; mp_bbox[2] = bbox[2]; mp_bbox[3] = bbox[3]; mp_bbox[4] = bbox[4]; mp_bbox[5] = bbox[5]; return TK_Normal; }; 00294 TK_Status SetPoints (int count, float const *points=0) alter; 00299 TK_Status SetVertexNormals (float const *normals=0) alter; 00308 TK_Status SetVertexParameters (float const *parameters=0, int width=0) alter; 00316 TK_Status SetVertexFaceColors (float const *colors=0) alter; 00324 TK_Status SetVertexEdgeColors (float const *colors=0) alter; 00332 TK_Status SetVertexMarkerColors (float const *colors=0) alter; 00340 TK_Status SetVertexMarkerRGBAs (float const *colors=0) alter; 00350 TK_Status SetVertexColors (float const *colors=0) alter; 00359 TK_Status SetVertexFaceIndices (float const *indices=0) alter; 00368 TK_Status SetVertexEdgeIndices (float const *indices=0) alter; 00377 TK_Status SetVertexMarkerIndices (float const *indices=0) alter; 00387 TK_Status SetVertexIndices (float const *indices=0) alter; 00393 TK_Status SetVertexMarkerVisibilities (char const *visibilities=0) alter; 00400 TK_Status SetVertexMarkerSizes (float const *sizes=0) alter; 00407 TK_Status SetVertexMarkerSymbols (char const *symbols=0) alter; 00411 TK_Status SetVertexMarkerSymbolStrings () alter; 00417 TK_Status SetFaceColors (float const *colors=0) alter; 00423 TK_Status SetFaceNormals (float const *normals=0) alter; 00429 TK_Status SetFaceVisibilities (char const *visibilities=0) alter; 00436 TK_Status SetFacePatterns (char const *patterns=0) alter; 00444 TK_Status SetFaceIndices (float const *indices=0) alter; 00447 TK_Status SetFaceRegions (int const * regions=0) alter; 00456 TK_Status SetEdgeColors (float const *colors=0) alter; 00463 TK_Status SetEdgeIndices (float const *indices=0) alter; 00469 TK_Status SetEdgeNormals (float const *normals=0) alter; 00476 TK_Status SetEdgeVisibilities (char const *visibilities=0) alter; 00482 TK_Status SetEdgePatterns (char const *patterns=0) alter; 00486 TK_Status SetEdgePatternStrings () alter; 00492 TK_Status SetEdgeWeights (float const *weights=0) alter; 00493 00498 TK_Status SetExists (unsigned int const *vals=0) alter; 00503 TK_Status SetFaceExists (unsigned int const *vals=0) alter; 00510 TK_Status SetEdgeExists (unsigned int const *vals=0) alter; 00511 00517 TK_Status AppendObject (BStreamFileToolkit & tk, BBaseOpcodeHandler *obj); 00520 BBaseOpcodeHandler *PopObject(); 00521 00523 bool HasOptionals() { return 00524 HasVertexAttributes() || 00525 HasFaceAttributes() || 00526 HasEdgeAttributes() || 00527 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);// 0x01 matches TKSH2_COLLECTION 00528 }; 00530 bool HasVertexNormals() const { return mp_normals != 0; }; 00532 bool HasVertexParameters() const { return mp_params != 0; }; 00534 bool HasVertexFaceColors() const { return mp_vfcolors != 0; }; 00536 bool HasVertexEdgeColors() const { return mp_vecolors != 0; }; 00538 bool HasVertexMarkerColors() const { return mp_vmcolors != 0; }; 00540 bool HasVertexMarkerRGBAs() const { return mp_vmrgbas != 0; }; 00542 bool HasVertexColors() const { return 00543 mp_vfcolors != 0 || 00544 mp_vecolors != 0 || 00545 mp_vmcolors != 0 || 00546 mp_vmrgbas != 0; 00547 }; 00549 inline bool HasVertexFaceIndices() const { return mp_vfindices != 0; }; 00551 inline bool HasVertexEdgeIndices() const { return mp_veindices != 0; }; 00553 inline bool HasVertexMarkerIndices() const { return mp_vmindices != 0; }; 00555 inline bool HasVertexIndices() const { return 00556 mp_vfindices != 0 || 00557 mp_veindices != 0 || 00558 mp_vmindices != 0; 00559 }; 00561 inline bool HasVertexMarkerVisibilities() const { return mp_vmvisibilities != 0; }; 00563 inline bool HasVertexMarkerSymbols() const { return mp_vmsymbols != 0; }; 00565 inline bool HasVertexMarkerSizes() const { return mp_vmsizes != 0; }; 00569 inline bool HasVertexAttributes() const { return 00570 HasVertexColors() || 00571 HasVertexIndices() || 00572 HasVertexNormals() || 00573 HasVertexParameters() || 00574 HasVertexMarkerVisibilities() || 00575 HasVertexMarkerSymbols() || 00576 HasVertexMarkerSizes(); 00577 }; 00579 inline bool HasFaceColors() const { return mp_fcolors != 0; }; 00581 inline bool HasFaceIndices() const { return mp_findices != 0; }; 00583 inline bool HasFaceNormals() const { return mp_fnormals != 0; }; 00585 inline bool HasFaceVisibilities() const { return mp_fvisibilities != 0; }; 00587 inline bool HasFacePatterns() const { return mp_fpatterns != 0; }; 00589 inline bool HasFaceRegions() const { return mp_fregions != 0; }; 00592 inline bool HasFaceAttributes() const { return 00593 HasFaceColors() || 00594 HasFaceIndices() || 00595 HasFaceNormals() || 00596 HasFaceVisibilities() || 00597 HasFacePatterns() || 00598 HasFaceRegions(); 00599 }; 00600 00602 inline bool HasEdgeColors() const { return mp_ecolors != 0; }; 00604 inline bool HasEdgeIndices() const { return mp_eindices != 0; }; 00606 inline bool HasEdgeNormals() const { return mp_enormals != 0; }; 00608 inline bool HasEdgeVisibilities() const { return mp_evisibilities != 0; }; 00610 inline bool HasEdgePatterns() const { return mp_epatterns != 0; }; 00612 inline bool HasEdgeWeights() const { return mp_eweights != 0; }; 00614 inline bool HasEdgeAttributes() const { return 00615 HasEdgeColors() || 00616 HasEdgeIndices() || 00617 HasEdgeNormals() || 00618 HasEdgeVisibilities() || 00619 HasEdgePatterns() || 00620 HasEdgeWeights(); 00621 }; 00622 00623 protected: 00624 //data members prefixed with "mp_", not "m_", to avoid potential naming conflicts with TK_Shell and/or TK_Mesh 00625 00626 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00627 00628 float * mp_points; 00629 float * mp_normals; 00630 float * mp_params; 00631 float * mp_vfcolors; 00632 float * mp_vecolors; 00633 float * mp_vmcolors; 00634 float * mp_vmrgbas; 00635 float * mp_vfindices; 00636 float * mp_veindices; 00637 float * mp_vmindices; 00638 char * mp_vmvisibilities; 00639 float * mp_vmsizes; 00640 unsigned char * mp_vmsymbols; 00641 char ** mp_vmsymbolstrings; 00642 float * mp_fcolors; 00643 float * mp_findices; 00644 int * mp_fregions; 00645 float * mp_fnormals; 00646 char * mp_fvisibilities; 00647 char * mp_fpatterns; 00648 float * mp_ecolors; 00649 float * mp_eindices; 00650 float * mp_enormals; 00651 char * mp_evisibilities; 00652 unsigned char * mp_epatterns; 00653 char ** mp_epatternstrings; 00654 float * mp_eweights; 00656 unsigned int * mp_exists; 00657 unsigned int * mp_face_exists; 00658 unsigned int * mp_edge_exists; 00660 int mp_pointcount; 00661 int mp_normalcount; 00662 int mp_paramcount; 00663 char mp_paramwidth; 00664 int mp_vfcolorcount; 00665 int mp_vecolorcount; 00666 int mp_vmcolorcount; 00667 int mp_vmrgbacount; 00668 int mp_vfindexcount; 00669 int mp_veindexcount; 00670 int mp_vmindexcount; 00671 int mp_vmvisibilitycount; 00672 int mp_vmsizecount; 00673 int mp_vmsymbolcount; 00674 int mp_facecount; 00675 int mp_fcolorcount; 00676 int mp_findexcount; 00677 int mp_fnormalcount; 00678 int mp_fpatterncount; 00679 int mp_fvisibilitycount; 00680 int mp_edgecount; 00681 int mp_ecolorcount; 00682 int mp_eindexcount; 00683 int mp_enormalcount; 00684 int mp_epatterncount; 00685 int mp_eweightcount; 00686 int mp_evisibilitycount; 00687 int * mp_edge_enumeration; 00689 int mp_stage; 00690 int mp_substage; 00691 int mp_progress; 00692 int mp_subprogress; 00693 unsigned char mp_optopcode; 00696 unsigned short mp_present; 00697 unsigned short mp_face_present; 00698 unsigned short mp_edge_present; 00699 unsigned char mp_bits_per_sample; 00700 float mp_bbox[256]; 00701 ID_Key mp_key; 00702 TK_Instance * mp_instance; 00703 float mp_matrix[16]; 00704 unsigned char * mp_workspace; 00705 int mp_workspace_allocated; 00706 int mp_workspace_used; 00707 unsigned char mp_compression_scheme; 00708 unsigned char mp_subop; 00709 unsigned short mp_subop2; 00710 int mp_num_collection_parts; 00711 BBaseOpcodeHandler **mp_collection_parts; 00718 virtual TK_Status EnumerateEdges() { return TK_Error; }; 00723 virtual TK_Status LabelFakeEdges() { return TK_Normal; }; 00728 virtual bool AllowInstancing(BStreamFileToolkit & tk) const; 00729 00730 TK_Polyhedron(unsigned char op); 00731 ~TK_Polyhedron(); 00732 00733 TK_Status Read (BStreamFileToolkit & tk) alter; 00734 TK_Status Write (BStreamFileToolkit & tk) alter; 00735 virtual void Reset () alter; 00736 00737 virtual TK_Status read_trivial_points (BStreamFileToolkit & tk) alter; 00738 virtual TK_Status write_trivial_points (BStreamFileToolkit & tk) alter; 00740 TK_Status read_vertex_normals (BStreamFileToolkit & tk) alter; 00741 TK_Status read_vertex_normals_compressed (BStreamFileToolkit & tk) alter; 00742 TK_Status read_vertex_normals_all (BStreamFileToolkit & tk) alter; 00743 TK_Status read_vertex_normals_compressed_all (BStreamFileToolkit & tk) alter; 00744 TK_Status read_vertex_parameters (BStreamFileToolkit & tk) alter; 00745 TK_Status read_vertex_parameters_all (BStreamFileToolkit & tk) alter; 00746 TK_Status read_vertex_colors_all (BStreamFileToolkit & tk, unsigned char op) alter; 00747 TK_Status read_vertex_colors (BStreamFileToolkit & tk, unsigned char op) alter; 00748 TK_Status read_vertex_indices_all (BStreamFileToolkit & tk, unsigned char op) alter; 00749 TK_Status read_vertex_indices (BStreamFileToolkit & tk, unsigned char op) alter; 00750 TK_Status read_vertex_marker_visibilities (BStreamFileToolkit & tk) alter; 00751 TK_Status read_vertex_marker_symbols (BStreamFileToolkit & tk) alter; 00752 TK_Status read_vertex_marker_sizes (BStreamFileToolkit & tk) alter; 00753 TK_Status read_face_colors (BStreamFileToolkit & tk) alter; 00754 TK_Status read_face_colors_all (BStreamFileToolkit & tk) alter; 00755 TK_Status read_face_indices (BStreamFileToolkit & tk) alter; 00756 TK_Status read_face_indices_all (BStreamFileToolkit & tk) alter; 00757 TK_Status read_face_regions (BStreamFileToolkit & tk) alter; 00758 TK_Status read_face_normals (BStreamFileToolkit & tk) alter; 00759 TK_Status read_face_visibilities (BStreamFileToolkit & tk) alter; 00760 TK_Status read_face_patterns (BStreamFileToolkit & tk) alter; 00761 TK_Status read_edge_colors (BStreamFileToolkit & tk) alter; 00762 TK_Status read_edge_indices (BStreamFileToolkit & tk) alter; 00763 TK_Status read_edge_normals (BStreamFileToolkit & tk) alter; 00764 TK_Status read_edge_visibilities (BStreamFileToolkit & tk) alter; 00765 TK_Status read_edge_patterns (BStreamFileToolkit & tk) alter; 00766 TK_Status read_edge_weights (BStreamFileToolkit & tk) alter; 00767 virtual TK_Status read_collection (BStreamFileToolkit & tk) alter; 00769 TK_Status write_vertex_normals (BStreamFileToolkit & tk) alter; 00770 TK_Status write_vertex_normals_compressed (BStreamFileToolkit & tk) alter; 00771 TK_Status write_vertex_normals_all (BStreamFileToolkit & tk) alter; 00772 TK_Status write_vertex_normals_compressed_all (BStreamFileToolkit & tk) alter; 00773 TK_Status write_vertex_parameters (BStreamFileToolkit & tk) alter; 00774 TK_Status write_vertex_parameters_all (BStreamFileToolkit & tk) alter; 00775 TK_Status write_vertex_colors (BStreamFileToolkit & tk, unsigned char op) alter; 00776 TK_Status write_vertex_colors_all (BStreamFileToolkit & tk, unsigned char op) alter; 00777 TK_Status write_vertex_indices (BStreamFileToolkit & tk, unsigned char op) alter; 00778 TK_Status write_vertex_indices_all (BStreamFileToolkit & tk, unsigned char op) alter; 00779 TK_Status write_vertex_marker_visibilities (BStreamFileToolkit & tk) alter; 00780 TK_Status write_vertex_marker_symbols (BStreamFileToolkit & tk) alter; 00781 TK_Status write_vertex_marker_sizes (BStreamFileToolkit & tk) alter; 00782 TK_Status write_face_colors (BStreamFileToolkit & tk) alter; 00783 TK_Status write_face_colors_all (BStreamFileToolkit & tk) alter; 00784 TK_Status write_face_indices (BStreamFileToolkit & tk) alter; 00785 TK_Status write_face_indices_all (BStreamFileToolkit & tk) alter; 00786 TK_Status write_face_regions (BStreamFileToolkit & tk) alter; 00787 TK_Status write_face_normals (BStreamFileToolkit & tk) alter; 00788 TK_Status write_face_visibilities (BStreamFileToolkit & tk) alter; 00789 TK_Status write_face_patterns (BStreamFileToolkit & tk) alter; 00790 TK_Status write_edge_colors (BStreamFileToolkit & tk) alter; 00791 TK_Status write_edge_indices (BStreamFileToolkit & tk) alter; 00792 TK_Status write_edge_normals (BStreamFileToolkit & tk) alter; 00793 TK_Status write_edge_visibilities (BStreamFileToolkit & tk) alter; 00794 TK_Status write_edge_patterns (BStreamFileToolkit & tk) alter; 00795 TK_Status write_edge_weights (BStreamFileToolkit & tk) alter; 00796 virtual TK_Status write_collection (BStreamFileToolkit & tk, bool write_tag = false, int variant = 0) alter; 00799 void normals_cartesian_to_polar (unsigned int *exists, int flag, int count, const float *in, float *out); 00801 void normals_polar_to_cartesian (unsigned int *exists, int flag, int count, const float *in, float *out); 00802 00806 TK_Status write_vertex_normals_main (BStreamFileToolkit & tk) alter; 00811 TK_Status write_vertex_parameters_main (BStreamFileToolkit & tk) alter; 00817 TK_Status write_vertex_colors_main (BStreamFileToolkit & tk, unsigned char base_op) alter; 00823 TK_Status write_vertex_indices_main (BStreamFileToolkit & tk, unsigned char base_op) alter; 00828 TK_Status write_face_colors_main (BStreamFileToolkit & tk) alter; 00833 TK_Status write_face_indices_main (BStreamFileToolkit & tk) alter; 00834 00835 00836 TK_Status ReadAscii (BStreamFileToolkit & tk) alter; 00837 TK_Status WriteAscii (BStreamFileToolkit & tk) alter; 00838 00839 virtual TK_Status read_trivial_points_ascii (BStreamFileToolkit & tk) alter; 00840 virtual TK_Status write_trivial_points_ascii (BStreamFileToolkit & tk) alter; 00842 TK_Status read_vertex_normals_ascii (BStreamFileToolkit & tk) alter; 00844 TK_Status read_vertex_normals_compressed_ascii (BStreamFileToolkit & tk) alter; 00845 TK_Status read_vertex_normals_all_ascii (BStreamFileToolkit & tk) alter; 00846 TK_Status read_vertex_normals_compressed_all_ascii (BStreamFileToolkit & tk) alter; 00847 TK_Status read_vertex_parameters_ascii (BStreamFileToolkit & tk) alter; 00848 TK_Status read_vertex_parameters_all_ascii (BStreamFileToolkit & tk) alter; 00849 TK_Status read_vertex_colors_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00850 TK_Status read_vertex_colors_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00851 TK_Status read_vertex_indices_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00852 TK_Status read_vertex_indices_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00853 TK_Status read_vertex_marker_visibilities_ascii (BStreamFileToolkit & tk) alter; 00854 TK_Status read_vertex_marker_symbols_ascii (BStreamFileToolkit & tk) alter; 00855 TK_Status read_vertex_marker_sizes_ascii (BStreamFileToolkit & tk) alter; 00856 TK_Status read_face_colors_ascii (BStreamFileToolkit & tk) alter; 00857 TK_Status read_face_colors_all_ascii (BStreamFileToolkit & tk) alter; 00858 TK_Status read_face_indices_ascii (BStreamFileToolkit & tk) alter; 00859 TK_Status read_face_indices_all_ascii (BStreamFileToolkit & tk) alter; 00860 TK_Status read_face_regions_ascii (BStreamFileToolkit & tk) alter; 00861 TK_Status read_face_normals_ascii (BStreamFileToolkit & tk) alter; 00862 TK_Status read_face_visibilities_ascii (BStreamFileToolkit & tk) alter; 00863 TK_Status read_face_patterns_ascii (BStreamFileToolkit & tk) alter; 00864 TK_Status read_edge_colors_ascii (BStreamFileToolkit & tk) alter; 00865 TK_Status read_edge_indices_ascii (BStreamFileToolkit & tk) alter; 00866 TK_Status read_edge_normals_ascii (BStreamFileToolkit & tk) alter; 00867 TK_Status read_edge_visibilities_ascii (BStreamFileToolkit & tk) alter; 00868 TK_Status read_edge_patterns_ascii (BStreamFileToolkit & tk) alter; 00869 TK_Status read_edge_weights_ascii (BStreamFileToolkit & tk) alter; 00871 virtual TK_Status read_collection_ascii (BStreamFileToolkit & tk) alter; 00873 TK_Status write_vertex_normals_ascii (BStreamFileToolkit & tk) alter; 00874 TK_Status write_vertex_normals_compressed_ascii (BStreamFileToolkit & tk) alter; 00875 TK_Status write_vertex_normals_all_ascii (BStreamFileToolkit & tk) alter; 00876 TK_Status write_vertex_normals_compressed_all_ascii (BStreamFileToolkit & tk) alter; 00877 TK_Status write_vertex_parameters_ascii (BStreamFileToolkit & tk) alter; 00878 TK_Status write_vertex_parameters_all_ascii (BStreamFileToolkit & tk) alter; 00879 TK_Status write_vertex_colors_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00880 TK_Status write_vertex_colors_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00881 TK_Status write_vertex_indices_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00882 TK_Status write_vertex_indices_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter; 00883 TK_Status write_vertex_marker_visibilities_ascii (BStreamFileToolkit & tk) alter; 00884 TK_Status write_vertex_marker_symbols_ascii (BStreamFileToolkit & tk) alter; 00885 virtual TK_Status write_vertex_marker_sizes_ascii (BStreamFileToolkit & tk) alter; 00886 TK_Status write_face_colors_ascii (BStreamFileToolkit & tk) alter; 00887 TK_Status write_face_colors_all_ascii (BStreamFileToolkit & tk) alter; 00888 TK_Status write_face_indices_ascii (BStreamFileToolkit & tk) alter; 00889 TK_Status write_face_indices_all_ascii (BStreamFileToolkit & tk) alter; 00890 TK_Status write_face_regions_ascii (BStreamFileToolkit & tk) alter; 00891 TK_Status write_face_normals_ascii (BStreamFileToolkit & tk) alter; 00892 TK_Status write_face_visibilities_ascii (BStreamFileToolkit & tk) alter; 00893 TK_Status write_face_patterns_ascii (BStreamFileToolkit & tk) alter; 00894 TK_Status write_edge_colors_ascii (BStreamFileToolkit & tk) alter; 00895 TK_Status write_edge_indices_ascii (BStreamFileToolkit & tk) alter; 00896 TK_Status write_edge_normals_ascii (BStreamFileToolkit & tk) alter; 00897 TK_Status write_edge_visibilities_ascii (BStreamFileToolkit & tk) alter; 00898 TK_Status write_edge_patterns_ascii (BStreamFileToolkit & tk) alter; 00899 TK_Status write_edge_weights_ascii (BStreamFileToolkit & tk) alter; 00901 virtual TK_Status write_collection_ascii (BStreamFileToolkit & tk, bool write_tag = false, int variant = 0) alter; 00907 TK_Status write_vertex_normals_main_ascii (BStreamFileToolkit & tk) alter; 00912 TK_Status write_vertex_parameters_main_ascii (BStreamFileToolkit & tk) alter; 00918 TK_Status write_vertex_colors_main_ascii (BStreamFileToolkit & tk, unsigned char base_op) alter; 00924 TK_Status write_vertex_indices_main_ascii (BStreamFileToolkit & tk, unsigned char base_op) alter; 00929 TK_Status write_face_colors_main_ascii (BStreamFileToolkit & tk) alter; 00934 TK_Status write_face_indices_main_ascii (BStreamFileToolkit & tk) alter; 00935 00936 00937 virtual TK_Status mangle_points (BStreamFileToolkit & tk, int pointmap_count, int *pointmap) alter; 00938 virtual TK_Status mangle_point_attributes (BStreamFileToolkit & tk, int pointmap_count, int *pointmap) alter; 00939 virtual TK_Status mangle_face_attributes (BStreamFileToolkit & tk, int facemap_count, int *facemap) alter; 00940 bool has_face_attributes() const; 00950 TK_Status repulse_compress_normals (BStreamFileToolkit & tk, int bits) alter; 00956 TK_Status repulse_decompress_normals (BStreamFileToolkit & tk, int bits) alter; 00957 00959 void set_points (int count, float const * points = 0) alter { SetPoints (count, points); }; 00961 void set_normals (float const * normals = 0) alter { SetVertexNormals (normals); }; 00963 void set_parameters (float const * params = 0) alter { SetVertexParameters (params); }; 00965 void set_vfcolors (float const * colors = 0) alter { SetVertexFaceColors (colors); }; 00967 void set_vecolors (float const * colors = 0) alter { SetVertexEdgeColors (colors); }; 00969 void set_vmcolors (float const * colors = 0) alter { SetVertexMarkerColors (colors); }; 00971 void set_vfindices (float const * indices = 0) alter { SetVertexFaceIndices (indices); }; 00973 void set_veindices (float const * indices = 0) alter { SetVertexEdgeIndices (indices); }; 00975 void set_vmindices (float const * indices = 0) alter { SetVertexMarkerIndices (indices); }; 00977 void set_fcolors (float const * colors = 0) alter { SetFaceColors (colors); }; 00979 void set_findices (float const * indices = 0) alter { SetFaceIndices (indices); }; 00981 void set_exists (unsigned int const * exists = 0) alter; 00983 void set_face_exists (unsigned int const * exists = 0) alter; 00985 void set_facemap (int count, int const * facemap = 0) alter; 00986 00987 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00988 00989 }; // end declaration of class TK_Polyhedron 00990 00991 00993 00999 class BBINFILETK_API TK_Mesh : public TK_Polyhedron { 01000 protected: 01001 int m_rows; 01002 int m_columns; 01005 TK_Status EnumerateEdges(); 01006 01007 public: 01008 TK_Mesh() 01009 : TK_Polyhedron (TKE_Mesh), m_rows(0), m_columns(0) {} 01010 01011 01012 01013 TK_Status ReadAscii (BStreamFileToolkit & tk) alter; 01014 TK_Status WriteAscii (BStreamFileToolkit & tk) alter; 01015 01016 TK_Status Read (BStreamFileToolkit & tk) alter; 01017 TK_Status Write (BStreamFileToolkit & tk) alter; 01018 void Reset () alter; 01019 01021 void SetRows (const int rows) alter { m_rows = rows; } 01022 01024 void SetColumns (const int columns) alter { m_columns = columns; } 01025 01026 }; // end declaration of class TK_Mesh 01027 01028 #endif //BBINFILETK_POLYHEDRON 01029