14 #ifndef BBINFILETK_POLYHEDRON
15 #define BBINFILETK_POLYHEDRON
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
55 Face_Any_Color = 0x0003,
57 Face_Visibility = 0x0008,
68 Edge_Any_Color = 0x0003,
70 Edge_Visibility = 0x0008,
71 Edge_Pattern = 0x0010,
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,
96 TKSH2_COLLECTION = 0x0001,
98 TKSH2_HAS_NEGATIVE_FACES = 0x0004,
99 TKSH2_GLOBAL_QUANTIZATION = 0x0008
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,
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,
134 OPT_ALL_PARAMETERS = 28,
135 OPT_ALL_VMRGBAS = 29,
136 OPT_VERTEX_MRGBAS = 30,
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,
149 OPT_FACE_REGIONS = 51,
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,
164 OPT_RESERVED_SPATIAL = 90,
165 OPT_ENTITY_ATTRIBUTES = 99
178 unsigned int const *
GetExists()
const {
return mp_exists; };
188 unsigned char GetSubop()
const {
return mp_subop; };
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;
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;
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;
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;
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; };
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;
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;
523 bool HasOptionals() {
return
524 HasVertexAttributes() ||
525 HasFaceAttributes() ||
526 HasEdgeAttributes() ||
527 (!(mp_subop2 & 0x01) && mp_num_collection_parts > 0);
571 HasVertexIndices() ||
572 HasVertexNormals() ||
573 HasVertexParameters() ||
574 HasVertexMarkerVisibilities() ||
575 HasVertexMarkerSymbols() ||
576 HasVertexMarkerSizes();
596 HasFaceVisibilities() ||
618 HasEdgeVisibilities() ||
626 #ifndef DOXYGEN_SHOULD_SKIP_THIS
635 float * mp_vfindices;
636 float * mp_veindices;
637 float * mp_vmindices;
638 char * mp_vmvisibilities;
640 unsigned char * mp_vmsymbols;
641 char ** mp_vmsymbolstrings;
646 char * mp_fvisibilities;
651 char * mp_evisibilities;
652 unsigned char * mp_epatterns;
653 char ** mp_epatternstrings;
656 unsigned int * mp_exists;
657 unsigned int * mp_face_exists;
658 unsigned int * mp_edge_exists;
671 int mp_vmvisibilitycount;
673 int mp_vmsymbolcount;
678 int mp_fpatterncount;
679 int mp_fvisibilitycount;
684 int mp_epatterncount;
686 int mp_evisibilitycount;
687 int * mp_edge_enumeration;
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;
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;
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);
940 bool has_face_attributes() const;
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;
1021 void SetRows (const
int rows)
alter { m_rows = rows; }
1028 #endif //BBINFILETK_POLYHEDRON
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
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