10 #ifndef BBINFILETK_POLYHEDRON
11 #define BBINFILETK_POLYHEDRON
29 Vertex_Normal = 0x0001,
30 Vertex_Parameter = 0x0002,
31 Vertex_Face_Color = 0x0004,
32 Vertex_Edge_Color = 0x0008,
33 Vertex_Marker_Color = 0x0010,
34 Vertex_Face_Index = 0x0020,
35 Vertex_Edge_Index = 0x0040,
36 Vertex_Marker_Index = 0x0080,
37 Vertex_Marker_Visibility= 0x0100,
38 Vertex_Marker_Size = 0x0200,
39 Vertex_Marker_Symbol = 0x0400,
40 Vertex_Marker_RGBA = 0x0800,
41 Vertex_Any_Color = 0x08FC
51 Face_Any_Color = 0x0003,
53 Face_Visibility = 0x0008,
64 Edge_Any_Color = 0x0003,
66 Edge_Visibility = 0x0008,
67 Edge_Pattern = 0x0010,
77 TKSH_COMPRESSED_POINTS = 0x01,
78 TKSH_COMPRESSED_FACES = 0x02,
79 TKSH_TRISTRIPS = 0x04,
80 TKSH_HAS_OPTIONALS = 0x08,
81 TKSH_FIRSTPASS = 0x10,
82 TKSH_BOUNDING_ONLY = 0x20,
83 TKSH_CONNECTIVITY_COMPRESSION = 0x40,
92 TKSH2_COLLECTION = 0x0001,
94 TKSH2_HAS_NEGATIVE_FACES = 0x0004,
95 TKSH2_GLOBAL_QUANTIZATION = 0x0008
103 OPT_ALL_NORMALS_COMPRESSED = 1,
104 OPT_NORMALS_COMPRESSED = 2,
105 OPT_ALL_PARAMETERS_COMPRESSED = 3,
106 OPT_PARAMETERS_COMPRESSED = 4,
107 OPT_ALL_VFCOLORS = 5,
108 OPT_VERTEX_FCOLORS = 6,
109 OPT_ALL_VECOLORS = 7,
110 OPT_VERTEX_ECOLORS = 8,
111 OPT_ALL_VMCOLORS = 9,
112 OPT_VERTEX_MCOLORS = 10,
113 OPT_ALL_VFINDICES = 11,
114 OPT_VERTEX_FINDICES = 12,
115 OPT_ALL_VEINDICES = 13,
116 OPT_VERTEX_EINDICES = 14,
117 OPT_ALL_VMINDICES = 15,
118 OPT_VERTEX_MINDICES = 16,
119 OPT_ALL_NORMALS = 17,
121 OPT_ALL_NORMALS_POLAR = 19,
122 OPT_NORMALS_POLAR = 20,
123 OPT_ALL_VMVISIBILITIES = 21,
124 OPT_VERTEX_MARKER_VISIBILITIES = 22,
125 OPT_ALL_VMSYMBOLS = 23,
126 OPT_VERTEX_MARKER_SYMBOLS = 24,
127 OPT_ALL_VMSIZES = 25,
128 OPT_VERTEX_MARKER_SIZES = 26,
130 OPT_ALL_PARAMETERS = 28,
131 OPT_ALL_VMRGBAS = 29,
132 OPT_VERTEX_MRGBAS = 30,
134 OPT_ALL_FACE_COLORS = 33,
135 OPT_FACE_COLORS = 34,
136 OPT_ALL_FACE_INDICES = 35,
137 OPT_FACE_INDICES = 36,
138 OPT_ALL_FACE_NORMALS_POLAR = 37,
139 OPT_FACE_NORMALS_POLAR = 38,
140 OPT_ALL_FACE_VISIBILITIES = 39,
141 OPT_FACE_VISIBILITIES = 40,
142 OPT_ALL_FACE_PATTERNS = 41,
143 OPT_FACE_PATTERNS = 42,
145 OPT_FACE_REGIONS = 51,
147 OPT_ALL_EDGE_COLORS = 71,
148 OPT_EDGE_COLORS = 72,
149 OPT_ALL_EDGE_INDICES = 73,
150 OPT_EDGE_INDICES = 74,
151 OPT_ALL_EDGE_NORMALS_POLAR = 75,
152 OPT_EDGE_NORMALS_POLAR = 76,
153 OPT_ALL_EDGE_VISIBILITIES = 77,
154 OPT_EDGE_VISIBILITIES = 78,
155 OPT_ALL_EDGE_PATTERNS = 79,
156 OPT_EDGE_PATTERNS = 80,
157 OPT_ALL_EDGE_WEIGHTS = 81,
158 OPT_EDGE_WEIGHTS = 82,
160 OPT_RESERVED_SPATIAL = 90,
161 OPT_ENTITY_ATTRIBUTES = 99,
165 OPT_ALL_VFCOLORS_UNCOMPRESSED = 101,
166 OPT_VERTEX_FCOLORS_UNCOMPRESSED = 102,
167 OPT_ALL_VECOLORS_UNCOMPRESSED = 103,
168 OPT_VERTEX_ECOLORS_UNCOMPRESSED = 104,
169 OPT_ALL_VMCOLORS_UNCOMPRESSED = 105,
170 OPT_VERTEX_MCOLORS_UNCOMPRESSED = 106,
171 OPT_ALL_VMRGBAS_UNCOMPRESSED = 107,
172 OPT_VERTEX_MRGBAS_UNCOMPRESSED = 108,
173 OPT_ALL_VFINDICES_UNCOMPRESSED = 109,
174 OPT_VERTEX_FINDICES_UNCOMPRESSED = 110,
175 OPT_ALL_VEINDICES_UNCOMPRESSED = 111,
176 OPT_VERTEX_EINDICES_UNCOMPRESSED = 112,
177 OPT_ALL_VMINDICES_UNCOMPRESSED = 113,
178 OPT_VERTEX_MINDICES_UNCOMPRESSED = 114,
179 OPT_ALL_FACE_COLORS_UNCOMPRESSED = 115,
180 OPT_FACE_COLORS_UNCOMPRESSED = 116,
181 OPT_ALL_FACE_INDICES_UNCOMPRESSED = 117,
182 OPT_FACE_INDICES_UNCOMPRESSED = 118,
202 unsigned int const *
GetExists()
const {
return mp_exists; };
212 unsigned char GetSubop()
const {
return mp_subop; };
244 if (mp_vmcolors != 0)
return mp_vmcolors;
245 else if (mp_vfcolors != 0)
return mp_vfcolors;
246 else if (mp_vecolors != 0)
return mp_vecolors;
252 if (mp_vmcolors != 0)
return mp_vmcolors;
253 else if (mp_vfcolors != 0)
return mp_vfcolors;
254 else if (mp_vecolors != 0)
return mp_vecolors;
272 if (mp_vmindices != 0)
return mp_vmindices;
273 else if (mp_vfindices != 0)
return mp_vfindices;
274 else if (mp_veindices != 0)
return mp_veindices;
280 if (mp_vmindices != 0)
return mp_vmindices;
281 else if (mp_vfindices != 0)
return mp_vfindices;
282 else if (mp_veindices != 0)
return mp_veindices;
320 TK_Status SetBounding (
float const *bbox) { 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; };
326 TK_Status SetPoints (
int count,
float const *points=0);
331 TK_Status SetDPoints (
int count,
double const *points=0);
337 TK_Status SetVertexNormals (
float const *normals=0);
346 TK_Status SetVertexParameters (
float const *parameters=0,
int width=0);
354 TK_Status SetVertexFaceColors (
float const *colors=0);
362 TK_Status SetVertexEdgeColors (
float const *colors=0);
370 TK_Status SetVertexMarkerColors (
float const *colors=0);
378 TK_Status SetVertexMarkerRGBAs (
float const *colors=0);
388 TK_Status SetVertexColors (
float const *colors=0);
397 TK_Status SetVertexFaceIndices (
float const *indices=0);
406 TK_Status SetVertexEdgeIndices (
float const *indices=0);
415 TK_Status SetVertexMarkerIndices (
float const *indices=0);
425 TK_Status SetVertexIndices (
float const *indices=0);
431 TK_Status SetVertexMarkerVisibilities (
char const *visibilities=0);
438 TK_Status SetVertexMarkerSizes (
float const *sizes=0);
445 TK_Status SetVertexMarkerSymbols (
char const *symbols=0);
449 TK_Status SetVertexMarkerSymbolStrings ();
455 TK_Status SetFaceColors (
float const *colors=0);
461 TK_Status SetFaceNormals (
float const *normals=0);
467 TK_Status SetFaceVisibilities (
char const *visibilities=0);
474 TK_Status SetFacePatterns (
char const *patterns=0);
482 TK_Status SetFaceIndices (
float const *indices=0);
485 TK_Status SetFaceRegions (
int const * regions=0);
494 TK_Status SetEdgeColors (
float const *colors=0);
501 TK_Status SetEdgeIndices (
float const *indices=0);
507 TK_Status SetEdgeNormals (
float const *normals=0);
514 TK_Status SetEdgeVisibilities (
char const *visibilities=0);
520 TK_Status SetEdgePatterns (
char const *patterns=0);
530 TK_Status SetEdgeWeights (
float const *weights=0);
536 TK_Status SetExists (
unsigned int const *vals=0);
541 TK_Status SetFaceExists (
unsigned int const *vals=0);
548 TK_Status SetEdgeExists (
unsigned int const *vals=0);
562 HasVertexAttributes() ||
563 HasFaceAttributes() ||
564 HasEdgeAttributes() ||
565 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);
568 bool HasOptionalsCommunicator() {
return
569 HasVertexAttributes() ||
570 HasFaceAttributesCommunicator() ||
571 HasEdgeAttributes() ||
572 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);
617 HasVertexIndices() ||
618 HasVertexNormals() ||
619 HasVertexParameters() ||
620 HasVertexMarkerVisibilities() ||
621 HasVertexMarkerSymbols() ||
622 HasVertexMarkerSizes();
642 HasFaceVisibilities() ||
647 inline bool HasFaceAttributesCommunicator()
const {
return
669 HasEdgeVisibilities() ||
677 #ifndef DOXYGEN_SHOULD_SKIP_THIS
687 float * mp_vfindices;
688 float * mp_veindices;
689 float * mp_vmindices;
690 char * mp_vmvisibilities;
692 unsigned char * mp_vmsymbols;
693 char ** mp_vmsymbolstrings;
698 char * mp_fvisibilities;
703 char * mp_evisibilities;
704 unsigned char * mp_epatterns;
705 char ** mp_epatternstrings;
708 unsigned int * mp_exists;
709 unsigned int * mp_face_exists;
710 unsigned int * mp_edge_exists;
723 int mp_vmvisibilitycount;
725 int mp_vmsymbolcount;
730 int mp_fpatterncount;
731 int mp_fvisibilitycount;
736 int mp_epatterncount;
738 int mp_evisibilitycount;
739 int * mp_edge_enumeration;
745 unsigned char mp_optopcode;
748 unsigned short mp_present;
749 unsigned short mp_face_present;
750 unsigned short mp_edge_present;
751 unsigned char mp_bits_per_sample;
756 unsigned char * mp_workspace;
757 int mp_workspace_allocated;
758 int mp_workspace_used;
759 unsigned char mp_compression_scheme;
760 unsigned char mp_subop;
761 unsigned short mp_subop2;
762 int mp_num_collection_parts;
867 void normals_cartesian_to_polar (
unsigned int *exists,
int flag,
int count,
const float *in,
float *out);
869 void normals_polar_to_cartesian (
unsigned int *exists,
int flag,
int count,
const float *in,
float *out);
1008 bool has_face_attributes()
const;
1027 void set_points (
int count,
float const * points = 0) { SetPoints (count, points); };
1029 void set_normals (
float const * normals = 0) { SetVertexNormals (normals); };
1031 void set_parameters (
float const * params = 0) { SetVertexParameters (params); };
1033 void set_vfcolors (
float const * colors = 0) { SetVertexFaceColors (colors); };
1035 void set_vecolors (
float const * colors = 0) { SetVertexEdgeColors (colors); };
1037 void set_vmcolors (
float const * colors = 0) { SetVertexMarkerColors (colors); };
1039 void set_vfindices (
float const * indices = 0) { SetVertexFaceIndices (indices); };
1041 void set_veindices (
float const * indices = 0) { SetVertexEdgeIndices (indices); };
1043 void set_vmindices (
float const * indices = 0) { SetVertexMarkerIndices (indices); };
1045 void set_fcolors (
float const * colors = 0) { SetFaceColors (colors); };
1047 void set_findices (
float const * indices = 0) { SetFaceIndices (indices); };
1049 void set_exists (
unsigned int const * exists = 0);
1051 void set_face_exists (
unsigned int const * exists = 0);
1053 void set_facemap (
int count,
int const * facemap = 0);
1098 #endif //BBINFILETK_POLYHEDRON
void SetRows(const int rows)
Definition: BPolyhedron.h:1091
float * GetVertexFaceColors()
Definition: BPolyhedron.h:228
float * GetVertexMarkerRGBAs()
Definition: BPolyhedron.h:240
Opt_Opcode
Definition: BPolyhedron.h:101
bool HasVertexMarkerVisibilities() const
Definition: BPolyhedron.h:607
float * GetFaceColors()
Definition: BPolyhedron.h:288
bool HasEdgePatterns() const
Definition: BPolyhedron.h:661
bool HasEdgeNormals() const
Definition: BPolyhedron.h:657
float const * GetVertexEdgeColors() const
Definition: BPolyhedron.h:230
bool HasVertexAttributes() const
Definition: BPolyhedron.h:615
TK_Status SetKey(BStreamFileToolkit &tk, ID_Key key)
informs the TK_Polyhedron of the id by which this piece of geometry is known
Definition: BPolyhedron.h:306
bool HasVertexIndices() const
Definition: BPolyhedron.h:601
float * GetVertexEdgeColors()
Definition: BPolyhedron.h:232
void SetColumns(const int columns)
Definition: BPolyhedron.h:1094
Face_Exists
Definition: BPolyhedron.h:47
bool HasOptionals()
Definition: BPolyhedron.h:561
float * GetVertexColors()
Definition: BPolyhedron.h:251
bool HasEdgeColors() const
Definition: BPolyhedron.h:653
int * GetFaceRegions()
Definition: BPolyhedron.h:296
bool HasVertexParameters() const
Definition: BPolyhedron.h:578
double * GetDPoints()
Definition: BPolyhedron.h:196
float const * GetVertexIndices() const
Definition: BPolyhedron.h:271
bool HasVertexMarkerRGBAs() const
Definition: BPolyhedron.h:586
bool HasFaceAttributes() const
Definition: BPolyhedron.h:638
TK_Status SetSubop(unsigned char subop)
Definition: BPolyhedron.h:309
virtual TK_Status Read(BStreamFileToolkit &tk)=0
bool HasFacePatterns() const
Definition: BPolyhedron.h:633
int const * GetFaceRegions() const
Definition: BPolyhedron.h:294
TK_Status SetBounding(float const *bbox)
Definition: BPolyhedron.h:320
float * GetPoints()
Definition: BPolyhedron.h:191
Definition: BStream.h:244
Suboptions2
Definition: BPolyhedron.h:91
float * GetVertexParameters()
Definition: BPolyhedron.h:224
unsigned int const * GetExists() const
Definition: BPolyhedron.h:202
float const * GetVertexMarkerColors() const
Definition: BPolyhedron.h:234
bool HasVertexFaceColors() const
Definition: BPolyhedron.h:580
int GetPointCount() const
Definition: BPolyhedron.h:200
bool HasEdgeAttributes() const
Definition: BPolyhedron.h:665
float * GetVertexFaceIndices()
Definition: BPolyhedron.h:260
unsigned int * GetFaceExists()
Definition: BPolyhedron.h:208
Handles the TKE_Repeat_Object opcode.
Definition: BOpcodeHandler.h:1749
Handles the TKE_Mesh opcode.
Definition: BPolyhedron.h:1069
float const * GetVertexNormals() const
Definition: BPolyhedron.h:218
bool HasEdgeWeights() const
Definition: BPolyhedron.h:663
ID_Key GetKey() const
Definition: BPolyhedron.h:210
Suboptions
Definition: BPolyhedron.h:75
float const * GetVertexMarkerRGBAs() const
Definition: BPolyhedron.h:238
bool HasFaceRegions() const
Definition: BPolyhedron.h:635
bool HasVertexEdgeColors() const
Definition: BPolyhedron.h:582
unsigned short GetSubop2() const
Definition: BPolyhedron.h:214
bool HasVertexMarkerColors() const
Definition: BPolyhedron.h:584
bool HasVertexMarkerSizes() const
Definition: BPolyhedron.h:611
float const * GetVertexMarkerIndices() const
Definition: BPolyhedron.h:266
Definition: BStream.h:243
float const * GetFaceColors() const
Definition: BPolyhedron.h:286
float * GetFaceIndices()
Definition: BPolyhedron.h:292
float * GetVertexMarkerColors()
Definition: BPolyhedron.h:236
bool HasEdgeVisibilities() const
Definition: BPolyhedron.h:659
unsigned char GetSubop() const
Definition: BPolyhedron.h:212
float * GetVertexEdgeIndices()
Definition: BPolyhedron.h:264
bool HasVertexEdgeIndices() const
Definition: BPolyhedron.h:597
int GetPriority()
Definition: BPolyhedron.h:299
TK_Status SetSubop2(unsigned short subop2)
Definition: BPolyhedron.h:312
float const * GetVertexParameters() const
Definition: BPolyhedron.h:222
float const * GetVertexColors() const
Definition: BPolyhedron.h:243
bool HasVertexMarkerIndices() const
Definition: BPolyhedron.h:599
bool HasFaceNormals() const
Definition: BPolyhedron.h:629
float const * GetVertexFaceColors() const
Definition: BPolyhedron.h:226
float * GetVertexMarkerIndices()
Definition: BPolyhedron.h:268
Exists
Definition: BPolyhedron.h:27
void set_last_key(BStreamFileToolkit &tk, ID_Key key)
sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices ...
Definition: BOpcodeHandler.h:623
void SetPriority(int priority)
Definition: BPolyhedron.h:301
unsigned int const * GetFaceExists() const
Definition: BPolyhedron.h:206
int m_columns
Definition: BPolyhedron.h:1072
The BBaseOpcodeHandler abstract class is used as a base for derived classes which manage logical piec...
Definition: BOpcodeHandler.h:53
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:242
float * GetVertexIndices()
Definition: BPolyhedron.h:279
float const * GetVertexEdgeIndices() const
Definition: BPolyhedron.h:262
Edge_Exists
Definition: BPolyhedron.h:60
float const * GetPoints() const
Definition: BPolyhedron.h:189
const float * GetBounding() const
Definition: BPolyhedron.h:216
#define ID_Key
Definition: BStream.h:218
Base class for shell and mesh.
Definition: BPolyhedron.h:21
bool HasFaceVisibilities() const
Definition: BPolyhedron.h:631
int m_rows
Definition: BPolyhedron.h:1071
bool HasEdgeIndices() const
Definition: BPolyhedron.h:655
double const * GetDPoints() const
Definition: BPolyhedron.h:194
bool HasVertexColors() const
Definition: BPolyhedron.h:588
float const * GetVertexFaceIndices() const
Definition: BPolyhedron.h:258
bool HasFaceColors() const
Definition: BPolyhedron.h:625
float * GetVertexNormals()
Definition: BPolyhedron.h:220
bool HasVertexMarkerSymbols() const
Definition: BPolyhedron.h:609
bool HasVertexFaceIndices() const
Definition: BPolyhedron.h:595
virtual TK_Status Write(BStreamFileToolkit &tk)=0
float const * GetFaceIndices() const
Definition: BPolyhedron.h:290
bool HasVertexNormals() const
Definition: BPolyhedron.h:576
unsigned int * GetExists()
Definition: BPolyhedron.h:204
bool HasFaceIndices() const
Definition: BPolyhedron.h:627