Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions

TransformState Class Reference

Indicates a coordinate-system transform on vertices. More...

#include "transformState.h"

Inheritance diagram for TransformState:
NodeCachedReferenceCount CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Classes

class  Composition
class  CompositionCycleDescEntry

Public Types

enum  Referenced { R_node = 0x001, R_cache = 0x002 }

Public Member Functions

virtual ~TransformState ()
 The destructor is responsible for removing the TransformState from the global set if it is there.
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
void cache_ref () const
 Overrides this method to update PStats appropriately.
bool cache_unref () const
 Overrides this method to update PStats appropriately.
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
bool components_given () const
 Returns true if the transform was specified componentwise, or false if it was specified with a general 4x4 matrix.
 CPT (TransformState) set_pos(const LVecBase3f &pos) const
 CPT (TransformState) set_quat(const LQuaternionf &quat) const
 CPT (TransformState) set_hpr(const LVecBase3f &hpr) const
 CPT (TransformState) set_scale(const LVecBase3f &scale) const
 CPT (TransformState) set_shear(const LVecBase3f &shear) const
 CPT (TransformState) set_pos2d(const LVecBase2f &pos) const
 CPT (TransformState) set_scale2d(const LVecBase2f &scale) const
 CPT (TransformState) set_rotate2d(float rotate) const
 CPT (TransformState) set_shear2d(float shear) const
 CPT (TransformState) compose(const TransformState *other) const
 CPT (TransformState) invert_compose(const TransformState *other) const
 CPT (TransformState) get_inverse() const
 CPT (TransformState) get_unique() const
string encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
bool encode_to_bam_stream (string &data, BamWriter *writer=NULL) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
virtual TypeHandle force_init_type ()
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter.
int get_best_parent_from_Set (const std::set< int > &) const
int get_cache_ref_count () const
 Returns the current reference count.
int get_composition_cache_num_entries () const
 Returns the number of entries in the composition cache for this TransformState.
const TransformStateget_composition_cache_result (int n) const
 Returns the result TransformState of the nth element in the composition cache.
int get_composition_cache_size () const
 Returns the number of slots in the composition cache for this TransformState.
const TransformStateget_composition_cache_source (int n) const
 Returns the source TransformState of the nth element in the composition cache.
int get_geom_rendering (int geom_rendering) const
 Returns the union of the Geom::GeomRendering bits that will be required once this TransformState is applied to a geom which includes the indicated geom_rendering bits.
size_t get_hash () const
 Returns a suitable hash value for phash_map.
const LVecBase3fget_hpr () const
 Returns the rotation component of the transform as a trio of Euler angles.
int get_invert_composition_cache_num_entries () const
 Returns the number of entries in the invert_composition cache for this TransformState.
const TransformStateget_invert_composition_cache_result (int n) const
 Returns the result TransformState of the nth element in the invert composition cache.
int get_invert_composition_cache_size () const
 Returns the number of slots in the composition cache for this TransformState.
const TransformStateget_invert_composition_cache_source (int n) const
 Returns the source TransformState of the nth element in the invert composition cache.
const LMatrix4fget_mat () const
 Returns the matrix that describes the transform.
LMatrix3f get_mat3 () const
 Returns the 3x3 matrix that describes the 2-d transform.
int get_node_ref_count () const
 Returns the current reference count.
const LQuaternionfget_norm_quat () const
 Returns the rotation component of the transform as a quaternion.
const LPoint3fget_pos () const
 Returns the pos component of the transform.
LVecBase2f get_pos2d () const
 Returns the pos component of the 2-d transform.
const LQuaternionfget_quat () const
 Returns the rotation component of the transform as a quaternion.
int get_ref_count () const
 Returns the current reference count.
int get_referenced_bits () const
 Returns the union of the values defined in the Referenced enum that represents the various things that appear to be holding a pointer to this object.
float get_rotate2d () const
 Returns the rotation component of the 2-d transform as an angle in degrees clockwise about the origin.
const LVecBase3fget_scale () const
 Returns the scale component of the transform.
LVecBase2f get_scale2d () const
 Returns the scale component of the 2-d transform.
const LVecBase3fget_shear () const
 Returns the shear component of the transform.
float get_shear2d () const
 Returns the shear component of the 2-d transform.
virtual TypeHandle get_type () const
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
float get_uniform_scale () const
 Returns the scale component of the transform, as a single number.
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
bool has_components () const
 Returns true if the transform can be described by separate pos, hpr, and scale components.
bool has_hpr () const
 Returns true if the transform's rotation component can be extracted out separately and described as a set of Euler angles.
bool has_identity_scale () const
 Returns true if the scale is uniform 1.0, or false if the scale has some real value.
bool has_mat () const
 Returns true if the transform can be described as a matrix.
bool has_nonzero_shear () const
 Returns true if the shear component is non-zero, false if it is zero or if the matrix cannot be decomposed.
bool has_pos () const
 Returns true if the transform's pos component can be extracted out separately.
bool has_quat () const
 Returns true if the transform's rotation component can be extracted out separately and described as a quaternion.
bool has_scale () const
 Returns true if the transform's scale component can be extracted out separately.
bool has_shear () const
 Returns true if the transform's shear component can be extracted out separately.
bool has_uniform_scale () const
 Returns true if the scale is uniform across all three axes (and therefore can be expressed as a single number), or false if the transform has a different scale in different dimensions.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
bool hpr_given () const
 Returns true if the rotation was specified via a trio of Euler angles, false otherwise.
bool is_2d () const
 Returns true if the transform has been constructed entirely using the 2-d transform operations, e.g.
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
bool is_identity () const
 Returns true if the transform represents the identity matrix, false otherwise.
bool is_invalid () const
 Returns true if the transform represents an invalid matrix, for instance the result of inverting a singular matrix, or false if the transform is valid.
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
bool is_singular () const
 Returns true if the transform represents a singular transform (that is, it has a zero scale, and it cannot be inverted), or false otherwise.
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
void node_ref () const
 Overrides this method to update PStats appropriately.
bool node_unref () const
 Overrides this method to update PStats appropriately.
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *, void *)
void * operator new (size_t size)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
bool operator< (const TransformState &other) const
 Provides an arbitrary ordering among all unique TransformStates, so we can store the essentially different ones in a big set and throw away the rest.
void output (ostream &out) const
bool quat_given () const
 Returns true if the rotation was specified via a quaternion, false otherwise.
void ref () const
 Explicitly increments the reference count.
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
bool sorts_less (const TransformState &other, bool uniquify_matrix) const
 Provides an arbitrary ordering among all unique TransformStates, so we can store the essentially different ones in a big set and throw away the rest.
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool unref () const
 This method overrides ReferenceCount::unref() to check whether the remaining reference count is entirely in the cache, and if so, it checks for and breaks a cycle in the cache involving this object.
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object.
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object.
void write (ostream &out, int indent_level) const
void write_composition_cache (ostream &out, int indent_level) const
 Writes a brief description of the composition cache and invert composition cache to the indicated ostream.
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 int clear_cache ()
 Empties the cache of composed TransformStates.
static CPT (TransformState) make_invalid()
static CPT (TransformState) make_hpr(const LVecBase3f &hpr)
static CPT (TransformState) make_scale(const LVecBase3f &scale)
static CPT (TransformState) make_rotate2d(float rotate)
static CPT (TransformState) make_pos_rotate2d(const LVecBase2f &pos
static CPT (TransformState) make_shear(const LVecBase3f &shear)
static CPT (TransformState) make_scale2d(float scale)
static CPT (TransformState) make_scale2d(const LVecBase2f &scale)
static CPT (TransformState) make_quat(const LQuaternionf &quat)
static CPT (TransformState) make_pos_hpr_scale(const LVecBase3f &pos
static CPT (TransformState) make_shear2d(float shear)
static CPT (TransformState) make_pos_quat_scale_shear(const LVecBase3f &pos
static CPT (TransformState) make_pos_rotate_scale2d(const LVecBase2f &pos
static CPT (TransformState) make_pos_quat_scale(const LVecBase3f &pos
static CPT (TransformState) make_pos_rotate_scale_shear2d(const LVecBase2f &pos
static CPT (TransformState) make_mat3(const LMatrix3f &mat)
static CPT (TransformState) make_identity()
static CPT (TransformState) make_pos(const LVecBase3f &pos)
static CPT (TransformState) make_pos_hpr_scale_shear(const LVecBase3f &pos
static CPT (TransformState) make_pos_hpr(const LVecBase3f &pos
static CPT (TransformState) make_scale(float scale)
static CPT (TransformState) make_mat(const LMatrix4f &mat)
static CPT (TransformState) make_pos2d(const LVecBase2f &pos)
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
static void flush_level ()
 Flushes the PStatCollectors used during traversal.
static TypeHandle get_class_type ()
static int get_num_states ()
 Returns the total number of unique TransformState objects allocated in the world.
static int get_num_unused_states ()
 Returns the total number of TransformState objects that have been allocated but have no references outside of the internal TransformState cache.
static void init_states ()
 Make sure the global _states map is allocated.
static void init_type ()
static void list_cycles (ostream &out)
 Detects all of the reference-count cycles in the cache and reports them to standard output.
static void list_states (ostream &out)
 Lists all of the TransformStates in the cache to the output stream, one per line.
static PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data
static PT (TypedWritableReferenceCount) change_this(TypedWritableReferenceCount *old_ptr
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type TransformState.
static bool validate_states ()
 Ensures that the cache is still stored in sorted order, and that none of the cache elements have been inadvertently deleted.

Public Attributes

static const LVecBase3fhpr
static BamReadermanager
static const LQuaternionfquat
static BamReaderreader = NULL)
static float rotate
static const LQuaternionf
const LVecBase3f
scale
static float const LVecBase2fscale
static const LVecBase3f const
LVecBase3f
scale
static const LVecBase3f const
LVecBase3f const LVecBase3f
shear
static float const LVecBase2f float shear
static const LQuaternionf
const LVecBase3f const
LVecBase3f
shear

Static Public Attributes

static TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

 TransformState ()
 Actually, this could be a private constructor, since no one inherits from TransformState, but gcc gives us a spurious warning if all constructors are private.
void cache_unref_only () const
 Decrements the cache reference count without affecting the normal reference count.
bool do_test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool do_test_ref_count_nonzero () const
 Returns true if the reference count is nonzero, false otherwise.
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 TransformState.
void node_unref_only () const
 Decrements the node reference count without affecting the normal reference count.

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 TransformState is encountered in the Bam file.

Detailed Description

Indicates a coordinate-system transform on vertices.

TransformStates are the primary means for storing transformations on the scene graph.

Transforms may be specified in one of two ways: componentwise, with a pos-hpr-scale, or with an arbitrary transform matrix. If you specify a transform componentwise, it will remember its original components.

TransformState objects are managed very much like RenderState objects. They are immutable and reference-counted automatically.

You should not attempt to create or modify a TransformState object directly. Instead, call one of the make() functions to create one for you. And instead of modifying a TransformState object, create a new one.

Definition at line 62 of file transformState.h.


Constructor & Destructor Documentation

TransformState::TransformState ( ) [protected]

Actually, this could be a private constructor, since no one inherits from TransformState, but gcc gives us a spurious warning if all constructors are private.

Definition at line 57 of file transformState.cxx.

TransformState::~TransformState ( ) [virtual]

The destructor is responsible for removing the TransformState from the global set if it is there.

Definition at line 94 of file transformState.cxx.

References CacheStats::add_num_states(), ReferenceCount::get_ref_count(), and SimpleHashMap< Key, Value, Compare >::is_empty().


Member Function Documentation

ReferenceCount * TypedWritableReferenceCount::as_reference_count ( ) [virtual, inherited]

Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.

Reimplemented from TypedWritable.

Definition at line 26 of file typedWritableReferenceCount.cxx.

TypedObject * TypedObject::as_typed_object ( ) [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 99 of file typedObject.I.

const TypedObject * TypedObject::as_typed_object ( ) const [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 110 of file typedObject.I.

void TransformState::cache_ref ( ) const [inline]

Overrides this method to update PStats appropriately.

Reimplemented from CachedTypedWritableReferenceCount.

Definition at line 728 of file transformState.I.

References NodeCachedReferenceCount::get_referenced_bits().

bool TransformState::cache_unref ( ) const [inline]

Overrides this method to update PStats appropriately.

Reimplemented from CachedTypedWritableReferenceCount.

Definition at line 744 of file transformState.I.

References NodeCachedReferenceCount::get_referenced_bits().

Referenced by clear_cache().

void CachedTypedWritableReferenceCount::cache_unref_only ( ) const [inline, protected, inherited]

Decrements the cache reference count without affecting the normal reference count.

Intended to be called by derived classes only, presumably to reimplement cache_unref().

Definition at line 204 of file cachedTypedWritableReferenceCount.I.

References CachedTypedWritableReferenceCount::test_ref_count_integrity().

int TransformState::clear_cache ( ) [static]

Empties the cache of composed TransformStates.

This makes every TransformState forget what results when it is composed with other TransformStates.

This will eliminate any TransformState objects that have been allocated but have no references outside of the internal TransformState map. It will not eliminate TransformState objects that are still in use.

Nowadays, this method should not be necessary, as reference-count cycles in the composition cache should be automatically detected and broken.

The return value is the number of TransformStates freed by this operation.

Definition at line 1203 of file transformState.cxx.

References CacheStats::add_total_size(), cache_unref(), SimpleHashMap< Key, Value, Compare >::clear(), SimpleHashMap< Key, Value, Compare >::get_data(), SimpleHashMap< Key, Value, Compare >::get_num_entries(), ReferenceCount::get_ref_count(), SimpleHashMap< Key, Value, Compare >::get_size(), and SimpleHashMap< Key, Value, Compare >::has_element().

int TypedWritable::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual, inherited]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in CFDoCullCommand, AnimBundleNode, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimGroup, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionNode, DataNodeTransmit, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, SliderTable, TextureStage, TransformBlendTable, TransformTable, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, PortalNode, RenderEffects, RenderState, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, BamCacheIndex, RecorderFrame, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TextureProperties, and TextureReference.

Definition at line 103 of file typedWritable.cxx.

bool TransformState::components_given ( ) const [inline]

Returns true if the transform was specified componentwise, or false if it was specified with a general 4x4 matrix.

If this is true, the components returned by get_pos() and get_scale() will be exactly those that were set; otherwise, these functions will return computed values. If this is true, the rotation may have been set either with a hpr trio or with a quaternion; hpr_given() or quat_given() can resolve the difference.

Definition at line 328 of file transformState.I.

bool TypedWritable::decode_raw_from_bam_stream ( TypedWritable *&  ptr,
ReferenceCount *&  ref_ptr,
const string &  data,
BamReader reader = NULL 
) [static, inherited]

Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.

Returns true on success, false on on error.

This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.

Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.

If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.

Definition at line 353 of file typedWritable.cxx.

References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().

bool NodeCachedReferenceCount::do_test_ref_count_integrity ( ) const [protected, inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Reimplemented from CachedTypedWritableReferenceCount.

Definition at line 26 of file nodeCachedReferenceCount.cxx.

Referenced by NodeCachedReferenceCount::test_ref_count_integrity().

bool ReferenceCount::do_test_ref_count_nonzero ( ) const [protected, inherited]

Returns true if the reference count is nonzero, false otherwise.

Definition at line 56 of file referenceCount.cxx.

References ReferenceCount::do_test_ref_count_integrity().

Referenced by ReferenceCount::test_ref_count_nonzero().

string TypedWritable::encode_to_bam_stream ( ) const [inline, 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.

Definition at line 86 of file typedWritable.I.

bool TypedWritable::encode_to_bam_stream ( string &  data,
BamWriter writer = NULL 
) const [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.

Definition at line 283 of file typedWritable.cxx.

References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().

void TransformState::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 TransformState.

Reimplemented from TypedWritable.

Definition at line 2457 of file transformState.cxx.

References DatagramIterator::get_uint32(), LMatrix4f::read_datagram(), LVecBase4f::read_datagram(), and LVecBase3f::read_datagram().

Referenced by make_from_bam().

void TypedWritable::finalize ( BamReader manager) [virtual, inherited]

Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

Reimplemented in PartBundle, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, InternalName, GeomNode, LightAttrib, RenderAttrib, RenderEffect, RenderEffects, RenderState, PaletteGroup, and Palettizer.

Definition at line 145 of file typedWritable.cxx.

Referenced by BamReader::finalize_now().

void TransformState::flush_level ( ) [inline, static]

Flushes the PStatCollectors used during traversal.

Definition at line 947 of file transformState.I.

Referenced by GraphicsEngine::render_frame().

UpdateSeq TypedWritable::get_bam_modified ( ) const [inline, inherited]

Returns the current bam_modified counter.

This counter is normally incremented automatically whenever the object is modified.

Definition at line 66 of file typedWritable.I.

Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().

int CachedTypedWritableReferenceCount::get_cache_ref_count ( ) const [inline, inherited]
int TransformState::get_composition_cache_num_entries ( ) const [inline]

Returns the number of entries in the composition cache for this TransformState.

This is the number of other TransformStates whose composition with this one has been cached. This number is not useful for any practical reason other than performance analysis.

Definition at line 798 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_num_entries().

const TransformState * TransformState::get_composition_cache_result ( int  n) const [inline]

Returns the result TransformState of the nth element in the composition cache.

Returns NULL if there doesn't happen to be an entry in the nth element.

In general, a->compose(a->get_composition_cache_source(n)) == a->get_composition_cache_result(n).

This has no practical value other than for examining the cache for performance analysis.

Definition at line 871 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_data(), and SimpleHashMap< Key, Value, Compare >::has_element().

int TransformState::get_composition_cache_size ( ) const [inline]

Returns the number of slots in the composition cache for this TransformState.

You may use this as an upper bound when walking through all of the composition cache results via get_composition_cache_source() or result().

This has no practical value other than for examining the cache for performance analysis.

Definition at line 831 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_size().

const TransformState * TransformState::get_composition_cache_source ( int  n) const [inline]

Returns the source TransformState of the nth element in the composition cache.

Returns NULL if there doesn't happen to be an entry in the nth element. See get_composition_cache_result().

This has no practical value other than for examining the cache for performance analysis.

Definition at line 848 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_key(), and SimpleHashMap< Key, Value, Compare >::has_element().

int TransformState::get_geom_rendering ( int  geom_rendering) const [inline]

Returns the union of the Geom::GeomRendering bits that will be required once this TransformState is applied to a geom which includes the indicated geom_rendering bits.

The RenderState's get_geom_rendering() should already have been applied.

Definition at line 712 of file transformState.I.

References has_identity_scale().

size_t TransformState::get_hash ( ) const [inline]

Returns a suitable hash value for phash_map.

Definition at line 38 of file transformState.I.

const LVecBase3f & TransformState::get_hpr ( ) const [inline]

Returns the rotation component of the transform as a trio of Euler angles.

It is an error to call this if has_components() returned false.

Definition at line 493 of file transformState.I.

References is_invalid().

Referenced by PartGroup::apply_freeze(), NodePath::set_pos_hpr(), and write_datagram().

int TransformState::get_invert_composition_cache_num_entries ( ) const [inline]

Returns the number of entries in the invert_composition cache for this TransformState.

This is similar to the composition cache, but it records cache entries for the invert_compose() operation. See get_composition_cache_num_entries().

Definition at line 813 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_num_entries().

const TransformState * TransformState::get_invert_composition_cache_result ( int  n) const [inline]

Returns the result TransformState of the nth element in the invert composition cache.

Returns NULL if there doesn't happen to be an entry in the nth element.

In general, a->invert_compose(a->get_invert_composition_cache_source(n)) == a->get_invert_composition_cache_result(n).

This has no practical value other than for examining the cache for performance analysis.

Definition at line 933 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_data(), and SimpleHashMap< Key, Value, Compare >::has_element().

int TransformState::get_invert_composition_cache_size ( ) const [inline]

Returns the number of slots in the composition cache for this TransformState.

You may use this as an upper bound when walking through all of the composition cache results via get_invert_composition_cache_source() or result().

This has no practical value other than for examining the cache for performance analysis.

Definition at line 892 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_size().

const TransformState * TransformState::get_invert_composition_cache_source ( int  n) const [inline]

Returns the source TransformState of the nth element in the invert composition cache.

Returns NULL if there doesn't happen to be an entry in the nth element. See get_invert_composition_cache_result().

This has no practical value other than for examining the cache for performance analysis.

Definition at line 909 of file transformState.I.

References SimpleHashMap< Key, Value, Compare >::get_key(), and SimpleHashMap< Key, Value, Compare >::has_element().

const LMatrix4f & TransformState::get_mat ( ) const [inline]
LMatrix3f TransformState::get_mat3 ( ) const [inline]

Returns the 3x3 matrix that describes the 2-d transform.

It is an error to call this if is_2d() returned false.

Definition at line 665 of file transformState.I.

References has_mat(), LMatrix3f::ident_mat(), and is_2d().

int NodeCachedReferenceCount::get_node_ref_count ( ) const [inline, inherited]

Returns the current reference count.

Definition at line 133 of file nodeCachedReferenceCount.I.

References NodeCachedReferenceCount::test_ref_count_integrity().

Referenced by NodeCachedReferenceCount::get_referenced_bits().

const LQuaternionf & TransformState::get_norm_quat ( ) const [inline]

Returns the rotation component of the transform as a quaternion.

Unlike the result of get_quat(), the return value of this method is guaranteed to be normalized. It is an error to call this if has_components() returned false.

Definition at line 530 of file transformState.I.

References is_invalid().

int TransformState::get_num_states ( ) [static]

Returns the total number of unique TransformState objects allocated in the world.

This will go up and down during normal operations.

Definition at line 1080 of file transformState.cxx.

Referenced by GraphicsEngine::render_frame().

int TransformState::get_num_unused_states ( ) [static]

Returns the total number of TransformState objects that have been allocated but have no references outside of the internal TransformState cache.

A nonzero return value is not necessarily indicative of leaked references; it is normal for two TransformState objects, both of which have references held outside the cache, to have the result of their composition stored within the cache. This result will be retained within the cache until one of the base TransformStates is released.

Use list_cycles() to get an idea of the number of actual "leaked" TransformState objects.

Definition at line 1107 of file transformState.cxx.

References CachedTypedWritableReferenceCount::get_cache_ref_count(), SimpleHashMap< Key, Value, Compare >::get_data(), ReferenceCount::get_ref_count(), SimpleHashMap< Key, Value, Compare >::get_size(), and SimpleHashMap< Key, Value, Compare >::has_element().

Referenced by GraphicsEngine::render_frame().

const LPoint3f & TransformState::get_pos ( ) const [inline]

Returns the pos component of the transform.

It is an error to call this if has_pos() returned false.

Definition at line 479 of file transformState.I.

References has_pos().

Referenced by CompassEffect::adjust_transform(), PartGroup::apply_freeze(), NodePath::get_pos(), NodePath::get_pos_delta(), NodePath::set_pos_hpr(), NodePath::set_pos_quat(), and ModelNode::test_transform().

LVecBase2f TransformState::get_pos2d ( ) const [inline]

Returns the pos component of the 2-d transform.

It is an error to call this if has_pos() or is_2d() returned false.

Definition at line 598 of file transformState.I.

References has_pos(), is_2d(), and LVecBase2f::zero().

const LQuaternionf & TransformState::get_quat ( ) const [inline]

Returns the rotation component of the transform as a quaternion.

The return value will be normalized if a normalized quaternion was given to the constructor (or if the quaternion was computed implicitly); it will be non-normalized if a non-normalized quaternion was given to the constructor. See also get_norm_quat().

It is an error to call this if has_components() returned false.

Definition at line 514 of file transformState.I.

References is_invalid().

Referenced by CompassEffect::adjust_transform(), and NodePath::set_pos_quat().

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
int NodeCachedReferenceCount::get_referenced_bits ( ) const [inline, inherited]

Returns the union of the values defined in the Referenced enum that represents the various things that appear to be holding a pointer to this object.

If R_node is included, at least one node is holding a pointer; if R_cache is included, at least one cache element is.

Definition at line 204 of file nodeCachedReferenceCount.I.

References CachedTypedWritableReferenceCount::get_cache_ref_count(), and NodeCachedReferenceCount::get_node_ref_count().

Referenced by cache_ref(), RenderState::cache_ref(), cache_unref(), RenderState::cache_unref(), node_ref(), RenderState::node_ref(), node_unref(), and RenderState::node_unref().

float TransformState::get_rotate2d ( ) const [inline]

Returns the rotation component of the 2-d transform as an angle in degrees clockwise about the origin.

It is an error to call this if has_components() or is_2d() returned false.

Definition at line 613 of file transformState.I.

References is_2d(), and is_invalid().

const LVecBase3f & TransformState::get_scale ( ) const [inline]

Returns the scale component of the transform.

It is an error to call this if has_components() returned false.

Definition at line 544 of file transformState.I.

References is_invalid().

Referenced by CompassEffect::adjust_transform(), and PartGroup::apply_freeze().

LVecBase2f TransformState::get_scale2d ( ) const [inline]

Returns the scale component of the 2-d transform.

It is an error to call this if has_components() or is_2d() returned false.

Definition at line 637 of file transformState.I.

References is_2d(), is_invalid(), and LVecBase2f::zero().

const LVecBase3f & TransformState::get_shear ( ) const [inline]

Returns the shear component of the transform.

It is an error to call this if has_components() returned false.

Definition at line 572 of file transformState.I.

References is_invalid().

float TransformState::get_shear2d ( ) const [inline]

Returns the shear component of the 2-d transform.

It is an error to call this if has_components() or is_2d() returned false.

Definition at line 651 of file transformState.I.

References is_2d(), and is_invalid().

int TypedObject::get_type_index ( ) const [inline, 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().

Definition at line 52 of file typedObject.I.

References TypeHandle::get_index().

float TransformState::get_uniform_scale ( ) const [inline]

Returns the scale component of the transform, as a single number.

It is an error to call this if has_uniform_scale() returned false.

Definition at line 558 of file transformState.I.

References has_uniform_scale().

WeakReferenceList * ReferenceCount::get_weak_list ( ) const [inline, inherited]

Returns the WeakReferenceList associated with this ReferenceCount object.

If there has never been a WeakReferenceList associated with this object, creates one now.

Definition at line 307 of file referenceCount.I.

Referenced by ReferenceCount::weak_ref().

bool TransformState::has_components ( ) const [inline]

Returns true if the transform can be described by separate pos, hpr, and scale components.

Most transforms we use in everyday life can be so described, but some kinds of transforms (for instance, those involving a skew) cannot.

This is not related to whether the transform was originally described componentwise. Even a transform that was constructed with a 4x4 may return true here if the matrix is a simple affine matrix with no skew.

If this returns true, you may safely call get_hpr() and get_scale() to retrieve the components. (You may always safely call get_pos() whether this returns true or false.)

Definition at line 309 of file transformState.I.

Referenced by CompassEffect::adjust_transform(), has_hpr(), has_quat(), has_scale(), has_shear(), NodePath::set_pos_hpr(), and NodePath::set_pos_quat().

bool TransformState::has_hpr ( ) const [inline]

Returns true if the transform's rotation component can be extracted out separately and described as a set of Euler angles.

This is generally true only when has_components() is true.

Definition at line 380 of file transformState.I.

References has_components().

bool TransformState::has_identity_scale ( ) const [inline]

Returns true if the scale is uniform 1.0, or false if the scale has some real value.

Definition at line 416 of file transformState.I.

Referenced by get_geom_rendering().

bool TransformState::has_mat ( ) const [inline]

Returns true if the transform can be described as a matrix.

This is generally always true, unless is_invalid() is true.

Definition at line 468 of file transformState.I.

References is_invalid().

Referenced by get_mat(), and get_mat3().

bool TransformState::has_nonzero_shear ( ) const [inline]

Returns true if the shear component is non-zero, false if it is zero or if the matrix cannot be decomposed.

Definition at line 455 of file transformState.I.

bool TransformState::has_pos ( ) const [inline]

Returns true if the transform's pos component can be extracted out separately.

This is generally always true, unless the transform is invalid (i.e. is_invalid() returns true).

Definition at line 367 of file transformState.I.

References is_invalid().

Referenced by get_pos(), and get_pos2d().

bool TransformState::has_quat ( ) const [inline]

Returns true if the transform's rotation component can be extracted out separately and described as a quaternion.

This is generally true only when has_components() is true.

Definition at line 393 of file transformState.I.

References has_components().

bool TransformState::has_scale ( ) const [inline]

Returns true if the transform's scale component can be extracted out separately.

This is generally true only when has_components() is true.

Definition at line 405 of file transformState.I.

References has_components().

bool TransformState::has_shear ( ) const [inline]

Returns true if the transform's shear component can be extracted out separately.

This is generally true only when has_components() is true.

Definition at line 443 of file transformState.I.

References has_components().

bool TransformState::has_uniform_scale ( ) const [inline]

Returns true if the scale is uniform across all three axes (and therefore can be expressed as a single number), or false if the transform has a different scale in different dimensions.

Definition at line 430 of file transformState.I.

Referenced by get_uniform_scale().

bool ReferenceCount::has_weak_list ( ) const [inline, inherited]

Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.

In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).

Definition at line 294 of file referenceCount.I.

Referenced by ReferenceCount::weak_unref().

bool TransformState::hpr_given ( ) const [inline]

Returns true if the rotation was specified via a trio of Euler angles, false otherwise.

If this is true, get_hpr() will be exactly as set; otherwise, it will return a computed value.

Definition at line 341 of file transformState.I.

void TransformState::init_states ( ) [static]

Make sure the global _states map is allocated.

This only has to be done once. We could make this map static, but then we run into problems if anyone creates a TransformState object at static init time; it also seems to cause problems when the Panda shared library is unloaded at application exit time.

Definition at line 1480 of file transformState.cxx.

References Thread::get_current_thread(), Thread::get_main_thread(), and CacheStats::init().

bool TransformState::is_2d ( ) const [inline]

Returns true if the transform has been constructed entirely using the 2-d transform operations, e.g.

make_pos2d(), and therefore operates strictly in two-dimensional space on X and Y only.

Definition at line 285 of file transformState.I.

Referenced by get_mat3(), get_pos2d(), get_rotate2d(), get_scale2d(), and get_shear2d().

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
bool TransformState::is_identity ( ) const [inline]
bool TransformState::is_invalid ( ) const [inline]

Returns true if the transform represents an invalid matrix, for instance the result of inverting a singular matrix, or false if the transform is valid.

Definition at line 259 of file transformState.I.

Referenced by get_hpr(), get_norm_quat(), get_quat(), get_rotate2d(), get_scale(), get_scale2d(), get_shear(), get_shear2d(), has_mat(), has_pos(), and CullTraverserData::is_in_view().

bool TypedObject::is_of_type ( TypeHandle  handle) const [inline, inherited]

Returns true if the current object is or derives from the indicated type.

Definition at line 63 of file typedObject.I.

References TypeHandle::is_derived_from().

Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().

bool TransformState::is_singular ( ) const [inline]

Returns true if the transform represents a singular transform (that is, it has a zero scale, and it cannot be inverted), or false otherwise.

Definition at line 271 of file transformState.I.

Referenced by CullTraverserData::apply_transform_and_state(), and LODNode::compute_child().

void TransformState::list_cycles ( ostream &  out) [static]

Detects all of the reference-count cycles in the cache and reports them to standard output.

These cycles may be inadvertently created when state compositions cycle back to a starting point. Nowadays, these cycles should be automatically detected and broken, so this method should never list any cycles unless there is a bug in that detection logic.

The cycles listed here are not leaks in the strictest sense of the word, since they can be reclaimed by a call to clear_cache(); but they will not be reclaimed automatically.

Definition at line 1287 of file transformState.cxx.

References ReferenceCount::get_ref_count().

void TransformState::list_states ( ostream &  out) [static]

Lists all of the TransformStates in the cache to the output stream, one per line.

This can be quite a lot of output if the cache is large, so be prepared.

Definition at line 1366 of file transformState.cxx.

void ReferenceCount::local_object ( ) [inline, inherited]

This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.

This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.

Definition at line 276 of file referenceCount.I.

Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().

TypedWritable * TransformState::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type TransformState is encountered in the Bam file.

It should create the TransformState and extract its information from the file.

Definition at line 2437 of file transformState.cxx.

References fillin(), and BamReader::register_change_this().

Referenced by register_with_read_factory().

void TypedWritable::mark_bam_modified ( ) [inline, inherited]
void TransformState::node_ref ( ) const [inline]

Overrides this method to update PStats appropriately.

Reimplemented from NodeCachedReferenceCount.

Definition at line 761 of file transformState.I.

References NodeCachedReferenceCount::get_referenced_bits().

bool TransformState::node_unref ( ) const [inline]

Overrides this method to update PStats appropriately.

Reimplemented from NodeCachedReferenceCount.

Definition at line 777 of file transformState.I.

References NodeCachedReferenceCount::get_referenced_bits().

void NodeCachedReferenceCount::node_unref_only ( ) const [inline, protected, inherited]

Decrements the node reference count without affecting the normal reference count.

Intended to be called by derived classes only, presumably to reimplement node_unref().

Definition at line 225 of file nodeCachedReferenceCount.I.

References NodeCachedReferenceCount::test_ref_count_integrity().

Referenced by NodeCachedReferenceCount::node_unref().

bool TransformState::operator< ( const TransformState other) const [inline]

Provides an arbitrary ordering among all unique TransformStates, so we can store the essentially different ones in a big set and throw away the rest.

This is the same as sorts_less(), except the uniquify_matrix value is implicit from the Config.prc file.

Definition at line 28 of file transformState.I.

References sorts_less().

bool TransformState::quat_given ( ) const [inline]

Returns true if the rotation was specified via a quaternion, false otherwise.

If this is true, get_quat() will be exactly as set; otherwise, it will return a computed value.

Definition at line 354 of file transformState.I.

void ReferenceCount::ref ( ) const [inline, 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.

Definition at line 179 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().

void TransformState::register_with_read_factory ( ) [static]

Tells the BamReader how to create objects of type TransformState.

Definition at line 2351 of file transformState.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

bool TypedWritable::require_fully_complete ( ) const [virtual, inherited]

Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.

If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).

Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.

Definition at line 118 of file typedWritable.cxx.

bool TransformState::sorts_less ( const TransformState other,
bool  uniquify_matrix 
) const

Provides an arbitrary ordering among all unique TransformStates, so we can store the essentially different ones in a big set and throw away the rest.

If uniquify_matrix is true, then matrix-defined TransformStates are also uniqified. If uniquify_matrix is false, then only component-defined TransformStates are uniquified, which is less expensive.

Definition at line 131 of file transformState.cxx.

References LVecBase3f::compare_to(), LVecBase4f::compare_to(), and get_mat().

Referenced by operator<().

bool NodeCachedReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Reimplemented from CachedTypedWritableReferenceCount.

Definition at line 184 of file nodeCachedReferenceCount.I.

References NodeCachedReferenceCount::do_test_ref_count_integrity().

Referenced by NodeCachedReferenceCount::get_node_ref_count(), NodeCachedReferenceCount::node_ref(), and NodeCachedReferenceCount::node_unref_only().

bool ReferenceCount::test_ref_count_nonzero ( ) const [inline, inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

Definition at line 252 of file referenceCount.I.

References ReferenceCount::do_test_ref_count_nonzero().

Referenced by CopyOnWritePointer::test_ref_count_nonzero().

bool TransformState::unref ( ) const [virtual]

This method overrides ReferenceCount::unref() to check whether the remaining reference count is entirely in the cache, and if so, it checks for and breaks a cycle in the cache involving this object.

This is designed to prevent leaks from cyclical references within the cache.

Reimplemented from ReferenceCount.

Definition at line 783 of file transformState.cxx.

References CachedTypedWritableReferenceCount::get_cache_ref_count(), ReferenceCount::get_ref_count(), and ReferenceCount::unref().

void TypedWritable::update_bam_nested ( BamWriter manager) [virtual, inherited]

Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.

Reimplemented in CFDoCullCommand, and PandaNode.

Definition at line 77 of file typedWritable.cxx.

bool TransformState::validate_states ( ) [static]

Ensures that the cache is still stored in sorted order, and that none of the cache elements have been inadvertently deleted.

Returns true if so, false if there is a problem (which implies someone has modified one of the supposedly-const TransformState objects).

Definition at line 1392 of file transformState.cxx.

void ReferenceCount::weak_ref ( WeakPointerToVoid ptv) [inline, inherited]

Adds the indicated PointerToVoid as a weak reference to this object.

Definition at line 321 of file referenceCount.I.

References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().

void ReferenceCount::weak_unref ( WeakPointerToVoid ptv) [inline, inherited]

Removes the indicated PointerToVoid as a weak reference to this object.

It must have previously been added via a call to weak_ref().

Definition at line 334 of file referenceCount.I.

References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().

void TransformState::write_composition_cache ( ostream &  out,
int  indent_level 
) const

Writes a brief description of the composition cache and invert composition cache to the indicated ostream.

This is not useful except for performance analysis, to examine the cache structure.

Definition at line 1067 of file transformState.cxx.

void TransformState::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 2362 of file transformState.cxx.

References Datagram::add_uint32(), get_hpr(), LMatrix4f::write_datagram(), LVecBase4f::write_datagram(), and LVecBase3f::write_datagram().


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