Panda3D
Loading...
Searching...
No Matches
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 */
20GeomVertexReader(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 */
32GeomVertexReader(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 */
46GeomVertexReader(const GeomVertexData *vertex_data,
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 */
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 */
74GeomVertexReader(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 */
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 */
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 */
125INLINE void GeomVertexReader::
126operator = (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 */
144INLINE 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 */
153get_vertex_data() const {
154 return _vertex_data;
155}
156
157/**
158 * Returns the particular array object that the reader is currently
159 * processing.
160 */
162get_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 */
171get_array_handle() const {
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 */
181get_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 */
190get_current_thread() const {
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 */
206set_force(bool force) {
207 _force = force;
208}
209
210/**
211 * Returns the value of the force flag. See set_force().
212 */
214get_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 */
229set_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 */
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 */
274clear() {
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 */
284has_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 */
293get_array() const {
294 return _array;
295}
296
297/**
298 * Returns the description of the data type that the reader is working on.
299 */
301get_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 */
316set_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 */
330set_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 */
343get_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 */
352get_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 */
362is_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 */
371get_data1f() {
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 */
380INLINE const LVecBase2f &GeomVertexReader::
381get_data2f() {
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 */
390INLINE const LVecBase3f &GeomVertexReader::
391get_data3f() {
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 */
400INLINE const LVecBase4f &GeomVertexReader::
401get_data4f() {
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 */
411INLINE LMatrix3f GeomVertexReader::
412get_matrix3f() {
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 */
435INLINE LMatrix4f GeomVertexReader::
436get_matrix4f() {
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 */
461get_data1d() {
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 */
470INLINE const LVecBase2d &GeomVertexReader::
471get_data2d() {
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 */
480INLINE const LVecBase3d &GeomVertexReader::
481get_data3d() {
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 */
490INLINE const LVecBase4d &GeomVertexReader::
491get_data4d() {
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 */
501INLINE LMatrix3d GeomVertexReader::
502get_matrix3d() {
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 */
525INLINE LMatrix4d GeomVertexReader::
526get_matrix4d() {
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 */
550INLINE PN_stdfloat GeomVertexReader::
551get_data1() {
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 */
563INLINE const LVecBase2 &GeomVertexReader::
564get_data2() {
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 */
576INLINE const LVecBase3 &GeomVertexReader::
577get_data3() {
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 */
589INLINE const LVecBase4 &GeomVertexReader::
590get_data4() {
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 */
603INLINE LMatrix3 GeomVertexReader::
604get_matrix3() {
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 */
617INLINE LMatrix4 GeomVertexReader::
618get_matrix4() {
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 */
631get_data1i() {
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 */
640INLINE const LVecBase2i &GeomVertexReader::
641get_data2i() {
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 */
650INLINE const LVecBase3i &GeomVertexReader::
651get_data3i() {
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 */
660INLINE const LVecBase4i &GeomVertexReader::
661get_data4i() {
662 nassertr(has_column(), LVecBase4i::zero());
663 return _packer->get_data4i(inc_pointer());
664}
665
666/**
667 * Returns the reader's Packer object.
668 */
669INLINE GeomVertexColumn::Packer *GeomVertexReader::
670get_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 */
683INLINE bool GeomVertexReader::
684set_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 */
702INLINE void GeomVertexReader::
703quick_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 */
725INLINE const unsigned char *GeomVertexReader::
726inc_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...
This data object is returned by GeomVertexArrayData::get_handle() or modify_handle().
This is the data for one array of a GeomVertexData structure.
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 get_element_stride() const
This value is only relevant for matrix types.
int get_num_elements() const
Returns the number of times this column is repeated.
Contents get_contents() const
Returns the token representing the semantic meaning of the stored value.
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This class defines the physical layout of the vertex data stored within a Geom.
int get_array_with(size_t i) const
Returns the index number of the array with the ith column.
get_column
Returns the ith column of the specification, across all arrays.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
bool set_column(int column)
Sets up the reader to use the nth data type of the GeomVertexFormat, numbering from 0.
bool is_at_end() const
Returns true if the reader is currently at the end of the list of vertices, false otherwise.
double get_data1d()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
const LVecBase4d & get_data4d()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
const LVecBase4f & get_data4f()
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...
const LVecBase3f & get_data3f()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
const LVecBase3i & get_data3i()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
LMatrix3 get_matrix3()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
int get_array() const
Returns the array index containing the data type that the reader is working on.
LMatrix3d get_matrix3d()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
void clear()
Resets the GeomVertexReader to the initial state.
const LVecBase2f & get_data2f()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
void set_force(bool force)
Sets the value of the force flag.
LMatrix4 get_matrix4()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
const GeomVertexColumn * get_column() const
Returns the description of the data type that the reader is working on.
LMatrix4d get_matrix4d()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
void set_row_unsafe(int row)
Sets the start row to the indicated value, without internal checks.
LMatrix3f get_matrix3f()
Returns the 3-by-3 matrix associated with the read row and advances the read row.
const LVecBase4 & get_data4()
Returns the data associated with the read row, expressed as a 4-component value, and advances the rea...
PN_stdfloat get_data1()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
int get_data1i()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
LMatrix4f get_matrix4f()
Returns the 4-by-4 matrix associated with the read row and advances the read row.
const GeomVertexData * get_vertex_data() const
Returns the vertex data object that the reader is processing.
const LVecBase2 & get_data2()
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...
const LVecBase2i & get_data2i()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
bool get_force() const
Returns the value of the force flag.
int get_start_row() const
Returns the row index at which the reader started.
void set_row(int row)
Sets the start row to the indicated value.
int get_read_row() const
Returns the row index from which the data will be retrieved by the next call to get_data*().
float get_data1f()
Returns the data associated with the read row, expressed as a 1-component value, and advances the rea...
const GeomVertexArrayDataHandle * get_array_handle() const
Returns the read handle to the array object that the read is currently processing.
const LVecBase3d & get_data3d()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
size_t get_stride() const
Returns the per-row stride (bytes between consecutive rows) of the underlying vertex array.
const LVecBase2d & get_data2d()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
const LVecBase3 & get_data3()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
const GeomVertexArrayData * get_array_data() const
Returns the particular array object that the reader is currently processing.
GeomVertexReader(Thread *current_thread=Thread::get_current_thread())
Constructs an invalid GeomVertexReader.
Encodes a string name in a hash table, mapping it to a pointer.
A thread; that is, a lightweight process.
Definition thread.h:46