GeomVertexReader
from panda3d.core import GeomVertexReader
- class GeomVertexReader
Bases:
GeomEnums
This object provides a high-level interface for quickly reading a sequence of numeric values from a vertex table.
It is particularly optimized for reading a single column of data values for a series of vertices, without changing columns between each number. Although you can also use one GeomVertexReader to read across the columns if it is convenient, by calling set_column() repeatedly at each vertex, it is faster to read down the columns, and to use a different GeomVertexReader for each column.
Note that a GeomVertexReader does not keep a reference count to the actual vertex data buffer (it grabs the current data buffer from the GeomVertexData whenever set_column() is called). This means that it is important not to keep a GeomVertexReader object around over a long period of time in which the data buffer is likely to be deallocated; it is intended for making a quick pass over the data in one session.
It also means that you should create any GeomVertexWriters before creating GeomVertexReaders on the same data, since the writer itself might cause the vertex buffer to be deallocated. Better yet, use a GeomVertexRewriter if you are going to create both of them anyway.
Inheritance diagram
- __init__(*args, **kwargs)
- assign()
C++ Interface: assign(const GeomVertexReader self, const GeomVertexReader copy)
- clear()
C++ Interface: clear(const GeomVertexReader self)
- /**
Resets the GeomVertexReader to the initial state.
*/
- getArray()
C++ Interface: get_array(GeomVertexReader self)
- /**
Returns the array index containing the data type that the reader is working
on.
*/
- getArrayData()
C++ Interface: get_array_data(GeomVertexReader self)
- /**
Returns the particular array object that the reader is currently
processing.
*/
- getArrayHandle()
C++ Interface: get_array_handle(GeomVertexReader self)
- /**
Returns the read handle to the array object that the read is currently
processing. This low-level call should be used with caution.
*/
- getColumn()
C++ Interface: get_column(GeomVertexReader self)
- /**
Returns the description of the data type that the reader is working on.
*/
- getCurrentThread()
C++ Interface: get_current_thread(GeomVertexReader self)
- /**
Returns the Thread pointer of the currently-executing thread, as passed to
the constructor of this object.
*/
- getData1()
C++ Interface: get_data1(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- getData1d()
C++ Interface: get_data1d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- getData1f()
C++ Interface: get_data1f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- getData1i()
C++ Interface: get_data1i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- getData2()
C++ Interface: get_data2(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- getData2d()
C++ Interface: get_data2d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- getData2f()
C++ Interface: get_data2f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- getData2i()
C++ Interface: get_data2i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- getData3()
C++ Interface: get_data3(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- getData3d()
C++ Interface: get_data3d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- getData3f()
C++ Interface: get_data3f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- getData3i()
C++ Interface: get_data3i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- getData4()
C++ Interface: get_data4(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- getData4d()
C++ Interface: get_data4d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- getData4f()
C++ Interface: get_data4f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- getData4i()
C++ Interface: get_data4i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- getForce()
C++ Interface: get_force(GeomVertexReader self)
- /**
Returns the value of the force flag. See set_force().
*/
- getMatrix3()
C++ Interface: get_matrix3(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getMatrix3d()
C++ Interface: get_matrix3d(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getMatrix3f()
C++ Interface: get_matrix3f(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getMatrix4()
C++ Interface: get_matrix4(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getMatrix4d()
C++ Interface: get_matrix4d(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getMatrix4f()
C++ Interface: get_matrix4f(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- getReadRow()
C++ Interface: get_read_row(GeomVertexReader self)
- /**
Returns the row index from which the data will be retrieved by the next
call to get_data*().
*/
- getStartRow()
C++ Interface: get_start_row(GeomVertexReader self)
- /**
Returns the row index at which the reader started. It will return to this
row if you reset the current column.
*/
- getStride()
C++ Interface: get_stride(GeomVertexReader self)
- /**
Returns the per-row stride (bytes between consecutive rows) of the
underlying vertex array. This low-level information is normally not needed
to use the GeomVertexReader directly.
*/
- getVertexData()
C++ Interface: get_vertex_data(GeomVertexReader self)
- /**
Returns the vertex data object that the reader is processing. This may
return NULL if the reader was constructed with just an array pointer.
*/
- get_array()
C++ Interface: get_array(GeomVertexReader self)
- /**
Returns the array index containing the data type that the reader is working
on.
*/
- get_array_data()
C++ Interface: get_array_data(GeomVertexReader self)
- /**
Returns the particular array object that the reader is currently
processing.
*/
- get_array_handle()
C++ Interface: get_array_handle(GeomVertexReader self)
- /**
Returns the read handle to the array object that the read is currently
processing. This low-level call should be used with caution.
*/
- get_column()
C++ Interface: get_column(GeomVertexReader self)
- /**
Returns the description of the data type that the reader is working on.
*/
- get_current_thread()
C++ Interface: get_current_thread(GeomVertexReader self)
- /**
Returns the Thread pointer of the currently-executing thread, as passed to
the constructor of this object.
*/
- get_data1()
C++ Interface: get_data1(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- get_data1d()
C++ Interface: get_data1d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- get_data1f()
C++ Interface: get_data1f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- get_data1i()
C++ Interface: get_data1i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 1-component
value, and advances the read row.
*/
- get_data2()
C++ Interface: get_data2(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- get_data2d()
C++ Interface: get_data2d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- get_data2f()
C++ Interface: get_data2f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- get_data2i()
C++ Interface: get_data2i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 2-component
value, and advances the read row.
*/
- get_data3()
C++ Interface: get_data3(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- get_data3d()
C++ Interface: get_data3d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- get_data3f()
C++ Interface: get_data3f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- get_data3i()
C++ Interface: get_data3i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 3-component
value, and advances the read row.
*/
- get_data4()
C++ Interface: get_data4(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- get_data4d()
C++ Interface: get_data4d(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- get_data4f()
C++ Interface: get_data4f(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- get_data4i()
C++ Interface: get_data4i(const GeomVertexReader self)
- /**
Returns the data associated with the read row, expressed as a 4-component
value, and advances the read row.
*/
- get_force()
C++ Interface: get_force(GeomVertexReader self)
- /**
Returns the value of the force flag. See set_force().
*/
- get_matrix3()
C++ Interface: get_matrix3(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_matrix3d()
C++ Interface: get_matrix3d(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_matrix3f()
C++ Interface: get_matrix3f(const GeomVertexReader self)
- /**
Returns the 3-by-3 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_matrix4()
C++ Interface: get_matrix4(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_matrix4d()
C++ Interface: get_matrix4d(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_matrix4f()
C++ Interface: get_matrix4f(const GeomVertexReader self)
- /**
Returns the 4-by-4 matrix associated with the read row and advances the
read row. This is a special method that only works when the column in
question contains a matrix of an appropriate size.
*/
- get_read_row()
C++ Interface: get_read_row(GeomVertexReader self)
- /**
Returns the row index from which the data will be retrieved by the next
call to get_data*().
*/
- get_start_row()
C++ Interface: get_start_row(GeomVertexReader self)
- /**
Returns the row index at which the reader started. It will return to this
row if you reset the current column.
*/
- get_stride()
C++ Interface: get_stride(GeomVertexReader self)
- /**
Returns the per-row stride (bytes between consecutive rows) of the
underlying vertex array. This low-level information is normally not needed
to use the GeomVertexReader directly.
*/
- get_vertex_data()
C++ Interface: get_vertex_data(GeomVertexReader self)
- /**
Returns the vertex data object that the reader is processing. This may
return NULL if the reader was constructed with just an array pointer.
*/
- hasColumn()
C++ Interface: has_column(GeomVertexReader self)
- /**
Returns true if a valid data type has been successfully set, or false if
the data type does not exist (or if get_force() is false and the vertex
data is nonresident).
*/
- has_column()
C++ Interface: has_column(GeomVertexReader self)
- /**
Returns true if a valid data type has been successfully set, or false if
the data type does not exist (or if get_force() is false and the vertex
data is nonresident).
*/
- isAtEnd()
C++ Interface: is_at_end(GeomVertexReader self)
- /**
Returns true if the reader is currently at the end of the list of vertices,
false otherwise. If this is true, another call to get_data*() will result
in a crash.
*/
- is_at_end()
C++ Interface: is_at_end(GeomVertexReader self)
- /**
Returns true if the reader is currently at the end of the list of vertices,
false otherwise. If this is true, another call to get_data*() will result
in a crash.
*/
- setColumn()
C++ Interface: set_column(const GeomVertexReader self, const InternalName name) set_column(const GeomVertexReader self, int column) set_column(const GeomVertexReader self, int array, const GeomVertexColumn column)
- /**
Sets up the reader to use the nth data type of the GeomVertexFormat,
numbering from 0.
This also resets the read row number to the start row (the same value
passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- /**
Sets up the reader to use the data type with the indicated name.
This also resets the read row number to the start row (the same value
passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- /**
Sets up the reader to use the indicated column description on the given
array.
This also resets the current read row number to the start row (the same
value passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- setForce()
C++ Interface: set_force(const GeomVertexReader self, bool force)
- /**
Sets the value of the force flag. When this is true (the default), vertex
data will be paged in from disk if necessary. When this is false, the
GeomVertexData will simply return a failure code when attempting to read
vertex data that is not resident (but will put it on the queue to become
resident later).
Normally, vertex data is always resident, so this will not be an issue. It
is only possible for vertex data to be nonresident if you have enabled
vertex paging via the GeomVertexArrayData and VertexDataPage interfaces.
*/
- setRow()
C++ Interface: set_row(const GeomVertexReader self, int row)
- /**
Sets the start row to the indicated value. The reader will begin reading
from the indicated row; each subsequent get_data*() call will return the
data from the subsequent row. If set_column() is called, the reader will
return to this row.
*/
- setRowUnsafe()
C++ Interface: set_row_unsafe(const GeomVertexReader self, int row)
- /**
Sets the start row to the indicated value, without internal checks. This
is the same as set_row(), but it does not check for the possibility that
the array has been reallocated internally for some reason; use only when
you are confident that the array is unchanged and you really need every bit
of available performance.
*/
- set_column()
C++ Interface: set_column(const GeomVertexReader self, const InternalName name) set_column(const GeomVertexReader self, int column) set_column(const GeomVertexReader self, int array, const GeomVertexColumn column)
- /**
Sets up the reader to use the nth data type of the GeomVertexFormat,
numbering from 0.
This also resets the read row number to the start row (the same value
passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- /**
Sets up the reader to use the data type with the indicated name.
This also resets the read row number to the start row (the same value
passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- /**
Sets up the reader to use the indicated column description on the given
array.
This also resets the current read row number to the start row (the same
value passed to a previous call to set_row(), or 0 if set_row() was never
called.)
The return value is true if the data type is valid, false otherwise.
*/
- set_force()
C++ Interface: set_force(const GeomVertexReader self, bool force)
- /**
Sets the value of the force flag. When this is true (the default), vertex
data will be paged in from disk if necessary. When this is false, the
GeomVertexData will simply return a failure code when attempting to read
vertex data that is not resident (but will put it on the queue to become
resident later).
Normally, vertex data is always resident, so this will not be an issue. It
is only possible for vertex data to be nonresident if you have enabled
vertex paging via the GeomVertexArrayData and VertexDataPage interfaces.
*/
- set_row()
C++ Interface: set_row(const GeomVertexReader self, int row)
- /**
Sets the start row to the indicated value. The reader will begin reading
from the indicated row; each subsequent get_data*() call will return the
data from the subsequent row. If set_column() is called, the reader will
return to this row.
*/
- set_row_unsafe()
C++ Interface: set_row_unsafe(const GeomVertexReader self, int row)
- /**
Sets the start row to the indicated value, without internal checks. This
is the same as set_row(), but it does not check for the possibility that
the array has been reallocated internally for some reason; use only when
you are confident that the array is unchanged and you really need every bit
of available performance.
*/