Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

EggMaterial Class Reference

#include <eggMaterial.h>

Inheritance diagram for EggMaterial:

EggNode EggNamedObject EggObject Namable TypedReferenceCount TypedObject ReferenceCount List of all members.

Public Types

enum  Equivalence { E_attributes = 0x001, E_mref_name = 0x002 }

Public Member Functions

 EggMaterial (const string &mref_name)
 EggMaterial (const EggMaterial &copy)
virtual void write (ostream &out, int indent_level) const
 Writes the material definition to the indicated output stream in Egg format.

bool is_equivalent_to (const EggMaterial &other, int eq) const
 Returns true if the two materials are equivalent in all relevant properties (according to eq), false otherwise.

bool sorts_less_than (const EggMaterial &other, int eq) const
 An ordering operator to compare two materials for sorting order.

void set_diff (const Colorf &diff)
void clear_diff ()
bool has_diff () const
Colorf get_diff () const
 It is legal to call this even if has_diff() returns false.

void set_amb (const Colorf &amb)
void clear_amb ()
bool has_amb () const
Colorf get_amb () const
 It is legal to call this even if has_amb() returns false.

void set_emit (const Colorf &emit)
void clear_emit ()
bool has_emit () const
Colorf get_emit () const
 It is legal to call this even if has_emit() returns false.

void set_spec (const Colorf &spec)
void clear_spec ()
bool has_spec () const
Colorf get_spec () const
 It is legal to call this even if has_spec() returns false.

void set_shininess (double shininess)
void clear_shininess ()
bool has_shininess () const
double get_shininess () const
void set_local (bool local)
void clear_local ()
bool has_local () const
bool get_local () const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
EggGroupNodeget_parent () const
int get_depth () const
 Returns the number of nodes above this node in the egg hierarchy.

bool is_under_instance () const
 Returns true if there is an node somewhere in the egg tree at or above this node, false otherwise.

bool is_under_transform () const
 Returns true if there is a entry somewhere in the egg tree at or above this node, false otherwise.

bool is_local_coord () const
 Returns true if this node's vertices are not in the global coordinate space.

const LMatrix4d & get_vertex_frame () const
 Returns the coordinate frame of the vertices referenced by primitives at or under this node.

const LMatrix4d & get_node_frame () const
 Returns the coordinate frame of the node itself.

const LMatrix4d & get_vertex_frame_inv () const
 Returns the inverse of the matrix returned by get_vertex_frame().

const LMatrix4d & get_node_frame_inv () const
 Returns the inverse of the matrix returned by get_node_frame().

const LMatrix4d & get_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 LMatrix4d & get_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.

void transform (const LMatrix4d &mat)
 Applies the indicated transformation to the node and all of its descendants.

void transform_vertices_only (const LMatrix4d &mat)
 Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.

void flatten_transforms ()
 Removes any transform and instance records from this node in the scene graph and below.

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 EggRenderModedetermine_alpha_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has an alpha_mode other than AM_unspecified.

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

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

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

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

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 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 write_header (ostream &out, int indent_level, const char *egg_keyword) const
 Writes the first line of the egg object, e.g.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.

int get_ref_count () const
 Returns the current reference count.

int ref () const
 Explicitly increments the reference count.

int unref () const
 Explicitly decrements the reference count.

void test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.

void set_name (const string &name)
void clear_name ()
 Resets the Namable's name to empty.

bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.

const string & get_name () const
void output (ostream &out) const
 Outputs the Namable.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Types

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

Protected Member Functions

virtual bool egg_start_parse_body ()
 This function is called within parse_egg().

virtual void update_under (int depth_offset)
 This function is called from within EggGroupNode whenever the parentage of the node has changed.

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

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 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_flatten_transforms ()
 The recursive implementation of flatten_transforms().

virtual void r_apply_texmats (EggTextureCollection &textures)
 The recursive implementation of apply_texmats().


Protected Attributes

EggGroupNode_parent
int _depth
int _under_flags
PointerTo< MatrixFrame_vertex_frame
PointerTo< MatrixFrame_node_frame
PointerTo< MatrixFrame_vertex_frame_inv
PointerTo< MatrixFrame_node_frame_inv
PointerTo< MatrixFrame_vertex_to_node
PointerTo< MatrixFrame_node_to_vertex

Private Types

enum  Flags {
  F_diff = 0x001, F_amb = 0x002, F_emit = 0x004, F_spec = 0x008,
  F_shininess = 0x010, F_local = 0x020
}

Private Attributes

Colorf _diff
Colorf _amb
Colorf _emit
Colorf _spec
double _shininess
bool _local
int _flags

Static Private Attributes

TypeHandle _type_handle

Member Typedef Documentation

typedef RefCountObj<LMatrix4d> EggNode::MatrixFrame [protected, inherited]
 

Definition at line 118 of file eggNode.h.

Referenced by EggGroup::string_collide_flags().


Member Enumeration Documentation

enum EggMaterial::Equivalence
 

Enumeration values:
E_attributes 
E_mref_name 

Definition at line 44 of file eggMaterial.h.

enum EggMaterial::Flags [private]
 

Enumeration values:
F_diff 
F_amb 
F_emit 
F_spec 
F_shininess 
F_local 

Definition at line 83 of file eggMaterial.h.

enum EggNode::UnderFlags [protected, inherited]
 

Enumeration values:
UF_under_instance 
UF_under_transform 
UF_local_coord 

Definition at line 92 of file eggNode.h.


Constructor & Destructor Documentation

EggMaterial::EggMaterial const string &  mref_name  ) 
 

Definition at line 37 of file eggMaterial.cxx.

EggMaterial::EggMaterial const EggMaterial &  copy  ) 
 

Definition at line 51 of file eggMaterial.cxx.


Member Function Documentation

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

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

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

Reimplemented in EggGroup.

Definition at line 361 of file eggNode.cxx.

Referenced by EggNode::test_under_integrity().

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 49 of file eggNode.cxx.

References EggNode::_parent, EggNode::determine_alpha_mode(), and NULL.

void EggMaterial::clear_amb  )  [inline]
 

Definition at line 102 of file eggMaterial.I.

References _amb, Colorf, has_amb(), and INLINE.

void EggMaterial::clear_diff  )  [inline]
 

Definition at line 44 of file eggMaterial.I.

References _flags, F_diff, and INLINE.

void EggMaterial::clear_emit  )  [inline]
 

Definition at line 160 of file eggMaterial.I.

References _flags, _spec, F_spec, and INLINE.

void EggMaterial::clear_local  )  [inline]
 

Definition at line 329 of file eggMaterial.I.

void Namable::clear_name  )  [inline, inherited]
 

Resets the Namable's name to empty.

Definition at line 82 of file namable.I.

References Namable::_name, and INLINE.

void EggMaterial::clear_shininess  )  [inline]
 

Definition at line 276 of file eggMaterial.I.

References _flags, F_local, and INLINE.

void EggMaterial::clear_spec  )  [inline]
 

Definition at line 218 of file eggMaterial.I.

References _flags, F_shininess, and INLINE.

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

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

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

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 72 of file eggNode.cxx.

References EggNode::_parent, EggNode::determine_depth_write_mode(), and NULL.

Referenced by EggNode::apply_texmats().

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

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

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

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 172 of file eggNode.cxx.

References EggNode::_depth, EggNode::_parent, EggNode::_under_flags, EggGroupNode::begin(), EggGroupNode::end(), EggGroupNode::iterator, nassertv, NULL, and ReferenceCount::test_ref_count_integrity().

Referenced by EggNode::determine_depth_test_mode(), and EggGroup::determine_depth_write_mode().

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

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

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

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 122 of file eggNode.cxx.

References EggNode::_parent, EggNode::determine_bin(), and NULL.

Referenced by EggGroup::determine_alpha_mode(), and EggPrimitive::determine_depth_write_mode().

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

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

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

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 97 of file eggNode.cxx.

Referenced by EggNode::determine_alpha_mode().

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

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

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

Reimplemented in EggGroup, and EggPrimitive.

Definition at line 147 of file eggNode.cxx.

References DCAST_INTO_R, egg_cleanup_parser(), egg_error_count(), egg_init_parser(), EggNode::egg_start_parse_body(), eggyyparse(), EggGroupNode::get_class_type(), EggNode::get_parent(), and TypedObject::is_of_type().

Referenced by EggPrimitive::determine_depth_test_mode().

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

This function is called within parse_egg().

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

Reimplemented in EggGroup, EggPrimitive, and EggTexture.

Definition at line 282 of file eggNode.cxx.

Referenced by EggNode::determine_draw_order().

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 381 of file eggNode.I.

virtual TypeHandle EggMaterial::force_init_type void   )  [inline, virtual]
 

Reimplemented from EggNode.

Definition at line 113 of file eggMaterial.h.

References EXPCL_PANDAEGG, and INLINE.

Colorf EggMaterial::get_amb  )  const [inline]
 

It is legal to call this even if has_amb() returns false.

If so, it simply returns the default amb color.

Definition at line 131 of file eggMaterial.I.

References _flags, and F_emit.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

TypeHandle EggMaterial::get_class_type void   )  [inline, static]
 

Reimplemented from EggNode.

Definition at line 102 of file eggMaterial.h.

Referenced by EggPoolUniquifier::EggPoolUniquifier(), and EggGroupNode::r_transform_vertices().

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

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

Definition at line 90 of file eggNode.I.

Colorf EggMaterial::get_diff  )  const [inline]
 

It is legal to call this even if has_diff() returns false.

If so, it simply returns the default diff color.

Definition at line 73 of file eggMaterial.I.

References _amb, _flags, and F_amb.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

Colorf EggMaterial::get_emit  )  const [inline]
 

It is legal to call this even if has_emit() returns false.

If so, it simply returns the default emit color.

Definition at line 189 of file eggMaterial.I.

References _flags, and F_spec.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

bool EggMaterial::get_local  )  const [inline]
 

Definition at line 353 of file eggMaterial.I.

Referenced by is_equivalent_to().

const string & Namable::get_name  )  const [inline, inherited]
 

Definition at line 109 of file namable.I.

Referenced by ComputedVerticesMaker::add_normal(), GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), BuilderBucket::BuilderBucket(), EggVertex::clear_grefs(), AnimBundleMaker::create_xfm_channel(), SceneGraphReducer::do_flatten_siblings(), BuilderBucket::done_geom(), DXTextureContext8::DXTextureContext8(), PartGroup::find_child(), EggLoader::find_collision_geometry(), EggGroupUniquifier::get_category(), PartBundle::get_control_effect(), PartGroup::get_num_children(), EggMorph< Parameter >::get_offset(), AnimChannelBase::has_changed(), Namable::has_name(), is_equivalent_to(), Texture::load(), EggLoader::make_node(), AnimBundleMaker::make_node(), FindApproxPath::Component::matches(), LineSegs::move_to(), MovingPartBase::MovingPartBase(), NodeMap::NodeMap(), EggMorph< Parameter >::operator<(), operator<<(), MouseWatcherRegion::output(), AnimGroup::output(), EggXfmSAnim::r_transform(), Texture::read(), MouseWatcherGroup::remove_region(), EggLoader::reparent_decals(), CRGraphicsStateGuardian::set_blend_mode(), NodePath::set_color(), GLGraphicsStateGuardian::set_draw_buffer(), AnimChannelScalarTable::set_table(), NodePath::set_transparency(), NodePathComponent::uncollapse(), Texture::unprepare(), TextNode::wordwrap_to(), MovingPartBase::write(), CollisionNode::xform(), and EggVertex::~EggVertex().

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 210 of file eggNode.I.

Referenced by EggGroup::string_collide_flags().

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 249 of file eggNode.I.

Referenced by EggGroup::string_collide_flags().

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 307 of file eggNode.I.

EggGroupNode * EggNode::get_parent  )  const [inline, inherited]
 

Definition at line 75 of file eggNode.I.

References EggNode::_depth.

Referenced by EggNode::determine_draw_order(), and CharacterMaker::make_dynamic_primitive().

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

Returns the current reference count.

Definition at line 183 of file referenceCount.I.

Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture().

double EggMaterial::get_shininess  )  const [inline]
 

Definition at line 300 of file eggMaterial.I.

References INLINE.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

Colorf EggMaterial::get_spec  )  const [inline]
 

It is legal to call this even if has_spec() returns false.

If so, it simply returns the default spec color.

Definition at line 247 of file eggMaterial.I.

References _shininess.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

virtual TypeHandle EggMaterial::get_type void   )  const [inline, virtual]
 

Reimplemented from EggNode.

Definition at line 110 of file eggMaterial.h.

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 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

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 entry reference their vertices in the coordinate system under effect at the time of the . Thus, nodes under an 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 188 of file eggNode.I.

References EggNode::_node_frame_inv, and NULL.

Referenced by EggGroup::string_collide_flags().

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 229 of file eggNode.I.

Referenced by EggGroup::string_collide_flags().

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 278 of file eggNode.I.

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

Referenced by EggLoader::find_collision_geometry().

bool EggMaterial::has_amb  )  const [inline]
 

Definition at line 114 of file eggMaterial.I.

References _emit, _flags, F_emit, and INLINE.

Referenced by clear_amb(), EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

bool EggMaterial::has_diff  )  const [inline]
 

Definition at line 56 of file eggMaterial.I.

References _diff, Colorf, and INLINE.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

bool EggMaterial::has_emit  )  const [inline]
 

Definition at line 172 of file eggMaterial.I.

References _flags, F_spec, and INLINE.

Referenced by EggLoader::get_texture_apply_attributes(), is_equivalent_to(), and set_emit().

bool EggMaterial::has_local  )  const [inline]
 

Definition at line 341 of file eggMaterial.I.

Referenced by EggLoader::get_texture_apply_attributes(), has_shininess(), and is_equivalent_to().

bool Namable::has_name  )  const [inline, inherited]
 

Returns true if the Namable has a nonempty name set, false if the name is empty.

Definition at line 97 of file namable.I.

References Namable::get_name(), and INLINE.

Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture().

bool EggMaterial::has_shininess  )  const [inline]
 

Definition at line 288 of file eggMaterial.I.

References _local, has_local(), and INLINE.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

bool EggMaterial::has_spec  )  const [inline]
 

Definition at line 230 of file eggMaterial.I.

References _flags, F_shininess, and INLINE.

Referenced by EggLoader::get_texture_apply_attributes(), and is_equivalent_to().

void EggMaterial::init_type void   )  [inline, static]
 

Reimplemented from EggNode.

Definition at line 105 of file eggMaterial.h.

References EggNode::get_class_type().

bool EggMaterial::is_equivalent_to const EggMaterial &  other,
int  eq
const
 

Returns true if the two materials are equivalent in all relevant properties (according to eq), false otherwise.

The Equivalence parameter, eq, should be set to the bitwise OR of the following properties, according to what you consider relevant:

EggMaterial::E_attributes: All material attributes (diff, spec, etc.) except MRef name.

EggMaterial::E_mref_name: The MRef name.

Definition at line 178 of file eggMaterial.cxx.

References _flags, E_attributes, E_mref_name, get_amb(), get_diff(), get_emit(), get_local(), Namable::get_name(), get_shininess(), get_spec(), has_amb(), has_diff(), has_emit(), has_local(), has_shininess(), and has_spec().

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

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

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 node under a transform at or above this node.

Definition at line 144 of file eggNode.I.

Referenced by EggVertex::sorts_less_than().

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 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

bool EggNode::is_under_instance  )  const [inline, inherited]
 

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

Definition at line 108 of file eggNode.I.

References EggNode::_under_flags, INLINE, and EggNode::UF_local_coord.

Referenced by EggGroupNode::find_textures().

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

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

Definition at line 125 of file eggNode.I.

References EggNode::_vertex_frame, INLINE, and NULL.

void Namable::output ostream &  out  )  const [inline, inherited]
 

Outputs the Namable.

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

Reimplemented in BuilderBucket, AnimBundle, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimGroup, PartBundle, CollisionNode, ButtonNode, HermiteCurve, RopeNode, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, PandaNode, PlaneNode, MouseWatcher, and MouseWatcherRegion.

Definition at line 126 of file namable.I.

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 200 of file eggNode.cxx.

References EggNode::_parent.

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

The recursive implementation of apply_texmats().

Reimplemented in EggGroupNode, EggNurbsSurface, and EggPrimitive.

Definition at line 454 of file eggNode.cxx.

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

The recursive implementation of flatten_transforms().

Reimplemented in EggGroup, EggGroupNode, and EggPrimitive.

Definition at line 442 of file eggNode.cxx.

Referenced by EggNode::get_vertex_to_node().

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

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

Reimplemented in EggGroupNode, EggXfmAnimData, and EggXfmSAnim.

Definition at line 430 of file eggNode.cxx.

void EggNode::r_transform const LMatrix4d &  mat,
const LMatrix4d &  inv,
CoordinateSystem  to_cs
[protected, virtual, inherited]
 

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 in EggGroup, EggGroupNode, EggPrimitive, EggVertexPool, EggXfmAnimData, and EggXfmSAnim.

Definition at line 390 of file eggNode.cxx.

void EggNode::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 in EggGroupNode, and EggVertexPool.

Definition at line 410 of file eggNode.cxx.

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

The return value is the new reference count.

Definition at line 225 of file referenceCount.I.

Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering().

void EggMaterial::set_amb const Colorf amb  )  [inline]
 

Definition at line 89 of file eggMaterial.I.

References _flags, F_amb, and INLINE.

void EggMaterial::set_diff const Colorf diff  )  [inline]
 

Definition at line 31 of file eggMaterial.I.

References _flags, F_diff, and INLINE.

void EggMaterial::set_emit const Colorf emit  )  [inline]
 

Definition at line 147 of file eggMaterial.I.

References _emit, Colorf, has_emit(), and INLINE.

void EggMaterial::set_local bool  local  )  [inline]
 

Definition at line 316 of file eggMaterial.I.

void Namable::set_name const string &  name  )  [inline, inherited]
 

Definition at line 69 of file namable.I.

References Namable::_name.

Referenced by BuilderBucket::BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture().

void EggMaterial::set_shininess double  shininess  )  [inline]
 

Definition at line 263 of file eggMaterial.I.

References _flags, F_local, and INLINE.

void EggMaterial::set_spec const Colorf spec  )  [inline]
 

Definition at line 205 of file eggMaterial.I.

bool EggMaterial::sorts_less_than const EggMaterial &  other,
int  eq
const
 

An ordering operator to compare two materials for sorting order.

This imposes an arbitrary ordering useful to identify unique materials, according to the indicated Equivalence factor. See is_equivalent_to().

Definition at line 217 of file eggMaterial.cxx.

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

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

Definition at line 328 of file referenceCount.I.

References INLINE.

Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount().

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 235 of file eggNode.cxx.

References EggNode::_depth, EggNode::_node_frame, EggNode::_node_frame_inv, EggNode::_node_to_vertex, EggNode::_parent, EggNode::_under_flags, EggNode::_vertex_frame, EggNode::_vertex_frame_inv, EggNode::_vertex_to_node, EggNode::adjust_under(), and NULL.

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 327 of file eggNode.I.

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 352 of file eggNode.I.

int ReferenceCount::unref  )  const [inline, 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; plus, we don't have a virtual destructor anyway.) 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 the new reference count.

Definition at line 293 of file referenceCount.I.

References INLINE.

Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds().

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

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

It should update the depth and under_instance flags accordingly.

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

Reimplemented in EggGroupNode.

Definition at line 311 of file eggNode.cxx.

Referenced by EggNode::EggNode(), EggNode::get_vertex_to_node(), and EggGroupNode::triangulate_polygons().

void EggMaterial::write ostream &  out,
int  indent_level
const [virtual]
 

Writes the material definition to the indicated output stream in Egg format.

Implements EggNode.

Definition at line 75 of file eggMaterial.cxx.

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 46 of file eggNamedObject.cxx.

Referenced by EggPoint::cleanup(), EggNurbsSurface::is_closed_u(), and EggExternalReference::operator=().


Member Data Documentation

Colorf EggMaterial::_amb [private]
 

Definition at line 93 of file eggMaterial.h.

Referenced by clear_amb(), and get_diff().

int EggNode::_depth [protected, inherited]
 

Definition at line 115 of file eggNode.h.

Referenced by EggNode::determine_bin(), EggNode::EggNode(), EggNode::get_parent(), and EggNode::test_under_integrity().

Colorf EggMaterial::_diff [private]
 

Definition at line 92 of file eggMaterial.h.

Referenced by has_diff().

Colorf EggMaterial::_emit [private]
 

Definition at line 94 of file eggMaterial.h.

Referenced by has_amb(), and set_emit().

int EggMaterial::_flags [private]
 

Definition at line 98 of file eggMaterial.h.

Referenced by clear_diff(), clear_emit(), clear_shininess(), clear_spec(), get_amb(), get_diff(), get_emit(), has_amb(), has_emit(), has_spec(), is_equivalent_to(), set_amb(), set_diff(), and set_shininess().

bool EggMaterial::_local [private]
 

Definition at line 97 of file eggMaterial.h.

Referenced by has_shininess().

PointerTo< MatrixFrame > EggNode::_node_frame [protected, inherited]
 

Definition at line 121 of file eggNode.h.

Referenced by EggGroup::string_collide_flags(), and EggNode::test_under_integrity().

PointerTo< MatrixFrame > EggNode::_node_frame_inv [protected, inherited]
 

Definition at line 123 of file eggNode.h.

Referenced by EggNode::get_vertex_frame(), EggGroup::string_collide_flags(), and EggNode::test_under_integrity().

PointerTo< MatrixFrame > EggNode::_node_to_vertex [protected, inherited]
 

Definition at line 125 of file eggNode.h.

Referenced by EggGroup::string_collide_flags(), and EggNode::test_under_integrity().

EggGroupNode* EggNode::_parent [protected, inherited]
 

Definition at line 114 of file eggNode.h.

Referenced by EggNode::apply_texmats(), EggNode::determine_alpha_mode(), EggNode::determine_bin(), EggNode::determine_depth_test_mode(), EggNode::EggNode(), EggNode::operator=(), EggNode::parse_egg(), and EggNode::test_under_integrity().

double EggMaterial::_shininess [private]
 

Definition at line 96 of file eggMaterial.h.

Referenced by get_spec().

Colorf EggMaterial::_spec [private]
 

Definition at line 95 of file eggMaterial.h.

Referenced by clear_emit().

TypeHandle EggMaterial::_type_handle [static, private]
 

Reimplemented from EggNode.

Definition at line 26 of file eggMaterial.cxx.

int EggNode::_under_flags [protected, inherited]
 

Definition at line 116 of file eggNode.h.

Referenced by EggNode::determine_bin(), EggNode::EggNode(), EggNode::is_under_instance(), EggGroup::string_collide_flags(), and EggNode::test_under_integrity().

PointerTo< MatrixFrame > EggNode::_vertex_frame [protected, inherited]
 

Definition at line 120 of file eggNode.h.

Referenced by EggNode::is_under_transform(), and EggNode::test_under_integrity().

PointerTo< MatrixFrame > EggNode::_vertex_frame_inv [protected, inherited]
 

Definition at line 122 of file eggNode.h.

Referenced by EggNode::test_under_integrity().

PointerTo< MatrixFrame > EggNode::_vertex_to_node [protected, inherited]
 

Definition at line 124 of file eggNode.h.

Referenced by EggGroup::string_collide_flags(), and EggNode::test_under_integrity().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:50:06 2003 for Panda by doxygen1.3