11 #ifndef BBINFILETK_POLYHEDRON
12 #define BBINFILETK_POLYHEDRON
30 Vertex_Normal = 0x0001,
31 Vertex_Parameter = 0x0002,
32 Vertex_Face_Color = 0x0004,
33 Vertex_Edge_Color = 0x0008,
34 Vertex_Marker_Color = 0x0010,
35 Vertex_Face_Index = 0x0020,
36 Vertex_Edge_Index = 0x0040,
37 Vertex_Marker_Index = 0x0080,
38 Vertex_Marker_Visibility= 0x0100,
39 Vertex_Marker_Size = 0x0200,
40 Vertex_Marker_Symbol = 0x0400,
41 Vertex_Marker_RGBA = 0x0800,
42 Vertex_Any_Color = 0x08FC
52 Face_Any_Color = 0x0003,
54 Face_Visibility = 0x0008,
65 Edge_Any_Color = 0x0003,
67 Edge_Visibility = 0x0008,
68 Edge_Pattern = 0x0010,
78 TKSH_COMPRESSED_POINTS = 0x01,
79 TKSH_COMPRESSED_FACES = 0x02,
80 TKSH_TRISTRIPS = 0x04,
81 TKSH_HAS_OPTIONALS = 0x08,
82 TKSH_FIRSTPASS = 0x10,
83 TKSH_BOUNDING_ONLY = 0x20,
84 TKSH_CONNECTIVITY_COMPRESSION = 0x40,
93 TKSH2_COLLECTION = 0x0001,
95 TKSH2_HAS_NEGATIVE_FACES = 0x0004,
96 TKSH2_GLOBAL_QUANTIZATION = 0x0008
104 OPT_ALL_NORMALS_COMPRESSED = 1,
105 OPT_NORMALS_COMPRESSED = 2,
106 OPT_ALL_PARAMETERS_COMPRESSED = 3,
107 OPT_PARAMETERS_COMPRESSED = 4,
108 OPT_ALL_VFCOLORS = 5,
109 OPT_VERTEX_FCOLORS = 6,
110 OPT_ALL_VECOLORS = 7,
111 OPT_VERTEX_ECOLORS = 8,
112 OPT_ALL_VMCOLORS = 9,
113 OPT_VERTEX_MCOLORS = 10,
114 OPT_ALL_VFINDICES = 11,
115 OPT_VERTEX_FINDICES = 12,
116 OPT_ALL_VEINDICES = 13,
117 OPT_VERTEX_EINDICES = 14,
118 OPT_ALL_VMINDICES = 15,
119 OPT_VERTEX_MINDICES = 16,
120 OPT_ALL_NORMALS = 17,
122 OPT_ALL_NORMALS_POLAR = 19,
123 OPT_NORMALS_POLAR = 20,
124 OPT_ALL_VMVISIBILITIES = 21,
125 OPT_VERTEX_MARKER_VISIBILITIES = 22,
126 OPT_ALL_VMSYMBOLS = 23,
127 OPT_VERTEX_MARKER_SYMBOLS = 24,
128 OPT_ALL_VMSIZES = 25,
129 OPT_VERTEX_MARKER_SIZES = 26,
131 OPT_ALL_PARAMETERS = 28,
132 OPT_ALL_VMRGBAS = 29,
133 OPT_VERTEX_MRGBAS = 30,
135 OPT_ALL_FACE_COLORS = 33,
136 OPT_FACE_COLORS = 34,
137 OPT_ALL_FACE_INDICES = 35,
138 OPT_FACE_INDICES = 36,
139 OPT_ALL_FACE_NORMALS_POLAR = 37,
140 OPT_FACE_NORMALS_POLAR = 38,
141 OPT_ALL_FACE_VISIBILITIES = 39,
142 OPT_FACE_VISIBILITIES = 40,
143 OPT_ALL_FACE_PATTERNS = 41,
144 OPT_FACE_PATTERNS = 42,
146 OPT_FACE_REGIONS = 51,
148 OPT_ALL_EDGE_COLORS = 71,
149 OPT_EDGE_COLORS = 72,
150 OPT_ALL_EDGE_INDICES = 73,
151 OPT_EDGE_INDICES = 74,
152 OPT_ALL_EDGE_NORMALS_POLAR = 75,
153 OPT_EDGE_NORMALS_POLAR = 76,
154 OPT_ALL_EDGE_VISIBILITIES = 77,
155 OPT_EDGE_VISIBILITIES = 78,
156 OPT_ALL_EDGE_PATTERNS = 79,
157 OPT_EDGE_PATTERNS = 80,
158 OPT_ALL_EDGE_WEIGHTS = 81,
159 OPT_EDGE_WEIGHTS = 82,
161 OPT_RESERVED_SPATIAL = 90,
162 OPT_ENTITY_ATTRIBUTES = 99,
166 OPT_ALL_VFCOLORS_UNCOMPRESSED = 101,
167 OPT_VERTEX_FCOLORS_UNCOMPRESSED = 102,
168 OPT_ALL_VECOLORS_UNCOMPRESSED = 103,
169 OPT_VERTEX_ECOLORS_UNCOMPRESSED = 104,
170 OPT_ALL_VMCOLORS_UNCOMPRESSED = 105,
171 OPT_VERTEX_MCOLORS_UNCOMPRESSED = 106,
172 OPT_ALL_VMRGBAS_UNCOMPRESSED = 107,
173 OPT_VERTEX_MRGBAS_UNCOMPRESSED = 108,
174 OPT_ALL_VFINDICES_UNCOMPRESSED = 109,
175 OPT_VERTEX_FINDICES_UNCOMPRESSED = 110,
176 OPT_ALL_VEINDICES_UNCOMPRESSED = 111,
177 OPT_VERTEX_EINDICES_UNCOMPRESSED = 112,
178 OPT_ALL_VMINDICES_UNCOMPRESSED = 113,
179 OPT_VERTEX_MINDICES_UNCOMPRESSED = 114,
180 OPT_ALL_FACE_COLORS_UNCOMPRESSED = 115,
181 OPT_FACE_COLORS_UNCOMPRESSED = 116,
182 OPT_ALL_FACE_INDICES_UNCOMPRESSED = 117,
183 OPT_FACE_INDICES_UNCOMPRESSED = 118,
203 unsigned int const *
GetExists()
const {
return mp_exists; };
213 unsigned char GetSubop()
const {
return mp_subop; };
245 if (mp_vmcolors != 0)
return mp_vmcolors;
246 else if (mp_vfcolors != 0)
return mp_vfcolors;
247 else if (mp_vecolors != 0)
return mp_vecolors;
253 if (mp_vmcolors != 0)
return mp_vmcolors;
254 else if (mp_vfcolors != 0)
return mp_vfcolors;
255 else if (mp_vecolors != 0)
return mp_vecolors;
273 if (mp_vmindices != 0)
return mp_vmindices;
274 else if (mp_vfindices != 0)
return mp_vfindices;
275 else if (mp_veindices != 0)
return mp_veindices;
281 if (mp_vmindices != 0)
return mp_vmindices;
282 else if (mp_vfindices != 0)
return mp_vfindices;
283 else if (mp_veindices != 0)
return mp_veindices;
321 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; };
327 TK_Status SetPoints (
int count,
float const points[]=0);
332 TK_Status SetDPoints (
int count,
double const points[]=0);
338 TK_Status SetVertexNormals (
float const normals[]=0);
347 TK_Status SetVertexParameters (
float const parameters[]=0,
int width=0);
355 TK_Status SetVertexFaceColors (
float const colors[]=0);
363 TK_Status SetVertexEdgeColors (
float const colors[]=0);
371 TK_Status SetVertexMarkerColors (
float const colors[]=0);
379 TK_Status SetVertexMarkerRGBAs (
float const colors[]=0);
389 TK_Status SetVertexColors (
float const colors[]=0);
398 TK_Status SetVertexFaceIndices (
float const indices[]=0);
407 TK_Status SetVertexEdgeIndices (
float const indices[]=0);
416 TK_Status SetVertexMarkerIndices (
float const indices[]=0);
426 TK_Status SetVertexIndices (
float const indices[]=0);
432 TK_Status SetVertexMarkerVisibilities (
char const *visibilities=0);
439 TK_Status SetVertexMarkerSizes (
float const sizes[]=0);
446 TK_Status SetVertexMarkerSymbols (
char const *symbols=0);
450 TK_Status SetVertexMarkerSymbolStrings ();
456 TK_Status SetFaceColors (
float const colors[]=0);
462 TK_Status SetFaceNormals (
float const normals[]=0);
468 TK_Status SetFaceVisibilities (
char const *visibilities=0);
475 TK_Status SetFacePatterns (
char const *patterns=0);
483 TK_Status SetFaceIndices (
float const indices[]=0);
486 TK_Status SetFaceRegions (
int const regions[]=0);
495 TK_Status SetEdgeColors (
float const colors[]=0);
502 TK_Status SetEdgeIndices (
float const indices[]=0);
508 TK_Status SetEdgeNormals (
float const normals[]=0);
515 TK_Status SetEdgeVisibilities (
char const *visibilities=0);
521 TK_Status SetEdgePatterns (
char const *patterns=0);
531 TK_Status SetEdgeWeights (
float const weights[]=0);
537 TK_Status SetExists (
unsigned int const vals[]=0);
542 TK_Status SetFaceExists (
unsigned int const vals[]=0);
549 TK_Status SetEdgeExists (
unsigned int const vals[]=0);
563 HasVertexAttributes() ||
564 HasFaceAttributes() ||
565 HasEdgeAttributes() ||
566 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);
569 bool HasOptionalsCommunicator() {
return
570 HasVertexAttributes() ||
571 HasFaceAttributesCommunicator() ||
572 HasEdgeAttributes() ||
573 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);
618 HasVertexIndices() ||
619 HasVertexNormals() ||
620 HasVertexParameters() ||
621 HasVertexMarkerVisibilities() ||
622 HasVertexMarkerSymbols() ||
623 HasVertexMarkerSizes();
643 HasFaceVisibilities() ||
648 inline bool HasFaceAttributesCommunicator()
const {
return
670 HasEdgeVisibilities() ||
678 #ifndef DOXYGEN_SHOULD_SKIP_THIS
688 float * mp_vfindices;
689 float * mp_veindices;
690 float * mp_vmindices;
691 char * mp_vmvisibilities;
693 unsigned char * mp_vmsymbols;
694 char ** mp_vmsymbolstrings;
699 char * mp_fvisibilities;
704 char * mp_evisibilities;
705 unsigned char * mp_epatterns;
706 char ** mp_epatternstrings;
709 unsigned int * mp_exists;
710 unsigned int * mp_face_exists;
711 unsigned int * mp_edge_exists;
724 int mp_vmvisibilitycount;
726 int mp_vmsymbolcount;
731 int mp_fpatterncount;
732 int mp_fvisibilitycount;
737 int mp_epatterncount;
739 int mp_evisibilitycount;
740 int * mp_edge_enumeration;
746 unsigned char mp_optopcode;
749 unsigned short mp_present;
750 unsigned short mp_face_present;
751 unsigned short mp_edge_present;
752 unsigned char mp_bits_per_sample;
757 unsigned char * mp_workspace;
758 int mp_workspace_allocated;
759 int mp_workspace_used;
760 unsigned char mp_compression_scheme;
761 unsigned char mp_subop;
762 unsigned short mp_subop2;
763 int mp_num_collection_parts;
788 virtual void Reset ();
868 void normals_cartesian_to_polar (
unsigned int * exists,
int flag,
int count,
const float in[],
float out[]);
870 void normals_polar_to_cartesian (
unsigned int * exists,
int flag,
int count,
const float in[],
float out[]);
1009 bool has_face_attributes()
const;
1028 void set_points (
int count,
float const points[] = 0) { SetPoints (count, points); };
1030 void set_normals (
float const normals[] = 0) { SetVertexNormals (normals); };
1032 void set_parameters (
float const params[] = 0) { SetVertexParameters (params); };
1034 void set_vfcolors (
float const colors[] = 0) { SetVertexFaceColors (colors); };
1036 void set_vecolors (
float const colors[] = 0) { SetVertexEdgeColors (colors); };
1038 void set_vmcolors (
float const colors[] = 0) { SetVertexMarkerColors (colors); };
1040 void set_vfindices (
float const indices[] = 0) { SetVertexFaceIndices (indices); };
1042 void set_veindices (
float const indices[] = 0) { SetVertexEdgeIndices (indices); };
1044 void set_vmindices (
float const indices[] = 0) { SetVertexMarkerIndices (indices); };
1046 void set_fcolors (
float const colors[] = 0) { SetFaceColors (colors); };
1048 void set_findices (
float const indices[] = 0) { SetFaceIndices (indices); };
1050 void set_exists (
unsigned int const exists[] = 0);
1052 void set_face_exists (
unsigned int const exists[] = 0);
1054 void set_facemap (
int count,
int const facemap[] = 0);
1099 #endif //BBINFILETK_POLYHEDRON
void SetRows(const int rows)
Definition: BPolyhedron.h:1092
float * GetVertexFaceColors()
Definition: BPolyhedron.h:229
float * GetVertexMarkerRGBAs()
Definition: BPolyhedron.h:241
Opt_Opcode
Definition: BPolyhedron.h:102
bool HasVertexMarkerVisibilities() const
Definition: BPolyhedron.h:608
float * GetFaceColors()
Definition: BPolyhedron.h:289
bool HasEdgePatterns() const
Definition: BPolyhedron.h:662
bool HasEdgeNormals() const
Definition: BPolyhedron.h:658
float const * GetVertexEdgeColors() const
Definition: BPolyhedron.h:231
bool HasVertexAttributes() const
Definition: BPolyhedron.h:616
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:307
bool HasVertexIndices() const
Definition: BPolyhedron.h:602
float * GetVertexEdgeColors()
Definition: BPolyhedron.h:233
void SetColumns(const int columns)
Definition: BPolyhedron.h:1095
Face_Exists
Definition: BPolyhedron.h:48
bool HasOptionals()
Definition: BPolyhedron.h:562
float * GetVertexColors()
Definition: BPolyhedron.h:252
bool HasEdgeColors() const
Definition: BPolyhedron.h:654
int * GetFaceRegions()
Definition: BPolyhedron.h:297
bool HasVertexParameters() const
Definition: BPolyhedron.h:579
double * GetDPoints()
Definition: BPolyhedron.h:197
float const * GetVertexIndices() const
Definition: BPolyhedron.h:272
bool HasVertexMarkerRGBAs() const
Definition: BPolyhedron.h:587
bool HasFaceAttributes() const
Definition: BPolyhedron.h:639
TK_Status SetSubop(unsigned char subop)
Definition: BPolyhedron.h:310
virtual TK_Status Read(BStreamFileToolkit &tk)=0
bool HasFacePatterns() const
Definition: BPolyhedron.h:634
int const * GetFaceRegions() const
Definition: BPolyhedron.h:295
float * GetPoints()
Definition: BPolyhedron.h:192
Definition: BStream.h:274
Suboptions2
Definition: BPolyhedron.h:92
float * GetVertexParameters()
Definition: BPolyhedron.h:225
unsigned int const * GetExists() const
Definition: BPolyhedron.h:203
float const * GetVertexMarkerColors() const
Definition: BPolyhedron.h:235
bool HasVertexFaceColors() const
Definition: BPolyhedron.h:581
int GetPointCount() const
Definition: BPolyhedron.h:201
bool HasEdgeAttributes() const
Definition: BPolyhedron.h:666
float * GetVertexFaceIndices()
Definition: BPolyhedron.h:261
unsigned int * GetFaceExists()
Definition: BPolyhedron.h:209
Handles the TKE_Repeat_Object opcode.
Definition: BOpcodeHandler.h:1450
Handles the TKE_Mesh opcode.
Definition: BPolyhedron.h:1070
float const * GetVertexNormals() const
Definition: BPolyhedron.h:219
bool HasEdgeWeights() const
Definition: BPolyhedron.h:664
ID_Key GetKey() const
Definition: BPolyhedron.h:211
Suboptions
Definition: BPolyhedron.h:76
float const * GetVertexMarkerRGBAs() const
Definition: BPolyhedron.h:239
bool HasFaceRegions() const
Definition: BPolyhedron.h:636
bool HasVertexEdgeColors() const
Definition: BPolyhedron.h:583
unsigned short GetSubop2() const
Definition: BPolyhedron.h:215
bool HasVertexMarkerColors() const
Definition: BPolyhedron.h:585
bool HasVertexMarkerSizes() const
Definition: BPolyhedron.h:612
float const * GetVertexMarkerIndices() const
Definition: BPolyhedron.h:267
Definition: BStream.h:273
float const * GetFaceColors() const
Definition: BPolyhedron.h:287
float * GetFaceIndices()
Definition: BPolyhedron.h:293
float * GetVertexMarkerColors()
Definition: BPolyhedron.h:237
bool HasEdgeVisibilities() const
Definition: BPolyhedron.h:660
unsigned char GetSubop() const
Definition: BPolyhedron.h:213
float * GetVertexEdgeIndices()
Definition: BPolyhedron.h:265
bool HasVertexEdgeIndices() const
Definition: BPolyhedron.h:598
int GetPriority()
Definition: BPolyhedron.h:300
TK_Status SetSubop2(unsigned short subop2)
Definition: BPolyhedron.h:313
float const * GetVertexParameters() const
Definition: BPolyhedron.h:223
float const * GetVertexColors() const
Definition: BPolyhedron.h:244
bool HasVertexMarkerIndices() const
Definition: BPolyhedron.h:600
bool HasFaceNormals() const
Definition: BPolyhedron.h:630
float const * GetVertexFaceColors() const
Definition: BPolyhedron.h:227
float * GetVertexMarkerIndices()
Definition: BPolyhedron.h:269
Exists
Definition: BPolyhedron.h:28
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:648
void SetPriority(int priority)
Definition: BPolyhedron.h:302
unsigned int const * GetFaceExists() const
Definition: BPolyhedron.h:207
TK_Status SetBounding(float const bbox[])
Definition: BPolyhedron.h:321
int m_columns
Definition: BPolyhedron.h:1073
The BBaseOpcodeHandler abstract class is used as a base for derived classes which manage logical piec...
Definition: BOpcodeHandler.h:55
TK_Status
Codes which can be either passed to various toolkit functions, or indicate the result of a toolkit fu...
Definition: BStream.h:272
float * GetVertexIndices()
Definition: BPolyhedron.h:280
float const * GetVertexEdgeIndices() const
Definition: BPolyhedron.h:263
Edge_Exists
Definition: BPolyhedron.h:61
float const * GetPoints() const
Definition: BPolyhedron.h:190
const float * GetBounding() const
Definition: BPolyhedron.h:217
#define ID_Key
Definition: BStream.h:248
Base class for shell and mesh.
Definition: BPolyhedron.h:22
bool HasFaceVisibilities() const
Definition: BPolyhedron.h:632
int m_rows
Definition: BPolyhedron.h:1072
bool HasEdgeIndices() const
Definition: BPolyhedron.h:656
double const * GetDPoints() const
Definition: BPolyhedron.h:195
bool HasVertexColors() const
Definition: BPolyhedron.h:589
float const * GetVertexFaceIndices() const
Definition: BPolyhedron.h:259
bool HasFaceColors() const
Definition: BPolyhedron.h:626
float * GetVertexNormals()
Definition: BPolyhedron.h:221
bool HasVertexMarkerSymbols() const
Definition: BPolyhedron.h:610
bool HasVertexFaceIndices() const
Definition: BPolyhedron.h:596
virtual TK_Status Write(BStreamFileToolkit &tk)=0
float const * GetFaceIndices() const
Definition: BPolyhedron.h:291
bool HasVertexNormals() const
Definition: BPolyhedron.h:577
unsigned int * GetExists()
Definition: BPolyhedron.h:205
bool HasFaceIndices() const
Definition: BPolyhedron.h:628