Panda3D
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends
TransformBlendTable Class Reference

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"

Inheritance diagram for TransformBlendTable:
CopyOnWriteObject CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Classes

class  CData

Public Member Functions

 TransformBlendTable (const TransformBlendTable &copy)
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 TransformBlendget_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 SparseArrayget_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)
SparseArraymodify_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 &copy)
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 TypedWritablemake_from_bam (const FactoryParams &params)
 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

Detailed Description

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.


Member Function Documentation

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().

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.

UpdateSeq TransformBlendTable::get_modified ( Thread current_thread) const [inline]

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.

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().

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.

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().

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.

void TransformBlendTable::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

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().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations