Panda3D
geomVertexReader.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file geomVertexReader.I
10  * @author drose
11  * @date 2005-03-25
12  */
13 
14 /**
15  * Constructs an invalid GeomVertexReader. You must use the assignment
16  * operator to assign a valid GeomVertexReader to this object before you can
17  * use it.
18  */
19 INLINE GeomVertexReader::
20 GeomVertexReader(Thread *current_thread) :
21  _vertex_data(nullptr),
22  _current_thread(current_thread)
23 {
24  initialize();
25 }
26 
27 /**
28  * Constructs a new reader to process the vertices of the indicated data
29  * object.
30  */
31 INLINE GeomVertexReader::
32 GeomVertexReader(const GeomVertexData *vertex_data,
33  Thread *current_thread) :
34  _vertex_data(vertex_data),
35  _current_thread(current_thread)
36 {
37  initialize();
38 }
39 
40 /**
41  * Constructs a new reader to process the vertices of the indicated data
42  * object. This flavor creates the reader specifically to process the named
43  * data type.
44  */
45 INLINE GeomVertexReader::
46 GeomVertexReader(const GeomVertexData *vertex_data,
47  CPT_InternalName name,
48  Thread *current_thread) :
49  _vertex_data(vertex_data),
50  _current_thread(current_thread)
51 {
52  initialize();
53  set_column(std::move(name));
54 }
55 
56 /**
57  * Constructs a new reader to process the vertices of the indicated array
58  * only.
59  */
60 INLINE GeomVertexReader::
62  Thread *current_thread) :
63  _array_data(array_data),
64  _current_thread(current_thread)
65 {
66  initialize();
67 }
68 
69 /**
70  * Constructs a new reader to process the vertices of the indicated array
71  * only.
72  */
73 INLINE GeomVertexReader::
74 GeomVertexReader(const GeomVertexArrayData *array_data, int column,
75  Thread *current_thread) :
76  _array_data(array_data),
77  _current_thread(current_thread)
78 {
79  initialize();
80  set_column(column);
81 }
82 
83 /**
84  * Constructs a new reader to process the vertices of the indicated data
85  * object. This flavor creates the reader specifically to process the named
86  * data type.
87  */
88 INLINE GeomVertexReader::
90  const InternalName *name, bool force) :
91  _vertex_data(data_reader->get_object()),
92  _current_thread(data_reader->get_current_thread())
93 {
94  initialize();
95  _force = force;
96  const GeomVertexFormat *format = data_reader->get_format();
97  set_vertex_column(format->get_array_with(name),
98  format->get_column(name),
99  data_reader);
100 }
101 
102 /**
103  *
104  */
105 INLINE GeomVertexReader::
106 GeomVertexReader(const GeomVertexReader &copy) :
107  _vertex_data(copy._vertex_data),
108  _array(copy._array),
109  _array_data(copy._array_data),
110  _current_thread(copy._current_thread),
111  _packer(copy._packer),
112  _stride(copy._stride),
113  _handle(copy._handle),
114  _pointer_begin(copy._pointer_begin),
115  _pointer_end(copy._pointer_end),
116  _pointer(copy._pointer),
117  _start_row(copy._start_row),
118  _force(copy._force)
119 {
120 }
121 
122 /**
123  *
124  */
125 INLINE void GeomVertexReader::
126 operator = (const GeomVertexReader &copy) {
127  _vertex_data = copy._vertex_data;
128  _array = copy._array;
129  _array_data = copy._array_data;
130  _current_thread = copy._current_thread;
131  _packer = copy._packer;
132  _stride = copy._stride;
133  _handle = copy._handle;
134  _pointer_begin = copy._pointer_begin;
135  _pointer_end = copy._pointer_end;
136  _pointer = copy._pointer;
137  _start_row = copy._start_row;
138  _force = copy._force;
139 }
140 
141 /**
142  *
143  */
144 INLINE GeomVertexReader::
145 ~GeomVertexReader() {
146 }
147 
148 /**
149  * Returns the vertex data object that the reader is processing. This may
150  * return NULL if the reader was constructed with just an array pointer.
151  */
154  return _vertex_data;
155 }
156 
157 /**
158  * Returns the particular array object that the reader is currently
159  * processing.
160  */
162 get_array_data() const {
163  return _array_data;
164 }
165 
166 /**
167  * Returns the read handle to the array object that the read is currently
168  * processing. This low-level call should be used with caution.
169  */
172  return _handle;
173 }
174 
175 /**
176  * Returns the per-row stride (bytes between consecutive rows) of the
177  * underlying vertex array. This low-level information is normally not needed
178  * to use the GeomVertexReader directly.
179  */
180 INLINE size_t GeomVertexReader::
181 get_stride() const {
182  return _stride;
183 }
184 
185 /**
186  * Returns the Thread pointer of the currently-executing thread, as passed to
187  * the constructor of this object.
188  */
191  return _current_thread;
192 }
193 
194 /**
195  * Sets the value of the force flag. When this is true (the default), vertex
196  * data will be paged in from disk if necessary. When this is false, the
197  * GeomVertexData will simply return a failure code when attempting to read
198  * vertex data that is not resident (but will put it on the queue to become
199  * resident later).
200  *
201  * Normally, vertex data is always resident, so this will not be an issue. It
202  * is only possible for vertex data to be nonresident if you have enabled
203  * vertex paging via the GeomVertexArrayData and VertexDataPage interfaces.
204  */
205 INLINE void GeomVertexReader::
206 set_force(bool force) {
207  _force = force;
208 }
209 
210 /**
211  * Returns the value of the force flag. See set_force().
212  */
213 INLINE bool GeomVertexReader::
214 get_force() const {
215  return _force;
216 }
217 
218 /**
219  * Sets up the reader to use the nth data type of the GeomVertexFormat,
220  * numbering from 0.
221  *
222  * This also resets the read row number to the start row (the same value
223  * passed to a previous call to set_row(), or 0 if set_row() was never
224  * called.)
225  *
226  * The return value is true if the data type is valid, false otherwise.
227  */
228 INLINE bool GeomVertexReader::
229 set_column(int column) {
230  if (_vertex_data != nullptr) {
231  GeomVertexDataPipelineReader reader(_vertex_data, _current_thread);
232  reader.check_array_readers();
233  const GeomVertexFormat *format = reader.get_format();
234  return set_vertex_column(format->get_array_with(column),
235  format->get_column(column),
236  &reader);
237  }
238  if (_array_data != nullptr) {
239  return set_array_column(_array_data->get_array_format()->get_column(column));
240  }
241  return false;
242 }
243 
244 /**
245  * Sets up the reader to use the data type with the indicated name.
246  *
247  * This also resets the read row number to the start row (the same value
248  * passed to a previous call to set_row(), or 0 if set_row() was never
249  * called.)
250  *
251  * The return value is true if the data type is valid, false otherwise.
252  */
253 INLINE bool GeomVertexReader::
255  if (_vertex_data != nullptr) {
256  GeomVertexDataPipelineReader reader(_vertex_data, _current_thread);
257  reader.check_array_readers();
258  const GeomVertexFormat *format = reader.get_format();
259  return set_vertex_column(format->get_array_with(name),
260  format->get_column(name),
261  &reader);
262  }
263  if (_array_data != nullptr) {
264  return set_array_column(_array_data->get_array_format()->get_column(name));
265  }
266 
267  return false;
268 }
269 
270 /**
271  * Resets the GeomVertexReader to the initial state.
272  */
273 INLINE void GeomVertexReader::
274 clear() {
275  (*this) = GeomVertexReader(_current_thread);
276 }
277 
278 /**
279  * Returns true if a valid data type has been successfully set, or false if
280  * the data type does not exist (or if get_force() is false and the vertex
281  * data is nonresident).
282  */
283 INLINE bool GeomVertexReader::
284 has_column() const {
285  return (_packer != nullptr);
286 }
287 
288 /**
289  * Returns the array index containing the data type that the reader is working
290  * on.
291  */
292 INLINE int GeomVertexReader::
293 get_array() const {
294  return _array;
295 }
296 
297 /**
298  * Returns the description of the data type that the reader is working on.
299  */
301 get_column() const {
302  if (_packer != nullptr) {
303  return _packer->_column;
304  }
305  return nullptr;
306 }
307 
308 /**
309  * Sets the start row to the indicated value, without internal checks. This
310  * is the same as set_row(), but it does not check for the possibility that
311  * the array has been reallocated internally for some reason; use only when
312  * you are confident that the array is unchanged and you really need every bit
313  * of available performance.
314  */
315 INLINE void GeomVertexReader::
316 set_row_unsafe(int row) {
317  _start_row = row;
318  if (has_column()) {
319  quick_set_pointer(_start_row);
320  }
321 }
322 
323 /**
324  * Sets the start row to the indicated value. The reader will begin reading
325  * from the indicated row; each subsequent get_data*() call will return the
326  * data from the subsequent row. If set_column() is called, the reader will
327  * return to this row.
328  */
329 INLINE void GeomVertexReader::
330 set_row(int row) {
331  _start_row = row;
332  if (has_column()) {
333  bool result = set_pointer(_start_row);
334  nassertv(result);
335  }
336 }
337 
338 /**
339  * Returns the row index at which the reader started. It will return to this
340  * row if you reset the current column.
341  */
342 INLINE int GeomVertexReader::
343 get_start_row() const {
344  return _start_row;
345 }
346 
347 /**
348  * Returns the row index from which the data will be retrieved by the next
349  * call to get_data*().
350  */
351 INLINE int GeomVertexReader::
352 get_read_row() const {
353  return (int)(_pointer - _pointer_begin) / _stride;
354 }
355 
356 /**
357  * Returns true if the reader is currently at the end of the list of vertices,
358  * false otherwise. If this is true, another call to get_data*() will result
359  * in a crash.
360  */
361 INLINE bool GeomVertexReader::
362 is_at_end() const {
363  return _pointer >= _pointer_end;
364 }
365 
366 /**
367  * Returns the data associated with the read row, expressed as a 1-component
368  * value, and advances the read row.
369  */
370 INLINE float GeomVertexReader::
372  nassertr(has_column(), 0.0f);
373  return _packer->get_data1f(inc_pointer());
374 }
375 
376 /**
377  * Returns the data associated with the read row, expressed as a 2-component
378  * value, and advances the read row.
379  */
380 INLINE const LVecBase2f &GeomVertexReader::
382  nassertr(has_column(), LVecBase2f::zero());
383  return _packer->get_data2f(inc_pointer());
384 }
385 
386 /**
387  * Returns the data associated with the read row, expressed as a 3-component
388  * value, and advances the read row.
389  */
390 INLINE const LVecBase3f &GeomVertexReader::
392  nassertr(has_column(), LVecBase3f::zero());
393  return _packer->get_data3f(inc_pointer());
394 }
395 
396 /**
397  * Returns the data associated with the read row, expressed as a 4-component
398  * value, and advances the read row.
399  */
400 INLINE const LVecBase4f &GeomVertexReader::
402  nassertr(has_column(), LVecBase4f::zero());
403  return _packer->get_data4f(inc_pointer());
404 }
405 
406 /**
407  * Returns the 3-by-3 matrix associated with the read row and advances the
408  * read row. This is a special method that only works when the column in
409  * question contains a matrix of an appropriate size.
410  */
411 INLINE LMatrix3f GeomVertexReader::
413  nassertr(has_column() &&
414  _packer->_column->get_contents() == C_matrix &&
415  _packer->_column->get_num_elements() >= 3,
416  LMatrix3f::ident_mat());
417 
418  size_t col_stride = _packer->_column->get_element_stride();
419  const unsigned char *pointer = inc_pointer();
420 
421  LMatrix3f mat;
422  mat.set_row(0, _packer->get_data3f(pointer));
423  pointer += col_stride;
424  mat.set_row(1, _packer->get_data3f(pointer));
425  pointer += col_stride;
426  mat.set_row(2, _packer->get_data3f(pointer));
427  return mat;
428 }
429 
430 /**
431  * Returns the 4-by-4 matrix associated with the read row and advances the
432  * read row. This is a special method that only works when the column in
433  * question contains a matrix of an appropriate size.
434  */
435 INLINE LMatrix4f GeomVertexReader::
437  nassertr(has_column() &&
438  _packer->_column->get_contents() == C_matrix &&
439  _packer->_column->get_num_elements() >= 4,
440  LMatrix4f::ident_mat());
441 
442  size_t col_stride = _packer->_column->get_element_stride();
443  const unsigned char *pointer = inc_pointer();
444 
445  LMatrix4f mat;
446  mat.set_row(0, _packer->get_data4f(pointer));
447  pointer += col_stride;
448  mat.set_row(1, _packer->get_data4f(pointer));
449  pointer += col_stride;
450  mat.set_row(2, _packer->get_data4f(pointer));
451  pointer += col_stride;
452  mat.set_row(3, _packer->get_data4f(pointer));
453  return mat;
454 }
455 
456 /**
457  * Returns the data associated with the read row, expressed as a 1-component
458  * value, and advances the read row.
459  */
460 INLINE double GeomVertexReader::
462  nassertr(has_column(), 0.0f);
463  return _packer->get_data1d(inc_pointer());
464 }
465 
466 /**
467  * Returns the data associated with the read row, expressed as a 2-component
468  * value, and advances the read row.
469  */
470 INLINE const LVecBase2d &GeomVertexReader::
472  nassertr(has_column(), LVecBase2d::zero());
473  return _packer->get_data2d(inc_pointer());
474 }
475 
476 /**
477  * Returns the data associated with the read row, expressed as a 3-component
478  * value, and advances the read row.
479  */
480 INLINE const LVecBase3d &GeomVertexReader::
482  nassertr(has_column(), LVecBase3d::zero());
483  return _packer->get_data3d(inc_pointer());
484 }
485 
486 /**
487  * Returns the data associated with the read row, expressed as a 4-component
488  * value, and advances the read row.
489  */
490 INLINE const LVecBase4d &GeomVertexReader::
492  nassertr(has_column(), LVecBase4d::zero());
493  return _packer->get_data4d(inc_pointer());
494 }
495 
496 /**
497  * Returns the 3-by-3 matrix associated with the read row and advances the
498  * read row. This is a special method that only works when the column in
499  * question contains a matrix of an appropriate size.
500  */
501 INLINE LMatrix3d GeomVertexReader::
503  nassertr(has_column() &&
504  _packer->_column->get_contents() == C_matrix &&
505  _packer->_column->get_num_elements() >= 3,
506  LMatrix3d::ident_mat());
507 
508  size_t col_stride = _packer->_column->get_element_stride();
509  const unsigned char *pointer = inc_pointer();
510 
511  LMatrix3d mat;
512  mat.set_row(0, _packer->get_data3d(pointer));
513  pointer += col_stride;
514  mat.set_row(1, _packer->get_data3d(pointer));
515  pointer += col_stride;
516  mat.set_row(2, _packer->get_data3d(pointer));
517  return mat;
518 }
519 
520 /**
521  * Returns the 4-by-4 matrix associated with the read row and advances the
522  * read row. This is a special method that only works when the column in
523  * question contains a matrix of an appropriate size.
524  */
525 INLINE LMatrix4d GeomVertexReader::
527  nassertr(has_column() &&
528  _packer->_column->get_contents() == C_matrix &&
529  _packer->_column->get_num_elements() >= 4,
530  LMatrix4d::ident_mat());
531 
532  size_t col_stride = _packer->_column->get_element_stride();
533  const unsigned char *pointer = inc_pointer();
534 
535  LMatrix4d mat;
536  mat.set_row(0, _packer->get_data4d(pointer));
537  pointer += col_stride;
538  mat.set_row(1, _packer->get_data4d(pointer));
539  pointer += col_stride;
540  mat.set_row(2, _packer->get_data4d(pointer));
541  pointer += col_stride;
542  mat.set_row(3, _packer->get_data4d(pointer));
543  return mat;
544 }
545 
546 /**
547  * Returns the data associated with the read row, expressed as a 1-component
548  * value, and advances the read row.
549  */
550 INLINE PN_stdfloat GeomVertexReader::
552 #ifndef STDFLOAT_DOUBLE
553  return get_data1f();
554 #else
555  return get_data1d();
556 #endif
557 }
558 
559 /**
560  * Returns the data associated with the read row, expressed as a 2-component
561  * value, and advances the read row.
562  */
563 INLINE const LVecBase2 &GeomVertexReader::
565 #ifndef STDFLOAT_DOUBLE
566  return get_data2f();
567 #else
568  return get_data2d();
569 #endif
570 }
571 
572 /**
573  * Returns the data associated with the read row, expressed as a 3-component
574  * value, and advances the read row.
575  */
576 INLINE const LVecBase3 &GeomVertexReader::
578 #ifndef STDFLOAT_DOUBLE
579  return get_data3f();
580 #else
581  return get_data3d();
582 #endif
583 }
584 
585 /**
586  * Returns the data associated with the read row, expressed as a 4-component
587  * value, and advances the read row.
588  */
589 INLINE const LVecBase4 &GeomVertexReader::
591 #ifndef STDFLOAT_DOUBLE
592  return get_data4f();
593 #else
594  return get_data4d();
595 #endif
596 }
597 
598 /**
599  * Returns the 3-by-3 matrix associated with the read row and advances the
600  * read row. This is a special method that only works when the column in
601  * question contains a matrix of an appropriate size.
602  */
603 INLINE LMatrix3 GeomVertexReader::
605 #ifndef STDFLOAT_DOUBLE
606  return get_matrix3f();
607 #else
608  return get_matrix3d();
609 #endif
610 }
611 
612 /**
613  * Returns the 4-by-4 matrix associated with the read row and advances the
614  * read row. This is a special method that only works when the column in
615  * question contains a matrix of an appropriate size.
616  */
617 INLINE LMatrix4 GeomVertexReader::
619 #ifndef STDFLOAT_DOUBLE
620  return get_matrix4f();
621 #else
622  return get_matrix4d();
623 #endif
624 }
625 
626 /**
627  * Returns the data associated with the read row, expressed as a 1-component
628  * value, and advances the read row.
629  */
630 INLINE int GeomVertexReader::
632  nassertr(has_column(), 0);
633  return _packer->get_data1i(inc_pointer());
634 }
635 
636 /**
637  * Returns the data associated with the read row, expressed as a 2-component
638  * value, and advances the read row.
639  */
640 INLINE const LVecBase2i &GeomVertexReader::
642  nassertr(has_column(), LVecBase2i::zero());
643  return _packer->get_data2i(inc_pointer());
644 }
645 
646 /**
647  * Returns the data associated with the read row, expressed as a 3-component
648  * value, and advances the read row.
649  */
650 INLINE const LVecBase3i &GeomVertexReader::
652  nassertr(has_column(), LVecBase3i::zero());
653  return _packer->get_data3i(inc_pointer());
654 }
655 
656 /**
657  * Returns the data associated with the read row, expressed as a 4-component
658  * value, and advances the read row.
659  */
660 INLINE const LVecBase4i &GeomVertexReader::
662  nassertr(has_column(), LVecBase4i::zero());
663  return _packer->get_data4i(inc_pointer());
664 }
665 
666 /**
667  * Returns the reader's Packer object.
668  */
669 INLINE GeomVertexColumn::Packer *GeomVertexReader::
670 get_packer() const {
671  return _packer;
672 }
673 
674 /**
675  * Sets up the array pointers freshly from the source object (in case they
676  * have been reallocated recently), and sets the internal pointer to the
677  * indicated row.
678  *
679  * Returns true if successful, or false if the vertex data is not resident.
680  * If it returns false, the reader's internal column spec is cleared. It is
681  * only possible to return false if get_force() is false.
682  */
683 INLINE bool GeomVertexReader::
684 set_pointer(int row) {
685  _pointer_begin = _handle->get_read_pointer(_force);
686  if (_pointer_begin == nullptr && _handle->get_data_size_bytes() != 0) {
687  // Vertex data is not resident.
688  set_column(0, nullptr);
689  return false;
690  }
691 
692  // Vertex data is resident, or just empty.
693  _pointer_end = _pointer_begin + _handle->get_data_size_bytes();
694  quick_set_pointer(row);
695  return true;
696 }
697 
698 /**
699  * Sets up the internal pointer to the indicated row, without first verifying
700  * that arrays haven't been reallocated.
701  */
702 INLINE void GeomVertexReader::
703 quick_set_pointer(int row) {
704  nassertv(has_column() && (_pointer_begin != nullptr || row == 0));
705 
706 #if defined(_DEBUG)
707  // Make sure we still have the same pointer as stored in the array.
708  nassertv(_pointer_begin == _handle->get_read_pointer(true));
709 #endif
710 
711  _pointer = _pointer_begin + _packer->_column->get_start() + _stride * row;
712 
713 #if defined(_DEBUG)
714  // We have to allow the pointer to exceed the end by up to one row's width.
715  // This wouldn't be legal on a plain GeomVertexReader, but it *is* legal for
716  // a GeomVertexRewriter.
717  nassertv(_pointer_begin == _pointer_end || (_pointer - _packer->_column->get_start()) <= _pointer_end);
718 #endif
719 }
720 
721 /**
722  * Increments to the next row, and returns the data pointer as it was before
723  * incrementing.
724  */
725 INLINE const unsigned char *GeomVertexReader::
726 inc_pointer() {
727 #if defined(_DEBUG)
728  nassertr(_pointer < _pointer_end, empty_buffer);
729  // Make sure we still have the same pointer as stored in the array.
730  nassertr(_pointer_begin == _handle->get_read_pointer(true), empty_buffer);
731  nassertr(_pointer < _pointer_begin + _handle->get_data_size_bytes(), empty_buffer);
732 #endif
733 
734  const unsigned char *orig_pointer = _pointer;
735  _pointer += _stride;
736  return orig_pointer;
737 }
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
Definition: internalName.h:193
const GeomVertexArrayData * get_array_data() const
Returns the particular array object that the reader is currently processing.
bool set_column(int column)
Sets up the reader to use the nth data type of the GeomVertexFormat, numbering from 0.
LMatrix3 get_matrix3()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
double get_data1d()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
const LVecBase2 & get_data2()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
const GeomVertexColumn * get_column() const
Returns the description of the data type that the reader is working on.
const LVecBase3i & get_data3i()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
bool get_force() const
Returns the value of the force flag.
const LVecBase2d & get_data2d()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
const LVecBase4 & get_data4()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
const LVecBase3f & get_data3f()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
This data object is returned by GeomVertexArrayData::get_handle() or modify_handle().
LMatrix4d get_matrix4d()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
size_t get_stride() const
Returns the per-row stride (bytes between consecutive rows) of the underlying vertex array.
const GeomVertexData * get_vertex_data() const
Returns the vertex data object that the reader is processing.
void set_force(bool force)
Sets the value of the force flag.
This defines how a single column is interleaved within a vertex array stored within a Geom.
const LVecBase4f & get_data4f()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
int get_read_row() const
Returns the row index from which the data will be retrieved by the next call to get_data*().
LMatrix3d get_matrix3d()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
const LVecBase2i & get_data2i()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
bool has_column() const
Returns true if a valid data type has been successfully set, or false if the data type does not exist...
get_column
Returns the ith column of the specification, across all arrays.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
const GeomVertexArrayDataHandle * get_array_handle() const
Returns the read handle to the array object that the read is currently processing.
const LVecBase3 & get_data3()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
int get_array_with(size_t i) const
Returns the index number of the array with the ith column.
void set_row(int row)
Sets the start row to the indicated value.
int get_array() const
Returns the array index containing the data type that the reader is working on.
int get_data1i()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
Encodes a string name in a hash table, mapping it to a pointer.
Definition: internalName.h:38
const LVecBase2f & get_data2f()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
This class defines the physical layout of the vertex data stored within a Geom.
A thread; that is, a lightweight process.
Definition: thread.h:46
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
float get_data1f()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
bool is_at_end() const
Returns true if the reader is currently at the end of the list of vertices, false otherwise.
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
void set_row_unsafe(int row)
Sets the start row to the indicated value, without internal checks.
void clear()
Resets the GeomVertexReader to the initial state.
const LVecBase3d & get_data3d()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
int get_start_row() const
Returns the row index at which the reader started.
LMatrix4f get_matrix4f()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
LMatrix4 get_matrix4()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
const LVecBase4d & get_data4d()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
const LVecBase4i & get_data4i()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
This is the data for one array of a GeomVertexData structure.
PN_stdfloat get_data1()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
LMatrix3f get_matrix3f()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
GeomVertexReader(Thread *current_thread=Thread::get_current_thread())
Constructs an invalid GeomVertexReader.