Panda3D
 All Classes Functions Variables Enumerations
geomVertexColumn.I
1 // Filename: geomVertexColumn.I
2 // Created by: drose (06Mar05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GeomVertexColumn::Default Constructor
18 // Access: Private
19 // Description: Creates an invalid column. Used only when constructing
20 // from a bam file.
21 ////////////////////////////////////////////////////////////////////
22 INLINE GeomVertexColumn::
23 GeomVertexColumn() :
24  _packer(NULL)
25 {
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: GeomVertexColumn::Constructor
30 // Access: Published
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 INLINE GeomVertexColumn::
34 GeomVertexColumn(CPT_InternalName name, int num_components,
35  NumericType numeric_type, Contents contents,
36  int start, int column_alignment) :
37  _name(MOVE(name)),
38  _num_components(num_components),
39  _numeric_type(numeric_type),
40  _contents(contents),
41  _start(start),
42  _column_alignment(column_alignment),
43  _packer(NULL)
44 {
45  setup();
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function: GeomVertexColumn::Copy Constructor
50 // Access: Published
51 // Description:
52 ////////////////////////////////////////////////////////////////////
53 INLINE GeomVertexColumn::
54 GeomVertexColumn(const GeomVertexColumn &copy) :
55  _name(copy._name),
56  _num_components(copy._num_components),
57  _numeric_type(copy._numeric_type),
58  _contents(copy._contents),
59  _start(copy._start),
60  _column_alignment(copy._column_alignment),
61  _packer(NULL)
62 {
63  setup();
64 }
65 
66 ////////////////////////////////////////////////////////////////////
67 // Function: GeomVertexColumn::Destructor
68 // Access: Published
69 // Description:
70 ////////////////////////////////////////////////////////////////////
71 INLINE GeomVertexColumn::
72 ~GeomVertexColumn() {
73  delete _packer;
74 }
75 
76 ////////////////////////////////////////////////////////////////////
77 // Function: GeomVertexColumn::get_name
78 // Access: Published
79 // Description: Returns the name of this particular data field,
80 // e.g. "vertex" or "normal". The name may be a
81 // user-defined string, or it may be one of the standard
82 // system-defined field types. Only the system-defined
83 // field types are used for the actual rendering.
84 ////////////////////////////////////////////////////////////////////
85 INLINE const InternalName *GeomVertexColumn::
86 get_name() const {
87  return _name;
88 }
89 
90 ////////////////////////////////////////////////////////////////////
91 // Function: GeomVertexColumn::get_num_components
92 // Access: Published
93 // Description: Returns the number of components of the column:
94 // the number of instances of the NumericType in each
95 // element. This is usually, but not always, the same
96 // thing as get_num_values().
97 ////////////////////////////////////////////////////////////////////
98 INLINE int GeomVertexColumn::
100  return _num_components;
101 }
102 
103 ////////////////////////////////////////////////////////////////////
104 // Function: GeomVertexColumn::get_num_values
105 // Access: Published
106 // Description: Returns the number of numeric values of the column:
107 // the number of distinct numeric values that go into
108 // each element. This is usually, but not always, the
109 // same thing as get_num_components(); the difference is
110 // in the case of a composite numeric type like
111 // NT_packed_dcba, which has four numeric values per
112 // component.
113 ////////////////////////////////////////////////////////////////////
114 INLINE int GeomVertexColumn::
115 get_num_values() const {
116  return _num_values;
117 }
118 
119 ////////////////////////////////////////////////////////////////////
120 // Function: GeomVertexColumn::get_num_elements
121 // Access: Published
122 // Description: Returns the number of times this column is repeated.
123 // This is usually 1, except for matrices.
124 ////////////////////////////////////////////////////////////////////
125 INLINE int GeomVertexColumn::
127  return _num_elements;
128 }
129 
130 ////////////////////////////////////////////////////////////////////
131 // Function: GeomVertexColumn::get_numeric_type
132 // Access: Published
133 // Description: Returns the token representing the numeric type of
134 // the data storage.
135 ////////////////////////////////////////////////////////////////////
136 INLINE GeomVertexColumn::NumericType GeomVertexColumn::
138  return _numeric_type;
139 }
140 
141 ////////////////////////////////////////////////////////////////////
142 // Function: GeomVertexColumn::get_contents
143 // Access: Published
144 // Description: Returns the token representing the semantic meaning of
145 // the stored value.
146 ////////////////////////////////////////////////////////////////////
147 INLINE GeomVertexColumn::Contents GeomVertexColumn::
148 get_contents() const {
149  return _contents;
150 }
151 
152 ////////////////////////////////////////////////////////////////////
153 // Function: GeomVertexColumn::get_start
154 // Access: Published
155 // Description: Returns the byte within the array record at which
156 // this column starts. This can be set to non-zero
157 // to implement interleaved arrays.
158 ////////////////////////////////////////////////////////////////////
159 INLINE int GeomVertexColumn::
160 get_start() const {
161  return _start;
162 }
163 
164 ////////////////////////////////////////////////////////////////////
165 // Function: GeomVertexColumn::get_column_alignment
166 // Access: Published
167 // Description: Returns the alignment requirements for this column.
168 // If this is greater than 1, it restricts the column to
169 // appear only on memory addresses that are integer
170 // multiples of this value; this has implications for
171 // this column's start value, as well as the stride of
172 // the resulting array.
173 ////////////////////////////////////////////////////////////////////
174 INLINE int GeomVertexColumn::
176  return _column_alignment;
177 }
178 
179 ////////////////////////////////////////////////////////////////////
180 // Function: GeomVertexColumn::get_element_stride
181 // Access: Published
182 // Description: This value is only relevant for matrix types.
183 // Returns the number of bytes to add to access the
184 // next row of the matrix.
185 ////////////////////////////////////////////////////////////////////
186 INLINE int GeomVertexColumn::
188  return _element_stride;
189 }
190 
191 ////////////////////////////////////////////////////////////////////
192 // Function: GeomVertexColumn::get_component_bytes
193 // Access: Published
194 // Description: Returns the number of bytes used by each component
195 // (that is, by one element of the numeric type).
196 ////////////////////////////////////////////////////////////////////
197 INLINE int GeomVertexColumn::
199  return _component_bytes;
200 }
201 
202 ////////////////////////////////////////////////////////////////////
203 // Function: GeomVertexColumn::get_total_bytes
204 // Access: Published
205 // Description: Returns the number of bytes used by each element of
206 // the column: component_bytes * num_components.
207 ////////////////////////////////////////////////////////////////////
208 INLINE int GeomVertexColumn::
210  return _total_bytes;
211 }
212 
213 ////////////////////////////////////////////////////////////////////
214 // Function: GeomVertexColumn::has_homogeneous_coord
215 // Access: Published
216 // Description: Returns true if this Contents type is one that
217 // includes a homogeneous coordinate in the fourth
218 // component, or false otherwise. If this is true,
219 // correct operation on the vertex data may require
220 // scaling by the homogeneous coordinate from time to
221 // time (but in general this is handled automatically if
222 // you use the 3-component or smaller forms of
223 // get_data() and set_data()).
224 ////////////////////////////////////////////////////////////////////
225 INLINE bool GeomVertexColumn::
227  switch (_contents) {
228  case C_point:
229  case C_texcoord:
230  return true;
231 
232  default:
233  return false;
234  }
235 }
236 
237 ////////////////////////////////////////////////////////////////////
238 // Function: GeomVertexColumn::overlaps_with
239 // Access: Published
240 // Description: Returns true if this column overlaps with any of
241 // the bytes in the indicated range, false if it does
242 // not.
243 ////////////////////////////////////////////////////////////////////
244 INLINE bool GeomVertexColumn::
245 overlaps_with(int start_byte, int num_bytes) const {
246  return (_start < start_byte + num_bytes &&
247  _start + _total_bytes > start_byte);
248 }
249 
250 ////////////////////////////////////////////////////////////////////
251 // Function: GeomVertexColumn::is_bytewise_equivalent
252 // Access: Published
253 // Description: Returns true if the data store of this column is
254 // exactly the same as that of the other, irrespective
255 // of name or start position within the record.
256 ////////////////////////////////////////////////////////////////////
257 INLINE bool GeomVertexColumn::
259  // Not sure if the contents are relevant, but let's say that they
260  // are.
261  return (_num_components == other._num_components &&
262  _numeric_type == other._numeric_type &&
263  _contents == other._contents);
264 }
265 
266 ////////////////////////////////////////////////////////////////////
267 // Function: GeomVertexColumn::is_packed_argb
268 // Access: Public
269 // Description: Returns true if this column is the standard
270 // DirectX representation of 4-component color: C_color,
271 // in NT_packed_dabc, with 1 component (4 values).
272 ////////////////////////////////////////////////////////////////////
273 INLINE bool GeomVertexColumn::
274 is_packed_argb() const {
275  return (_num_components == 1 &&
276  _numeric_type == NT_packed_dabc &&
277  _contents == C_color);
278 }
279 
280 ////////////////////////////////////////////////////////////////////
281 // Function: GeomVertexColumn::is_uint8_rgba
282 // Access: Public
283 // Description: Returns true if this column is the standard
284 // OpenGL representation of 4-component color: C_color,
285 // in NT_uint8, with 4 components.
286 ////////////////////////////////////////////////////////////////////
287 INLINE bool GeomVertexColumn::
288 is_uint8_rgba() const {
289  return (_num_components == 4 &&
290  _numeric_type == NT_uint8 &&
291  _contents == C_color);
292 }
293 
294 ////////////////////////////////////////////////////////////////////
295 // Function: GeomVertexColumn::compare_to
296 // Access: Public
297 // Description: This is used to unquify columns, and hence
298 // formats, for the GeomVertexFormat registry.
299 ////////////////////////////////////////////////////////////////////
300 INLINE int GeomVertexColumn::
301 compare_to(const GeomVertexColumn &other) const {
302  if (_name != other._name) {
303  return _name < other._name ? -1 : 1;
304  }
305  if (_num_components != other._num_components) {
306  return _num_components - other._num_components;
307  }
308  if (_numeric_type != other._numeric_type) {
309  return (int)_numeric_type - (int)other._numeric_type;
310  }
311  if (_contents != other._contents) {
312  return (int)_contents - (int)other._contents;
313  }
314  if (_start != other._start) {
315  return _start - other._start;
316  }
317  if (_column_alignment != other._column_alignment) {
318  return _column_alignment - other._column_alignment;
319  }
320  return 0;
321 }
322 
323 ////////////////////////////////////////////////////////////////////
324 // Function: GeomVertexColumn::operator ==
325 // Access: Public
326 // Description: Returns true if the two columns are exactly
327 // equivalent, false otherwise.
328 ////////////////////////////////////////////////////////////////////
329 INLINE bool GeomVertexColumn::
330 operator == (const GeomVertexColumn &other) const {
331  return compare_to(other) == 0;
332 }
333 
334 ////////////////////////////////////////////////////////////////////
335 // Function: GeomVertexColumn::operator !=
336 // Access: Public
337 // Description:
338 ////////////////////////////////////////////////////////////////////
339 INLINE bool GeomVertexColumn::
340 operator != (const GeomVertexColumn &other) const {
341  return compare_to(other) != 0;
342 }
343 
344 ////////////////////////////////////////////////////////////////////
345 // Function: GeomVertexColumn::operator <
346 // Access: Public
347 // Description: This is used to put columns in order within a
348 // particular GeomVertexArrayFormat. Note that it is
349 // *not* in the same space as operator == and operator
350 // !=.
351 ////////////////////////////////////////////////////////////////////
352 INLINE bool GeomVertexColumn::
353 operator < (const GeomVertexColumn &other) const {
354  if (_start != other._start) {
355  return _start < other._start;
356  }
357  if (_total_bytes < other._total_bytes) {
358  return _total_bytes < other._total_bytes;
359  }
360  return 0;
361 }
362 
363 INLINE ostream &
364 operator << (ostream &out, const GeomVertexColumn &obj) {
365  obj.output(out);
366  return out;
367 }
368 
369 ////////////////////////////////////////////////////////////////////
370 // Function: GeomVertexColumn::Packer::maybe_scale_color_f
371 // Access: Public
372 // Description: Converts an integer (typically a uint8) value to a
373 // floating-point value. If the contents value
374 // indicates this is a color value, scales it into the
375 // range 0..1 per convention; otherwise leaves it alone.
376 ////////////////////////////////////////////////////////////////////
377 INLINE float GeomVertexColumn::Packer::
378 maybe_scale_color_f(unsigned int value) {
379  if (_column->get_contents() == C_color) {
380  return (float)value / 255.0f;
381  } else {
382  return (float)value;
383  }
384 }
385 
386 ////////////////////////////////////////////////////////////////////
387 // Function: GeomVertexColumn::Packer::maybe_scale_color_f
388 // Access: Public
389 // Description: Converts a pair of integers into the _v2 member. See
390 // one-parameter maybe_scale_color_f() for more info.
391 ////////////////////////////////////////////////////////////////////
392 INLINE void GeomVertexColumn::Packer::
393 maybe_scale_color_f(unsigned int a, unsigned int b) {
394  if (_column->get_contents() == C_color) {
395  _v2.set((float)a / 255.0f,
396  (float)b / 255.0f);
397  } else {
398  _v2.set((float)a, (float)b);
399  }
400 }
401 
402 ////////////////////////////////////////////////////////////////////
403 // Function: GeomVertexColumn::Packer::maybe_scale_color_f
404 // Access: Public
405 // Description: Converts a pair of integers into the _v3 member. See
406 // one-parameter maybe_scale_color_f() for more info.
407 ////////////////////////////////////////////////////////////////////
408 INLINE void GeomVertexColumn::Packer::
409 maybe_scale_color_f(unsigned int a, unsigned int b, unsigned int c) {
410  if (_column->get_contents() == C_color) {
411  _v3.set((float)a / 255.0f,
412  (float)b / 255.0f,
413  (float)c / 255.0f);
414  } else {
415  _v3.set((float)a, (float)b, (float)c);
416  }
417 }
418 
419 ////////////////////////////////////////////////////////////////////
420 // Function: GeomVertexColumn::Packer::maybe_scale_color_f
421 // Access: Public
422 // Description: Converts a pair of integers into the _v4 member. See
423 // one-parameter maybe_scale_color_f() for more info.
424 ////////////////////////////////////////////////////////////////////
425 INLINE void GeomVertexColumn::Packer::
426 maybe_scale_color_f(unsigned int a, unsigned int b, unsigned int c,
427  unsigned int d) {
428  if (_column->get_contents() == C_color) {
429  _v4.set((float)a / 255.0f,
430  (float)b / 255.0f,
431  (float)c / 255.0f,
432  (float)d / 255.0f);
433  } else {
434  _v4.set((float)a, (float)b, (float)c, (float)d);
435  }
436 }
437 
438 ////////////////////////////////////////////////////////////////////
439 // Function: GeomVertexColumn::Packer::maybe_unscale_color_f
440 // Access: Public
441 // Description: Converts a floating-point value to a uint8 value. If
442 // the contents value indicates this is a color value,
443 // scales it into the range 0..255 per convention;
444 // otherwise leaves it alone.
445 ////////////////////////////////////////////////////////////////////
446 INLINE unsigned int GeomVertexColumn::Packer::
447 maybe_unscale_color_f(float data) {
448  if (_column->get_contents() == C_color) {
449  return (unsigned int)(data * 255.0f);
450  } else {
451  return (unsigned int)data;
452  }
453 }
454 
455 ////////////////////////////////////////////////////////////////////
456 // Function: GeomVertexColumn::Packer::maybe_unscale_color_f
457 // Access: Public
458 // Description: Converts an LVecBase2f into a pair of uint8
459 // values. See one-parameter maybe_unscale_color_f() for
460 // more info.
461 ////////////////////////////////////////////////////////////////////
462 INLINE void GeomVertexColumn::Packer::
463 maybe_unscale_color_f(const LVecBase2f &data) {
464  if (_column->get_contents() == C_color) {
465  _a = (unsigned int)(data[0] * 255.0f);
466  _b = (unsigned int)(data[1] * 255.0f);
467  } else {
468  _a = (unsigned int)data[0];
469  _b = (unsigned int)data[1];
470  }
471 }
472 
473 ////////////////////////////////////////////////////////////////////
474 // Function: GeomVertexColumn::Packer::maybe_unscale_color_f
475 // Access: Public
476 // Description: Converts an LVecBase3f into a pair of uint8
477 // values. See one-parameter maybe_unscale_color_f() for
478 // more info.
479 ////////////////////////////////////////////////////////////////////
480 INLINE void GeomVertexColumn::Packer::
481 maybe_unscale_color_f(const LVecBase3f &data) {
482  if (_column->get_contents() == C_color) {
483  _a = (unsigned int)(data[0] * 255.0f);
484  _b = (unsigned int)(data[1] * 255.0f);
485  _c = (unsigned int)(data[2] * 255.0f);
486  } else {
487  _a = (unsigned int)data[0];
488  _b = (unsigned int)data[1];
489  _c = (unsigned int)data[2];
490  }
491 }
492 
493 ////////////////////////////////////////////////////////////////////
494 // Function: GeomVertexColumn::Packer::maybe_unscale_color_f
495 // Access: Public
496 // Description: Converts an LVecBase4f into a pair of uint8
497 // values. See one-parameter maybe_unscale_color_f() for
498 // more info.
499 ////////////////////////////////////////////////////////////////////
500 INLINE void GeomVertexColumn::Packer::
501 maybe_unscale_color_f(const LVecBase4f &data) {
502  if (_column->get_contents() == C_color) {
503  _a = (unsigned int)(data[0] * 255.0f);
504  _b = (unsigned int)(data[1] * 255.0f);
505  _c = (unsigned int)(data[2] * 255.0f);
506  _d = (unsigned int)(data[3] * 255.0f);
507  } else {
508  _a = (unsigned int)data[0];
509  _b = (unsigned int)data[1];
510  _c = (unsigned int)data[2];
511  _d = (unsigned int)data[3];
512  }
513 }
514 
515 ////////////////////////////////////////////////////////////////////
516 // Function: GeomVertexColumn::Packer::maybe_scale_color_d
517 // Access: Public
518 // Description: Converts an integer (typically a uint8) value to a
519 // floating-point value. If the contents value
520 // indicates this is a color value, scales it into the
521 // range 0..1 per convention; otherwise leaves it alone.
522 ////////////////////////////////////////////////////////////////////
523 INLINE double GeomVertexColumn::Packer::
524 maybe_scale_color_d(unsigned int value) {
525  if (_column->get_contents() == C_color) {
526  return (double)value / 255.0;
527  } else {
528  return (double)value;
529  }
530 }
531 
532 ////////////////////////////////////////////////////////////////////
533 // Function: GeomVertexColumn::Packer::maybe_scale_color_d
534 // Access: Public
535 // Description: Converts a pair of integers into the _v2d member. See
536 // one-parameter maybe_scale_color_d() for more info.
537 ////////////////////////////////////////////////////////////////////
538 INLINE void GeomVertexColumn::Packer::
539 maybe_scale_color_d(unsigned int a, unsigned int b) {
540  if (_column->get_contents() == C_color) {
541  _v2d.set((double)a / 255.0,
542  (double)b / 255.0);
543  } else {
544  _v2d.set((double)a, (double)b);
545  }
546 }
547 
548 ////////////////////////////////////////////////////////////////////
549 // Function: GeomVertexColumn::Packer::maybe_scale_color_d
550 // Access: Public
551 // Description: Converts a pair of integers into the _v3d member. See
552 // one-parameter maybe_scale_color_d() for more info.
553 ////////////////////////////////////////////////////////////////////
554 INLINE void GeomVertexColumn::Packer::
555 maybe_scale_color_d(unsigned int a, unsigned int b, unsigned int c) {
556  if (_column->get_contents() == C_color) {
557  _v3d.set((double)a / 255.0,
558  (double)b / 255.0,
559  (double)c / 255.0);
560  } else {
561  _v3d.set((double)a, (double)b, (double)c);
562  }
563 }
564 
565 ////////////////////////////////////////////////////////////////////
566 // Function: GeomVertexColumn::Packer::maybe_scale_color_d
567 // Access: Public
568 // Description: Converts a pair of integers into the _v4d member. See
569 // one-parameter maybe_scale_color_d() for more info.
570 ////////////////////////////////////////////////////////////////////
571 INLINE void GeomVertexColumn::Packer::
572 maybe_scale_color_d(unsigned int a, unsigned int b, unsigned int c,
573  unsigned int d) {
574  if (_column->get_contents() == C_color) {
575  _v4d.set((double)a / 255.0,
576  (double)b / 255.0,
577  (double)c / 255.0,
578  (double)d / 255.0);
579  } else {
580  _v4d.set((double)a, (double)b, (double)c, (double)d);
581  }
582 }
583 
584 ////////////////////////////////////////////////////////////////////
585 // Function: GeomVertexColumn::Packer::maybe_unscale_color_d
586 // Access: Public
587 // Description: Converts a floating-point value to a uint8 value. If
588 // the contents value indicates this is a color value,
589 // scales it into the range 0..255 per convention;
590 // otherwise leaves it alone.
591 ////////////////////////////////////////////////////////////////////
592 INLINE unsigned int GeomVertexColumn::Packer::
593 maybe_unscale_color_d(double data) {
594  if (_column->get_contents() == C_color) {
595  return (unsigned int)(data * 255.0);
596  } else {
597  return (unsigned int)data;
598  }
599 }
600 
601 ////////////////////////////////////////////////////////////////////
602 // Function: GeomVertexColumn::Packer::maybe_unscale_color_d
603 // Access: Public
604 // Description: Converts an LVecBase2d into a pair of uint8
605 // values. See one-parameter maybe_unscale_color_d() for
606 // more info.
607 ////////////////////////////////////////////////////////////////////
608 INLINE void GeomVertexColumn::Packer::
609 maybe_unscale_color_d(const LVecBase2d &data) {
610  if (_column->get_contents() == C_color) {
611  _a = (unsigned int)(data[0] * 255.0);
612  _b = (unsigned int)(data[1] * 255.0);
613  } else {
614  _a = (unsigned int)data[0];
615  _b = (unsigned int)data[1];
616  }
617 }
618 
619 ////////////////////////////////////////////////////////////////////
620 // Function: GeomVertexColumn::Packer::maybe_unscale_color_d
621 // Access: Public
622 // Description: Converts an LVecBase3d into a pair of uint8
623 // values. See one-parameter maybe_unscale_color_d() for
624 // more info.
625 ////////////////////////////////////////////////////////////////////
626 INLINE void GeomVertexColumn::Packer::
627 maybe_unscale_color_d(const LVecBase3d &data) {
628  if (_column->get_contents() == C_color) {
629  _a = (unsigned int)(data[0] * 255.0);
630  _b = (unsigned int)(data[1] * 255.0);
631  _c = (unsigned int)(data[2] * 255.0);
632  } else {
633  _a = (unsigned int)data[0];
634  _b = (unsigned int)data[1];
635  _c = (unsigned int)data[2];
636  }
637 }
638 
639 ////////////////////////////////////////////////////////////////////
640 // Function: GeomVertexColumn::Packer::maybe_unscale_color_d
641 // Access: Public
642 // Description: Converts an LVecBase4d into a pair of uint8
643 // values. See one-parameter maybe_unscale_color_d() for
644 // more info.
645 ////////////////////////////////////////////////////////////////////
646 INLINE void GeomVertexColumn::Packer::
647 maybe_unscale_color_d(const LVecBase4d &data) {
648  if (_column->get_contents() == C_color) {
649  _a = (unsigned int)(data[0] * 255.0);
650  _b = (unsigned int)(data[1] * 255.0);
651  _c = (unsigned int)(data[2] * 255.0);
652  _d = (unsigned int)(data[3] * 255.0);
653  } else {
654  _a = (unsigned int)data[0];
655  _b = (unsigned int)data[1];
656  _c = (unsigned int)data[2];
657  _d = (unsigned int)data[3];
658  }
659 }
int get_element_stride() const
This value is only relevant for matrix types.
bool is_uint8_rgba() const
Returns true if this column is the standard OpenGL representation of 4-component color: C_color...
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
Definition: internalName.h:197
bool is_packed_argb() const
Returns true if this column is the standard DirectX representation of 4-component color: C_color...
bool operator==(const GeomVertexColumn &other) const
Returns true if the two columns are exactly equivalent, false otherwise.
This is the base class for all two-component vectors and points.
Definition: lvecBase2.h:1241
int get_total_bytes() const
Returns the number of bytes used by each element of the column: component_bytes * num_components...
int get_num_elements() const
Returns the number of times this column is repeated.
const InternalName * get_name() const
Returns the name of this particular data field, e.g.
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:1661
bool operator<(const GeomVertexColumn &other) const
This is used to put columns in order within a particular GeomVertexArrayFormat.
int get_num_components() const
Returns the number of components of the column: the number of instances of the NumericType in each el...
int get_column_alignment() const
Returns the alignment requirements for this column.
This defines how a single column is interleaved within a vertex array stored within a Geom...
int get_start() const
Returns the byte within the array record at which this column starts.
int compare_to(const GeomVertexColumn &other) const
This is used to unquify columns, and hence formats, for the GeomVertexFormat registry.
int get_component_bytes() const
Returns the number of bytes used by each component (that is, by one element of the numeric type)...
bool is_bytewise_equivalent(const GeomVertexColumn &other) const
Returns true if the data store of this column is exactly the same as that of the other, irrespective of name or start position within the record.
bool overlaps_with(int start_byte, int num_bytes) const
Returns true if this column overlaps with any of the bytes in the indicated range, false if it does not.
bool has_homogeneous_coord() const
Returns true if this Contents type is one that includes a homogeneous coordinate in the fourth compon...
This is the base class for all two-component vectors and points.
Definition: lvecBase2.h:105
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:1455
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
int get_num_values() const
Returns the number of numeric values of the column: the number of distinct numeric values that go int...
Contents get_contents() const
Returns the token representing the semantic meaning of the stored value.
NumericType get_numeric_type() const
Returns the token representing the numeric type of the data storage.