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

EggVertexPool Class Reference

A collection of vertices. More...

#include "eggVertexPool.h"

Inheritance diagram for EggVertexPool:
EggNode EggNamedObject EggObject Namable TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Types

typedef iterator const_iterator
typedef
second_of_pair_iterator
< IndexVertices::const_iterator > 
iterator
typedef IndexVertices::size_type size_type

Public Member Functions

 EggVertexPool (const string &name)
 EggVertexPool (const EggVertexPool &copy)
 Copying a vertex pool is of questionable value, since it will copy all of the vertices and assign new pointers to them all.
EggVertexadd_vertex (EggVertex *vertex, int index=-1)
 Adds the indicated vertex to the pool.
void apply_texmats ()
 Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves.
virtual EggTransformas_transform ()
 Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.
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.
iterator begin () const
 Returns an iterator that can be used to traverse through all the vertices in the pool.
void check_overall_color (bool &has_overall_color, Colorf &overall_color) const
 Scans the vertex pool for different colors on different vertices.
void clear_name ()
 Resets the Namable's name to empty.
void clear_user_data ()
 Removes *all* user data pointers from the node.
void clear_user_data (TypeHandle type)
 Removes the user data pointer of the indicated type.
EggVertexcreate_unique_vertex (const EggVertex &copy)
 Creates a new vertex in the pool that is a copy of the indicated one and returns it.
virtual EggRenderModedetermine_alpha_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has an alpha_mode other than AM_unspecified.
virtual EggRenderModedetermine_bin ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a bin specified.
virtual bool determine_decal ()
 Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set.
virtual EggRenderModedetermine_depth_offset ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_offset specified.
virtual EggRenderModedetermine_depth_test_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_test_mode other than DTM_unspecified.
virtual EggRenderModedetermine_depth_write_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_write_mode other than DWM_unspecified.
virtual EggRenderModedetermine_draw_order ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a draw_order specified.
virtual bool determine_indexed ()
 Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set.
virtual EggRenderModedetermine_visibility_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified.
bool empty () const
 Returns true if the pool is empty.
iterator end () const
 Returns an iterator that can be used to traverse through all the vertices in the pool.
EggVertexfind_matching_vertex (const EggVertex &copy)
 If the EggVertexPool already has a vertex matching the indicated vertex, returns it; otherwise, returns NULL.
void flatten_transforms ()
 Removes any transform and instance records from this node in the scene graph and below.
virtual TypeHandle force_init_type ()
int get_best_parent_from_Set (const std::set< int > &) const
int get_depth () const
 Returns the number of nodes above this node in the egg hierarchy.
EggVertexget_forward_vertex (int index)
 Returns the vertex in the pool with the indicated index number.
int get_highest_index () const
 Returns the highest index number used by any vertex in the pool (except forward references).
const string & get_name () const
const LMatrix4dget_node_frame () const
 Returns the coordinate frame of the node itself.
const LMatrix4dget_node_frame_inv () const
 Returns the inverse of the matrix returned by get_node_frame().
const LMatrix4dget_node_frame_inv_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix.
const LMatrix4dget_node_frame_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix.
const LMatrix4dget_node_to_vertex () const
 Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file.
const LMatrix4dget_node_to_vertex_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix.
int get_num_dimensions () const
 Returns the maximum number of dimensions used by any vertex in the pool.
EggGroupNodeget_parent () const
int get_ref_count () const
 Returns the current reference count.
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.
EggUserDataget_user_data () const
 Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.
EggUserDataget_user_data (TypeHandle type) const
 Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.
void get_uv_names (vector_string &uv_names, vector_string &uvw_names, vector_string &tbn_names) const
 Returns the list of UV names that are defined by any vertices in the pool, as well as the subset of UV names that actually define 3-d texture coordinates ("uvw_names").
EggVertexget_vertex (int index) const
 Returns the vertex in the pool with the indicated index number, or NULL if no vertices have that index number.
const LMatrix4dget_vertex_frame () const
 Returns the coordinate frame of the vertices referenced by primitives at or under this node.
const LMatrix4dget_vertex_frame_inv () const
 Returns the inverse of the matrix returned by get_vertex_frame().
const LMatrix4dget_vertex_frame_inv_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix.
const LMatrix4dget_vertex_frame_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix.
const LMatrix4dget_vertex_to_node () const
 Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node.
const LMatrix4dget_vertex_to_node_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix.
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
bool has_colors () const
 Returns true if any vertex in the pool has a color defined, false if none of them do.
bool has_defined_vertices () const
 Returns true if any vertices in the pool are fully defined vertices, false if all vertices are forward references.
bool has_forward_vertices () const
 Returns true if any vertices in the pool are undefined forward-reference vertices, false if all vertices are defined.
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.
bool has_nonwhite_colors () const
 Returns true if any vertex in the pool has a color defined other than white, false if no vertices have colors, or if all colors are white.
bool has_normals () const
 Returns true if any vertex in the pool has a normal defined, false if none of them do.
bool has_user_data (TypeHandle type) const
 Returns true if the user data pointer of the indicated type has been set, false otherwise.
bool has_user_data () const
 Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.
bool has_uvs () const
 Returns true if any vertex in the pool has a uv defined, false if none of them do.
bool has_vertex (int index) const
 Returns true if the indicated vertex has been defined in the vertex pool, false otherwise.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
virtual bool is_anim_matrix () const
 Returns true if this node represents a table of animation transformation data, false otherwise.
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
virtual bool is_joint () const
 Returns true if this particular node represents a <Joint> entry or not.
bool is_local_coord () const
 Returns true if this node's vertices are not in the global coordinate space.
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
bool is_under_instance () const
 Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise.
bool is_under_transform () const
 Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, 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.
EggVertexmake_new_vertex ()
 Allocates and returns a new vertex from the pool.
EggVertexmake_new_vertex (const LPoint3d &pos)
 Allocates and returns a new vertex from the pool.
EggVertexmake_new_vertex (double pos)
 Allocates and returns a new vertex from the pool.
EggVertexmake_new_vertex (const LPoint2d &pos)
 Allocates and returns a new vertex from the pool.
EggVertexmake_new_vertex (const LPoint4d &pos)
 Allocates and returns a new vertex from the pool.
void operator delete (void *ptr)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr, void *)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
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 *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void * operator new[] (size_t size)
EggVertexoperator[] (int index) const
 Returns the vertex in the pool with the indicated index number, or NULL if no vertices have that index number.
void output (ostream &out) const
 Outputs the Namable.
bool parse_egg (const string &egg_syntax)
 Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition.
void ref () const
 Explicitly increments the reference count.
int remove_unused_vertices ()
 Removes all vertices from the pool that are not referenced by at least one primitive.
void remove_vertex (EggVertex *vertex)
 Removes the vertex from the pool.
int rename_node (vector_string strip_prefix)
 Rename by stripping out the prefix.
void set_highest_index (int highest_index)
 Artificially changes the "highest index number", so that a newly created vertex will begin at this number plus 1.
void set_name (const string &name)
void set_user_data (EggUserData *user_data)
 Sets the user data associated with this object.
size_type size () const
 Returns the number of vertices in the pool.
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.
void test_under_integrity () const
 Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors.
void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to all the vertices.
void transform_vertices_only (const LMatrix4d &mat)
 Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.
virtual bool unref () const
 Explicitly decrements the reference count.
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
 Writes the vertex pool to the indicated output stream in Egg format.
void write_header (ostream &out, int indent_level, const char *egg_keyword) const
 Writes the first line of the egg object, e.g.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Types

typedef RefCountObj< LMatrix4dMatrixFrame
enum  UnderFlags { UF_under_instance = 0x001, UF_under_transform = 0x002, UF_local_coord = 0x004 }

Protected Member Functions

virtual void adjust_under ()
 This is called within update_under() after all the various under settings have been inherited directly from the parent node.
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.
virtual bool egg_start_parse_body ()
 This function is called within parse_egg().
virtual bool has_primitives () const
 Returns true if there are any primitives (e.g.
virtual bool joint_has_primitives () const
 Returns true if there are any primitives (e.g.
 PT (MatrixFrame) _vertex_frame_inv
 PT (MatrixFrame) _node_to_vertex
 PT (MatrixFrame) _vertex_frame
 PT (MatrixFrame) _node_frame_inv
 PT (MatrixFrame) _node_frame
 PT (MatrixFrame) _vertex_to_node
virtual void r_apply_texmats (EggTextureCollection &textures)
 The recursive implementation of apply_texmats().
virtual void r_flatten_transforms ()
 The recursive implementation of flatten_transforms().
virtual void r_mark_coordsys (CoordinateSystem cs)
 This is only called immediately after loading an egg file from disk, to propagate the value found in the CoordinateSystem entry (or the default Y-up coordinate system) to all nodes that care about what the coordinate system is.
virtual void r_transform (const LMatrix4d &mat, const LMatrix4d &inv, CoordinateSystem to_cs)
 This is called from within the egg code by transform().
virtual void r_transform_vertices (const LMatrix4d &mat)
 This is called from within the egg code by transform_vertices_only()().
virtual void update_under (int depth_offset)
 This function is called from within EggGroupNode whenever the parentage of the node has changed.

Protected Attributes

int _depth
EggGroupNode_parent
int _under_flags

Friends

class EggVertex

Detailed Description

A collection of vertices.

There may be any number of vertex pools in a single egg structure. The vertices in a single pool need not necessarily have any connection to each other, but it is necessary that any one primitive (e.g. a polygon) must pull all its vertices from the same pool.

An EggVertexPool is an STL-style container of pointers to EggVertex's. Functions add_vertex() and remove_vertex() are provided to manipulate the list. The list may also be operated on (read-only) via iterators and begin()/end().

Definition at line 46 of file eggVertexPool.h.


Constructor & Destructor Documentation

EggVertexPool::EggVertexPool ( const EggVertexPool copy)

Copying a vertex pool is of questionable value, since it will copy all of the vertices and assign new pointers to them all.

There will be no polygons referring to the new vertices.

Definition at line 42 of file eggVertexPool.cxx.

References add_vertex(), begin(), end(), and EggVertex::get_index().


Member Function Documentation

EggVertex * EggVertexPool::add_vertex ( EggVertex vertex,
int  index = -1 
)

Adds the indicated vertex to the pool.

It is an error if the vertex is already a member of this or any other pool. The vertex must have been allocated from the free store; its pointer will now be owned by the vertex pool. If the index number is supplied, tries to assign that index number; it is an error if the index number is already in use.

It is possible that a forward reference to this vertex was requested in the past; if so, the data from the supplied vertex is copied onto the forward reference, which becomes the actual vertex. In this case, a different pointer is saved (and returned) than the one actually passed in. In the usual case, however, the vertex pointer passed in is the one that is saved in the vertex pool and returned from this method.

Definition at line 437 of file eggVertexPool.cxx.

References get_highest_index(), and EggVertex::is_forward_reference().

Referenced by create_unique_vertex(), EggVertexPool(), get_forward_vertex(), make_new_vertex(), and EggMesherFanMaker::unroll().

void EggNode::adjust_under ( ) [protected, virtual, inherited]

This is called within update_under() after all the various under settings have been inherited directly from the parent node.

It is responsible for adjusting these settings to reflect states local to the current node; for instance, an <Instance> node will force the UF_under_instance bit on.

Reimplemented in EggGroup.

Definition at line 401 of file eggNode.cxx.

Referenced by EggNode::update_under().

void EggNode::apply_texmats ( ) [inherited]

Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves.

Definition at line 58 of file eggNode.cxx.

References EggTextureCollection::find_used_textures(), and EggNode::r_apply_texmats().

EggTransform * EggObject::as_transform ( ) [virtual, inherited]

Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.

Reimplemented in EggGroup, and EggTexture.

Definition at line 183 of file eggObject.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.

EggVertexPool::iterator EggVertexPool::begin ( ) const

Returns an iterator that can be used to traverse through all the vertices in the pool.

Definition at line 377 of file eggVertexPool.cxx.

Referenced by XFileMesh::create_polygons(), EggVertexPool(), SoftToEggConverter::FindClosestTriVert(), SoftNodeDesc::make_vertex_offsets(), transform(), and write().

void EggVertexPool::check_overall_color ( bool &  has_overall_color,
Colorf overall_color 
) const

Scans the vertex pool for different colors on different vertices.

If all vertices are the same color, sets has_overall_color to true and fills the color into overall_color. If no vertices have any color, set has_overall_color to true and fills white into overall_color. If at least two vertices have different colors, sets has_overall_color to false.

Definition at line 283 of file eggVertexPool.cxx.

References LVecBase4f::almost_equal(), empty(), and EggAttributes::get_color().

Referenced by EggLoader::make_polyset().

void Namable::clear_name ( ) [inline, inherited]

Resets the Namable's name to empty.

Reimplemented in AsyncTask.

Definition at line 64 of file namable.I.

void EggObject::clear_user_data ( ) [inherited]

Removes *all* user data pointers from the node.

Definition at line 153 of file eggObject.cxx.

void EggObject::clear_user_data ( TypeHandle  type) [inherited]

Removes the user data pointer of the indicated type.

Definition at line 164 of file eggObject.cxx.

EggVertex * EggVertexPool::create_unique_vertex ( const EggVertex copy)

Creates a new vertex in the pool that is a copy of the indicated one and returns it.

If there is already a vertex in the pool like the indicated one, simply returns that one.

Definition at line 490 of file eggVertexPool.cxx.

References add_vertex().

Referenced by XFileMesh::create_polygons(), EggPrimitive::do_apply_flat_attribute(), EggPrimitive::r_apply_texmats(), EggPrimitive::r_flatten_transforms(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::strip_normals(), EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().

EggRenderMode * EggNode::determine_alpha_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has an alpha_mode other than AM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 99 of file eggNode.cxx.

References EggNode::determine_alpha_mode().

Referenced by EggNode::determine_alpha_mode().

EggRenderMode * EggNode::determine_bin ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a bin specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 207 of file eggNode.cxx.

References EggNode::determine_bin().

Referenced by EggNode::determine_bin().

bool EggNode::determine_decal ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set.

Returns the value of the decal flag if it is found, or false if it is not.

In other words, returns true if the "decal" flag is in effect for the indicated node, false otherwise.

Reimplemented in EggGroup.

Definition at line 247 of file eggNode.cxx.

References EggNode::determine_decal().

Referenced by EggNode::determine_decal().

EggRenderMode * EggNode::determine_depth_offset ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_offset specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 171 of file eggNode.cxx.

References EggNode::determine_depth_offset().

Referenced by EggNode::determine_depth_offset().

EggRenderMode * EggNode::determine_depth_test_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_test_mode other than DTM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 135 of file eggNode.cxx.

References EggNode::determine_depth_test_mode().

Referenced by EggNode::determine_depth_test_mode().

EggRenderMode * EggNode::determine_depth_write_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_write_mode other than DWM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 117 of file eggNode.cxx.

References EggNode::determine_depth_write_mode().

Referenced by EggNode::determine_depth_write_mode().

EggRenderMode * EggNode::determine_draw_order ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a draw_order specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 189 of file eggNode.cxx.

References EggNode::determine_draw_order().

Referenced by EggNode::determine_draw_order().

bool EggNode::determine_indexed ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set.

Returns the value of the indexed scalar if it is found, or false if it is not.

In other words, returns true if the "indexed" flag is in effect for the indicated node, false otherwise.

Reimplemented in EggGroup.

Definition at line 227 of file eggNode.cxx.

References EggNode::determine_indexed().

Referenced by EggNode::determine_indexed().

EggRenderMode * EggNode::determine_visibility_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 153 of file eggNode.cxx.

References EggNode::determine_visibility_mode().

Referenced by EggNode::determine_visibility_mode().

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

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

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

Definition at line 29 of file referenceCount.cxx.

Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::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().

bool EggNode::egg_start_parse_body ( ) [protected, virtual, inherited]

This function is called within parse_egg().

It should call the appropriate function on the lexer to initialize the parser into the state associated with this object. If the object cannot be parsed into directly, it should return false.

Reimplemented in EggGroup, EggPrimitive, and EggTexture.

Definition at line 340 of file eggNode.cxx.

Referenced by EggNode::parse_egg().

bool EggVertexPool::empty ( ) const

Returns true if the pool is empty.

Definition at line 400 of file eggVertexPool.cxx.

Referenced by check_overall_color(), and EggGroupNode::remove_unused_vertices().

EggVertexPool::iterator EggVertexPool::end ( ) const

Returns an iterator that can be used to traverse through all the vertices in the pool.

Definition at line 390 of file eggVertexPool.cxx.

Referenced by XFileMesh::create_polygons(), EggVertexPool(), SoftToEggConverter::FindClosestTriVert(), SoftNodeDesc::make_vertex_offsets(), transform(), and write().

EggVertex * EggVertexPool::find_matching_vertex ( const EggVertex copy)

If the EggVertexPool already has a vertex matching the indicated vertex, returns it; otherwise, returns NULL.

This is similar to create_unique_vertex() except that a new vertex is never created.

Definition at line 512 of file eggVertexPool.cxx.

Referenced by EggGroupNode::rebuild_vertex_pools().

void EggNode::flatten_transforms ( ) [inline, inherited]

Removes any transform and instance records from this node in the scene graph and below.

If an instance node is encountered, removes the instance and applies the transform to its vertices, duplicating vertices if necessary.

Since this function may result in duplicated vertices, it may be a good idea to call remove_unused_vertices() after calling this.

Definition at line 351 of file eggNode.I.

References EggNode::r_flatten_transforms(), and EggNode::update_under().

int EggNode::get_depth ( ) const [inline, inherited]

Returns the number of nodes above this node in the egg hierarchy.

Definition at line 71 of file eggNode.I.

EggVertex * EggVertexPool::get_forward_vertex ( int  index)

Returns the vertex in the pool with the indicated index number.

If there is not a vertex in the pool with the indicated index number, creates a special forward-reference EggVertex that has no data, on the assumption that the vertex pool has not yet been fully read and more data will be available later.

Definition at line 152 of file eggVertexPool.cxx.

References add_vertex().

int EggVertexPool::get_highest_index ( ) const

Returns the highest index number used by any vertex in the pool (except forward references).

Returns -1 if the pool is empty.

Definition at line 174 of file eggVertexPool.cxx.

Referenced by add_vertex().

const LMatrix4d & EggNode::get_node_frame ( ) const [inline, inherited]

Returns the coordinate frame of the node itself.

This is simply the net product of all transformations up to the root.

Definition at line 152 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d & EggNode::get_node_frame_inv ( ) const [inline, inherited]

Returns the inverse of the matrix returned by get_node_frame().

See get_node_frame().

Definition at line 183 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d * EggNode::get_node_frame_inv_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix.

Definition at line 277 of file eggNode.I.

const LMatrix4d * EggNode::get_node_frame_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix.

Definition at line 252 of file eggNode.I.

const LMatrix4d & EggNode::get_node_to_vertex ( ) const [inline, inherited]

Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file.

This is the same thing as:

get_node_frame() * get_vertex_frame_inv()

Definition at line 223 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by XFileMesh::create_polygons().

const LMatrix4d * EggNode::get_node_to_vertex_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix.

Definition at line 301 of file eggNode.I.

int EggVertexPool::get_num_dimensions ( ) const

Returns the maximum number of dimensions used by any vertex in the pool.

Definition at line 199 of file eggVertexPool.cxx.

References EggVertex::get_num_dimensions().

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
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().

EggUserData * EggObject::get_user_data ( ) const [inherited]

Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.

Definition at line 102 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group(), and EggBinner::sorts_less().

EggUserData * EggObject::get_user_data ( TypeHandle  type) const [inherited]

Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.

Definition at line 113 of file eggObject.cxx.

void EggVertexPool::get_uv_names ( vector_string &  uv_names,
vector_string &  uvw_names,
vector_string &  tbn_names 
) const

Returns the list of UV names that are defined by any vertices in the pool, as well as the subset of UV names that actually define 3-d texture coordinates ("uvw_names").

Also returns the subset of UV/UVW names that define a tangent and binormal. It is the user's responsibility to clear both vectors before calling this method.

Definition at line 339 of file eggVertexPool.cxx.

References EggVertexUV::has_w(), EggVertex::uv_begin(), and EggVertex::uv_end().

EggVertex * EggVertexPool::get_vertex ( int  index) const

Returns the vertex in the pool with the indicated index number, or NULL if no vertices have that index number.

Definition at line 127 of file eggVertexPool.cxx.

References EggVertex::is_forward_reference().

Referenced by EggMesherFanMaker::compute_angle(), EggMesherEdge::compute_box(), EggMesherEdge::compute_length(), EggMesherStrip::convex_quad(), has_vertex(), operator[](), remove_vertex(), and EggMesherFanMaker::unroll().

const LMatrix4d & EggNode::get_vertex_frame ( ) const [inline, inherited]

Returns the coordinate frame of the vertices referenced by primitives at or under this node.

This is not the same as get_node_frame().

Generally, vertices in an egg file are stored in the global coordinate space, regardless of the transforms defined at each node. Thus, get_vertex_frame() will usually return the identity transform (global coordinate space). However, primitives under an <Instance> entry reference their vertices in the coordinate system under effect at the time of the <Instance>. Thus, nodes under an <Instance> entry may return this non-identity matrix.

Specifically, this may return a non-identity matrix only if is_local_coord() is true.

Definition at line 135 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under(), EggPrimitive::r_flatten_transforms(), EggGroup::r_flatten_transforms(), XFileVertex::set_from_egg(), XFileNormal::set_from_egg(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_polyline().

const LMatrix4d & EggNode::get_vertex_frame_inv ( ) const [inline, inherited]

Returns the inverse of the matrix returned by get_vertex_frame().

See get_vertex_frame().

Definition at line 167 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d * EggNode::get_vertex_frame_inv_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix.

Definition at line 264 of file eggNode.I.

const LMatrix4d * EggNode::get_vertex_frame_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix.

Definition at line 239 of file eggNode.I.

const LMatrix4d & EggNode::get_vertex_to_node ( ) const [inline, inherited]

Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node.

This is the same thing as:

get_vertex_frame() * get_node_frame_inv()

Definition at line 203 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggLoader::make_polyset(), XFileVertex::set_from_egg(), and XFileNormal::set_from_egg().

const LMatrix4d * EggNode::get_vertex_to_node_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix.

Definition at line 289 of file eggNode.I.

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 EggVertexPool::has_colors ( ) const

Returns true if any vertex in the pool has a color defined, false if none of them do.

Definition at line 237 of file eggVertexPool.cxx.

bool EggVertexPool::has_defined_vertices ( ) const

Returns true if any vertices in the pool are fully defined vertices, false if all vertices are forward references.

Definition at line 107 of file eggVertexPool.cxx.

References EggVertex::is_forward_reference().

bool EggVertexPool::has_forward_vertices ( ) const

Returns true if any vertices in the pool are undefined forward-reference vertices, false if all vertices are defined.

Definition at line 87 of file eggVertexPool.cxx.

References EggVertex::is_forward_reference().

bool Namable::has_name ( ) const [inline, inherited]
bool EggVertexPool::has_nonwhite_colors ( ) const

Returns true if any vertex in the pool has a color defined other than white, false if no vertices have colors, or if all colors are white.

Definition at line 257 of file eggVertexPool.cxx.

References EggAttributes::get_color().

bool EggVertexPool::has_normals ( ) const [virtual]

Returns true if any vertex in the pool has a normal defined, false if none of them do.

Reimplemented from EggNode.

Definition at line 218 of file eggVertexPool.cxx.

bool EggNode::has_primitives ( ) const [protected, virtual, inherited]

Returns true if there are any primitives (e.g.

polygons) defined within this group or below, false otherwise.

Reimplemented in EggGroupNode, and EggPrimitive.

Definition at line 412 of file eggNode.cxx.

bool EggObject::has_user_data ( TypeHandle  type) const [inherited]

Returns true if the user data pointer of the indicated type has been set, false otherwise.

Definition at line 141 of file eggObject.cxx.

bool EggObject::has_user_data ( ) const [inherited]

Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.

Definition at line 130 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group().

bool EggVertexPool::has_uvs ( ) const

Returns true if any vertex in the pool has a uv defined, false if none of them do.

Definition at line 315 of file eggVertexPool.cxx.

References EggVertex::has_uv().

bool EggVertexPool::has_vertex ( int  index) const [inline]

Returns true if the indicated vertex has been defined in the vertex pool, false otherwise.

This does not include forward references.

Definition at line 24 of file eggVertexPool.I.

References get_vertex().

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

static void EggVertexPool::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from EggNode.

Definition at line 152 of file eggVertexPool.h.

References EggNode::init_type().

bool EggNode::is_anim_matrix ( ) const [virtual, inherited]

Returns true if this node represents a table of animation transformation data, false otherwise.

Reimplemented in EggXfmAnimData, and EggXfmSAnim.

Definition at line 85 of file eggNode.cxx.

Referenced by EggTable::has_transform(), and EggTable::r_transform().

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
bool EggNode::is_joint ( ) const [virtual, inherited]

Returns true if this particular node represents a <Joint> entry or not.

This is a handy thing to know since Joints are sorted to the end of their sibling list when writing an egg file. See EggGroupNode::write().

Reimplemented in EggGroup.

Definition at line 74 of file eggNode.cxx.

Referenced by EggGroupNode::joint_has_primitives().

bool EggNode::is_local_coord ( ) const [inline, inherited]

Returns true if this node's vertices are not in the global coordinate space.

This will be the case if there was an <Instance> node under a transform at or above this node.

Definition at line 109 of file eggNode.I.

Referenced by EggVertex::get_num_global_coord(), EggVertex::get_num_local_coord(), EggPrimitive::r_flatten_transforms(), and EggGroup::r_flatten_transforms().

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 EggNode::is_under_instance ( ) const [inline, inherited]

Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise.

Definition at line 84 of file eggNode.I.

bool EggNode::is_under_transform ( ) const [inline, inherited]

Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise.

Definition at line 96 of file eggNode.I.

bool EggNode::joint_has_primitives ( ) const [protected, virtual, inherited]

Returns true if there are any primitives (e.g.

polygons) defined within this group or below, but the search does not include nested joints.

Reimplemented in EggGroupNode, and EggPrimitive.

Definition at line 424 of file eggNode.cxx.

Referenced by EggGroupNode::joint_has_primitives().

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

EggVertex * EggVertexPool::make_new_vertex ( const LPoint2d pos) [inline]

Allocates and returns a new vertex from the pool.

This is one of three ways to add new vertices to a vertex pool.

This flavor of make_new_vertex() explicitly sets the vertex position as it is allocated. It does not attempt to share vertices.

Definition at line 83 of file eggVertexPool.I.

References make_new_vertex(), and EggVertex::set_pos().

EggVertex * EggVertexPool::make_new_vertex ( ) [inline]

Allocates and returns a new vertex from the pool.

This is one of three ways to add new vertices to a vertex pool.

Definition at line 48 of file eggVertexPool.I.

References add_vertex().

Referenced by make_new_vertex().

EggVertex * EggVertexPool::make_new_vertex ( double  pos) [inline]

Allocates and returns a new vertex from the pool.

This is one of three ways to add new vertices to a vertex pool.

This flavor of make_new_vertex() explicitly sets the vertex position as it is allocated. It does not attempt to share vertices.

Definition at line 65 of file eggVertexPool.I.

References make_new_vertex(), and EggVertex::set_pos().

EggVertex * EggVertexPool::make_new_vertex ( const LPoint4d pos) [inline]

Allocates and returns a new vertex from the pool.

This is one of three ways to add new vertices to a vertex pool.

This flavor of make_new_vertex() explicitly sets the vertex position as it is allocated. It does not attempt to share vertices.

Definition at line 119 of file eggVertexPool.I.

References make_new_vertex(), and EggVertex::set_pos().

EggVertex * EggVertexPool::make_new_vertex ( const LPoint3d pos) [inline]

Allocates and returns a new vertex from the pool.

This is one of three ways to add new vertices to a vertex pool.

This flavor of make_new_vertex() explicitly sets the vertex position as it is allocated. It does not attempt to share vertices.

Definition at line 101 of file eggVertexPool.I.

References make_new_vertex(), and EggVertex::set_pos().

EggVertex * EggVertexPool::operator[] ( int  index) const [inline]

Returns the vertex in the pool with the indicated index number, or NULL if no vertices have that index number.

Definition at line 36 of file eggVertexPool.I.

References get_vertex().

void EggNamedObject::output ( ostream &  out) const [inherited]

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

Definition at line 28 of file eggNamedObject.cxx.

References Namable::has_name().

bool EggNode::parse_egg ( const string &  egg_syntax) [inherited]

Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition.

Updates the object accordingly. Returns true if successful, false if there was some parse error or if the object does not support this functionality.

Definition at line 267 of file eggNode.cxx.

References EggNode::egg_start_parse_body(), and TypedObject::is_of_type().

void EggNode::r_apply_texmats ( EggTextureCollection textures) [protected, virtual, inherited]

The recursive implementation of apply_texmats().

Reimplemented in EggGroupNode, EggNurbsSurface, and EggPrimitive.

Definition at line 499 of file eggNode.cxx.

Referenced by EggNode::apply_texmats().

void EggNode::r_flatten_transforms ( ) [protected, virtual, inherited]

The recursive implementation of flatten_transforms().

Reimplemented in EggGroup, EggGroupNode, and EggPrimitive.

Definition at line 490 of file eggNode.cxx.

Referenced by EggNode::flatten_transforms().

void EggNode::r_mark_coordsys ( CoordinateSystem  cs) [protected, virtual, inherited]

This is only called immediately after loading an egg file from disk, to propagate the value found in the CoordinateSystem entry (or the default Y-up coordinate system) to all nodes that care about what the coordinate system is.

Reimplemented in EggGroupNode, EggXfmAnimData, and EggXfmSAnim.

Definition at line 481 of file eggNode.cxx.

void EggVertexPool::r_transform ( const LMatrix4d mat,
const LMatrix4d inv,
CoordinateSystem  to_cs 
) [protected, virtual]

This is called from within the egg code by transform().

It applies a transformation matrix to the current node in some sensible way, then continues down the tree.

The first matrix is the transformation to apply; the second is its inverse. The third parameter is the coordinate system we are changing to, or CS_default if we are not changing coordinate systems.

Reimplemented from EggNode.

Definition at line 773 of file eggVertexPool.cxx.

void EggVertexPool::r_transform_vertices ( const LMatrix4d mat) [protected, virtual]

This is called from within the egg code by transform_vertices_only()().

It applies a transformation matrix to the current node in some sensible way (if the current node is a vertex pool with vertices), then continues down the tree.

Reimplemented from EggNode.

Definition at line 786 of file eggVertexPool.cxx.

References transform().

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

int EggVertexPool::remove_unused_vertices ( )

Removes all vertices from the pool that are not referenced by at least one primitive.

Also collapses together equivalent vertices, and renumbers all vertices after the operation so their indices are consecutive, beginning at zero. Returns the number of vertices removed.

Definition at line 593 of file eggVertexPool.cxx.

References EggVertex::clear_grefs(), EggPrimitive::find(), EggVertex::pref_size(), EggPrimitive::replace(), and EggVertex::test_pref_integrity().

Referenced by EggLoader::make_polyset(), and EggGroupNode::remove_unused_vertices().

void EggVertexPool::remove_vertex ( EggVertex vertex)

Removes the vertex from the pool.

It is an error if the vertex is not already a member of the pool.

Definition at line 533 of file eggVertexPool.cxx.

References get_vertex().

int EggNode::rename_node ( vector_string  strip_prefix) [inherited]

Rename by stripping out the prefix.

Definition at line 36 of file eggNode.cxx.

Referenced by EggGroupNode::rename_nodes().

void EggVertexPool::set_highest_index ( int  highest_index)

Artificially changes the "highest index number", so that a newly created vertex will begin at this number plus 1.

This can be used to default a vertex pool to start counting at 1 (or any other index number), instead of the default of 0. Use with caution.

Definition at line 188 of file eggVertexPool.cxx.

void EggObject::set_user_data ( EggUserData user_data) [inherited]

Sets the user data associated with this object.

This may be any EggUserData-derived object. The egg library will do nothing with this pointer, except to hold its reference count and return the pointer on request.

The EggObject maintains multiple different EggUserData pointers, one for each unique type (as reported by get_type()). If you know that only one type of EggUserData object will be added in your application, you may use the query functions that accept no parameters, but it is recommended that in general you pass in the type of your particular user data, to allow multiple applications to coexist in the same egg data.

This pointer is also copied by the copy assignment operator and copy constructor.

Definition at line 89 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group(), and EggBinner::prepare_node().

EggVertexPool::size_type EggVertexPool::size ( ) const

Returns the number of vertices in the pool.

Definition at line 410 of file eggVertexPool.cxx.

Referenced by SoftToEggConverter::FindClosestTriVert(), SoftNodeDesc::make_vertex_offsets(), EggGroupNode::rebuild_vertex_pools(), and transform().

bool ReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]
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().

void EggNode::test_under_integrity ( ) const [inherited]

Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors.

Definition at line 300 of file eggNode.cxx.

References ReferenceCount::test_ref_count_integrity(), and EggNode::test_under_integrity().

Referenced by EggNode::test_under_integrity(), EggGroup::write(), EggAnimPreload::write(), EggTable::write(), and EggXfmSAnim::write().

void EggVertexPool::transform ( const LMatrix4d mat)

Applies the indicated transformation matrix to all the vertices.

However, vertices that are attached to primitives that believe their vertices are in a local coordinate system are transformed only by the scale and rotation component. If a vertex happens to be attached both to a local and a global primitive, and the transformation includes a translation component, the vertex will be split.

Reimplemented from EggNode.

Definition at line 675 of file eggVertexPool.cxx.

References begin(), end(), EggVertex::get_num_global_coord(), EggVertex::get_num_local_coord(), LMatrix4d::get_row3(), LMatrix4d::set_row(), size(), and EggVertex::transform().

Referenced by r_transform_vertices().

void EggNode::transform_vertices_only ( const LMatrix4d mat) [inline, inherited]

Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.

Joints and other transforms are not affected, nor are local vertices.

Definition at line 333 of file eggNode.I.

References EggNode::r_transform_vertices().

Referenced by EggTopstrip::strip_anim_vertices().

bool ReferenceCount::unref ( ) const [inline, virtual, 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, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.

Definition at line 214 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().

void EggNode::update_under ( int  depth_offset) [protected, virtual, inherited]

This function is called from within EggGroupNode whenever the parentage of the node has changed.

It should update the depth and under_instance flags accordingly.

depth_offset is the difference between the old depth value and the new value. It should be consistent with the supplied depth value. If it is not, we have some error.

Reimplemented in EggGroupNode.

Definition at line 358 of file eggNode.cxx.

References EggNode::adjust_under(), and ReferenceCount::test_ref_count_integrity().

Referenced by EggNode::flatten_transforms(), and EggNode::transform().

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 EggVertexPool::write ( ostream &  out,
int  indent_level 
) const [virtual]

Writes the vertex pool to the indicated output stream in Egg format.

Implements EggNode.

Definition at line 746 of file eggVertexPool.cxx.

References begin(), end(), and EggNamedObject::write_header().

void EggNamedObject::write_header ( ostream &  out,
int  indent_level,
const char *  egg_keyword 
) const [inherited]

Writes the first line of the egg object, e.g.

"<Group> group_name {" or some such. It automatically enquotes the name if it contains any special characters. egg_keyword is the keyword that begins the line, e.g. "<Group>".

Definition at line 45 of file eggNamedObject.cxx.

References Namable::has_name().

Referenced by EggXfmSAnim::write(), EggXfmAnimData::write(), write(), EggTriangleStrip::write(), EggTriangleFan::write(), EggTexture::write(), EggTable::write(), EggSAnimData::write(), EggPoint::write(), EggNurbsSurface::write(), EggNurbsCurve::write(), EggMaterial::write(), EggLine::write(), EggGroup::write(), EggExternalReference::write(), EggComment::write(), and EggAnimPreload::write().


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