Panda3D
|
This structure collects together the different combinations of transforms and blend amounts used by a GeomVertexData, to facilitate computing dynamic vertices on the CPU at runtime. More...
#include "transformBlendTable.h"
Classes | |
class | CData |
Public Member Functions | |
TransformBlendTable (const TransformBlendTable ©) | |
int | add_blend (const TransformBlend &blend) |
Adds a new blend to the table, and returns its index number. | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
virtual TypeHandle | force_init_type () |
const TransformBlend & | get_blend (int n) const |
Returns the nth blend in the table. | |
int | get_max_simultaneous_transforms () const |
Returns the maximum number of unique VertexTransform objects that are applied to any one vertex simultaneously. | |
UpdateSeq | get_modified (Thread *current_thread) const |
Returns a counter which is guaranteed to increment at least when any TransformBlends within the table have changed. | |
int | get_num_blends () const |
Returns the total number of different blend combinations in the table. | |
int | get_num_transforms () const |
Returns the number of unique VertexTransform objects represented in the table. | |
const SparseArray & | get_rows () const |
Returns the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects. | |
virtual TypeHandle | get_type () const |
MAKE_SEQ (get_blends, get_num_blends, get_blend) | |
SparseArray & | modify_rows () |
Returns a modifiable reference to the SparseArray that specifies the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects. | |
void | operator= (const TransformBlendTable ©) |
void | remove_blend (int n) |
Removes the blend at the nth position. | |
void | set_blend (int n, const TransformBlend &blend) |
Replaces the blend at the nth position with the indicated value. | |
void | set_rows (const SparseArray &rows) |
Specifies the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects. | |
void | write (ostream &out, int indent_level) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type TransformBlendTable. | |
Protected Member Functions | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TransformBlendTable. | |
virtual | PT (CopyOnWriteObject) make_cow_copy() |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type TransformBlendTable is encountered in the Bam file. | |
Friends | |
class | VertexTransform |
This structure collects together the different combinations of transforms and blend amounts used by a GeomVertexData, to facilitate computing dynamic vertices on the CPU at runtime.
Each vertex has a pointer to exactly one of the entries in this table, and each entry defines a number of transform/blend combinations.
This structure is used for a GeomVertexData set up to compute its dynamic vertices on the CPU. See TransformTable for one set up to compute its dynamic vertices on the graphics card.
Definition at line 50 of file transformBlendTable.h.
int TransformBlendTable::add_blend | ( | const TransformBlend & | blend | ) |
Adds a new blend to the table, and returns its index number.
If there is already an identical blend in the table, simply returns that number instead.
Definition at line 105 of file transformBlendTable.cxx.
References TransformBlend::get_num_transforms().
int TransformBlendTable::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [virtual] |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Returns the number of pointers processed.
Reimplemented from TypedWritable.
Definition at line 271 of file transformBlendTable.cxx.
void TransformBlendTable::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TransformBlendTable.
Reimplemented from TypedWritable.
Definition at line 310 of file transformBlendTable.cxx.
References TransformBlend::fillin(), BamReader::get_file_minor_ver(), DatagramIterator::get_uint16(), BamReader::read_cdata(), and SparseArray::read_datagram().
const TransformBlend & TransformBlendTable::get_blend | ( | int | n | ) | const [inline] |
Returns the nth blend in the table.
Definition at line 33 of file transformBlendTable.I.
Referenced by GeomVertexData::describe_vertex().
int TransformBlendTable::get_max_simultaneous_transforms | ( | ) | const [inline] |
Returns the maximum number of unique VertexTransform objects that are applied to any one vertex simultaneously.
This is the same limit reflected by GraphicsStateGuardian::get_max_vertex_transforms().
Definition at line 90 of file transformBlendTable.I.
Returns a counter which is guaranteed to increment at least when any TransformBlends within the table have changed.
Definition at line 46 of file transformBlendTable.I.
References VertexTransform::get_global_modified().
int TransformBlendTable::get_num_blends | ( | ) | const [inline] |
Returns the total number of different blend combinations in the table.
Definition at line 23 of file transformBlendTable.I.
int TransformBlendTable::get_num_transforms | ( | ) | const [inline] |
Returns the number of unique VertexTransform objects represented in the table.
This will correspond to the size of the TransformTable object that would represent the same table. This is also the same limit reflected by GraphicsStateGuardian::get_max_vertex_transform_indices().
Definition at line 68 of file transformBlendTable.I.
const SparseArray & TransformBlendTable::get_rows | ( | ) | const [inline] |
Returns the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects.
Definition at line 115 of file transformBlendTable.I.
TypedWritable * TransformBlendTable::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type TransformBlendTable is encountered in the Bam file.
It should create the TransformBlendTable and extract its information from the file.
Definition at line 291 of file transformBlendTable.cxx.
Referenced by register_with_read_factory().
SparseArray & TransformBlendTable::modify_rows | ( | ) | [inline] |
Returns a modifiable reference to the SparseArray that specifies the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects.
Definition at line 128 of file transformBlendTable.I.
void TransformBlendTable::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type TransformBlendTable.
Definition at line 238 of file transformBlendTable.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void TransformBlendTable::remove_blend | ( | int | n | ) |
Removes the blend at the nth position.
Definition at line 92 of file transformBlendTable.cxx.
void TransformBlendTable::set_blend | ( | int | n, |
const TransformBlend & | blend | ||
) |
Replaces the blend at the nth position with the indicated value.
Definition at line 81 of file transformBlendTable.cxx.
void TransformBlendTable::set_rows | ( | const SparseArray & | rows | ) | [inline] |
Specifies the subset of rows (vertices) in the associated GeomVertexData that this TransformBlendTable actually affects.
Definition at line 103 of file transformBlendTable.I.
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 249 of file transformBlendTable.cxx.
References Datagram::add_uint16(), BamWriter::write_cdata(), and SparseArray::write_datagram().