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

EggGroup Class Reference

The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nodes. More...

#include "eggGroup.h"

Inheritance diagram for EggGroup:
EggGroupNode EggRenderMode EggTransform EggNode EggNamedObject EggObject Namable TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase EggBin

List of all members.

Public Types

enum  AlphaMode {
  AM_unspecified, AM_off, AM_on, AM_blend,
  AM_blend_no_occlude, AM_ms, AM_ms_mask, AM_binary,
  AM_dual
}
enum  BillboardType { BT_none = 0x00000000, BT_axis = 0x00000020, BT_point_camera_relative = 0x00000040, BT_point_world_relative = 0x00000080 }
enum  BlendMode {
  BM_unspecified, BM_none, BM_add, BM_subtract,
  BM_inv_subtract, BM_min, BM_max
}
enum  BlendOperand {
  BO_unspecified, BO_zero, BO_one, BO_incoming_color,
  BO_one_minus_incoming_color, BO_fbuffer_color, BO_one_minus_fbuffer_color, BO_incoming_alpha,
  BO_one_minus_incoming_alpha, BO_fbuffer_alpha, BO_one_minus_fbuffer_alpha, BO_constant_color,
  BO_one_minus_constant_color, BO_constant_alpha, BO_one_minus_constant_alpha, BO_incoming_color_saturate,
  BO_color_scale, BO_one_minus_color_scale, BO_alpha_scale, BO_one_minus_alpha_scale
}
enum  CollideFlags {
  CF_none = 0x00000000, CF_descend = 0x00100000, CF_event = 0x00200000, CF_keep = 0x00400000,
  CF_solid = 0x00800000, CF_center = 0x01000000, CF_turnstile = 0x02000000, CF_level = 0x04000000,
  CF_intangible = 0x08000000
}
enum  CollisionSolidType {
  CST_none = 0x00000000, CST_plane = 0x00010000, CST_polygon = 0x00020000, CST_polyset = 0x00030000,
  CST_sphere = 0x00040000, CST_tube = 0x00050000, CST_inv_sphere = 0x00060000, CST_floor_mesh = 0x00080000
}
enum  ComponentType {
  CT_invalid, CT_translate2d, CT_translate3d, CT_rotate2d,
  CT_rotx, CT_roty, CT_rotz, CT_rotate3d,
  CT_scale2d, CT_scale3d, CT_uniform_scale, CT_matrix3,
  CT_matrix4
}
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
enum  DartType {
  DT_none = 0x00000000, DT_structured = 0x10000000, DT_sync = 0x20000000, DT_nosync = 0x30000000,
  DT_default = 0x40000000
}
enum  DCSType {
  DC_unspecified = 0x00000000, DC_none = 0x00000010, DC_local = 0x00000020, DC_net = 0x00000030,
  DC_no_touch = 0x00000040, DC_default = 0x00000050
}
enum  DepthTestMode { DTM_unspecified, DTM_off, DTM_on }
enum  DepthWriteMode { DWM_unspecified, DWM_off, DWM_on }
typedef Children::difference_type difference_type
enum  GroupType { GT_invalid = -1, GT_group = 0x00000000, GT_instance = 0x00000001, GT_joint = 0x00000002 }
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
typedef pmap< string, string > TagData
enum  TriangulateFlags {
  T_polygon = 0x001, T_convex = 0x002, T_composite = 0x004, T_recurse = 0x008,
  T_flat_shaded = 0x010
}
typedef pmap< PT_EggVertex,
double > 
VertexRef
enum  VisibilityMode { VM_unspecified, VM_hidden, VM_normal }

Public Member Functions

 EggGroup (const string &name="")
 EggGroup (const EggGroup &copy)
EggNodeadd_child (EggNode *node)
 Adds the indicated child to the group and returns it.
void add_group_ref (EggGroup *group)
 Adds a new <Ref> entry to the group.
void add_matrix3 (const LMatrix3d &mat)
 Appends an arbitrary 3x3 matrix to the current transform.
void add_matrix4 (const LMatrix4d &mat)
 Appends an arbitrary 4x4 matrix to the current transform.
void add_object_type (const string &object_type)
void add_rotate2d (double angle)
 Appends a 2-d rotation to the current transform.
void add_rotate3d (const LQuaterniond &quat)
 Appends an arbitrary 3-d rotation to the current transform, expressed as a quaternion.
void add_rotate3d (double angle, const LVector3d &axis)
 Appends a 3-d rotation about an arbitrary axis to the current transform.
void add_rotx (double angle)
 Appends a rotation about the X axis to the current transform.
void add_roty (double angle)
 Appends a rotation about the Y axis to the current transform.
void add_rotz (double angle)
 Appends a rotation about the Z axis to the current transform.
void add_scale2d (const LVecBase2d &scale)
 Appends a possibly non-uniform scale to the current transform.
void add_scale3d (const LVecBase3d &scale)
 Appends a possibly non-uniform scale to the current transform.
void add_translate2d (const LVector2d &translate)
 Appends a 2-d translation operation to the current transform.
void add_translate3d (const LVector3d &translate)
 Appends a 3-d translation operation to the current transform.
void add_uniform_scale (double scale)
 Appends a uniform scale to the current transform.
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_billboard_center ()
void clear_bin ()
 Removes the bin name that was set for this particular object.
void clear_blend_color ()
 Removes the blend color specification.
void clear_collide_mask ()
void clear_collision_name ()
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_default_pose ()
 Removes the initial pose transform.
void clear_depth_offset ()
 Removes the depth-offset flag from this particular object.
void clear_draw_order ()
 Removes the draw-order flag from this particular object.
void clear_from_collide_mask ()
void clear_group_refs ()
 Removes all of the <Ref> entries within this group.
void clear_indexed_flag ()
void clear_into_collide_mask ()
void clear_lod ()
void clear_name ()
 Resets the Namable's name to empty.
void clear_object_types ()
void clear_tag (const string &key)
 Removes the value defined for this key on this particular node.
void clear_transform ()
 Resets the transform to empty, identity.
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 group 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 group 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 group 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 group 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 group 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 group 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 group that has a visibility_mode other than VM_unspecified.
bool empty () const
iterator end () const
iterator erase (iterator position)
iterator erase (iterator first, iterator last)
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 ()
AlphaMode get_alpha_mode () const
 Returns the alpha mode that was set, or AM_unspecified if nothing was set.
int get_best_parent_from_Set (const std::set< int > &) const
const LPoint3dget_billboard_center () const
BillboardType get_billboard_type () const
string get_bin () const
 Returns the bin name that has been set for this particular object, if any.
const Colorfget_blend_color () const
 Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.
BlendMode get_blend_mode () const
BlendOperand get_blend_operand_a () const
BlendOperand get_blend_operand_b () const
CollideFlags get_collide_flags () const
CollideMask get_collide_mask () const
const string & get_collision_name () const
const LMatrix3dget_component_mat3 (int n) const
 Returns the 3x3 matrix associated with the nth component.
const LMatrix4dget_component_mat4 (int n) const
 Returns the 4x4 matrix associated with the nth component.
double get_component_number (int n) const
 Returns the solitary number associated with the nth component.
ComponentType get_component_type (int n) const
 Returns the type of the nth component.
const LVecBase2dget_component_vec2 (int n) const
 Returns the 2-component vector associated with the nth component.
const LVecBase3dget_component_vec3 (int n) const
 Returns the 3-component vector associated with the nth component.
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.
CollisionSolidType get_cs_type () const
DartType get_dart_type () const
DCSType get_dcs_type () const
bool get_decal_flag () const
const EggTransformget_default_pose () const
 Returns a read-only accessor to the initial pose transform.
int get_depth () const
 Returns the number of nodes above this node in the egg hierarchy.
int get_depth_offset () const
 Returns the "depth-offset" flag as set for this particular object.
DepthTestMode get_depth_test_mode () const
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.
DepthWriteMode get_depth_write_mode () const
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.
bool get_direct_flag () const
int get_draw_order () const
 Returns the "draw-order" flag as set for this particular object.
EggNodeget_first_child ()
 Returns the first child in the group's list of children, or NULL if the list of children is empty.
CollideMask get_from_collide_mask () const
EggGroupget_group_ref (int n) const
 Returns the nth <Ref> entry within this group.
GroupType get_group_type () const
bool get_indexed_flag () const
CollideMask get_into_collide_mask () const
const EggSwitchConditionget_lod () const
bool get_model_flag () const
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.
bool get_nofog_flag () const
int get_num_components () const
 Returns the number of components that make up the transform.
int get_num_group_refs () const
 Returns the number of <Ref> entries within this group.
int get_num_object_types () const
string get_object_type (int index) const
EggGroupNodeget_parent () const
bool get_polylight_flag () const
bool get_portal_flag () const
int get_ref_count () const
 Returns the current reference count.
double get_scroll_r () const
double get_scroll_u () const
double get_scroll_v () const
bool get_switch_flag () const
double get_switch_fps () const
string get_tag (const string &key) const
 Retrieves the user-defined value that was previously set on this node for the particular key, if any.
bool get_texlist_flag () const
LMatrix3d get_transform2d () const
 Returns the overall transform as a 3x3 matrix.
const LMatrix4dget_transform3d () const
 Returns the overall transform as a 4x4 matrix.
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.
double get_vertex_membership (const EggVertex *vert) const
 Returns the amount of membership of the indicated vertex in this group.
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.
VisibilityMode get_visibility_mode () const
 Returns the visibility mode that was set, or VM_unspecified if nothing was set.
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_billboard_center () const
bool has_bin () const
 Returns true if a bin name has been set for this particular object.
bool has_blend_color () const
 Returns true if the blend color has been specified, false otherwise.
bool has_collide_mask () const
bool has_collision_name () const
bool has_dcs_type () const
 Returns true if the specified DCS type is not DC_none and not DC_unspecified.
bool has_depth_offset () const
 Returns true if the depth-offset flag has been set for this particular object.
bool has_draw_order () const
 Returns true if the draw-order flag has been set for this particular object.
bool has_from_collide_mask () const
bool has_indexed_flag () const
bool has_into_collide_mask () const
bool has_lod () const
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.
bool has_object_type (const string &object_type) const
 Returns true if the indicated object type has been added to the group, or false otherwise.
virtual bool has_primitives () const
 Returns true if there are any primitives (e.g.
bool has_scrolling_uvs ()
bool has_tag (const string &key) const
 Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set.
bool has_transform () const
 Returns true if the transform is nonempty, false if it is empty (no transform components have been added).
bool has_transform2d () const
 Returns true if the transform is specified as a 2-d transform, e.g.
bool has_transform3d () const
 Returns true if the transform is specified as a 3-d transform, e.g.
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_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.
bool is_instance_type () const
 Returns true if this group is an instance type node; i.e.
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.
 MAKE_SEQ (get_group_refs, get_num_group_refs, get_group_ref)
 MAKE_SEQ (get_object_types, get_num_object_types, get_object_type)
void mesh_triangles (int flags)
 Combine triangles together into triangle strips, at this group and below.
EggTransformmodify_default_pose ()
 Returns a writable accessor to the initial pose transform.
void operator delete (void *ptr, void *)
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void * operator new[] (size_t size)
bool operator!= (const EggRenderMode &other) const
bool operator< (const EggRenderMode &other) const
EggGroupoperator= (const EggGroup &copy)
bool operator== (const EggRenderMode &other) const
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.
void ref_vertex (EggVertex *vert, double membership=1.0)
 Adds the vertex to the set of those referenced by the group, at the indicated membership level.
void remove_group_ref (int n)
 Removes the nth <Ref> entry within this group.
int remove_invalid_primitives (bool recurse)
 Removes primitives at this level and below which appear to be degenerate; e.g.
bool remove_object_type (const string &object_type)
 Removes the first instance of the indicated object type from the group if it is present.
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_alpha_mode (AlphaMode mode)
 Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.
void set_billboard_center (const LPoint3d &billboard_center)
 Sets the point around which the billboard will rotate, if this node contains a billboard specification.
void set_billboard_type (BillboardType type)
void set_bin (const string &bin)
 Sets the "bin" string for this particular object.
void set_blend_color (const Colorf &blend_color)
void set_blend_mode (BlendMode blend_mode)
void set_blend_operand_a (BlendOperand blend_operand_a)
void set_blend_operand_b (BlendOperand blend_operand_b)
void set_collide_flags (int flags)
void set_collide_mask (CollideMask mask)
void set_collision_name (const string &collision_name)
void set_cs_type (CollisionSolidType type)
void set_dart_type (DartType type)
void set_dcs_type (DCSType type)
void set_decal_flag (bool flag)
void set_default_pose (const EggTransform &transform)
 Replaces the initial pose transform.
void set_depth_offset (int bias)
 Sets the "depth-offset" flag associated with this object.
void set_depth_test_mode (DepthTestMode mode)
 Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).
void set_depth_write_mode (DepthWriteMode mode)
 Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.
void set_direct_flag (bool flag)
void set_draw_order (int order)
 Sets the "draw-order" flag associated with this object.
void set_from_collide_mask (CollideMask mask)
void set_group_type (GroupType type)
void set_indexed_flag (bool flag)
 If this flag is true, geometry at this node and below will be generated as indexed geometry.
void set_into_collide_mask (CollideMask mask)
void set_lod (const EggSwitchCondition &lod)
void set_model_flag (bool flag)
void set_name (const string &name)
void set_nofog_flag (bool flag)
void set_polylight_flag (bool flag)
void set_portal_flag (bool flag)
void set_scroll_r (const double r_speed)
void set_scroll_u (const double u_speed)
void set_scroll_v (const double v_speed)
void set_switch_flag (bool flag)
void set_switch_fps (double fps)
void set_tag (const string &key, const string &value)
 Associates a user-defined value with a user-defined key which is stored on the node.
void set_texlist_flag (bool flag)
void set_transform2d (const LMatrix3d &mat)
 Sets the overall transform as a 3x3 matrix.
void set_transform3d (const LMatrix4d &mat)
 Sets the overall transform as a 4x4 matrix.
void set_user_data (EggUserData *user_data)
 Sets the user data associated with this object.
void set_vertex_membership (EggVertex *vert, double membership)
 Explicitly sets the net membership of the indicated vertex in this group to the given value.
void set_visibility_mode (VisibilityMode mode)
 Specifies whether this geometry is to be considered normally visible, or hidden.
size_type size () const
void steal_children (EggGroupNode &other)
 Moves all the children from the other node to this one.
void steal_vrefs (EggGroup *other)
 Moves all of the vertex references from the indicated other group into this one.
void strip_normals ()
 Removes all normals from primitives, and the vertices they reference, at this node and below.
TagData::const_iterator tag_begin () const
 Returns an iterator that can, in conjunction with tag_end(), be used to traverse the entire set of tag keys.
TagData::const_iterator tag_end () const
 Returns an iterator that can, in conjunction with tag_begin(), be used to traverse the entire set of tag keys.
TagData::size_type tag_size () const
 Returns the number of elements between tag_begin() and tag_end().
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 test_vref_integrity () const
 Verifies that each vertex in the group exists and that it knows it is referenced by the group.
void transform (const LMatrix4d &mat)
 Applies the indicated transformation to the node and all of its descendants.
bool transform_is_identity () const
 Returns true if the described transform is identity, false otherwise.
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 unref_all_vertices ()
 Removes all vertices from the reference list.
void unref_vertex (EggVertex *vert)
 Removes the vertex from the set of those referenced by the group.
VertexRef::const_iterator vref_begin () const
 Returns an iterator that can, in conjunction with vref_end(), be used to traverse the entire set of referenced vertices.
VertexRef::const_iterator vref_end () const
 Returns an iterator that can, in conjunction with vref_begin(), be used to traverse the entire set of referenced vertices.
VertexRef::size_type vref_size () const
 Returns the number of elements between vref_begin() and vref_end().
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 group and all of its children to the indicated output stream in Egg format.
void write (ostream &out, int indent_level, const string &label) const
 Writes the transform to the indicated stream in Egg format.
void write_billboard_flags (ostream &out, int indent_level) const
 Writes just the <Billboard> entry and related fields to the indicated ostream.
void write_collide_flags (ostream &out, int indent_level) const
 Writes just the <Collide> entry and related fields to the indicated ostream.
void write_decal_flags (ostream &out, int indent_level) const
 Writes the flags related to decaling, if any.
void write_header (ostream &out, int indent_level, const char *egg_keyword) const
 Writes the first line of the egg object, e.g.
void write_model_flags (ostream &out, int indent_level) const
 Writes the <Model> flag and related flags to the indicated ostream.
void write_object_types (ostream &out, int indent_level) const
 Writes just the <ObjectTypes> entries, if any, to the indicated ostream.
void write_render_mode (ostream &out, int indent_level) const
 Writes the flags inherited from EggRenderMode and similar flags that control obscure render effects.
void write_switch_flags (ostream &out, int indent_level) const
 Writes the <Switch> flag and related flags to the indicated ostream.
void write_tags (ostream &out, int indent_level) const
 Writes just the <Tag> entries, if any, to the indicated ostream.

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 AlphaMode string_alpha_mode (const string &string)
 Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.
static BillboardType string_billboard_type (const string &strval)
 Returns the BillboardType value associated with the given string representation, or BT_none if the string does not match any known BillboardType value.
static BlendMode string_blend_mode (const string &strval)
 Returns the BlendMode value associated with the given string representation, or BM_none if the string does not match any known BlendMode.
static BlendOperand string_blend_operand (const string &strval)
 Returns the BlendOperand value associated with the given string representation, or BO_none if the string does not match any known BlendOperand.
static CollideFlags string_collide_flags (const string &strval)
 Returns the CollideFlags value associated with the given string representation, or CF_none if the string does not match any known CollideFlags value.
static CollisionSolidType string_cs_type (const string &strval)
 Returns the CollisionSolidType value associated with the given string representation, or CST_none if the string does not match any known CollisionSolidType value.
static DartType string_dart_type (const string &strval)
 Returns the DartType value associated with the given string representation, or DT_none if the string does not match any known DartType value.
static DCSType string_dcs_type (const string &strval)
 Returns the DCSType value associated with the given string representation, or DC_unspecified if the string does not match any known DCSType value.
static DepthTestMode string_depth_test_mode (const string &string)
 Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.
static DepthWriteMode string_depth_write_mode (const string &string)
 Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.
static GroupType string_group_type (const string &strval)
 Returns the GroupType value associated with the given string representation, or GT_invalid if the string does not match any known GroupType value.
static VisibilityMode string_visibility_mode (const string &string)
 Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode 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.
void internal_add_matrix (const LMatrix3d &mat)
 Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed().
void internal_add_matrix (const LMatrix4d &mat)
 Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed().
void internal_clear_transform ()
 Resets the transform to empty without calling transform_changed().
void internal_set_transform (const LMatrix3d &mat)
 Sets the overall transform without calling transform_changed().
void internal_set_transform (const LMatrix4d &mat)
 Sets the overall transform without calling transform_changed().
 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 transform_changed ()
 This virtual method is inherited by EggTransform3d; it is called whenever the transform is changed.
virtual void update_under (int depth_offset)
 This function is called from within EggGroupNode whenever the parentage of the node has changed.
void write_vertex_ref (ostream &out, int indent_level) const
 Writes out the vertex ref component of the group body only.

Protected Attributes

int _depth
EggGroupNode_parent
int _under_flags

Detailed Description

The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nodes.

Definition at line 36 of file eggGroup.h.


Member Function Documentation

EggNode * EggGroupNode::add_child ( EggNode node) [inherited]
void EggGroup::add_group_ref ( EggGroup group)

Adds a new <Ref> entry to the group.

This declares an internal reference to another node, and is used to implement scene-graph instancing; it is only valid if the group_type is GT_instance.

Definition at line 840 of file eggGroup.cxx.

void EggTransform::add_matrix3 ( const LMatrix3d mat) [inline, inherited]

Appends an arbitrary 3x3 matrix to the current transform.

Definition at line 137 of file eggTransform.I.

References EggTransform::internal_add_matrix(), and EggTransform::transform_changed().

void EggTransform::add_matrix4 ( const LMatrix4d mat) [inline, inherited]

Appends an arbitrary 4x4 matrix to the current transform.

Definition at line 149 of file eggTransform.I.

References EggTransform::internal_add_matrix(), and EggTransform::transform_changed().

Referenced by r_transform().

void EggTransform::add_rotate2d ( double  angle) [inherited]

Appends a 2-d rotation to the current transform.

The rotation angle is specified in degrees counterclockwise about the origin.

Definition at line 102 of file eggTransform.cxx.

References LMatrix4d::rotate_mat_normaxis(), and EggTransform::transform_changed().

void EggTransform::add_rotate3d ( double  angle,
const LVector3d axis 
) [inherited]

Appends a 3-d rotation about an arbitrary axis to the current transform.

The rotation angle is specified in degrees counterclockwise about the axis.

Definition at line 161 of file eggTransform.cxx.

References LMatrix4d::rotate_mat(), and EggTransform::transform_changed().

Referenced by EggTransform::add_rotate3d(), and FltToEggLevelState::set_transform().

void EggTransform::add_rotate3d ( const LQuaterniond quat) [inherited]

Appends an arbitrary 3-d rotation to the current transform, expressed as a quaternion.

This is converted to axis-angle notation for the egg file.

Definition at line 178 of file eggTransform.cxx.

References EggTransform::add_rotate3d(), LQuaterniond::get_angle(), LQuaterniond::get_axis(), and EggTransform::transform_changed().

void EggTransform::add_rotx ( double  angle) [inherited]

Appends a rotation about the X axis to the current transform.

The rotation angle is specified in degrees counterclockwise about the axis.

Definition at line 116 of file eggTransform.cxx.

References LMatrix4d::rotate_mat_normaxis(), and EggTransform::transform_changed().

void EggTransform::add_roty ( double  angle) [inherited]

Appends a rotation about the Y axis to the current transform.

The rotation angle is specified in degrees counterclockwise about the axis.

Definition at line 131 of file eggTransform.cxx.

References LMatrix4d::rotate_mat_normaxis(), and EggTransform::transform_changed().

void EggTransform::add_rotz ( double  angle) [inherited]

Appends a rotation about the Z axis to the current transform.

The rotation angle is specified in degrees counterclockwise about the axis.

Definition at line 146 of file eggTransform.cxx.

References LMatrix4d::rotate_mat_normaxis(), and EggTransform::transform_changed().

void EggTransform::add_scale2d ( const LVecBase2d scale) [inherited]

Appends a possibly non-uniform scale to the current transform.

Definition at line 191 of file eggTransform.cxx.

References LMatrix4d::scale_mat(), and EggTransform::transform_changed().

void EggTransform::add_scale3d ( const LVecBase3d scale) [inherited]

Appends a possibly non-uniform scale to the current transform.

Definition at line 206 of file eggTransform.cxx.

References LMatrix4d::scale_mat(), and EggTransform::transform_changed().

Referenced by FltToEggLevelState::set_transform().

void EggTransform::add_translate2d ( const LVector2d translate) [inherited]

Appends a 2-d translation operation to the current transform.

Definition at line 72 of file eggTransform.cxx.

References EggTransform::transform_changed(), and LMatrix4d::translate_mat().

void EggTransform::add_translate3d ( const LVector3d translate) [inherited]

Appends a 3-d translation operation to the current transform.

Definition at line 86 of file eggTransform.cxx.

References EggTransform::transform_changed(), and LMatrix4d::translate_mat().

Referenced by FltToEggLevelState::set_transform().

void EggTransform::add_uniform_scale ( double  scale) [inherited]

Appends a uniform scale to the current transform.

Definition at line 220 of file eggTransform.cxx.

References LMatrix4d::scale_mat(), and EggTransform::transform_changed().

void EggGroup::adjust_under ( ) [protected, virtual]

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

Definition at line 1227 of file eggGroup.cxx.

References EggNode::get_node_frame(), EggNode::get_node_frame_inv(), EggTransform::get_transform3d(), EggNode::get_vertex_frame(), EggNode::get_vertex_frame_inv(), EggTransform::has_transform(), LMatrix4d::invert_from(), and is_instance_type().

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 * EggGroup::as_transform ( ) [virtual]

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

Reimplemented from EggObject.

Definition at line 1128 of file eggGroup.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 EggRenderMode::clear_bin ( ) [inline, inherited]

Removes the bin name that was set for this particular object.

See set_bin().

Definition at line 277 of file eggRenderMode.I.

void EggGroup::clear_blend_color ( ) [inline]

Removes the blend color specification.

Definition at line 775 of file eggGroup.I.

References LVecBase4f::zero().

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 EggGroup::clear_default_pose ( ) [inline]

Removes the initial pose transform.

See set_default_pose().

Definition at line 959 of file eggGroup.I.

References EggTransform::clear_transform().

void EggRenderMode::clear_depth_offset ( ) [inline, inherited]

Removes the depth-offset flag from this particular object.

See set_depth_offset().

Definition at line 178 of file eggRenderMode.I.

void EggRenderMode::clear_draw_order ( ) [inline, inherited]

Removes the draw-order flag from this particular object.

See set_draw_order().

Definition at line 227 of file eggRenderMode.I.

void EggGroup::clear_group_refs ( )

Removes all of the <Ref> entries within this group.

See add_group_ref().

Definition at line 887 of file eggGroup.cxx.

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 EggGroup::clear_tag ( const string &  key) [inline]

Removes the value defined for this key on this particular node.

After a call to clear_tag(), has_tag() will return false for the indicated key.

Definition at line 903 of file eggGroup.I.

void EggTransform::clear_transform ( ) [inline, inherited]
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 * EggGroup::determine_alpha_mode ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 511 of file eggGroup.cxx.

References EggRenderMode::get_alpha_mode().

EggRenderMode * EggGroup::determine_bin ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 613 of file eggGroup.cxx.

References EggRenderMode::has_bin().

bool EggGroup::determine_decal ( ) [virtual]

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

Definition at line 651 of file eggGroup.cxx.

EggRenderMode * EggGroup::determine_depth_offset ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 579 of file eggGroup.cxx.

References EggRenderMode::has_depth_offset().

EggRenderMode * EggGroup::determine_depth_test_mode ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 545 of file eggGroup.cxx.

References EggRenderMode::get_depth_test_mode().

EggRenderMode * EggGroup::determine_depth_write_mode ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 528 of file eggGroup.cxx.

References EggRenderMode::get_depth_write_mode().

EggRenderMode * EggGroup::determine_draw_order ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 596 of file eggGroup.cxx.

References EggRenderMode::has_draw_order().

bool EggGroup::determine_indexed ( ) [virtual]

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

Definition at line 632 of file eggGroup.cxx.

EggRenderMode * EggGroup::determine_visibility_mode ( ) [virtual]

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

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

Reimplemented from EggNode.

Definition at line 562 of file eggGroup.cxx.

References EggRenderMode::get_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 EggGroup::egg_start_parse_body ( ) [protected, virtual]

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

Definition at line 1211 of file eggGroup.cxx.

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

EggRenderMode::AlphaMode EggRenderMode::get_alpha_mode ( ) const [inline, inherited]

Returns the alpha mode that was set, or AM_unspecified if nothing was set.

See set_alpha_mode().

Definition at line 130 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_alpha_mode(), determine_alpha_mode(), EggRenderState::fill_state(), TextureReference::from_egg(), and EggRenderMode::write().

string EggRenderMode::get_bin ( ) const [inline, inherited]

Returns the bin name that has been set for this particular object, if any.

See set_bin().

Definition at line 255 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

const Colorf & EggGroup::get_blend_color ( ) const [inline]

Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.

Definition at line 798 of file eggGroup.I.

Referenced by write().

const LMatrix3d & EggTransform::get_component_mat3 ( int  n) const [inline, inherited]

Returns the 3x3 matrix associated with the nth component.

It is an error to call this if the component type is not CT_matrix3.

Definition at line 344 of file eggTransform.I.

References LMatrix3d::ident_mat().

Referenced by EggTransform::write().

const LMatrix4d & EggTransform::get_component_mat4 ( int  n) const [inline, inherited]

Returns the 4x4 matrix associated with the nth component.

It is an error to call this if the component type is not CT_matrix4.

Definition at line 358 of file eggTransform.I.

References LMatrix4d::ident_mat().

Referenced by EggTransform::write().

double EggTransform::get_component_number ( int  n) const [inline, inherited]

Returns the solitary number associated with the nth component.

In the case of a rotation, this is the angle in degrees to rotate; in the case of uniform scale, this is the amount of the scale. Other types do not use this property.

Definition at line 299 of file eggTransform.I.

Referenced by EggTransform::write().

EggTransform::ComponentType EggTransform::get_component_type ( int  n) const [inline, inherited]

Returns the type of the nth component.

Definition at line 284 of file eggTransform.I.

Referenced by EggTransform::write().

const LVecBase2d & EggTransform::get_component_vec2 ( int  n) const [inline, inherited]

Returns the 2-component vector associated with the nth component.

This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 2-d vector property.

Definition at line 314 of file eggTransform.I.

References LVector2d::zero().

Referenced by EggTransform::write().

const LVecBase3d & EggTransform::get_component_vec3 ( int  n) const [inline, inherited]

Returns the 3-component vector associated with the nth component.

This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 3-d vector property.

Definition at line 330 of file eggTransform.I.

References LVector3d::zero().

Referenced by EggTransform::write().

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

const EggTransform & EggGroup::get_default_pose ( ) const [inline]

Returns a read-only accessor to the initial pose transform.

This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.

Definition at line 918 of file eggGroup.I.

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.

int EggRenderMode::get_depth_offset ( ) const [inline, inherited]

Returns the "depth-offset" flag as set for this particular object.

See set_depth_offset().

Definition at line 156 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

EggRenderMode::DepthTestMode EggRenderMode::get_depth_test_mode ( ) const [inline, inherited]

Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.

See set_depth_test_mode().

Definition at line 73 of file eggRenderMode.I.

Referenced by determine_depth_test_mode(), EggPrimitive::determine_depth_test_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

EggRenderMode::DepthWriteMode EggRenderMode::get_depth_write_mode ( ) const [inline, inherited]

Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.

See set_depth_write_mode().

Definition at line 47 of file eggRenderMode.I.

Referenced by determine_depth_write_mode(), EggPrimitive::determine_depth_write_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

int EggRenderMode::get_draw_order ( ) const [inline, inherited]

Returns the "draw-order" flag as set for this particular object.

See set_draw_order().

Definition at line 205 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

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

EggGroup * EggGroup::get_group_ref ( int  n) const

Returns the nth <Ref> entry within this group.

See add_group_ref().

Definition at line 863 of file eggGroup.cxx.

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

Returns the number of components that make up the transform.

Definition at line 274 of file eggTransform.I.

Referenced by EggTransform::write().

int EggGroup::get_num_group_refs ( ) const

Returns the number of <Ref> entries within this group.

See add_group_ref().

Definition at line 852 of file eggGroup.cxx.

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
string EggGroup::get_tag ( const string &  key) const [inline]

Retrieves the user-defined value that was previously set on this node for the particular key, if any.

If no value has been previously set, returns the empty string.

Definition at line 872 of file eggGroup.I.

LMatrix3d EggTransform::get_transform2d ( ) const [inline, inherited]

Returns the overall transform as a 3x3 matrix.

It is an error to call this if has_transform3d() is true.

Definition at line 234 of file eggTransform.I.

References EggTransform::has_transform3d(), and LMatrix3d::ident_mat().

Referenced by TextureReference::from_egg(), and XFileVertex::set_from_egg().

const LMatrix4d & EggTransform::get_transform3d ( ) const [inline, inherited]

Returns the overall transform as a 4x4 matrix.

It is valid to call this even if has_transform2d() is true; in this case, the 3x3 transform will be expanded to a 4x4 matrix.

Definition at line 251 of file eggTransform.I.

Referenced by adjust_under(), XFileAnimationSet::create_hierarchy(), EggTexture::is_equivalent_to(), EggPrimitive::r_apply_texmats(), r_transform(), and EggTexture::sorts_less_than().

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.

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 adjust_under(), EggPrimitive::r_flatten_transforms(), 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 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.

double EggGroup::get_vertex_membership ( const EggVertex vert) const

Returns the amount of membership of the indicated vertex in this group.

If the vertex is not reffed by the group, returns 0.

Definition at line 745 of file eggGroup.cxx.

Referenced by EggVertex::copy_grefs_from(), and EggVertex::test_gref_integrity().

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.

EggRenderMode::VisibilityMode EggRenderMode::get_visibility_mode ( ) const [inline, inherited]

Returns the visibility mode that was set, or VM_unspecified if nothing was set.

See set_visibility_mode().

Definition at line 99 of file eggRenderMode.I.

Referenced by determine_visibility_mode(), EggPrimitive::determine_visibility_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

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

Returns true if a bin name has been set for this particular object.

See set_bin().

Definition at line 266 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_bin(), determine_bin(), and EggRenderMode::write().

bool EggGroup::has_blend_color ( ) const [inline]

Returns true if the blend color has been specified, false otherwise.

Definition at line 787 of file eggGroup.I.

Referenced by write().

bool EggGroup::has_dcs_type ( ) const [inline]

Returns true if the specified DCS type is not DC_none and not DC_unspecified.

Definition at line 244 of file eggGroup.I.

bool EggRenderMode::has_depth_offset ( ) const [inline, inherited]

Returns true if the depth-offset flag has been set for this particular object.

See set_depth_offset().

Definition at line 167 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_offset(), determine_depth_offset(), and EggRenderMode::write().

bool EggRenderMode::has_draw_order ( ) const [inline, inherited]

Returns true if the draw-order flag has been set for this particular object.

See set_draw_order().

Definition at line 216 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_draw_order(), determine_draw_order(), and EggRenderMode::write().

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 EggGroup::has_object_type ( const string &  object_type) const

Returns true if the indicated object type has been added to the group, or false otherwise.

Definition at line 155 of file eggGroup.cxx.

Referenced by MayaNodeTree::get_egg_group(), and MayaNodeDesc::has_object_type().

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 EggGroup::has_tag ( const string &  key) const [inline]

Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set.

Definition at line 889 of file eggGroup.I.

bool EggTransform::has_transform ( ) const [inline, inherited]

Returns true if the transform is nonempty, false if it is empty (no transform components have been added).

This is true for either a 2-d or a 3-d transform.

Definition at line 163 of file eggTransform.I.

Referenced by adjust_under(), EggRenderState::fill_state(), EggTransform::has_transform2d(), EggTransform::has_transform3d(), EggTexture::is_equivalent_to(), EggPrimitive::r_apply_texmats(), r_transform(), EggTexture::sorts_less_than(), EggTexture::write(), and write().

bool EggTransform::has_transform2d ( ) const [inline, inherited]

Returns true if the transform is specified as a 2-d transform, e.g.

with a 3x3 matrix, or false if it is specified as a 3-d transform (with a 4x4 matrix), or not specified at all.

Normally, EggTextures have a 2-d matrix (but occasionally they use a 3-d matrix), and EggGroups always have a 3-d matrix.

Definition at line 180 of file eggTransform.I.

References EggTransform::has_transform().

Referenced by TextureReference::from_egg(), and XFileVertex::set_from_egg().

bool EggTransform::has_transform3d ( ) const [inline, inherited]

Returns true if the transform is specified as a 3-d transform, e.g.

with a 4x4 matrix, or false if it is specified as a 2-d transform (with a 2x2 matrix), or not specified at all.

Normally, EggTextures have a 3-d matrix (but occasionally they use a 3-d matrix), and EggGroups always have a 3-d matrix.

Definition at line 210 of file eggTransform.I.

References EggTransform::has_transform().

Referenced by EggTransform::get_transform2d(), and EggPrimitive::r_apply_texmats().

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

Reimplemented in EggBin.

Definition at line 402 of file eggGroup.h.

References EggGroupNode::init_type().

Referenced by EggBin::init_type().

void EggTransform::internal_add_matrix ( const LMatrix3d mat) [protected, inherited]

Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed().

Definition at line 331 of file eggTransform.cxx.

Referenced by EggTransform::add_matrix3(), EggTransform::add_matrix4(), and EggTransform::internal_set_transform().

void EggTransform::internal_add_matrix ( const LMatrix4d mat) [protected, inherited]

Appends an arbitrary 4x4 matrix to the current transform, without calling transform_changed().

Definition at line 348 of file eggTransform.cxx.

void EggTransform::internal_clear_transform ( ) [protected, inherited]

Resets the transform to empty without calling transform_changed().

Definition at line 318 of file eggTransform.cxx.

References LMatrix4d::ident_mat().

Referenced by EggTransform::clear_transform(), EggTransform::internal_set_transform(), and r_flatten_transforms().

void EggTransform::internal_set_transform ( const LMatrix3d mat) [inline, protected, inherited]
void EggTransform::internal_set_transform ( const LMatrix4d mat) [inline, protected, inherited]

Sets the overall transform without calling transform_changed().

Definition at line 383 of file eggTransform.I.

References EggTransform::internal_add_matrix(), and EggTransform::internal_clear_transform().

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 EggGroup::is_instance_type ( ) const [inline]

Returns true if this group is an instance type node; i.e.

it begins the root of a local coordinate space. This is not related to instancing (multiple copies of a node in a scene graph).

This also includes the case of the node including a billboard flag without an explicit center, which implicitly makes the node behave like an instance.

Definition at line 39 of file eggGroup.I.

Referenced by adjust_under().

bool EggGroup::is_joint ( ) const [virtual]

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

Definition at line 497 of file eggGroup.cxx.

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

EggTransform & EggGroup::modify_default_pose ( ) [inline]

Returns a writable accessor to the initial pose transform.

This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.

Definition at line 933 of file eggGroup.I.

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 EggGroup::r_flatten_transforms ( ) [protected, virtual]

The recursive implementation of flatten_transforms().

Reimplemented from EggGroupNode.

Definition at line 1338 of file eggGroup.cxx.

References EggNode::get_vertex_frame(), EggTransform::internal_clear_transform(), EggNode::is_local_coord(), and set_billboard_center().

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 EggGroup::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 1290 of file eggGroup.cxx.

References EggTransform::add_matrix4(), EggTransform::clear_transform(), EggTransform::get_transform3d(), EggTransform::has_transform(), EggTransform::internal_set_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 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 ( 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_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().

void EggGroup::ref_vertex ( EggVertex vert,
double  membership = 1.0 
)

Adds the vertex to the set of those referenced by the group, at the indicated membership level.

If the vertex is already being referenced, increases the membership amount by the indicated amount.

Definition at line 667 of file eggGroup.cxx.

References unref_vertex().

Referenced by EggVertex::copy_grefs_from(), XFileMesh::create_polygons(), and steal_vrefs().

void EggGroup::remove_group_ref ( int  n)

Removes the nth <Ref> entry within this group.

See add_group_ref().

Definition at line 875 of file eggGroup.cxx.

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

bool EggGroup::remove_object_type ( const string &  object_type)

Removes the first instance of the indicated object type from the group if it is present.

Returns true if the object type was found and removed, false otherwise.

Definition at line 174 of file eggGroup.cxx.

Referenced by MayaNodeTree::get_egg_group().

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 EggRenderMode::set_alpha_mode ( AlphaMode  mode) [inline, inherited]

Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.

The default, AM_unspecified, is to use transparency if the geometry has a color whose alpha value is non-1, or if it has a four-channel texture applied; otherwise, AM_on forces transparency on, and AM_off forces it off. The other flavors of transparency are specific ways to turn on transparency, which may or may not be supported by a particular rendering backend.

Definition at line 118 of file eggRenderMode.I.

Referenced by TextureReference::update_egg().

void EggGroup::set_billboard_center ( const LPoint3d billboard_center) [inline]

Sets the point around which the billboard will rotate, if this node contains a billboard specification.

If a billboard type is given but no billboard_center is specified, then the group node is treated as an <Instance>, and the billboard rotates around the origin. If, however, a billboard_center is specified, then the group node is *not* treated as an <Instance>, and the billboard rotates around the specified point.

The point is in the same coordinate system as the vertices of this node: usually global, but possibly local if there is an <Instance> somewhere above. Specifically, this is the coordinate system defined by get_vertex_frame().

Definition at line 91 of file eggGroup.I.

References EggGroupNode::update_under().

Referenced by r_flatten_transforms().

void EggRenderMode::set_bin ( const string &  bin) [inline, inherited]

Sets the "bin" string for this particular object.

This names a particular bin in which the object should be rendered. The exact meaning of a bin is implementation defined, but generally a GeomBin matching each bin name must also be specifically added to the rendering engine (e.g. the CullTraverser) in use for this to work. See also set_draw_order().

Definition at line 244 of file eggRenderMode.I.

void EggGroup::set_default_pose ( const EggTransform transform) [inline]

Replaces the initial pose transform.

This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.

Definition at line 948 of file eggGroup.I.

References EggNode::transform().

void EggRenderMode::set_depth_offset ( int  order) [inline, inherited]

Sets the "depth-offset" flag associated with this object.

This adds or subtracts an offset bias into the depth buffer. See also DepthOffsetAttrib and NodePath::set_depth_offset().

Definition at line 143 of file eggRenderMode.I.

void EggRenderMode::set_depth_test_mode ( DepthTestMode  mode) [inline, inherited]

Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).

Note that this is different, and independent from, the depth_write mode.

Definition at line 61 of file eggRenderMode.I.

void EggRenderMode::set_depth_write_mode ( DepthWriteMode  mode) [inline, inherited]

Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.

Definition at line 35 of file eggRenderMode.I.

void EggRenderMode::set_draw_order ( int  order) [inline, inherited]

Sets the "draw-order" flag associated with this object.

This specifies a particular order in which objects of this type should be drawn, within the specified bin. If a bin is not explicitly specified, "fixed" is used. See also set_bin().

Definition at line 193 of file eggRenderMode.I.

void EggGroup::set_indexed_flag ( bool  flag) [inline]

If this flag is true, geometry at this node and below will be generated as indexed geometry.

Definition at line 532 of file eggGroup.I.

void EggGroup::set_tag ( const string &  key,
const string &  value 
) [inline]

Associates a user-defined value with a user-defined key which is stored on the node.

This value has no meaning to Panda; but it is stored indefinitely on the node until it is requested again. This value will be copied to the PandaNode that is created for this particular EggGroup if the egg file is loaded as a scene.

Each unique key stores a different string value. There is no effective limit on the number of different keys that may be stored or on the length of any one key's value.

Definition at line 859 of file eggGroup.I.

Referenced by MayaNodeTree::get_egg_group().

void EggTransform::set_transform2d ( const LMatrix3d mat) [inline, inherited]

Sets the overall transform as a 3x3 matrix.

This completely replaces whatever componentwise transform may have been defined.

Definition at line 192 of file eggTransform.I.

References EggTransform::internal_set_transform(), and EggTransform::transform_changed().

Referenced by TextureReference::update_egg().

void EggTransform::set_transform3d ( const LMatrix4d mat) [inline, inherited]

Sets the overall transform as a 4x4 matrix.

This completely replaces whatever componentwise transform may have been defined.

Definition at line 222 of file eggTransform.I.

References EggTransform::internal_set_transform(), and EggTransform::transform_changed().

Referenced by SoftNodeDesc::get_transform(), and FltToEggLevelState::set_transform().

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 EggGroup::set_vertex_membership ( EggVertex vert,
double  membership 
)

Explicitly sets the net membership of the indicated vertex in this group to the given value.

Definition at line 762 of file eggGroup.cxx.

References unref_vertex().

void EggRenderMode::set_visibility_mode ( VisibilityMode  mode) [inline, inherited]

Specifies whether this geometry is to be considered normally visible, or hidden.

If it is hidden, it is either not loaded into the scene graph at all, or loaded as a "stashed" node, according to the setting of egg-suppress-hidden.

Definition at line 87 of file eggRenderMode.I.

Referenced by MayaNodeTree::get_egg_group().

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

void EggGroup::steal_vrefs ( EggGroup other)

Moves all of the vertex references from the indicated other group into this one.

If a given vertex was previously shared by both groups, the relative memberships will be summed.

Definition at line 796 of file eggGroup.cxx.

References ref_vertex(), unref_all_vertices(), vref_begin(), and vref_end().

EggRenderMode::AlphaMode EggRenderMode::string_alpha_mode ( const string &  string) [static, inherited]

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

Definition at line 183 of file eggRenderMode.cxx.

Referenced by TxaLine::parse().

EggGroup::BillboardType EggGroup::string_billboard_type ( const string &  strval) [static]

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

Definition at line 967 of file eggGroup.cxx.

EggGroup::BlendMode EggGroup::string_blend_mode ( const string &  strval) [static]

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

Definition at line 1050 of file eggGroup.cxx.

EggGroup::BlendOperand EggGroup::string_blend_operand ( const string &  strval) [static]

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

Definition at line 1076 of file eggGroup.cxx.

EggGroup::CollideFlags EggGroup::string_collide_flags ( const string &  strval) [static]

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

This only recognizes a single keyword; it does not attempt to parse a string of keywords.

Definition at line 1020 of file eggGroup.cxx.

EggGroup::CollisionSolidType EggGroup::string_cs_type ( const string &  strval) [static]

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

Definition at line 989 of file eggGroup.cxx.

EggGroup::DartType EggGroup::string_dart_type ( const string &  strval) [static]

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

Definition at line 921 of file eggGroup.cxx.

EggGroup::DCSType EggGroup::string_dcs_type ( const string &  strval) [static]

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

Definition at line 943 of file eggGroup.cxx.

EggRenderMode::DepthTestMode EggRenderMode::string_depth_test_mode ( const string &  string) [static, inherited]

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

Definition at line 233 of file eggRenderMode.cxx.

EggRenderMode::DepthWriteMode EggRenderMode::string_depth_write_mode ( const string &  string) [static, inherited]

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

Definition at line 214 of file eggRenderMode.cxx.

EggGroup::GroupType EggGroup::string_group_type ( const string &  strval) [static]

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

Definition at line 901 of file eggGroup.cxx.

EggRenderMode::VisibilityMode EggRenderMode::string_visibility_mode ( const string &  string) [static, inherited]

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

Definition at line 252 of file eggRenderMode.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().

EggGroup::TagData::const_iterator EggGroup::tag_begin ( ) const [inline]

Returns an iterator that can, in conjunction with tag_end(), be used to traverse the entire set of tag keys.

Each iterator returns a pair<string, string>.

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 975 of file eggGroup.I.

EggGroup::TagData::const_iterator EggGroup::tag_end ( ) const [inline]

Returns an iterator that can, in conjunction with tag_begin(), be used to traverse the entire set of tag keys.

Each iterator returns a pair<string, string>.

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 991 of file eggGroup.I.

EggGroup::TagData::size_type EggGroup::tag_size ( ) const [inline]

Returns the number of elements between tag_begin() and tag_end().

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 1005 of file eggGroup.I.

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

void EggGroup::test_vref_integrity ( ) const

Verifies that each vertex in the group exists and that it knows it is referenced by the group.

Definition at line 817 of file eggGroup.cxx.

References EggVertex::has_gref(), ReferenceCount::test_ref_count_integrity(), vref_begin(), and vref_end().

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

void EggGroup::transform_changed ( ) [protected, virtual]

This virtual method is inherited by EggTransform3d; it is called whenever the transform is changed.

Reimplemented from EggTransform.

Definition at line 1374 of file eggGroup.cxx.

References EggGroupNode::update_under().

bool EggTransform::transform_is_identity ( ) const [inline, inherited]

Returns true if the described transform is identity, false otherwise.

Definition at line 262 of file eggTransform.I.

References LMatrix4d::almost_equal(), and LMatrix4d::ident_mat().

Referenced by EggTexture::is_equivalent_to(), EggPrimitive::r_apply_texmats(), and EggTexture::sorts_less_than().

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 EggGroup::unref_all_vertices ( )

Removes all vertices from the reference list.

Definition at line 721 of file eggGroup.cxx.

Referenced by steal_vrefs().

void EggGroup::unref_vertex ( EggVertex vert)

Removes the vertex from the set of those referenced by the group.

Does nothing if the vertex is not already reffed.

Definition at line 703 of file eggGroup.cxx.

Referenced by EggVertex::clear_grefs(), ref_vertex(), and set_vertex_membership().

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 set_billboard_center(), EggData::set_coordinate_system(), and transform_changed().

EggGroup::VertexRef::const_iterator EggGroup::vref_begin ( ) const [inline]

Returns an iterator that can, in conjunction with vref_end(), be used to traverse the entire set of referenced vertices.

Each iterator returns a pair<PT(EggVertex), double>.

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 1021 of file eggGroup.I.

Referenced by steal_vrefs(), and test_vref_integrity().

EggGroup::VertexRef::const_iterator EggGroup::vref_end ( ) const [inline]

Returns an iterator that can, in conjunction with vref_begin(), be used to traverse the entire set of referenced vertices.

Each iterator returns a pair<PT(EggVertex), double>.

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 1037 of file eggGroup.I.

Referenced by steal_vrefs(), and test_vref_integrity().

EggGroup::VertexRef::size_type EggGroup::vref_size ( ) const [inline]

Returns the number of elements between vref_begin() and vref_end().

This interface is not safe to use outside of PANDAEGG.DLL.

Definition at line 1051 of file eggGroup.I.

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 EggGroup::write ( ostream &  out,
int  indent_level 
) const [virtual]
void EggTransform::write ( ostream &  out,
int  indent_level,
const string &  label 
) const [inherited]
void EggGroup::write_billboard_flags ( ostream &  out,
int  indent_level 
) const

Writes just the <Billboard> entry and related fields to the indicated ostream.

Definition at line 322 of file eggGroup.cxx.

Referenced by write().

void EggGroup::write_collide_flags ( ostream &  out,
int  indent_level 
) const

Writes just the <Collide> entry and related fields to the indicated ostream.

Definition at line 341 of file eggGroup.cxx.

References BitMask< WType, nbits >::output_hex().

Referenced by write().

void EggGroup::write_decal_flags ( ostream &  out,
int  indent_level 
) const

Writes the flags related to decaling, if any.

Definition at line 446 of file eggGroup.cxx.

Referenced by write().

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(), EggTable::write(), EggSAnimData::write(), EggPoint::write(), EggNurbsSurface::write(), EggNurbsCurve::write(), EggMaterial::write(), EggLine::write(), write(), EggExternalReference::write(), EggComment::write(), and EggAnimPreload::write().

void EggGroup::write_model_flags ( ostream &  out,
int  indent_level 
) const

Writes the <Model> flag and related flags to the indicated ostream.

Definition at line 383 of file eggGroup.cxx.

Referenced by write().

void EggGroup::write_object_types ( ostream &  out,
int  indent_level 
) const

Writes just the <ObjectTypes> entries, if any, to the indicated ostream.

Definition at line 431 of file eggGroup.cxx.

Referenced by write().

void EggGroup::write_render_mode ( ostream &  out,
int  indent_level 
) const

Writes the flags inherited from EggRenderMode and similar flags that control obscure render effects.

Definition at line 479 of file eggGroup.cxx.

References write().

Referenced by write().

void EggGroup::write_switch_flags ( ostream &  out,
int  indent_level 
) const

Writes the <Switch> flag and related flags to the indicated ostream.

Definition at line 414 of file eggGroup.cxx.

Referenced by write().

void EggGroup::write_tags ( ostream &  out,
int  indent_level 
) const

Writes just the <Tag> entries, if any, to the indicated ostream.

Definition at line 459 of file eggGroup.cxx.

Referenced by write().

void EggGroup::write_vertex_ref ( ostream &  out,
int  indent_level 
) const [protected]

Writes out the vertex ref component of the group body only.

This may consist of a number of <VertexRef> entries, each with its own membership value.

Definition at line 1141 of file eggGroup.cxx.

References EggVertex::get_index(), and EggVertex::get_pool().

Referenced by write().


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