27 _current_thread(current_thread)
41 _vertex_data(vertex_data),
42 _current_thread(current_thread)
58 _vertex_data(vertex_data),
59 _current_thread(current_thread)
74 _array_data(array_data),
75 _current_thread(current_thread)
89 _array_data(array_data),
90 _current_thread(current_thread)
105 const InternalName *name,
bool force) :
106 _vertex_data(data_reader->get_object()),
111 const GeomVertexFormat *format = data_reader->get_format();
112 set_vertex_column(format->get_array_with(name),
113 format->get_column(name),
124 _vertex_data(copy._vertex_data),
126 _array_data(copy._array_data),
127 _current_thread(copy._current_thread),
128 _packer(copy._packer),
129 _stride(copy._stride),
130 _handle(copy._handle),
131 _pointer_begin(copy._pointer_begin),
132 _pointer_end(copy._pointer_end),
133 _pointer(copy._pointer),
134 _start_row(copy._start_row),
144 INLINE
void GeomVertexReader::
146 _vertex_data = copy._vertex_data;
147 _array = copy._array;
148 _array_data = copy._array_data;
149 _current_thread = copy._current_thread;
150 _packer = copy._packer;
151 _stride = copy._stride;
152 _handle = copy._handle;
153 _pointer_begin = copy._pointer_begin;
154 _pointer_end = copy._pointer_end;
155 _pointer = copy._pointer;
156 _start_row = copy._start_row;
157 _force = copy._force;
165 INLINE GeomVertexReader::
166 ~GeomVertexReader() {
225 return _current_thread;
277 reader.check_array_readers();
278 const GeomVertexFormat *format = reader.get_format();
279 return set_vertex_column(format->get_array_with(column),
280 format->get_column(column),
284 return set_array_column(_array_data->get_array_format()->get_column(column));
306 reader.check_array_readers();
307 const GeomVertexFormat *format = reader.get_format();
308 return set_vertex_column(format->get_array_with(name),
309 format->get_column(name),
313 return set_array_column(_array_data->get_array_format()->get_column(name));
339 return (_packer != (GeomVertexColumn::Packer *)NULL);
361 if (_packer != (GeomVertexColumn::Packer *)NULL) {
362 return _packer->_column;
382 quick_set_pointer(_start_row);
399 bool result = set_pointer(_start_row);
424 return (
int)(_pointer - _pointer_begin) / _stride;
437 return _pointer >= _pointer_end;
450 return _packer->get_data1f(inc_pointer());
463 return _packer->get_data2f(inc_pointer());
476 return _packer->get_data3f(inc_pointer());
489 return _packer->get_data4f(inc_pointer());
503 _packer->_column->get_contents() == C_matrix &&
504 _packer->_column->get_num_elements() >= 3,
507 size_t col_stride = _packer->_column->get_element_stride();
508 const unsigned char *pointer = inc_pointer();
511 mat.
set_row(0, _packer->get_data3f(pointer));
512 pointer += col_stride;
513 mat.
set_row(1, _packer->get_data3f(pointer));
514 pointer += col_stride;
515 mat.
set_row(2, _packer->get_data3f(pointer));
530 _packer->_column->get_contents() == C_matrix &&
531 _packer->_column->get_num_elements() >= 4,
534 size_t col_stride = _packer->_column->get_element_stride();
535 const unsigned char *pointer = inc_pointer();
538 mat.
set_row(0, _packer->get_data4f(pointer));
539 pointer += col_stride;
540 mat.
set_row(1, _packer->get_data4f(pointer));
541 pointer += col_stride;
542 mat.
set_row(2, _packer->get_data4f(pointer));
543 pointer += col_stride;
544 mat.
set_row(3, _packer->get_data4f(pointer));
558 return _packer->get_data1d(inc_pointer());
571 return _packer->get_data2d(inc_pointer());
584 return _packer->get_data3d(inc_pointer());
597 return _packer->get_data4d(inc_pointer());
611 _packer->_column->get_contents() == C_matrix &&
612 _packer->_column->get_num_elements() >= 3,
615 size_t col_stride = _packer->_column->get_element_stride();
616 const unsigned char *pointer = inc_pointer();
619 mat.
set_row(0, _packer->get_data3d(pointer));
620 pointer += col_stride;
621 mat.
set_row(1, _packer->get_data3d(pointer));
622 pointer += col_stride;
623 mat.
set_row(2, _packer->get_data3d(pointer));
638 _packer->_column->get_contents() == C_matrix &&
639 _packer->_column->get_num_elements() >= 4,
642 size_t col_stride = _packer->_column->get_element_stride();
643 const unsigned char *pointer = inc_pointer();
646 mat.
set_row(0, _packer->get_data4d(pointer));
647 pointer += col_stride;
648 mat.
set_row(1, _packer->get_data4d(pointer));
649 pointer += col_stride;
650 mat.
set_row(2, _packer->get_data4d(pointer));
651 pointer += col_stride;
652 mat.
set_row(3, _packer->get_data4d(pointer));
665 #ifndef STDFLOAT_DOUBLE 681 #ifndef STDFLOAT_DOUBLE 697 #ifndef STDFLOAT_DOUBLE 713 #ifndef STDFLOAT_DOUBLE 730 #ifndef STDFLOAT_DOUBLE 747 #ifndef STDFLOAT_DOUBLE 764 return _packer->get_data1i(inc_pointer());
777 return _packer->get_data2i(inc_pointer());
790 return _packer->get_data3i(inc_pointer());
803 return _packer->get_data4i(inc_pointer());
811 INLINE GeomVertexColumn::Packer *GeomVertexReader::
828 INLINE
bool GeomVertexReader::
829 set_pointer(
int row) {
830 _pointer_begin = _handle->get_read_pointer(_force);
831 if (_pointer_begin == NULL && _handle->get_data_size_bytes() != 0) {
838 _pointer_end = _pointer_begin + _handle->get_data_size_bytes();
839 quick_set_pointer(row);
850 INLINE
void GeomVertexReader::
851 quick_set_pointer(
int row) {
852 nassertv(
has_column() && (_pointer_begin != NULL || row == 0));
856 nassertv(_pointer_begin == _handle->get_read_pointer(
true));
859 _pointer = _pointer_begin + _packer->_column->get_start() + _stride * row;
865 nassertv(_pointer_begin == _pointer_end || (_pointer - _packer->_column->get_start()) <= _pointer_end);
875 INLINE
const unsigned char *GeomVertexReader::
878 nassertr(_pointer < _pointer_end, empty_buffer);
880 nassertr(_pointer_begin == _handle->get_read_pointer(
true), empty_buffer);
881 nassertr(_pointer < _pointer_begin + _handle->get_data_size_bytes(), empty_buffer);
884 const unsigned char *orig_pointer = _pointer;
static const LMatrix4f & ident_mat()
Returns an identity matrix.
This is the base class for all three-component vectors and points.
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This is a 4-by-4 transform matrix.
static const LMatrix3f & ident_mat()
Returns an identity matrix.
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. ...
static const LVecBase2i & zero()
Returns a zero-length vector.
This is the base class for all two-component vectors and points.
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.
static const LVecBase3i & zero()
Returns a zero-length vector.
const LVecBase3i & get_data3i()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
This is the base class for all two-component vectors and points.
bool get_force() const
Returns the value of the force flag.
static const LVecBase4d & zero()
Returns a zero-length vector.
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...
This is the base class for all three-component vectors and points.
const LVecBase3f & get_data3f()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
static const LVecBase2f & zero()
Returns a zero-length vector.
void set_row(int row, const LVecBase3f &v)
Replaces the indicated row of the matrix from a three-component vector.
static const LVecBase4i & zero()
Returns a zero-length vector.
static const LVecBase3f & zero()
Returns a zero-length vector.
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...
This is the base class for all three-component vectors and points.
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.
void set_row(int row, const LVecBase4d &v)
Replaces the indicated row of the matrix.
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*().
This is a 3-by-3 transform matrix.
LMatrix3d get_matrix3d()
Returns the 3-by-3 matrix associated with the read row and advances the read row. ...
void set_row(int row, const LVecBase3d &v)
Replaces the indicated row of the matrix from a three-component vector.
This is a 4-by-4 transform matrix.
static const LMatrix4d & ident_mat()
Returns an identity matrix.
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...
static const LVecBase3d & zero()
Returns a zero-length vector.
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...
This is the base class for all two-component vectors and points.
This is the base class for all three-component vectors and points.
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...
const LVecBase2f & get_data2f()
Returns the data associated with the read row, expressed as a 2-component value, and advances the rea...
static const LVecBase2d & zero()
Returns a zero-length vector.
This is the base class for all three-component vectors and points.
This is the base class for all three-component vectors and points.
A thread; that is, a lightweight process.
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(int row, const LVecBase4f &v)
Replaces the indicated row of the matrix.
void set_row_unsafe(int row)
Sets the start row to the indicated value, without internal checks.
static const LMatrix3d & ident_mat()
Returns an identity matrix.
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...
This is a 3-by-3 transform matrix.
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.
static const LVecBase4f & zero()
Returns a zero-length vector.
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.