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

EggTable Class Reference

This corresponds to a. More...

#include "eggTable.h"

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

List of all members.

Public Types

typedef Children::const_iterator const_iterator
typedef Children::const_pointer const_pointer
typedef Children::const_reference const_reference
typedef
Children::const_reverse_iterator 
const_reverse_iterator
typedef Children::difference_type difference_type
typedef Children::const_iterator iterator
typedef Children::const_pointer pointer
typedef Children::const_reference reference
typedef
Children::const_reverse_iterator 
reverse_iterator
typedef Children::size_type size_type
enum  TableType { TT_invalid, TT_table, TT_bundle }
enum  TriangulateFlags {
  T_polygon = 0x001, T_convex = 0x002, T_composite = 0x004, T_recurse = 0x008,
  T_flat_shaded = 0x010
}

Public Member Functions

 EggTable (const string &name="")
 EggTable (const EggTable &copy)
EggNodeadd_child (EggNode *node)
 Adds the indicated child to the group and returns it.
void apply_first_attribute (bool recurse)
 Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
void apply_last_attribute (bool recurse)
 Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
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
void clear ()
void clear_connected_shading ()
 Resets the connected_shading information on all primitives at this node and below, so that it may be accurately rederived by the next call to get_connected_shading().
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.
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
iterator end () const
iterator erase (iterator first, iterator last)
iterator erase (iterator position)
EggNodefind_child (const string &name) const
 Returns the child of this node whose name is the indicated string, or NULL if there is no child of this node by that name.
void flatten_transforms ()
 Removes any transform and instance records from this node in the scene graph and below.
void force_filenames (const Filename &directory)
 Similar to resolve_filenames, but each non-absolute filename encountered is arbitrarily taken to be in the indicated directory, whether or not the so-named filename exists.
virtual TypeHandle force_init_type ()
int get_best_parent_from_Set (const std::set< int > &) const
void get_connected_shading ()
 Queries the connected_shading information on all primitives at this node and below, to ensure that it has been completely filled in before we start mucking around with vertices.
int get_depth () const
 Returns the number of nodes above this node in the egg hierarchy.
EggNodeget_first_child ()
 Returns the first child in the group's list of children, or NULL if the list of children is empty.
const string & get_name () const
EggNodeget_next_child ()
 Returns the next child in the group's list of children since the last call to get_first_child() or get_next_child(), or NULL if the last child has been returned.
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.
EggGroupNodeget_parent () const
int get_ref_count () const
 Returns the current reference count.
TableType get_table_type () const
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.
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_absolute_pathnames () const
 Returns true if any nodes at this level and below include a reference to a file via an absolute pathname, or false if all references are relative.
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.
virtual bool has_normals () const
 Returns true if any of the primitives (e.g.
virtual bool has_primitives () const
 Returns true if there are any primitives (e.g.
bool has_transform () const
 Returns true if the table contains a transform description, 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_user_data (TypeHandle type) const
 Returns true if the user data pointer of the indicated type has been set, false otherwise.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
iterator insert (iterator position, PT(EggNode) x)
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.
virtual bool joint_has_primitives () const
 Returns true if there are any primitives (e.g.
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void mesh_triangles (int flags)
 Combine triangles together into triangle strips, at this group and below.
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
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 * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
EggTableoperator= (const EggTable &copy)
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 post_apply_flat_attribute (bool recurse)
 Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*.
 PT (EggNode) remove_child(EggNode *node)
reverse_iterator rbegin () const
void rebuild_vertex_pools (EggVertexPools &vertex_pools, unsigned int max_vertices, bool recurse)
 Copies vertices used by the primitives at this group node (and below, if recurse is true) into one or more new vertex pools, and updates the primitives to reference these pools.
void recompute_polygon_normals (CoordinateSystem cs=CS_default)
 Recomputes all the polygon normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
bool recompute_tangent_binormal (const GlobPattern &uv_name)
 This function recomputes the tangent and binormal for the named texture coordinate set for all vertices at this level and below.
bool recompute_tangent_binormal (const vector_string &names)
 This function recomputes the tangent and binormal for the named texture coordinate sets.
bool recompute_tangent_binormal_auto ()
 This function recomputes the tangent and binormal for any texture coordinate set that affects a normal map.
void recompute_vertex_normals (double threshold, CoordinateSystem cs=CS_default)
 Recomputes all the vertex normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
void ref () const
 Explicitly increments the reference count.
int remove_invalid_primitives (bool recurse)
 Removes primitives at this level and below which appear to be degenerate; e.g.
int remove_unused_vertices (bool recurse)
 Removes all vertices from VertexPools within this group or below that are not referenced by at least one primitive.
int rename_node (vector_string strip_prefix)
 Rename by stripping out the prefix.
int rename_nodes (vector_string strip_prefix, bool recurse)
 Rename by stripping out the prefix.
reverse_iterator rend () const
void replace (iterator position, PT(EggNode) x)
 Replaces the node at the indicated position with the indicated node.
void resolve_filenames (const DSearchPath &searchpath)
 Walks the tree and attempts to resolve any filenames encountered.
void reverse_vertex_ordering ()
 Reverses the vertex ordering of all polygons defined at this node and below.
void set_name (const string &name)
void set_table_type (TableType type)
void set_user_data (EggUserData *user_data)
 Sets the user data associated with this object.
size_type size () const
void steal_children (EggGroupNode &other)
 Moves all the children from the other node to this one.
void strip_normals ()
 Removes all normals from primitives, and the vertices they reference, at this node and below.
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 to the node and all of its descendants.
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.
int triangulate_polygons (int flags)
 Replace all higher-order polygons at this point in the scene graph and below with triangles.
void unify_attributes (bool use_connected_shading, bool allow_per_primitive, bool recurse)
 Applies per-vertex normal and color to all vertices, if they are in fact per-vertex (and different for each vertex), or moves them to the primitive if they are all the same.
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.
virtual void write (ostream &out, int indent_level) const
 Writes the table and all of its children 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.
static bool is_right (const LVector2d &v1, const LVector2d &v2)
 Returns true if the 2-d v1 is to the right of v2.
static TableType string_table_type (const string &string)
 Returns the TableType value associated with the given string representation, or TT_invalid if the string does not match any known TableType value.

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().
CoordinateSystem find_coordsys_entry ()
 Walks the tree, looking for an EggCoordinateSystem entry.
int find_materials (EggMaterialCollection *collection)
 Walks the tree, looking for EggMaterials.
int find_textures (EggTextureCollection *collection)
 Walks the tree, looking for EggTextures.
 PT (MatrixFrame) _vertex_frame
virtual void r_apply_texmats (EggTextureCollection &textures)
 The recursive implementation of apply_texmats().
virtual void r_flatten_transforms ()
 The recursive implementation of flatten_transforms().
bool r_load_externals (const DSearchPath &searchpath, CoordinateSystem coordsys, BamCacheRecord *record)
 Walks the tree and locates unloaded external reference nodes, which it attempts to locate and load in.
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

Detailed Description

This corresponds to a.

a <Bundle> entry. As such, it doesn't actually contain a table of numbers, but it may be a parent to an EggSAnimData or an EggXfmAnimData, which do. It may also be a parent to another

<Bundle>, establishing a hierarchy of tables.

Definition at line 31 of file eggTable.h.


Member Function Documentation

EggNode * EggGroupNode::add_child ( EggNode node) [inherited]
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 EggGroupNode::apply_first_attribute ( bool  recurse) [inherited]

Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.

This reflects the DirectX convention of storing flat-shaded properties on the first vertex, although it is not usually a convention in Egg.

This may create redundant vertices in the vertex pool, so it may be a good idea to follow this up with remove_unused_vertices().

Definition at line 1139 of file eggGroupNode.cxx.

References EggPrimitive::apply_first_attribute(), and TypedObject::is_of_type().

Referenced by EggLoader::make_polyset().

void EggGroupNode::apply_last_attribute ( bool  recurse) [inherited]

Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.

This reflects the OpenGL convention of storing flat-shaded properties on the last vertex, although it is not usually a convention in Egg.

This may create redundant vertices in the vertex pool, so it may be a good idea to follow this up with remove_unused_vertices().

Definition at line 1108 of file eggGroupNode.cxx.

References EggPrimitive::apply_last_attribute(), and TypedObject::is_of_type().

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.

void EggGroupNode::clear_connected_shading ( ) [inherited]

Resets the connected_shading information on all primitives at this node and below, so that it may be accurately rederived by the next call to get_connected_shading().

It may be a good idea to call remove_unused_vertices() as well, to establish the correct connectivity between common vertices.

Definition at line 995 of file eggGroupNode.cxx.

References EggPrimitive::clear_connected_shading(), and TypedObject::is_of_type().

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.

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

EggNode * EggGroupNode::find_child ( const string &  name) const [inherited]

Returns the child of this node whose name is the indicated string, or NULL if there is no child of this node by that name.

Does not search recursively.

Definition at line 342 of file eggGroupNode.cxx.

Referenced by EggXfmSAnim::add_component_data(), EggXfmSAnim::add_data(), SoftNodeDesc::make_vertex_offsets(), and EggXfmSAnim::set_value().

CoordinateSystem EggGroupNode::find_coordsys_entry ( ) [protected, inherited]

Walks the tree, looking for an EggCoordinateSystem entry.

If one is found, extracts it and returns its value. If multiple entries are found, extracts all of them and returns CS_invalid if they disagree.

Definition at line 1517 of file eggGroupNode.cxx.

References TypedObject::is_of_type().

int EggGroupNode::find_materials ( EggMaterialCollection collection) [protected, inherited]

Walks the tree, looking for EggMaterials.

Each EggMaterial that is found is removed from the hierarchy and added to the EggMaterialCollection. Returns the number of EggMaterials found.

Definition at line 1621 of file eggGroupNode.cxx.

References EggMaterialCollection::add_material(), and TypedObject::is_of_type().

Referenced by EggMaterialCollection::extract_materials().

int EggGroupNode::find_textures ( EggTextureCollection collection) [protected, inherited]

Walks the tree, looking for EggTextures.

Each EggTexture that is found is removed from the hierarchy and added to the EggTextureCollection. Returns the number of EggTextures found.

Definition at line 1575 of file eggGroupNode.cxx.

References EggTextureCollection::add_texture(), and TypedObject::is_of_type().

Referenced by EggTextureCollection::extract_textures().

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

void EggGroupNode::force_filenames ( const Filename directory) [inherited]

Similar to resolve_filenames, but each non-absolute filename encountered is arbitrarily taken to be in the indicated directory, whether or not the so-named filename exists.

Definition at line 461 of file eggGroupNode.cxx.

References EggTexture::get_alpha_filename(), EggFilenameNode::get_filename(), EggTexture::has_alpha_filename(), Filename::is_local(), TypedObject::is_of_type(), and EggTexture::set_alpha_filename().

void EggGroupNode::get_connected_shading ( ) [inherited]

Queries the connected_shading information on all primitives at this node and below, to ensure that it has been completely filled in before we start mucking around with vertices.

Definition at line 1018 of file eggGroupNode.cxx.

References EggPrimitive::get_connected_shading(), and TypedObject::is_of_type().

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.

EggNode * EggGroupNode::get_first_child ( ) [inherited]

Returns the first child in the group's list of children, or NULL if the list of children is empty.

Can be used with get_next_child() to return the complete list of children without using the iterator class; however, this is non-thread-safe, and so is not recommended except for languages other than C++ which cannot use the iterators.

Definition at line 246 of file eggGroupNode.cxx.

References EggGroupNode::get_next_child().

EggNode * EggGroupNode::get_next_child ( ) [inherited]

Returns the next child in the group's list of children since the last call to get_first_child() or get_next_child(), or NULL if the last child has been returned.

Can be used with get_first_child() to return the complete list of children without using the iterator class; however, this is non-thread-safe, and so is not recommended except for languages other than C++ which cannot use the iterators.

It is an error to call this without previously calling get_first_child().

Definition at line 267 of file eggGroupNode.cxx.

Referenced by EggGroupNode::get_first_child().

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

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

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 EggGroupNode::has_absolute_pathnames ( ) const [inherited]

Returns true if any nodes at this level and below include a reference to a file via an absolute pathname, or false if all references are relative.

Definition at line 362 of file eggGroupNode.cxx.

References EggTexture::get_alpha_filename(), EggFilenameNode::get_filename(), EggTexture::has_alpha_filename(), Filename::is_local(), and TypedObject::is_of_type().

bool Namable::has_name ( ) const [inline, inherited]
bool EggGroupNode::has_normals ( ) const [virtual, inherited]

Returns true if any of the primitives (e.g.

polygons) defined within this group or below have either face or vertex normals defined, false otherwise.

Reimplemented from EggNode.

Definition at line 1234 of file eggGroupNode.cxx.

bool EggGroupNode::has_primitives ( ) const [virtual, inherited]

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

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

Reimplemented from EggNode.

Definition at line 1188 of file eggGroupNode.cxx.

bool EggTable::has_transform ( ) const

Returns true if the table contains a transform description, false otherwise.

Definition at line 29 of file eggTable.cxx.

References EggNode::is_anim_matrix().

Referenced by r_transform().

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 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 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 EggTable::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 EggGroupNode.

Definition at line 64 of file eggTable.h.

References EggGroupNode::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 has_transform(), and 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 EggGroupNode::is_right ( const LVector2d v1,
const LVector2d v2 
) [inline, static, inherited]

Returns true if the 2-d v1 is to the right of v2.

Definition at line 22 of file eggGroupNode.I.

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 EggGroupNode::joint_has_primitives ( ) const [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 from EggNode.

Definition at line 1209 of file eggGroupNode.cxx.

References EggNode::is_joint(), and EggNode::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().

void EggGroupNode::mesh_triangles ( int  flags) [inherited]

Combine triangles together into triangle strips, at this group and below.

Definition at line 844 of file eggGroupNode.cxx.

References EggMesher::mesh(), and EggGroupNode::mesh_triangles().

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

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 EggGroupNode::post_apply_flat_attribute ( bool  recurse) [inherited]

Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*.

Definition at line 1164 of file eggGroupNode.cxx.

References TypedObject::is_of_type(), and EggPrimitive::post_apply_flat_attribute().

Referenced by EggLoader::make_polyset().

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

The recursive implementation of apply_texmats().

Reimplemented from EggNode.

Definition at line 1499 of file eggGroupNode.cxx.

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

The recursive implementation of flatten_transforms().

Reimplemented from EggNode.

Reimplemented in EggGroup.

Definition at line 1484 of file eggGroupNode.cxx.

bool EggGroupNode::r_load_externals ( const DSearchPath searchpath,
CoordinateSystem  coordsys,
BamCacheRecord record 
) [protected, inherited]

Walks the tree and locates unloaded external reference nodes, which it attempts to locate and load in.

The reference node is replaced with the entire subtree loaded. This is intended to be called from EggData::load_externals().

Definition at line 1668 of file eggGroupNode.cxx.

References BamCacheRecord::add_dependent_file(), Filename::get_basename_wo_extension(), TypedObject::is_of_type(), EggData::load_externals(), EggGroupNode::r_load_externals(), EggData::read(), EggGroupNode::replace(), EggData::resolve_egg_filename(), EggData::set_auto_resolve_externals(), EggData::set_coordinate_system(), and EggGroupNode::steal_children().

Referenced by EggData::load_externals(), and EggGroupNode::r_load_externals().

void EggGroupNode::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 from EggNode.

Reimplemented in EggXfmSAnim.

Definition at line 1469 of file eggGroupNode.cxx.

void EggTable::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 EggGroupNode.

Definition at line 103 of file eggTable.cxx.

References has_transform(), EggNode::is_anim_matrix(), EggNode::r_transform(), and LMatrix4d::set_row().

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

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 1450 of file eggGroupNode.cxx.

Referenced by EggData::set_coordinate_system().

void EggGroupNode::rebuild_vertex_pools ( EggVertexPools &  vertex_pools,
unsigned int  max_vertices,
bool  recurse 
) [inherited]

Copies vertices used by the primitives at this group node (and below, if recurse is true) into one or more new vertex pools, and updates the primitives to reference these pools.

It is up to the caller to parent the newly-created vertex pools somewhere appropriate in the egg hierarchy.

No more than max_vertices will be placed into any one vertex pool. This is the sole criteria for splitting vertex pools.

Definition at line 1262 of file eggGroupNode.cxx.

References EggPrimitive::add_vertex(), EggPrimitive::clear(), EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), EggVertexPool::find_matching_vertex(), EggCompositePrimitive::get_component(), EggCompositePrimitive::get_num_components(), TypedObject::is_of_type(), EggCompositePrimitive::set_component(), and EggVertexPool::size().

Referenced by EggLoader::make_polyset().

void EggGroupNode::recompute_polygon_normals ( CoordinateSystem  cs = CS_default) [inherited]

Recomputes all the polygon normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.

Normals are removed from the vertices and defined only on polygons, giving the geometry a faceted appearance.

This function also removes degenerate polygons that do not have enough vertices to define a normal. It does not affect normals for other kinds of primitives like Nurbs or Points.

This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the normals removed. Thus, it is a good idea to call remove_unused_vertices() after calling this.

Definition at line 612 of file eggGroupNode.cxx.

References EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), EggVertex::get_pool(), EggPrimitive::get_vertex(), TypedObject::is_of_type(), EggPolygon::recompute_polygon_normal(), and EggPrimitive::set_vertex().

bool EggGroupNode::recompute_tangent_binormal ( const vector_string &  names) [inherited]

This function recomputes the tangent and binormal for the named texture coordinate sets.

Returns true if anything was done.

Definition at line 746 of file eggGroupNode.cxx.

References EggGroupNode::recompute_tangent_binormal().

bool EggGroupNode::recompute_tangent_binormal ( const GlobPattern uv_name) [inherited]

This function recomputes the tangent and binormal for the named texture coordinate set for all vertices at this level and below.

Use the empty string for the default texture coordinate set.

It is necessary for each vertex to already have a normal (or at least a polygon normal), as well as a texture coordinate in the named texture coordinate set, before calling this function. You might precede this with recompute_vertex_normals() to ensure that the normals exist.

Like recompute_vertex_normals(), this function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the new tangents and binormals computed. Thus, it is a good idea to call remove_unused_vertices() after calling this.

Definition at line 719 of file eggGroupNode.cxx.

Referenced by EggGroupNode::recompute_tangent_binormal(), and EggGroupNode::recompute_tangent_binormal_auto().

bool EggGroupNode::recompute_tangent_binormal_auto ( ) [inherited]

This function recomputes the tangent and binormal for any texture coordinate set that affects a normal map.

Returns true if anything was done.

Definition at line 769 of file eggGroupNode.cxx.

References EggTextureCollection::find_used_textures(), EggTexture::get_uv_name(), and EggGroupNode::recompute_tangent_binormal().

void EggGroupNode::recompute_vertex_normals ( double  threshold,
CoordinateSystem  cs = CS_default 
) [inherited]

Recomputes all the vertex normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.

A shared edge between two polygons (even in different groups) is considered smooth if the angle between the two edges is less than threshold degrees.

This function also removes degenerate polygons that do not have enough vertices to define a normal. It does not affect normals for other kinds of primitives like Nurbs or Points.

This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the correct normals. Thus, it is a good idea to call remove_unused_vertices() after calling this.

Definition at line 539 of file eggGroupNode.cxx.

Referenced by XFileMesh::create_polygons().

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 EggGroupNode::remove_invalid_primitives ( bool  recurse) [inherited]

Removes primitives at this level and below which appear to be degenerate; e.g.

polygons with fewer than 3 vertices, etc. Returns the number of primitives removed.

Definition at line 953 of file eggGroupNode.cxx.

References EggPrimitive::cleanup(), and TypedObject::is_of_type().

int EggGroupNode::remove_unused_vertices ( bool  recurse) [inherited]

Removes all vertices from VertexPools within this group or below 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 total number of vertices removed.

Note that this operates on the VertexPools within this group level, without respect to primitives that reference these vertices (unlike other functions like strip_normals()). It is therefore most useful to call this on the EggData root, rather than on a subgroup within the hierarchy, since a VertexPool may appear anywhere in the hierarchy.

Definition at line 912 of file eggGroupNode.cxx.

References EggVertexPool::empty(), TypedObject::is_of_type(), and EggVertexPool::remove_unused_vertices().

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

int EggGroupNode::rename_nodes ( vector_string  strip_prefix,
bool  recurse 
) [inherited]

Rename by stripping out the prefix.

Definition at line 865 of file eggGroupNode.cxx.

References EggNode::rename_node(), and EggGroupNode::rename_nodes().

Referenced by EggGroupNode::rename_nodes().

void EggGroupNode::replace ( iterator  position,
PT(EggNode x 
) [inherited]

Replaces the node at the indicated position with the indicated node.

It is an error to call this with an invalid position iterator (e.g. end()).

Definition at line 196 of file eggGroupNode.cxx.

Referenced by EggGroupNode::r_load_externals().

void EggGroupNode::resolve_filenames ( const DSearchPath searchpath) [inherited]

Walks the tree and attempts to resolve any filenames encountered.

This looks up filenames along the specified search path; it does not automatically search the model_path for missing files.

Definition at line 420 of file eggGroupNode.cxx.

References EggTexture::get_alpha_filename(), EggFilenameNode::get_default_extension(), EggFilenameNode::get_filename(), VirtualFileSystem::get_global_ptr(), EggTexture::has_alpha_filename(), TypedObject::is_of_type(), VirtualFileSystem::resolve_filename(), and EggTexture::set_alpha_filename().

void EggGroupNode::reverse_vertex_ordering ( ) [inherited]

Reverses the vertex ordering of all polygons defined at this node and below.

Does not change the surface normals, if any.

Definition at line 502 of file eggGroupNode.cxx.

References TypedObject::is_of_type(), and EggPrimitive::reverse_vertex_ordering().

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

void EggGroupNode::steal_children ( EggGroupNode other) [inherited]

Moves all the children from the other node to this one.

This is especially useful because the group node copy assignment operator does not copy children.

Definition at line 322 of file eggGroupNode.cxx.

Referenced by EggJointNodePointer::do_finish_reparent(), SomethingToEggConverter::handle_external_reference(), EggData::merge(), EggMesher::mesh(), EggGroupNode::r_load_externals(), EggXfmSAnim::r_transform(), and EggData::read().

EggTable::TableType EggTable::string_table_type ( const string &  string) [static]

Returns the TableType value associated with the given string representation, or TT_invalid if the string does not match any known TableType value.

Definition at line 79 of file eggTable.cxx.

void EggGroupNode::strip_normals ( ) [inherited]

Removes all normals from primitives, and the vertices they reference, at this node and below.

This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the normal removed. Thus, it is a good idea to call remove_unused_vertices() after calling this.

Reimplemented in EggData.

Definition at line 666 of file eggGroupNode.cxx.

References EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), EggVertex::get_pool(), EggPrimitive::get_vertex(), TypedObject::is_of_type(), and EggPrimitive::set_vertex().

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(), write(), and EggXfmSAnim::write().

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

Applies the indicated transformation to the node and all of its descendants.

Reimplemented in EggVertexPool.

Definition at line 313 of file eggNode.I.

References EggNode::r_transform(), EggNode::r_transform_vertices(), and EggNode::update_under().

Referenced by SomethingToEgg::apply_units_scale(), EggToSomething::apply_units_scale(), and EggGroup::set_default_pose().

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

int EggGroupNode::triangulate_polygons ( int  flags) [inherited]

Replace all higher-order polygons at this point in the scene graph and below with triangles.

Returns the total number of new triangles produced, less degenerate polygons removed.

If flags contains T_polygon and T_convex, both concave and convex polygons will be subdivided into triangles; with only T_polygon, only concave polygons will be subdivided, and convex polygons will be largely unchanged.

Definition at line 803 of file eggGroupNode.cxx.

References TypedObject::is_of_type().

Referenced by EggLoader::make_polyset().

void EggGroupNode::unify_attributes ( bool  use_connected_shading,
bool  allow_per_primitive,
bool  recurse 
) [inherited]

Applies per-vertex normal and color to all vertices, if they are in fact per-vertex (and different for each vertex), or moves them to the primitive if they are all the same.

After this call, either the primitive will have normals or its vertices will, but not both. Ditto for colors.

If use_connected_shading is true, each polygon is considered in conjunction with all connected polygons; otherwise, each polygon is considered individually.

If allow_per_primitive is false, S_per_face or S_overall will treated like S_per_vertex: normals and colors will always be assigned to the vertices. In this case, there will never be per-primitive colors or normals after this call returns. On the other hand, if allow_per_primitive is true, then S_per_face means that normals and colors should be assigned to the primitives, and removed from the vertices, as described above.

This may create redundant vertices in the vertex pool, so it may be a good idea to follow this up with remove_unused_vertices().

Definition at line 1064 of file eggGroupNode.cxx.

References EggPrimitive::get_connected_shading(), EggPrimitive::get_shading(), TypedObject::is_of_type(), and EggPrimitive::unify_attributes().

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 EggGroupNode::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.

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 from EggNode.

Definition at line 1404 of file eggGroupNode.cxx.

Referenced by EggGroup::set_billboard_center(), EggData::set_coordinate_system(), and EggGroup::transform_changed().

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

Writes the table and all of its children to the indicated output stream in Egg format.

Reimplemented from EggGroupNode.

Definition at line 49 of file eggTable.cxx.

References EggNode::test_under_integrity(), 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(), EggVertexPool::write(), EggTriangleStrip::write(), EggTriangleFan::write(), EggTexture::write(), 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