Panda3D
|
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particular GeomVertexFormat object. More...
Public Types | |
enum | AnimationType { ATNone = 0, ATPanda = 1, ATHardware = 2 } |
enum | Contents { COther = 0, CPoint = 1, CClipPoint = 2, CVector = 3, CTexcoord = 4, CColor = 5, CIndex = 6, CMorphDelta = 7 } |
enum | GeomRendering { GRIndexedPoint = 1, GRIndexedOther = 65536, GRIndexedBits = 65537, GRPoint = 2, GRPointUniformSize = 4, GRPerPointSize = 8, GRPointPerspective = 16, GRPointAspectRatio = 32, GRPointScale = 64, GRPointRotate = 128, GRPointSprite = 256, GRPointSpriteTexMatrix = 512, GRPointBits = 1022, GRTriangleStrip = 1024, GRTriangleFan = 2048, GRLineStrip = 4096, GRCompositeBits = 7168, GRFlatFirstVertex = 8192, GRFlatLastVertex = 16384, GRShadeModelBits = 24576, GRTexcoordLightVector = 32768 } |
enum | NumericType { NTUint8 = 0, NTUint16 = 1, NTUint32 = 2, NTPackedDcba = 3, NTPackedDabc = 4, NTFloat32 = 5 } |
enum | PrimitiveType { PTNone = 0, PTPolygons = 1, PTLines = 2, PTPoints = 3 } |
enum | ShadeModel { SMUniform = 0, SMSmooth = 1, SMFlatFirstVertex = 2, SMFlatLastVertex = 3 } |
enum | UsageHint { UHClient = 0, UHStream = 1, UHDynamic = 2, UHStatic = 3, UHUnspecified = 4 } |
Public Member Functions | |
GeomVertexData (GeomVertexData const copy) | |
GeomVertexData (GeomVertexData const copy, GeomVertexFormat const format) | |
This constructor copies all of the basic properties of the source VertexData, like usage_hint and animation tables, but does not copy the actual data, and it allows you to specify a different format. | |
GeomVertexData (string name, GeomVertexFormat const format, UsageHint usage_hint) | |
GeomVertexData const | animateVertices (bool force, Thread current_thread) |
Returns a GeomVertexData that represents the results of computing the vertex animation on the CPU for this GeomVertexData. | |
cacheRef () | |
See CachedTypedWritableReferenceCount.cache_ref(). | |
bool | cacheUnref () |
Explicitly decrements the cache reference count and the normal reference count simultaneously. | |
clearAnimatedVertices () | |
Removes the cache of animated vertices computed by a previous call to animate_vertices() within the same frame. | |
clearCache () | |
Removes all of the previously-cached results of convert_to(). | |
clearCacheStage () | |
Removes all of the previously-cached results of convert_to(), at the current pipeline stage and upstream. | |
clearRows () | |
Removes all of the rows from the arrays; functionally equivalent to set_num_rows(0) (but faster). | |
clearSliderTable () | |
Sets the SliderTable pointer to NULL, removing the table from the vertex data. | |
clearTransformBlendTable () | |
Sets the TransformBlendTable pointer to NULL, removing the table from the vertex data. | |
clearTransformTable () | |
Sets the TransformTable pointer to NULL, removing the table from the vertex data. | |
int | compareTo (GeomVertexData const other) |
Returns 0 if the two objects are equivalent, even if they are not the same pointer. | |
GeomVertexData const | convertTo (GeomVertexFormat const new_format) |
Returns a new GeomVertexData that represents the same contents as this one, with all data types matched up name-by-name to the indicated new format. | |
copyFrom (GeomVertexData const source, bool keep_data_objects) | |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name. | |
copyFrom (GeomVertexData const source, bool keep_data_objects, Thread current_thread) | |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name. | |
copyRowFrom (int dest_row, GeomVertexData const source, int source_row, Thread current_thread) | |
Copies a single row of the data from the other array into the indicated row of this array. | |
describeVertex (ostream out, int row) | |
Writes a verbose, human-friendly description of the indicated vertex number. | |
bool | encodeToBamStream (basic_stringchar data, BamWriter writer) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
bool | encodeToBamStream (basic_stringchar data) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
string | encodeToBamStream () |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
GeomVertexArrayData const | getArray (int i) |
Returns a const pointer to the vertex data for the indicated array, for application code to directly examine (but not modify) the underlying vertex data. | |
list | getArrays () |
UpdateSeq | getBamModified () |
Returns the current bam_modified counter. | |
int | getCacheRefCount () |
Returns the current reference count. | |
GeomVertexFormat const | getFormat () |
Returns a pointer to the GeomVertexFormat structure that defines this data. | |
UpdateSeq | getModified (Thread current_thread) |
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified. | |
UpdateSeq | getModified () |
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified. | |
string | getName () |
Returns the name passed to the constructor, if any. | |
int | getNumArrays () |
Returns the number of individual arrays stored within the data. | |
int | getNumBytes () |
Returns the total number of bytes consumed by the different arrays of the vertex data. | |
int | getNumRows () |
Returns the number of rows stored within all the arrays. | |
int | getRefCount () |
Returns the current reference count. | |
SliderTable const | getSliderTable () |
Returns a const pointer to the SliderTable assigned to this data. | |
TransformBlendTable const | getTransformBlendTable () |
Returns a const pointer to the TransformBlendTable assigned to this data. | |
TransformTable const | getTransformTable () |
Returns a const pointer to the TransformTable assigned to this data. | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
UsageHint | getUsageHint () |
Returns the usage hint that was passed to the constructor, and which will be passed to each array data object created initially, and arrays created as the result of a convert_to() operation. | |
bool | hasColumn (InternalName const name) |
Returns true if the data has the named column, false otherwise. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
markBamModified () | |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
GeomVertexArrayData | modifyArray (int i) |
Returns a modifiable pointer to the indicated vertex array, so that application code may directly manipulate the data. | |
TransformBlendTable | modifyTransformBlendTable () |
Returns a modifiable pointer to the current TransformBlendTable on this vertex data, if any, or NULL if there is not a TransformBlendTable. | |
operator new (unsigned int size) | |
GeomVertexData | operator= (GeomVertexData const copy) |
The copy assignment operator is not pipeline-safe. | |
output (ostream out) | |
PyObject | reduce (PyObject self) |
This special Python method is implement to provide support for the pickle module. | |
PyObject | reducePersist (PyObject self, PyObject pickler) |
This special Python method is implement to provide support for the pickle module. | |
ref () | |
Explicitly increments the reference count. | |
GeomVertexData | replaceColumn (InternalName name, int num_components, NumericType numeric_type, Contents contents) |
Returns a new GeomVertexData object, suitable for modification, with the indicated data type replaced with a new table filled with undefined values. | |
bool | requestResident () |
Returns true if the vertex data is currently resident in memory. | |
GeomVertexData const | reverseNormals () |
Returns a new GeomVertexData object with the normal data modified in-place, so that each lighting normal is now facing in the opposite direction. | |
GeomVertexData const | scaleColor (VBase4 const color_scale, int num_components, NumericType numeric_type, Contents contents) |
Returns a new GeomVertexData object with the color table replaced with a new color table that has been scaled by the indicated value. | |
GeomVertexData const | scaleColor (VBase4 const color_scale) |
Returns a new GeomVertexData object with the color table modified in-place to apply the indicated scale. | |
setArray (int i, GeomVertexArrayData const array) | |
Replaces the indicated vertex data array with a completely new array. | |
GeomVertexData const | setColor (VBase4 const color, int num_components, NumericType numeric_type, Contents contents) |
Returns a new GeomVertexData object with the color table replaced with a new color table for which each vertex has the indicated value. | |
GeomVertexData const | setColor (VBase4 const color) |
Returns a new GeomVertexData object with the color data modified in-place with the new value. | |
setFormat (GeomVertexFormat const format) | |
Changes the format of the vertex data. | |
setName (string name) | |
Changes the name of the vertex data. | |
bool | setNumRows (int n) |
Sets the length of the array to n rows in all of the various arrays (presumably by adding rows). | |
setSliderTable (SliderTable const table) | |
Replaces the SliderTable on this vertex data with the indicated table. | |
setTransformBlendTable (TransformBlendTable const table) | |
Replaces the TransformBlendTable on this vertex data with the indicated table. | |
setTransformTable (TransformTable const table) | |
Replaces the TransformTable on this vertex data with the indicated table. | |
setUsageHint (UsageHint usage_hint) | |
Changes the UsageHint hint for this vertex data, and for all of the arrays that share this data. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | uncleanSetNumRows (int n) |
This method behaves like set_num_rows(), except the new data is not initialized. | |
bool | unref () |
Explicitly decrements the reference count. | |
write (ostream out) | |
write (ostream out, int indent_level) | |
Static Public Member Functions | |
static TypedWritableReferenceCount | decodeFromBamStream (string data, BamReader reader) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypedWritableReferenceCount | decodeFromBamStream (string data) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypeHandle | getClassType () |
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particular GeomVertexFormat object.
The data consists of one or more arrays, each of which in turn consists of a series of rows, one per vertex. All arrays should have the same number of rows; each vertex is defined by the column data from a particular row across all arrays.
Often, there will be only one array per Geom, and the various columns defined in the GeomVertexFormat will be interleaved within that array. However, it is also possible to have multiple different arrays, with a certain subset of the total columns defined in each array.
However the data is distributed, the effect is of a single table of vertices, where each vertex is represented by one row of the table.
In general, application code should not attempt to directly manipulate the vertex data through this structure; instead, use the GeomVertexReader, GeomVertexWriter, and GeomVertexRewriter objects to read and write vertex data at a high level.
enum AnimationType [inherited] |
enum Contents [inherited] |
enum GeomRendering [inherited] |
enum NumericType [inherited] |
enum PrimitiveType [inherited] |
enum ShadeModel [inherited] |
enum UsageHint [inherited] |
GeomVertexData | ( | GeomVertexData const | copy | ) |
GeomVertexData | ( | GeomVertexData const | copy, |
GeomVertexFormat const | format | ||
) |
This constructor copies all of the basic properties of the source VertexData, like usage_hint and animation tables, but does not copy the actual data, and it allows you to specify a different format.
GeomVertexData | ( | string | name, |
GeomVertexFormat const | format, | ||
UsageHint | usage_hint | ||
) |
GeomVertexData const animateVertices | ( | bool | force, |
Thread | current_thread | ||
) |
Returns a GeomVertexData that represents the results of computing the vertex animation on the CPU for this GeomVertexData.
If there is no CPU-defined vertex animation on this object, this just returns the original object.
If there is vertex animation, but the VertexTransform values have not changed since last time, this may return the same pointer it returned previously. Even if the VertexTransform values have changed, it may still return the same pointer, but with its contents modified (this is preferred, since it allows the graphics backend to update vertex buffers optimally).
If force is false, this method may return immediately with stale data, if the vertex data is not completely resident. If force is true, this method will never return stale data, but may block until the data is available.
cacheRef | ( | ) | [inherited] |
See CachedTypedWritableReferenceCount.cache_ref().
Reimplemented from CachedTypedWritableReferenceCount.
bool cacheUnref | ( | ) | [inherited] |
Explicitly decrements the cache reference count and the normal reference count simultaneously.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in TransformState, and RenderState.
clearAnimatedVertices | ( | ) |
Removes the cache of animated vertices computed by a previous call to animate_vertices() within the same frame.
This will force the next call to animate_vertices() to recompute these values from scratch. Normally it is not necessary to call this.
clearCache | ( | ) |
Removes all of the previously-cached results of convert_to().
This blows away the entire cache, upstream and downstream the pipeline. Use clear_cache_stage() instead if you only want to blow away the cache at the current stage and upstream.
clearCacheStage | ( | ) |
Removes all of the previously-cached results of convert_to(), at the current pipeline stage and upstream.
Does not affect the downstream cache.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
clearRows | ( | ) |
Removes all of the rows from the arrays; functionally equivalent to set_num_rows(0) (but faster).
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
clearSliderTable | ( | ) |
Sets the SliderTable pointer to NULL, removing the table from the vertex data.
This disables morph (blend shape) animation.
clearTransformBlendTable | ( | ) |
Sets the TransformBlendTable pointer to NULL, removing the table from the vertex data.
This disables CPU-driven vertex animation.
clearTransformTable | ( | ) |
Sets the TransformTable pointer to NULL, removing the table from the vertex data.
This disables hardware-driven vertex animation.
int compareTo | ( | GeomVertexData const | other | ) |
Returns 0 if the two objects are equivalent, even if they are not the same pointer.
GeomVertexData const convertTo | ( | GeomVertexFormat const | new_format | ) |
Returns a new GeomVertexData that represents the same contents as this one, with all data types matched up name-by-name to the indicated new format.
copyFrom | ( | GeomVertexData const | source, |
bool | keep_data_objects | ||
) |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name.
keep_data_objects specifies what to do when one or more of the arrays can be copied without the need to apply any conversion operation. If it is true, the original GeomVertexArrayData objects in this object are retained, and their data arrays are copied byte-by-byte from the source; if it is false, then the GeomVertexArrayData objects are copied pointerwise from the source.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
copyFrom | ( | GeomVertexData const | source, |
bool | keep_data_objects, | ||
Thread | current_thread | ||
) |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name.
keep_data_objects specifies what to do when one or more of the arrays can be copied without the need to apply any conversion operation. If it is true, the original GeomVertexArrayData objects in this object are retained, and their data arrays are copied byte-by-byte from the source; if it is false, then the GeomVertexArrayData objects are copied pointerwise from the source.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
copyRowFrom | ( | int | dest_row, |
GeomVertexData const | source, | ||
int | source_row, | ||
Thread | current_thread | ||
) |
Copies a single row of the data from the other array into the indicated row of this array.
In this case, the source format must exactly match the destination format.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data, |
BamReader | reader | ||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data | ) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
Writes a verbose, human-friendly description of the indicated vertex number.
bool encodeToBamStream | ( | basic_stringchar | data, |
BamWriter | writer | ||
) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
string encodeToBamStream | ( | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
GeomVertexArrayData const getArray | ( | int | i | ) |
Returns a const pointer to the vertex data for the indicated array, for application code to directly examine (but not modify) the underlying vertex data.
list getArrays | ( | ) |
UpdateSeq getBamModified | ( | ) | [inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
int getCacheRefCount | ( | ) | [inherited] |
Returns the current reference count.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from CopyOnWriteObject.
GeomVertexFormat const getFormat | ( | ) |
Returns a pointer to the GeomVertexFormat structure that defines this data.
UpdateSeq getModified | ( | ) |
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified.
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified.
string getName | ( | ) |
Returns the name passed to the constructor, if any.
This name is reported on the PStats graph for vertex computations.
int getNumArrays | ( | ) |
Returns the number of individual arrays stored within the data.
This must match get_format()->get_num_arrays().
int getNumBytes | ( | ) |
Returns the total number of bytes consumed by the different arrays of the vertex data.
int getNumRows | ( | ) |
Returns the number of rows stored within all the arrays.
All arrays store data for the same n rows.
int getRefCount | ( | ) | [inherited] |
Returns the current reference count.
SliderTable const getSliderTable | ( | ) |
Returns a const pointer to the SliderTable assigned to this data.
Vertices within the vertex data will look up their morph offsets, if any, within this table.
This will return NULL if the vertex data does not have a SliderTable assigned.
TransformBlendTable const getTransformBlendTable | ( | ) |
Returns a const pointer to the TransformBlendTable assigned to this data.
Vertices within the table will index into this table to indicate their dynamic skinning information; this table is used when the vertex animation is to be performed by the CPU (but also see get_transform_table()).
This will return NULL if the vertex data does not have a TransformBlendTable assigned (which implies the vertices will not be animated by the CPU).
TransformTable const getTransformTable | ( | ) |
Returns a const pointer to the TransformTable assigned to this data.
Vertices within the table will index into this table to indicate their dynamic skinning information; this table is used when the vertex animation is to be performed by the graphics hardware (but also see get_transform_blend_table()).
This will return NULL if the vertex data does not have a TransformTable assigned (which implies the vertices will not be animated by the graphics hardware).
TypeHandle getType | ( | ) | [inherited] |
Reimplemented in AnimChannelBase.
int getTypeIndex | ( | ) | [inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
UsageHint getUsageHint | ( | ) |
Returns the usage hint that was passed to the constructor, and which will be passed to each array data object created initially, and arrays created as the result of a convert_to() operation.
See geomEnums.h.
However, each individual array may be replaced with a different array object with an independent usage hint specified, so there is no guarantee that the individual arrays all have the same usage_hint.
bool hasColumn | ( | InternalName const | name | ) |
Returns true if the data has the named column, false otherwise.
This is really just a shortcut for asking the same thing from the format.
bool isExactType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is the indicated type exactly.
bool isOfType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is or derives from the indicated type.
markBamModified | ( | ) | [inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
GeomVertexArrayData modifyArray | ( | int | i | ) |
Returns a modifiable pointer to the indicated vertex array, so that application code may directly manipulate the data.
You should avoid changing the length of this array, since all of the arrays should be kept in sync--use set_num_rows() instead.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
TransformBlendTable modifyTransformBlendTable | ( | ) |
Returns a modifiable pointer to the current TransformBlendTable on this vertex data, if any, or NULL if there is not a TransformBlendTable.
See get_transform_blend_table().
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
operator new | ( | unsigned int | size | ) |
GeomVertexData operator= | ( | GeomVertexData const | copy | ) |
The copy assignment operator is not pipeline-safe.
This will completely obliterate all stages of the pipeline, so don't do it for a GeomVertexData that is actively being used for rendering.
output | ( | ostream | out | ) |
PyObject reduce | ( | PyObject | self | ) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.
PyObject reducePersist | ( | PyObject | self, |
PyObject | pickler | ||
) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.
ref | ( | ) | [inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
GeomVertexData replaceColumn | ( | InternalName | name, |
int | num_components, | ||
NumericType | numeric_type, | ||
Contents | contents | ||
) |
Returns a new GeomVertexData object, suitable for modification, with the indicated data type replaced with a new table filled with undefined values.
The new table will be added as a new array; if the old table was interleaved with a previous array, the previous array will not be repacked.
If num_components is 0, the indicated name is simply removed from the type, without replacing it with anything else.
bool requestResident | ( | ) |
Returns true if the vertex data is currently resident in memory.
If this returns false, the vertex data will be brought back into memory shortly; try again later.
GeomVertexData const reverseNormals | ( | ) |
Returns a new GeomVertexData object with the normal data modified in-place, so that each lighting normal is now facing in the opposite direction.
If the vertex data does not include a normal column, this returns the original GeomVertexData object, unchanged.
GeomVertexData const scaleColor | ( | VBase4 const | color_scale | ) |
Returns a new GeomVertexData object with the color table modified in-place to apply the indicated scale.
If the vertex data does not include a color column, a new one will not be added.
GeomVertexData const scaleColor | ( | VBase4 const | color_scale, |
int | num_components, | ||
NumericType | numeric_type, | ||
Contents | contents | ||
) |
Returns a new GeomVertexData object with the color table replaced with a new color table that has been scaled by the indicated value.
The new color table will be added as a new array; if the old color table was interleaved with a previous array, the previous array will not be repacked.
setArray | ( | int | i, |
GeomVertexArrayData const | array | ||
) |
Replaces the indicated vertex data array with a completely new array.
You should be careful that the new array has the same length and format as the old one, unless you know what you are doing.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
GeomVertexData const setColor | ( | VBase4 const | color | ) |
Returns a new GeomVertexData object with the color data modified in-place with the new value.
If the vertex data does not include a color column, a new one will not be added.
GeomVertexData const setColor | ( | VBase4 const | color, |
int | num_components, | ||
NumericType | numeric_type, | ||
Contents | contents | ||
) |
Returns a new GeomVertexData object with the color table replaced with a new color table for which each vertex has the indicated value.
The new color table will be added as a new array; if the old color table was interleaved with a previous array, the previous array will not be repacked.
setFormat | ( | GeomVertexFormat const | format | ) |
Changes the format of the vertex data.
If the data is not empty, this will implicitly change every row to match the new format.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
setName | ( | string | name | ) |
Changes the name of the vertex data.
This name is reported on the PStats graph for vertex computations.
bool setNumRows | ( | int | n | ) |
Sets the length of the array to n rows in all of the various arrays (presumably by adding rows).
The new vertex data is initialized to 0, except for the "color" column, which is initialized to (1, 1, 1, 1).
The return value is true if the number of rows was changed, false if the object already contained n rows (or if there was some error).
Although this method is Published, application code only very rarely has any need to call it. Instead, you should use the GeomVertexWriter to build up the rows in a GeomVertexData object automatically, without need to explicitly set the number of rows.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
setSliderTable | ( | SliderTable const | table | ) |
Replaces the SliderTable on this vertex data with the indicated table.
There should be an entry in this table for each kind of morph offset defined in the vertex data.
The SliderTable object must have been registered prior to setting it on the GeomVertexData.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
setTransformBlendTable | ( | TransformBlendTable const | table | ) |
Replaces the TransformBlendTable on this vertex data with the indicated table.
The length of this table should be consistent with the maximum table index assigned to the vertices under the "transform_blend" name.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
setTransformTable | ( | TransformTable const | table | ) |
Replaces the TransformTable on this vertex data with the indicated table.
The length of this table should be consistent with the maximum table index assigned to the vertices under the "transform_index" name.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
setUsageHint | ( | UsageHint | usage_hint | ) |
Changes the UsageHint hint for this vertex data, and for all of the arrays that share this data.
See get_usage_hint().
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
bool testRefCountIntegrity | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Reimplemented from ReferenceCount.
Reimplemented in NodeCachedReferenceCount.
bool testRefCountNonzero | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
bool uncleanSetNumRows | ( | int | n | ) |
This method behaves like set_num_rows(), except the new data is not initialized.
Furthermore, after this call, *any* of the data in the GeomVertexData may be uninitialized, including the earlier rows.
This is intended for applications that are about to completely fill the GeomVertexData with new data anyway; it provides a tiny performance boost over set_num_rows().
Although this method is Published, application code only very rarely has any need to call it. Instead, you should use the GeomVertexWriter to build up the rows in a GeomVertexData object automatically, without need to explicitly set the number of rows.
bool unref | ( | ) | [inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.
write | ( | ostream | out | ) |