GeomVertexArrayDataHandle

class GeomVertexArrayDataHandle

Bases: ReferenceCount, GeomEnums

This data object is returned by GeomVertexArrayData::get_handle() or modify_handle(). As long as it exists, the data is locked; when the last of these destructs, the data is unlocked.

Only one thread at a time may lock the data; other threads attempting to lock the data will block. A given thread may simultaneously lock the data multiple times.

This class serves in lieu of a pair of GeomVertexArrayDataPipelineReader and GeomVertexArrayDataPipelineWriter classes

Inheritance diagram

Inheritance diagram of GeomVertexArrayDataHandle

void clear_rows(void)
void copy_data_from(GeomVertexArrayDataHandle const *other)
void copy_data_from(unsigned char const *source, std::size_t size)
void copy_data_from(PyObject *buffer)

Copies the entire data array from the other object.

Copies the entire data array from the buffer.

void copy_subdata_from(std::size_t to_start, std::size_t to_size, GeomVertexArrayDataHandle const *other, std::size_t from_start, std::size_t from_size)
void copy_subdata_from(std::size_t to_start, std::size_t to_size, unsigned char const *source, std::size_t from_start, std::size_t from_size)
void copy_subdata_from(std::size_t to_start, std::size_t to_size, PyObject *buffer)
void copy_subdata_from(std::size_t to_start, std::size_t to_size, PyObject *buffer, std::size_t from_start, std::size_t from_size)

Copies a portion of the data array from the other object into a portion of the data array of this object. If to_size != from_size, the size of this data array is adjusted accordingly.

Copies a portion of the data array from the buffer into a portion of the data array of this object. If to_size != from_size, the size of this data array is adjusted accordingly.

GeomVertexArrayFormat const *get_array_format(void) const
static TypeHandle get_class_type(void)
vector_uchar get_data(void) const

Returns the entire raw data of the GeomVertexArrayData object, formatted as a string. This is primarily for the benefit of high-level languages such as Python.

std::size_t get_data_size_bytes(void) const
UpdateSeq get_modified(void) const
int get_num_rows(void) const
GeomVertexArrayData const *get_object(void) const
GeomVertexArrayData *get_object(void)
vector_uchar get_subdata(std::size_t start, std::size_t size) const

Returns a subset of the raw data of the GeomVertexArrayData object, formatted as a string. This is primarily for the benefit of high-level languages such as Python.

GeomEnums::UsageHint get_usage_hint(void) const
void mark_used(void) const

Marks the array data recently-used.

VertexBufferContext *prepare_now(PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg) const

Creates a context for the data on the particular GSG, if it does not already exist. Returns the new (or old) VertexBufferContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use prepare() instead.

Normally, this is not called directly except by the GraphicsStateGuardian; a data does not need to be explicitly prepared by the user before it may be rendered.

bool request_resident(void) const

Returns true if the vertex data is currently resident in memory. If this returns true, the next call to get_handle()->get_read_pointer() will probably not block. If this returns false, the vertex data will be brought back into memory shortly; try again later.

bool reserve_num_rows(int n)
void set_data(vector_uchar const &data)

Replaces the entire raw data array with the contents of the indicated string. This is primarily for the benefit of high-level languages like Python.

bool set_num_rows(int n)
void set_subdata(std::size_t start, std::size_t size, vector_uchar const &data)

Replaces a portion of the data array from the indicated string. If size != data.size(), the size of this data array is adjusted accordingly.

This is primarily for the benefit of high-level languages like Python.

bool unclean_set_num_rows(int n)