Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BPolyhedron.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: e0e98542edad236ff02d1833dd38caeb1f18b3f7 $
13 //
14 #ifndef BBINFILETK_POLYHEDRON
15 #define BBINFILETK_POLYHEDRON
16 
17 
19 
25 class BBINFILETK_API TK_Polyhedron : public BBaseOpcodeHandler {
26  public:
27 
31  enum Exists {
32  Vertex_None = 0x0000,
33  Vertex_Normal = 0x0001,
34  Vertex_Parameter = 0x0002,
35  Vertex_Face_Color = 0x0004,
36  Vertex_Edge_Color = 0x0008,
37  Vertex_Marker_Color = 0x0010,
38  Vertex_Face_Index = 0x0020,
39  Vertex_Edge_Index = 0x0040,
40  Vertex_Marker_Index = 0x0080,
41  Vertex_Marker_Visibility= 0x0100,
42  Vertex_Marker_Size = 0x0200,
43  Vertex_Marker_Symbol = 0x0400,
44  Vertex_Marker_RGBA = 0x0800,
45  Vertex_Any_Color = 0x08FC
46  };
47 
51  enum Face_Exists {
52  Face_None = 0x0000,
53  Face_Color = 0x0001,
54  Face_Index = 0x0002,
55  Face_Any_Color = 0x0003,
56  Face_Normal = 0x0004,
57  Face_Visibility = 0x0008,
58  Face_Pattern = 0x0010
59  };
60 
64  enum Edge_Exists {
65  Edge_None = 0x0000,
66  Edge_Color = 0x0001,
67  Edge_Index = 0x0002,
68  Edge_Any_Color = 0x0003,
69  Edge_Normal = 0x0004,
70  Edge_Visibility = 0x0008,
71  Edge_Pattern = 0x0010,
72  Edge_Weight = 0x0020,
73  Fake_Edge = 0x8000 //for edges (if any) that do not exist on the write side, but will be introduced due to triangulation
74  };
75 
79  enum Suboptions {
80  TKSH_STANDARD = 0x00,
81  TKSH_COMPRESSED_POINTS = 0x01,
82  TKSH_COMPRESSED_FACES = 0x02,
83  TKSH_TRISTRIPS = 0x04,
84  TKSH_HAS_OPTIONALS = 0x08,
85  TKSH_FIRSTPASS = 0x10,
86  TKSH_BOUNDING_ONLY = 0x20,
87  TKSH_CONNECTIVITY_COMPRESSION = 0x40,
88  TKSH_EXPANDED = 0x80
89  };
90 
95  enum Suboptions2 {
96  TKSH2_COLLECTION = 0x0001,
97  TKSH2_NULL = 0x0002,
98  TKSH2_HAS_NEGATIVE_FACES = 0x0004,
99  TKSH2_GLOBAL_QUANTIZATION = 0x0008
100  };
101 
105  enum Opt_Opcode {
106  OPT_TERMINATE = 0,
107  OPT_ALL_NORMALS_COMPRESSED = 1,
108  OPT_NORMALS_COMPRESSED = 2,
109  OPT_ALL_PARAMETERS_COMPRESSED = 3,
110  OPT_PARAMETERS_COMPRESSED = 4,
111  OPT_ALL_VFCOLORS = 5,
112  OPT_VERTEX_FCOLORS = 6,
113  OPT_ALL_VECOLORS = 7,
114  OPT_VERTEX_ECOLORS = 8,
115  OPT_ALL_VMCOLORS = 9,
116  OPT_VERTEX_MCOLORS = 10,
117  OPT_ALL_VFINDICES = 11,
118  OPT_VERTEX_FINDICES = 12,
119  OPT_ALL_VEINDICES = 13,
120  OPT_VERTEX_EINDICES = 14,
121  OPT_ALL_VMINDICES = 15,
122  OPT_VERTEX_MINDICES = 16,
123  OPT_ALL_NORMALS = 17,
124  OPT_NORMALS = 18,
125  OPT_ALL_NORMALS_POLAR = 19,
126  OPT_NORMALS_POLAR = 20,
127  OPT_ALL_VMVISIBILITIES = 21,
128  OPT_VERTEX_MARKER_VISIBILITIES = 22,
129  OPT_ALL_VMSYMBOLS = 23,
130  OPT_VERTEX_MARKER_SYMBOLS = 24,
131  OPT_ALL_VMSIZES = 25,
132  OPT_VERTEX_MARKER_SIZES = 26,
133  OPT_PARAMETERS = 27,
134  OPT_ALL_PARAMETERS = 28,
135  OPT_ALL_VMRGBAS = 29,
136  OPT_VERTEX_MRGBAS = 30,
137 
138  OPT_ALL_FACE_COLORS = 33,
139  OPT_FACE_COLORS = 34,
140  OPT_ALL_FACE_INDICES = 35,
141  OPT_FACE_INDICES = 36,
142  OPT_ALL_FACE_NORMALS_POLAR = 37,
143  OPT_FACE_NORMALS_POLAR = 38,
144  OPT_ALL_FACE_VISIBILITIES = 39,
145  OPT_FACE_VISIBILITIES = 40,
146  OPT_ALL_FACE_PATTERNS = 41,
147  OPT_FACE_PATTERNS = 42,
148 
149  OPT_FACE_REGIONS = 51,
150 
151  OPT_ALL_EDGE_COLORS = 71,
152  OPT_EDGE_COLORS = 72,
153  OPT_ALL_EDGE_INDICES = 73,
154  OPT_EDGE_INDICES = 74,
155  OPT_ALL_EDGE_NORMALS_POLAR = 75,
156  OPT_EDGE_NORMALS_POLAR = 76,
157  OPT_ALL_EDGE_VISIBILITIES = 77,
158  OPT_EDGE_VISIBILITIES = 78,
159  OPT_ALL_EDGE_PATTERNS = 79,
160  OPT_EDGE_PATTERNS = 80,
161  OPT_ALL_EDGE_WEIGHTS = 81,
162  OPT_EDGE_WEIGHTS = 82,
163 
164  OPT_RESERVED_SPATIAL = 90,
165  OPT_ENTITY_ATTRIBUTES = 99
166  };
167 
168 
169  //see TK_Shell for GetFacesLength, GetFaces, GetLodLevel, SetFaces, SetLodLevel
170 
172  float const *GetPoints() const { return mp_points; };
174  float *GetPoints() { return mp_points; };
176  int GetPointCount() const { return mp_pointcount; };
178  unsigned int const *GetExists() const { return mp_exists; };
180  unsigned int *GetExists() { return mp_exists; };
182  unsigned int const *GetFaceExists() const { return mp_face_exists; };
184  unsigned int *GetFaceExists() { return mp_face_exists; };
186  ID_Key GetKey() const { return mp_key; };
188  unsigned char GetSubop() const { return mp_subop; };
190  unsigned short GetSubop2() const { return mp_subop2; };
192  const float *GetBounding() const { return mp_bbox; };
194  float const *GetVertexNormals() const { return mp_normals; };
196  float *GetVertexNormals() { return mp_normals; };
198  float const *GetVertexParameters() const { return mp_params; };
200  float *GetVertexParameters() { return mp_params; };
202  float const *GetVertexFaceColors() const { return mp_vfcolors; };
204  float *GetVertexFaceColors() { return mp_vfcolors; };
206  float const *GetVertexEdgeColors() const { return mp_vecolors; };
208  float *GetVertexEdgeColors() { return mp_vecolors; };
210  float const *GetVertexMarkerColors() const { return mp_vmcolors; };
212  float *GetVertexMarkerColors() { return mp_vmcolors; };
214  float const *GetVertexMarkerRGBAs() const { return mp_vmcolors; };
216  float *GetVertexMarkerRGBAs() { return mp_vmcolors; };
219  float const *GetVertexColors() const {
220  if (mp_vmcolors != 0) return mp_vmcolors;
221  else if (mp_vfcolors != 0) return mp_vfcolors;
222  else if (mp_vecolors != 0) return mp_vecolors;
223  else return 0;
224  };
227  float *GetVertexColors() {
228  if (mp_vmcolors != 0) return mp_vmcolors;
229  else if (mp_vfcolors != 0) return mp_vfcolors;
230  else if (mp_vecolors != 0) return mp_vecolors;
231  else return 0;
232  };
234  float const *GetVertexFaceIndices() const { return mp_vfindices; };
236  float *GetVertexFaceIndices() { return mp_vfindices; };
238  float const *GetVertexEdgeIndices() const { return mp_veindices; };
240  float *GetVertexEdgeIndices() { return mp_veindices; };
242  float const *GetVertexMarkerIndices() const { return mp_vmindices; };
244  float *GetVertexMarkerIndices() { return mp_vmindices; };
247  float const *GetVertexIndices() const {
248  if (mp_vmindices != 0) return mp_vmindices;
249  else if (mp_vfindices != 0) return mp_vfindices;
250  else if (mp_veindices != 0) return mp_veindices;
251  else return 0;
252  };
255  float *GetVertexIndices() {
256  if (mp_vmindices != 0) return mp_vmindices;
257  else if (mp_vfindices != 0) return mp_vfindices;
258  else if (mp_veindices != 0) return mp_veindices;
259  else return 0;
260  };
262  float const *GetFaceColors() const { return mp_fcolors; };
264  float *GetFaceColors() { return mp_fcolors; };
266  float const *GetFaceIndices() const { return mp_findices; };
268  float *GetFaceIndices() { return mp_findices; };
270  int const * GetFaceRegions() const { return mp_fregions; };
272  int alter * GetFaceRegions() alter { return mp_fregions; };
273 
275  TK_Status SetKey (BStreamFileToolkit &tk, ID_Key key) alter { set_last_key (tk, key); mp_key = key; return TK_Normal; };
278  TK_Status SetSubop (unsigned char subop) alter { mp_subop = subop; return TK_Normal; };
281  TK_Status SetSubop2 (unsigned short subop2) alter { mp_subop2 = subop2; return TK_Normal; };
286  TK_Status InitSubop (BStreamFileToolkit &tk, int lodlevel, bool is_firstpass) alter;
289  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; };
294  TK_Status SetPoints (int count, float const *points=0) alter;
299  TK_Status SetVertexNormals (float const *normals=0) alter;
308  TK_Status SetVertexParameters (float const *parameters=0, int width=0) alter;
316  TK_Status SetVertexFaceColors (float const *colors=0) alter;
324  TK_Status SetVertexEdgeColors (float const *colors=0) alter;
332  TK_Status SetVertexMarkerColors (float const *colors=0) alter;
340  TK_Status SetVertexMarkerRGBAs (float const *colors=0) alter;
350  TK_Status SetVertexColors (float const *colors=0) alter;
359  TK_Status SetVertexFaceIndices (float const *indices=0) alter;
368  TK_Status SetVertexEdgeIndices (float const *indices=0) alter;
377  TK_Status SetVertexMarkerIndices (float const *indices=0) alter;
387  TK_Status SetVertexIndices (float const *indices=0) alter;
393  TK_Status SetVertexMarkerVisibilities (char const *visibilities=0) alter;
400  TK_Status SetVertexMarkerSizes (float const *sizes=0) alter;
407  TK_Status SetVertexMarkerSymbols (char const *symbols=0) alter;
411  TK_Status SetVertexMarkerSymbolStrings () alter;
417  TK_Status SetFaceColors (float const *colors=0) alter;
423  TK_Status SetFaceNormals (float const *normals=0) alter;
429  TK_Status SetFaceVisibilities (char const *visibilities=0) alter;
436  TK_Status SetFacePatterns (char const *patterns=0) alter;
444  TK_Status SetFaceIndices (float const *indices=0) alter;
447  TK_Status SetFaceRegions (int const * regions=0) alter;
456  TK_Status SetEdgeColors (float const *colors=0) alter;
463  TK_Status SetEdgeIndices (float const *indices=0) alter;
469  TK_Status SetEdgeNormals (float const *normals=0) alter;
476  TK_Status SetEdgeVisibilities (char const *visibilities=0) alter;
482  TK_Status SetEdgePatterns (char const *patterns=0) alter;
486  TK_Status SetEdgePatternStrings () alter;
492  TK_Status SetEdgeWeights (float const *weights=0) alter;
493 
498  TK_Status SetExists (unsigned int const *vals=0) alter;
503  TK_Status SetFaceExists (unsigned int const *vals=0) alter;
510  TK_Status SetEdgeExists (unsigned int const *vals=0) alter;
511 
517  TK_Status AppendObject (BStreamFileToolkit & tk, BBaseOpcodeHandler *obj);
520  BBaseOpcodeHandler *PopObject();
521 
523  bool HasOptionals() { return
524  HasVertexAttributes() ||
525  HasFaceAttributes() ||
526  HasEdgeAttributes() ||
527  (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);// 0x01 matches TKSH2_COLLECTION
528  };
530  bool HasVertexNormals() const { return mp_normals != 0; };
532  bool HasVertexParameters() const { return mp_params != 0; };
534  bool HasVertexFaceColors() const { return mp_vfcolors != 0; };
536  bool HasVertexEdgeColors() const { return mp_vecolors != 0; };
538  bool HasVertexMarkerColors() const { return mp_vmcolors != 0; };
540  bool HasVertexMarkerRGBAs() const { return mp_vmrgbas != 0; };
542  bool HasVertexColors() const { return
543  mp_vfcolors != 0 ||
544  mp_vecolors != 0 ||
545  mp_vmcolors != 0 ||
546  mp_vmrgbas != 0;
547  };
549  inline bool HasVertexFaceIndices() const { return mp_vfindices != 0; };
551  inline bool HasVertexEdgeIndices() const { return mp_veindices != 0; };
553  inline bool HasVertexMarkerIndices() const { return mp_vmindices != 0; };
555  inline bool HasVertexIndices() const { return
556  mp_vfindices != 0 ||
557  mp_veindices != 0 ||
558  mp_vmindices != 0;
559  };
561  inline bool HasVertexMarkerVisibilities() const { return mp_vmvisibilities != 0; };
563  inline bool HasVertexMarkerSymbols() const { return mp_vmsymbols != 0; };
565  inline bool HasVertexMarkerSizes() const { return mp_vmsizes != 0; };
569  inline bool HasVertexAttributes() const { return
570  HasVertexColors() ||
571  HasVertexIndices() ||
572  HasVertexNormals() ||
573  HasVertexParameters() ||
574  HasVertexMarkerVisibilities() ||
575  HasVertexMarkerSymbols() ||
576  HasVertexMarkerSizes();
577  };
579  inline bool HasFaceColors() const { return mp_fcolors != 0; };
581  inline bool HasFaceIndices() const { return mp_findices != 0; };
583  inline bool HasFaceNormals() const { return mp_fnormals != 0; };
585  inline bool HasFaceVisibilities() const { return mp_fvisibilities != 0; };
587  inline bool HasFacePatterns() const { return mp_fpatterns != 0; };
589  inline bool HasFaceRegions() const { return mp_fregions != 0; };
592  inline bool HasFaceAttributes() const { return
593  HasFaceColors() ||
594  HasFaceIndices() ||
595  HasFaceNormals() ||
596  HasFaceVisibilities() ||
597  HasFacePatterns() ||
598  HasFaceRegions();
599  };
600 
602  inline bool HasEdgeColors() const { return mp_ecolors != 0; };
604  inline bool HasEdgeIndices() const { return mp_eindices != 0; };
606  inline bool HasEdgeNormals() const { return mp_enormals != 0; };
608  inline bool HasEdgeVisibilities() const { return mp_evisibilities != 0; };
610  inline bool HasEdgePatterns() const { return mp_epatterns != 0; };
612  inline bool HasEdgeWeights() const { return mp_eweights != 0; };
614  inline bool HasEdgeAttributes() const { return
615  HasEdgeColors() ||
616  HasEdgeIndices() ||
617  HasEdgeNormals() ||
618  HasEdgeVisibilities() ||
619  HasEdgePatterns() ||
620  HasEdgeWeights();
621  };
622 
623  protected:
624  //data members prefixed with "mp_", not "m_", to avoid potential naming conflicts with TK_Shell and/or TK_Mesh
625 
626 #ifndef DOXYGEN_SHOULD_SKIP_THIS
627 
628  float * mp_points;
629  float * mp_normals;
630  float * mp_params;
631  float * mp_vfcolors;
632  float * mp_vecolors;
633  float * mp_vmcolors;
634  float * mp_vmrgbas;
635  float * mp_vfindices;
636  float * mp_veindices;
637  float * mp_vmindices;
638  char * mp_vmvisibilities;
639  float * mp_vmsizes;
640  unsigned char * mp_vmsymbols;
641  char ** mp_vmsymbolstrings;
642  float * mp_fcolors;
643  float * mp_findices;
644  int * mp_fregions;
645  float * mp_fnormals;
646  char * mp_fvisibilities;
647  char * mp_fpatterns;
648  float * mp_ecolors;
649  float * mp_eindices;
650  float * mp_enormals;
651  char * mp_evisibilities;
652  unsigned char * mp_epatterns;
653  char ** mp_epatternstrings;
654  float * mp_eweights;
656  unsigned int * mp_exists;
657  unsigned int * mp_face_exists;
658  unsigned int * mp_edge_exists;
660  int mp_pointcount;
661  int mp_normalcount;
662  int mp_paramcount;
663  char mp_paramwidth;
664  int mp_vfcolorcount;
665  int mp_vecolorcount;
666  int mp_vmcolorcount;
667  int mp_vmrgbacount;
668  int mp_vfindexcount;
669  int mp_veindexcount;
670  int mp_vmindexcount;
671  int mp_vmvisibilitycount;
672  int mp_vmsizecount;
673  int mp_vmsymbolcount;
674  int mp_facecount;
675  int mp_fcolorcount;
676  int mp_findexcount;
677  int mp_fnormalcount;
678  int mp_fpatterncount;
679  int mp_fvisibilitycount;
680  int mp_edgecount;
681  int mp_ecolorcount;
682  int mp_eindexcount;
683  int mp_enormalcount;
684  int mp_epatterncount;
685  int mp_eweightcount;
686  int mp_evisibilitycount;
687  int * mp_edge_enumeration;
689  int mp_stage;
690  int mp_substage;
691  int mp_progress;
692  int mp_subprogress;
693  unsigned char mp_optopcode;
696  unsigned short mp_present;
697  unsigned short mp_face_present;
698  unsigned short mp_edge_present;
699  unsigned char mp_bits_per_sample;
700  float mp_bbox[256];
701  ID_Key mp_key;
702  TK_Instance * mp_instance;
703  float mp_matrix[16];
704  unsigned char * mp_workspace;
705  int mp_workspace_allocated;
706  int mp_workspace_used;
707  unsigned char mp_compression_scheme;
708  unsigned char mp_subop;
709  unsigned short mp_subop2;
710  int mp_num_collection_parts;
711  BBaseOpcodeHandler **mp_collection_parts;
718  virtual TK_Status EnumerateEdges() { return TK_Error; };
723  virtual TK_Status LabelFakeEdges() { return TK_Normal; };
728  virtual bool AllowInstancing(BStreamFileToolkit & tk) const;
729 
730  TK_Polyhedron(unsigned char op);
731  ~TK_Polyhedron();
732 
735  virtual void Reset () alter;
736 
737  virtual TK_Status read_trivial_points (BStreamFileToolkit & tk) alter;
738  virtual TK_Status write_trivial_points (BStreamFileToolkit & tk) alter;
740  TK_Status read_vertex_normals (BStreamFileToolkit & tk) alter;
741  TK_Status read_vertex_normals_compressed (BStreamFileToolkit & tk) alter;
742  TK_Status read_vertex_normals_all (BStreamFileToolkit & tk) alter;
743  TK_Status read_vertex_normals_compressed_all (BStreamFileToolkit & tk) alter;
744  TK_Status read_vertex_parameters (BStreamFileToolkit & tk) alter;
745  TK_Status read_vertex_parameters_all (BStreamFileToolkit & tk) alter;
746  TK_Status read_vertex_colors_all (BStreamFileToolkit & tk, unsigned char op) alter;
747  TK_Status read_vertex_colors (BStreamFileToolkit & tk, unsigned char op) alter;
748  TK_Status read_vertex_indices_all (BStreamFileToolkit & tk, unsigned char op) alter;
749  TK_Status read_vertex_indices (BStreamFileToolkit & tk, unsigned char op) alter;
750  TK_Status read_vertex_marker_visibilities (BStreamFileToolkit & tk) alter;
751  TK_Status read_vertex_marker_symbols (BStreamFileToolkit & tk) alter;
752  TK_Status read_vertex_marker_sizes (BStreamFileToolkit & tk) alter;
753  TK_Status read_face_colors (BStreamFileToolkit & tk) alter;
754  TK_Status read_face_colors_all (BStreamFileToolkit & tk) alter;
755  TK_Status read_face_indices (BStreamFileToolkit & tk) alter;
756  TK_Status read_face_indices_all (BStreamFileToolkit & tk) alter;
757  TK_Status read_face_regions (BStreamFileToolkit & tk) alter;
758  TK_Status read_face_normals (BStreamFileToolkit & tk) alter;
759  TK_Status read_face_visibilities (BStreamFileToolkit & tk) alter;
760  TK_Status read_face_patterns (BStreamFileToolkit & tk) alter;
761  TK_Status read_edge_colors (BStreamFileToolkit & tk) alter;
762  TK_Status read_edge_indices (BStreamFileToolkit & tk) alter;
763  TK_Status read_edge_normals (BStreamFileToolkit & tk) alter;
764  TK_Status read_edge_visibilities (BStreamFileToolkit & tk) alter;
765  TK_Status read_edge_patterns (BStreamFileToolkit & tk) alter;
766  TK_Status read_edge_weights (BStreamFileToolkit & tk) alter;
767  virtual TK_Status read_collection (BStreamFileToolkit & tk) alter;
769  TK_Status write_vertex_normals (BStreamFileToolkit & tk) alter;
770  TK_Status write_vertex_normals_compressed (BStreamFileToolkit & tk) alter;
771  TK_Status write_vertex_normals_all (BStreamFileToolkit & tk) alter;
772  TK_Status write_vertex_normals_compressed_all (BStreamFileToolkit & tk) alter;
773  TK_Status write_vertex_parameters (BStreamFileToolkit & tk) alter;
774  TK_Status write_vertex_parameters_all (BStreamFileToolkit & tk) alter;
775  TK_Status write_vertex_colors (BStreamFileToolkit & tk, unsigned char op) alter;
776  TK_Status write_vertex_colors_all (BStreamFileToolkit & tk, unsigned char op) alter;
777  TK_Status write_vertex_indices (BStreamFileToolkit & tk, unsigned char op) alter;
778  TK_Status write_vertex_indices_all (BStreamFileToolkit & tk, unsigned char op) alter;
779  TK_Status write_vertex_marker_visibilities (BStreamFileToolkit & tk) alter;
780  TK_Status write_vertex_marker_symbols (BStreamFileToolkit & tk) alter;
781  TK_Status write_vertex_marker_sizes (BStreamFileToolkit & tk) alter;
782  TK_Status write_face_colors (BStreamFileToolkit & tk) alter;
783  TK_Status write_face_colors_all (BStreamFileToolkit & tk) alter;
784  TK_Status write_face_indices (BStreamFileToolkit & tk) alter;
785  TK_Status write_face_indices_all (BStreamFileToolkit & tk) alter;
786  TK_Status write_face_regions (BStreamFileToolkit & tk) alter;
787  TK_Status write_face_normals (BStreamFileToolkit & tk) alter;
788  TK_Status write_face_visibilities (BStreamFileToolkit & tk) alter;
789  TK_Status write_face_patterns (BStreamFileToolkit & tk) alter;
790  TK_Status write_edge_colors (BStreamFileToolkit & tk) alter;
791  TK_Status write_edge_indices (BStreamFileToolkit & tk) alter;
792  TK_Status write_edge_normals (BStreamFileToolkit & tk) alter;
793  TK_Status write_edge_visibilities (BStreamFileToolkit & tk) alter;
794  TK_Status write_edge_patterns (BStreamFileToolkit & tk) alter;
795  TK_Status write_edge_weights (BStreamFileToolkit & tk) alter;
796  virtual TK_Status write_collection (BStreamFileToolkit & tk, bool write_tag = false, int variant = 0) alter;
799  void normals_cartesian_to_polar (unsigned int *exists, int flag, int count, const float *in, float *out);
801  void normals_polar_to_cartesian (unsigned int *exists, int flag, int count, const float *in, float *out);
802 
806  TK_Status write_vertex_normals_main (BStreamFileToolkit & tk) alter;
811  TK_Status write_vertex_parameters_main (BStreamFileToolkit & tk) alter;
817  TK_Status write_vertex_colors_main (BStreamFileToolkit & tk, unsigned char base_op) alter;
823  TK_Status write_vertex_indices_main (BStreamFileToolkit & tk, unsigned char base_op) alter;
828  TK_Status write_face_colors_main (BStreamFileToolkit & tk) alter;
833  TK_Status write_face_indices_main (BStreamFileToolkit & tk) alter;
834 
835 
836  TK_Status ReadAscii (BStreamFileToolkit & tk) alter;
837  TK_Status WriteAscii (BStreamFileToolkit & tk) alter;
838 
839  virtual TK_Status read_trivial_points_ascii (BStreamFileToolkit & tk) alter;
840  virtual TK_Status write_trivial_points_ascii (BStreamFileToolkit & tk) alter;
842  TK_Status read_vertex_normals_ascii (BStreamFileToolkit & tk) alter;
844  TK_Status read_vertex_normals_compressed_ascii (BStreamFileToolkit & tk) alter;
845  TK_Status read_vertex_normals_all_ascii (BStreamFileToolkit & tk) alter;
846  TK_Status read_vertex_normals_compressed_all_ascii (BStreamFileToolkit & tk) alter;
847  TK_Status read_vertex_parameters_ascii (BStreamFileToolkit & tk) alter;
848  TK_Status read_vertex_parameters_all_ascii (BStreamFileToolkit & tk) alter;
849  TK_Status read_vertex_colors_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
850  TK_Status read_vertex_colors_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
851  TK_Status read_vertex_indices_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
852  TK_Status read_vertex_indices_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
853  TK_Status read_vertex_marker_visibilities_ascii (BStreamFileToolkit & tk) alter;
854  TK_Status read_vertex_marker_symbols_ascii (BStreamFileToolkit & tk) alter;
855  TK_Status read_vertex_marker_sizes_ascii (BStreamFileToolkit & tk) alter;
856  TK_Status read_face_colors_ascii (BStreamFileToolkit & tk) alter;
857  TK_Status read_face_colors_all_ascii (BStreamFileToolkit & tk) alter;
858  TK_Status read_face_indices_ascii (BStreamFileToolkit & tk) alter;
859  TK_Status read_face_indices_all_ascii (BStreamFileToolkit & tk) alter;
860  TK_Status read_face_regions_ascii (BStreamFileToolkit & tk) alter;
861  TK_Status read_face_normals_ascii (BStreamFileToolkit & tk) alter;
862  TK_Status read_face_visibilities_ascii (BStreamFileToolkit & tk) alter;
863  TK_Status read_face_patterns_ascii (BStreamFileToolkit & tk) alter;
864  TK_Status read_edge_colors_ascii (BStreamFileToolkit & tk) alter;
865  TK_Status read_edge_indices_ascii (BStreamFileToolkit & tk) alter;
866  TK_Status read_edge_normals_ascii (BStreamFileToolkit & tk) alter;
867  TK_Status read_edge_visibilities_ascii (BStreamFileToolkit & tk) alter;
868  TK_Status read_edge_patterns_ascii (BStreamFileToolkit & tk) alter;
869  TK_Status read_edge_weights_ascii (BStreamFileToolkit & tk) alter;
871  virtual TK_Status read_collection_ascii (BStreamFileToolkit & tk) alter;
873  TK_Status write_vertex_normals_ascii (BStreamFileToolkit & tk) alter;
874  TK_Status write_vertex_normals_compressed_ascii (BStreamFileToolkit & tk) alter;
875  TK_Status write_vertex_normals_all_ascii (BStreamFileToolkit & tk) alter;
876  TK_Status write_vertex_normals_compressed_all_ascii (BStreamFileToolkit & tk) alter;
877  TK_Status write_vertex_parameters_ascii (BStreamFileToolkit & tk) alter;
878  TK_Status write_vertex_parameters_all_ascii (BStreamFileToolkit & tk) alter;
879  TK_Status write_vertex_colors_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
880  TK_Status write_vertex_colors_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
881  TK_Status write_vertex_indices_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
882  TK_Status write_vertex_indices_all_ascii (BStreamFileToolkit & tk, unsigned char op) alter;
883  TK_Status write_vertex_marker_visibilities_ascii (BStreamFileToolkit & tk) alter;
884  TK_Status write_vertex_marker_symbols_ascii (BStreamFileToolkit & tk) alter;
885  virtual TK_Status write_vertex_marker_sizes_ascii (BStreamFileToolkit & tk) alter;
886  TK_Status write_face_colors_ascii (BStreamFileToolkit & tk) alter;
887  TK_Status write_face_colors_all_ascii (BStreamFileToolkit & tk) alter;
888  TK_Status write_face_indices_ascii (BStreamFileToolkit & tk) alter;
889  TK_Status write_face_indices_all_ascii (BStreamFileToolkit & tk) alter;
890  TK_Status write_face_regions_ascii (BStreamFileToolkit & tk) alter;
891  TK_Status write_face_normals_ascii (BStreamFileToolkit & tk) alter;
892  TK_Status write_face_visibilities_ascii (BStreamFileToolkit & tk) alter;
893  TK_Status write_face_patterns_ascii (BStreamFileToolkit & tk) alter;
894  TK_Status write_edge_colors_ascii (BStreamFileToolkit & tk) alter;
895  TK_Status write_edge_indices_ascii (BStreamFileToolkit & tk) alter;
896  TK_Status write_edge_normals_ascii (BStreamFileToolkit & tk) alter;
897  TK_Status write_edge_visibilities_ascii (BStreamFileToolkit & tk) alter;
898  TK_Status write_edge_patterns_ascii (BStreamFileToolkit & tk) alter;
899  TK_Status write_edge_weights_ascii (BStreamFileToolkit & tk) alter;
901  virtual TK_Status write_collection_ascii (BStreamFileToolkit & tk, bool write_tag = false, int variant = 0) alter;
907  TK_Status write_vertex_normals_main_ascii (BStreamFileToolkit & tk) alter;
912  TK_Status write_vertex_parameters_main_ascii (BStreamFileToolkit & tk) alter;
918  TK_Status write_vertex_colors_main_ascii (BStreamFileToolkit & tk, unsigned char base_op) alter;
924  TK_Status write_vertex_indices_main_ascii (BStreamFileToolkit & tk, unsigned char base_op) alter;
929  TK_Status write_face_colors_main_ascii (BStreamFileToolkit & tk) alter;
934  TK_Status write_face_indices_main_ascii (BStreamFileToolkit & tk) alter;
935 
936 
937  virtual TK_Status mangle_points (BStreamFileToolkit & tk, int pointmap_count, int *pointmap) alter;
938  virtual TK_Status mangle_point_attributes (BStreamFileToolkit & tk, int pointmap_count, int *pointmap) alter;
939  virtual TK_Status mangle_face_attributes (BStreamFileToolkit & tk, int facemap_count, int *facemap) alter;
940  bool has_face_attributes() const;
950  TK_Status repulse_compress_normals (BStreamFileToolkit & tk, int bits) alter;
956  TK_Status repulse_decompress_normals (BStreamFileToolkit & tk, int bits) alter;
957 
959  void set_points (int count, float const * points = 0) alter { SetPoints (count, points); };
961  void set_normals (float const * normals = 0) alter { SetVertexNormals (normals); };
963  void set_parameters (float const * params = 0) alter { SetVertexParameters (params); };
965  void set_vfcolors (float const * colors = 0) alter { SetVertexFaceColors (colors); };
967  void set_vecolors (float const * colors = 0) alter { SetVertexEdgeColors (colors); };
969  void set_vmcolors (float const * colors = 0) alter { SetVertexMarkerColors (colors); };
971  void set_vfindices (float const * indices = 0) alter { SetVertexFaceIndices (indices); };
973  void set_veindices (float const * indices = 0) alter { SetVertexEdgeIndices (indices); };
975  void set_vmindices (float const * indices = 0) alter { SetVertexMarkerIndices (indices); };
977  void set_fcolors (float const * colors = 0) alter { SetFaceColors (colors); };
979  void set_findices (float const * indices = 0) alter { SetFaceIndices (indices); };
981  void set_exists (unsigned int const * exists = 0) alter;
983  void set_face_exists (unsigned int const * exists = 0) alter;
985  void set_facemap (int count, int const * facemap = 0) alter;
986 
987 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
988 
989 }; // end declaration of class TK_Polyhedron
990 
991 
993 
999 class BBINFILETK_API TK_Mesh : public TK_Polyhedron {
1000  protected:
1001  int m_rows;
1005  TK_Status EnumerateEdges();
1006 
1007  public:
1008  TK_Mesh()
1009  : TK_Polyhedron (TKE_Mesh), m_rows(0), m_columns(0) {}
1010 
1011 
1012 
1013  TK_Status ReadAscii (BStreamFileToolkit & tk) alter;
1014  TK_Status WriteAscii (BStreamFileToolkit & tk) alter;
1015 
1018  void Reset () alter;
1019 
1021  void SetRows (const int rows) alter { m_rows = rows; }
1022 
1024  void SetColumns (const int columns) alter { m_columns = columns; }
1025 
1026 }; // end declaration of class TK_Mesh
1027 
1028 #endif //BBINFILETK_POLYHEDRON
1029 
float * GetVertexFaceColors()
Definition: BPolyhedron.h:204
float * GetVertexMarkerRGBAs()
Definition: BPolyhedron.h:216
Opt_Opcode
Definition: BPolyhedron.h:105
bool HasVertexMarkerVisibilities() const
Definition: BPolyhedron.h:561
float * GetFaceColors()
Definition: BPolyhedron.h:264
bool HasEdgePatterns() const
Definition: BPolyhedron.h:610
bool HasEdgeNormals() const
Definition: BPolyhedron.h:606
float const * GetVertexEdgeColors() const
Definition: BPolyhedron.h:206
#define alter
complementary to const, indicates we thought about it instead of a forgotten "const" ...
Definition: BStream.h:225
bool HasVertexAttributes() const
Definition: BPolyhedron.h:569
bool HasVertexIndices() const
Definition: BPolyhedron.h:555
The BStreamFileToolkit class provides support for importing/exporting HOOPS Stream File information...
Definition: BStreamFileToolkit.h:328
float * GetVertexEdgeColors()
Definition: BPolyhedron.h:208
void set_last_key(BStreamFileToolkit &tk, ID_Key key) alter
sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices ...
Definition: BOpcodeHandler.h:638
Face_Exists
Definition: BPolyhedron.h:51
TK_Status SetSubop2(unsigned short subop2) alter
Definition: BPolyhedron.h:281
float * GetVertexColors()
Definition: BPolyhedron.h:227
bool HasEdgeColors() const
Definition: BPolyhedron.h:602
bool HasVertexParameters() const
Definition: BPolyhedron.h:532
float const * GetVertexIndices() const
Definition: BPolyhedron.h:247
bool HasVertexMarkerRGBAs() const
Definition: BPolyhedron.h:540
bool HasFaceAttributes() const
Definition: BPolyhedron.h:592
bool HasFacePatterns() const
Definition: BPolyhedron.h:587
int const * GetFaceRegions() const
Definition: BPolyhedron.h:270
float * GetPoints()
Definition: BPolyhedron.h:174
Definition: BStream.h:239
Suboptions2
Definition: BPolyhedron.h:95
float * GetVertexParameters()
Definition: BPolyhedron.h:200
unsigned int const * GetExists() const
Definition: BPolyhedron.h:178
float const * GetVertexMarkerColors() const
Definition: BPolyhedron.h:210
bool HasVertexFaceColors() const
Definition: BPolyhedron.h:534
int GetPointCount() const
Definition: BPolyhedron.h:176
bool HasEdgeAttributes() const
Definition: BPolyhedron.h:614
float * GetVertexFaceIndices()
Definition: BPolyhedron.h:236
unsigned int * GetFaceExists()
Definition: BPolyhedron.h:184
Handles the TKE_Repeat_Object opcode.
Definition: BOpcodeHandler.h:1379
Handles the TKE_Mesh opcode.
Definition: BPolyhedron.h:999
float const * GetVertexNormals() const
Definition: BPolyhedron.h:194
virtual TK_Status Read(BStreamFileToolkit &tk) alter=0
bool HasEdgeWeights() const
Definition: BPolyhedron.h:612
ID_Key GetKey() const
Definition: BPolyhedron.h:186
Suboptions
Definition: BPolyhedron.h:79
float const * GetVertexMarkerRGBAs() const
Definition: BPolyhedron.h:214
bool HasFaceRegions() const
Definition: BPolyhedron.h:589
bool HasVertexEdgeColors() const
Definition: BPolyhedron.h:536
unsigned short GetSubop2() const
Definition: BPolyhedron.h:190
TK_Status SetBounding(float const *bbox) alter
Definition: BPolyhedron.h:289
bool HasVertexMarkerColors() const
Definition: BPolyhedron.h:538
bool HasVertexMarkerSizes() const
Definition: BPolyhedron.h:565
float const * GetVertexMarkerIndices() const
Definition: BPolyhedron.h:242
Definition: BStream.h:238
void SetColumns(const int columns) alter
Definition: BPolyhedron.h:1024
float const * GetFaceColors() const
Definition: BPolyhedron.h:262
float * GetFaceIndices()
Definition: BPolyhedron.h:268
float * GetVertexMarkerColors()
Definition: BPolyhedron.h:212
bool HasEdgeVisibilities() const
Definition: BPolyhedron.h:608
unsigned char GetSubop() const
Definition: BPolyhedron.h:188
float * GetVertexEdgeIndices()
Definition: BPolyhedron.h:240
int alter * GetFaceRegions() alter
Definition: BPolyhedron.h:272
bool HasVertexEdgeIndices() const
Definition: BPolyhedron.h:551
TK_Status SetKey(BStreamFileToolkit &tk, ID_Key key) alter
informs the TK_Polyhedron of the id by which this piece of geometry is known
Definition: BPolyhedron.h:275
float const * GetVertexParameters() const
Definition: BPolyhedron.h:198
float const * GetVertexColors() const
Definition: BPolyhedron.h:219
bool HasVertexMarkerIndices() const
Definition: BPolyhedron.h:553
bool HasFaceNormals() const
Definition: BPolyhedron.h:583
float const * GetVertexFaceColors() const
Definition: BPolyhedron.h:202
float * GetVertexMarkerIndices()
Definition: BPolyhedron.h:244
Exists
Definition: BPolyhedron.h:31
unsigned int const * GetFaceExists() const
Definition: BPolyhedron.h:182
int m_columns
Definition: BPolyhedron.h:1002
The BBaseOpcodeHandler abstract class is used as a base for derived classes which manage logical piec...
Definition: BOpcodeHandler.h:60
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:237
float * GetVertexIndices()
Definition: BPolyhedron.h:255
float const * GetVertexEdgeIndices() const
Definition: BPolyhedron.h:238
Edge_Exists
Definition: BPolyhedron.h:64
float const * GetPoints() const
Definition: BPolyhedron.h:172
const float * GetBounding() const
Definition: BPolyhedron.h:192
#define ID_Key
Definition: BStream.h:219
virtual void Reset() alter
Base class for shell and mesh.
Definition: BPolyhedron.h:25
TK_Status SetSubop(unsigned char subop) alter
Definition: BPolyhedron.h:278
bool HasFaceVisibilities() const
Definition: BPolyhedron.h:585
int m_rows
Definition: BPolyhedron.h:1001
bool HasEdgeIndices() const
Definition: BPolyhedron.h:604
bool HasVertexColors() const
Definition: BPolyhedron.h:542
float const * GetVertexFaceIndices() const
Definition: BPolyhedron.h:234
bool HasFaceColors() const
Definition: BPolyhedron.h:579
virtual TK_Status Write(BStreamFileToolkit &tk) alter=0
float * GetVertexNormals()
Definition: BPolyhedron.h:196
bool HasVertexMarkerSymbols() const
Definition: BPolyhedron.h:563
bool HasVertexFaceIndices() const
Definition: BPolyhedron.h:549
float const * GetFaceIndices() const
Definition: BPolyhedron.h:266
bool HasVertexNormals() const
Definition: BPolyhedron.h:530
unsigned int * GetExists()
Definition: BPolyhedron.h:180
bool HasFaceIndices() const
Definition: BPolyhedron.h:581