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

EggGroupNode Class Reference

#include <eggGroupNode.h>

Inheritance diagram for EggGroupNode:

EggNode EggNamedObject EggObject Namable TypedReferenceCount TypedObject ReferenceCount EggData EggGroup EggTable EggXfmSAnim EggBin List of all members.

Public Types

typedef Children::const_pointer pointer
typedef Children::const_pointer const_pointer
typedef Children::const_reference reference
typedef Children::const_reference const_reference
typedef Children::const_iterator iterator
typedef Children::const_iterator const_iterator
typedef Children::const_reverse_iterator reverse_iterator
typedef Children::const_reverse_iterator const_reverse_iterator
typedef Children::size_type size_type
typedef Children::difference_type difference_type

Public Member Functions

 EggGroupNode (const string &name="")
 EggGroupNode (const EggGroupNode &copy)
EggGroupNode & operator= (const EggGroupNode &copy)
virtual ~EggGroupNode ()
virtual void write (ostream &out, int indent_level) const
iterator begin () const
iterator end () const
reverse_iterator rbegin () const
reverse_iterator rend () const
bool empty () const
size_type size () const
iterator insert (iterator position, PT(EggNode) x)
iterator erase (iterator position)
iterator erase (iterator first, iterator last)
void replace (iterator position, PT(EggNode) x)
void clear ()
 PT (EggNode) add_child(PT(EggNode) node)
 PT (EggNode) remove_child(PT(EggNode) node)
void steal_children (EggGroupNode &other)
void resolve_filenames (const DSearchPath &searchpath)
void reverse_vertex_ordering ()
void recompute_vertex_normals (double threshold, CoordinateSystem cs=CS_default)
void recompute_polygon_normals (CoordinateSystem cs=CS_default)
void strip_normals ()
int triangulate_polygons (bool convex_also)
int remove_unused_vertices ()
int remove_invalid_primitives ()
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

virtual void update_under (int depth_offset)
virtual void r_transform (const LMatrix4d &mat, const LMatrix4d &inv, CoordinateSystem to_cs)
virtual void r_transform_vertices (const LMatrix4d &mat)
virtual void r_mark_coordsys (CoordinateSystem cs)
virtual void r_flatten_transforms ()
virtual void r_apply_texmats (EggTextureCollection &textures)
CoordinateSystem find_coordsys_entry ()
int find_textures (EggTextureCollection *collection)
int find_materials (EggMaterialCollection *collection)
bool r_load_externals (const DSearchPath &searchpath, CoordinateSystem coordsys)

Private Types

typedef plist< PT(EggNodeChildren )
typedef pvector< NVertexReferenceNVertexGroup
typedef pmap< Vertexd, NVertexGroupNVertexCollection

Private Member Functions

void prepare_add_child (EggNode *node)
void prepare_remove_child (EggNode *node)
void r_collect_vertex_normals (NVertexCollection &collection, double threshold, CoordinateSystem cs)
void do_compute_vertex_normals (const NVertexGroup &group)

Private Attributes

Children _children

Static Private Attributes

TypeHandle _type_handle

Friends

class EggTextureCollection
class EggMaterialCollection

Member Typedef Documentation

typedef plist< PT(EggNode) EggGroupNode::Children) [private]
 

Definition at line 62 of file eggGroupNode.h.

Referenced by triangulate_polygons().

typedef Children::const_iterator EggGroupNode::const_iterator
 

Definition at line 89 of file eggGroupNode.h.

Referenced by EggXfmSAnim::add_data(), AnimBundleMaker::build_hierarchy(), CharacterMaker::build_joint_hierarchy(), AnimBundleMaker::create_xfm_channel(), EggXfmAnimData::EggXfmAnimData(), EggLoader::find_collision_geometry(), EggXfmSAnim::get_num_rows(), get_textures_by_filename(), EggXfmSAnim::get_value(), AnimBundleMaker::inspect_tree(), AnimBundleMaker::make_bundle(), EggLoader::make_collision_plane(), EggLoader::make_collision_polygon(), EggLoader::make_collision_polyset(), EggLoader::make_collision_solids(), EggLoader::make_collision_sphere(), CharacterMaker::make_geometry(), EggLoader::make_node(), and EggXfmSAnim::set_value().

typedef Children::const_pointer EggGroupNode::const_pointer
 

Definition at line 84 of file eggGroupNode.h.

typedef Children::const_reference EggGroupNode::const_reference
 

Definition at line 87 of file eggGroupNode.h.

typedef Children::const_reverse_iterator EggGroupNode::const_reverse_iterator
 

Definition at line 91 of file eggGroupNode.h.

typedef Children::difference_type EggGroupNode::difference_type
 

Definition at line 93 of file eggGroupNode.h.

typedef Children::const_iterator EggGroupNode::iterator
 

Definition at line 88 of file eggGroupNode.h.

Referenced by EggBinMaker::collect_nodes(), EggLoader::create_collision_polygons(), erase(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggXfmSAnim::normalize_by_expanding(), EggXfmSAnim::optimize(), EggData::pre_write(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggNode::test_under_integrity(), EggNameUniquifier::uniquify(), and write().

typedef pmap<Vertexd, NVertexGroup> EggGroupNode::NVertexCollection [private]
 

Definition at line 158 of file eggGroupNode.h.

Referenced by recompute_vertex_normals().

typedef pvector<NVertexReference> EggGroupNode::NVertexGroup [private]
 

Definition at line 157 of file eggGroupNode.h.

Referenced by recompute_vertex_normals().

typedef Children::const_pointer EggGroupNode::pointer
 

Definition at line 83 of file eggGroupNode.h.

typedef Children::const_reference EggGroupNode::reference
 

Definition at line 86 of file eggGroupNode.h.

typedef Children::const_reverse_iterator EggGroupNode::reverse_iterator
 

Definition at line 90 of file eggGroupNode.h.

typedef Children::size_type EggGroupNode::size_type
 

Definition at line 92 of file eggGroupNode.h.


Constructor & Destructor Documentation

EggGroupNode::EggGroupNode const string &  name = ""  )  [inline]
 

Definition at line 67 of file eggGroupNode.h.

Referenced by r_load_externals().

EggGroupNode::EggGroupNode const EggGroupNode &  copy  ) 
 

Definition at line 48 of file eggGroupNode.cxx.

EggGroupNode::~EggGroupNode  )  [virtual]
 

Definition at line 76 of file eggGroupNode.cxx.


Member Function Documentation

EggGroupNode::iterator EggGroupNode::begin  )  const
 

Definition at line 100 of file eggGroupNode.cxx.

References _children.

Referenced by EggXfmSAnim::add_data(), AnimBundleMaker::build_hierarchy(), CharacterMaker::build_joint_hierarchy(), clear(), EggBinMaker::collect_nodes(), AnimBundleMaker::create_xfm_channel(), EggLoader::find_collision_geometry(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggXfmSAnim::get_num_rows(), get_textures_by_filename(), EggXfmSAnim::get_value(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), AnimBundleMaker::inspect_tree(), AnimBundleMaker::make_bundle(), EggLoader::make_collision_plane(), EggLoader::make_collision_polygon(), EggLoader::make_collision_polyset(), EggLoader::make_collision_solids(), EggLoader::make_collision_sphere(), CharacterMaker::make_geometry(), EggLoader::make_node(), EggXfmSAnim::normalize_by_expanding(), EggXfmSAnim::optimize(), EggData::pre_write(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggXfmSAnim::set_value(), EggNode::test_under_integrity(), EggNameUniquifier::uniquify(), and write().

void EggGroupNode::clear  ) 
 

Definition at line 213 of file eggGroupNode.cxx.

References begin(), end(), and erase().

Referenced by EggData::read().

void EggGroupNode::do_compute_vertex_normals const NVertexGroup group  )  [private]
 

Definition at line 1086 of file eggGroupNode.cxx.

References EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), EggVertex::get_pool(), Normald, ref, ReferenceCount::ref(), and EggAttributes::set_normal().

Referenced by recompute_vertex_normals().

bool EggGroupNode::empty  )  const
 

Definition at line 140 of file eggGroupNode.cxx.

References _children.

Referenced by EggXfmSAnim::add_data(), EggBinMaker::make_bins_for_group(), and operator=().

EggGroupNode::iterator EggGroupNode::end  )  const
 

Definition at line 110 of file eggGroupNode.cxx.

References _children.

Referenced by EggXfmSAnim::add_data(), AnimBundleMaker::build_hierarchy(), CharacterMaker::build_joint_hierarchy(), clear(), EggBinMaker::collect_nodes(), AnimBundleMaker::create_xfm_channel(), EggLoader::find_collision_geometry(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggXfmSAnim::get_num_rows(), get_textures_by_filename(), EggXfmSAnim::get_value(), AnimBundleMaker::inspect_tree(), AnimBundleMaker::make_bundle(), EggLoader::make_collision_plane(), EggLoader::make_collision_polygon(), EggLoader::make_collision_polyset(), EggLoader::make_collision_solids(), EggLoader::make_collision_sphere(), CharacterMaker::make_geometry(), EggLoader::make_node(), EggXfmSAnim::normalize_by_expanding(), EggXfmSAnim::optimize(), EggData::pre_write(), replace(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggXfmSAnim::set_value(), EggNode::test_under_integrity(), EggNameUniquifier::uniquify(), and write().

EggGroupNode::iterator EggGroupNode::erase iterator  first,
iterator  last
 

Definition at line 182 of file eggGroupNode.cxx.

References _children, first, iterator, and prepare_remove_child().

EggGroupNode::iterator EggGroupNode::erase iterator  position  ) 
 

Definition at line 171 of file eggGroupNode.cxx.

References _children, and prepare_remove_child().

Referenced by clear(), EggBinMaker::collect_nodes(), and EggXfmSAnim::optimize().

CoordinateSystem EggGroupNode::find_coordsys_entry  )  [protected]
 

Definition at line 768 of file eggGroupNode.cxx.

References _children, CoordinateSystem, CS_default, CS_invalid, DCAST, get_class_type(), EggCoordinateSystem::get_class_type(), TypedObject::is_of_type(), and prepare_remove_child().

Referenced by EggData::post_read().

int EggGroupNode::find_materials EggMaterialCollection collection  )  [protected]
 

Definition at line 872 of file eggGroupNode.cxx.

References _children, EggMaterialCollection::add_material(), DCAST, get_class_type(), EggMaterial::get_class_type(), TypedObject::is_of_type(), prepare_remove_child(), and tex.

Referenced by EggMaterialCollection::extract_materials().

int EggGroupNode::find_textures EggTextureCollection collection  )  [protected]
 

Definition at line 826 of file eggGroupNode.cxx.

References _children, EggTextureCollection::add_texture(), DCAST, get_class_type(), EggTexture::get_class_type(), TypedObject::is_of_type(), prepare_remove_child(), and tex.

Referenced by EggTextureCollection::extract_textures().

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

Reimplemented from EggNode.

Reimplemented in EggBin, EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 176 of file eggGroupNode.h.

References EggNode::get_class_type(), and EggNode::init_type().

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

Reimplemented from EggNode.

Reimplemented in EggBin, EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 165 of file eggGroupNode.h.

Referenced by EggBinMaker::collect_nodes(), find_coordsys_entry(), find_materials(), find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggXfmSAnim::force_init_type(), EggTable::force_init_type(), EggGroup::force_init_type(), EggData::force_init_type(), get_textures_by_filename(), EggXfmSAnim::get_type(), EggTable::get_type(), EggGroup::get_type(), EggData::get_type(), EggXfmSAnim::init_type(), EggTable::init_type(), EggGroup::init_type(), EggData::init_type(), AnimBundleMaker::inspect_tree(), CharacterMaker::make_geometry(), EggLoader::make_node(), EggNode::parse_egg(), r_collect_vertex_normals(), r_load_externals(), recompute_polygon_normals(), remove_invalid_primitives(), remove_unused_vertices(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), resolve_filenames(), reverse_vertex_ordering(), strip_normals(), triangulate_polygons(), and EggNameUniquifier::uniquify().

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

Reimplemented from EggNode.

Reimplemented in EggBin, EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 173 of file eggGroupNode.h.

References EggNode::get_class_type().

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

Reimplemented from EggNode.

Reimplemented in EggBin, EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 168 of file eggGroupNode.h.

References EggNode::get_class_type(), EggNode::init_type(), and register_type().

Referenced by EggXfmSAnim::force_init_type(), EggTable::force_init_type(), EggGroup::force_init_type(), EggData::force_init_type(), init_libegg(), EggXfmSAnim::init_type(), EggTable::init_type(), EggGroup::init_type(), and EggData::init_type().

EggGroupNode::iterator EggGroupNode::insert iterator  position,
PT(EggNode x
 

Definition at line 160 of file eggGroupNode.cxx.

References _children, prepare_add_child(), and x.

Referenced by EggMaterialCollection::insert_materials(), and EggTextureCollection::insert_textures().

EggGroupNode & EggGroupNode::operator= const EggGroupNode &  copy  ) 
 

Definition at line 61 of file eggGroupNode.cxx.

References empty(), and EggNode::operator=().

Referenced by EggGroup::operator=().

void EggGroupNode::prepare_add_child EggNode node  )  [private]
 

Definition at line 980 of file eggGroupNode.cxx.

References EggNode::_parent, EggNode::get_depth(), EggNode::get_parent(), NULL, and EggNode::update_under().

Referenced by insert(), replace(), and steal_children().

void EggGroupNode::prepare_remove_child EggNode node  )  [private]
 

Definition at line 1003 of file eggGroupNode.cxx.

References EggNode::_parent, EggNode::get_depth(), EggNode::get_parent(), NULL, and EggNode::update_under().

Referenced by erase(), find_coordsys_entry(), find_materials(), find_textures(), r_collect_vertex_normals(), recompute_polygon_normals(), replace(), and steal_children().

EggGroupNode::PT EggNode   ) 
 

EggGroupNode::PT EggNode   ) 
 

Referenced by r_load_externals(), and EggData::read().

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

Reimplemented from EggNode.

Definition at line 750 of file eggGroupNode.cxx.

References _children, and textures.

void EggGroupNode::r_collect_vertex_normals NVertexCollection collection,
double  threshold,
CoordinateSystem  cs
[private]
 

Definition at line 1024 of file eggGroupNode.cxx.

References _children, EggPolygon::calculate_normal(), EggAttributes::clear_normal(), cs, DCAST, get_class_type(), EggPolygon::get_class_type(), EggVertex::get_pos3(), EggPrimitive::get_vertex(), TypedObject::is_of_type(), EggNode::is_under_instance(), prepare_remove_child(), recompute_vertex_normals(), ref, ReferenceCount::ref(), and EggPrimitive::size().

Referenced by recompute_vertex_normals().

void EggGroupNode::r_flatten_transforms  )  [protected, virtual]
 

Reimplemented from EggNode.

Reimplemented in EggGroup.

Definition at line 735 of file eggGroupNode.cxx.

References _children.

Referenced by EggGroup::r_flatten_transforms().

bool EggGroupNode::r_load_externals const DSearchPath &  searchpath,
CoordinateSystem  coordsys
[protected]
 

Definition at line 919 of file eggGroupNode.cxx.

References _children, DCAST, EggGroupNode(), get_class_type(), EggExternalReference::get_class_type(), TypedObject::is_of_type(), EggData::load_externals(), PT(), EggData::read(), ReferenceCount::ref(), replace(), EggData::resolve_egg_filename(), EggData::set_auto_resolve_externals(), EggData::set_coordinate_system(), and steal_children().

Referenced by EggData::load_externals().

void EggGroupNode::r_mark_coordsys CoordinateSystem  cs  )  [protected, virtual]
 

Reimplemented from EggNode.

Reimplemented in EggXfmSAnim.

Definition at line 720 of file eggGroupNode.cxx.

References _children, and cs.

Referenced by EggData::post_read().

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

Reimplemented from EggNode.

Reimplemented in EggGroup, and EggXfmSAnim.

Definition at line 681 of file eggGroupNode.cxx.

References _children.

Referenced by EggGroup::r_transform(), and EggData::set_coordinate_system().

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

Reimplemented from EggNode.

Definition at line 701 of file eggGroupNode.cxx.

References _children.

EggGroupNode::reverse_iterator EggGroupNode::rbegin  )  const
 

Definition at line 120 of file eggGroupNode.cxx.

References _children.

void EggGroupNode::recompute_polygon_normals CoordinateSystem  cs = CS_default  ) 
 

Definition at line 433 of file eggGroupNode.cxx.

References _children, EggAttributes::clear_normal(), EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), cs, DCAST, get_class_type(), EggPolygon::get_class_type(), EggVertex::get_pool(), EggPrimitive::get_vertex(), EggAttributes::has_normal(), TypedObject::is_of_type(), prepare_remove_child(), EggPolygon::recompute_polygon_normal(), EggPrimitive::set_vertex(), and EggPrimitive::size().

void EggGroupNode::recompute_vertex_normals double  threshold,
CoordinateSystem  cs = CS_default
 

Definition at line 360 of file eggGroupNode.cxx.

References EggGroupNode::NVertexReference::_normal, cs, deg_2_rad(), do_compute_vertex_normals(), dot(), NVertexCollection, NVertexGroup, r_collect_vertex_normals(), ref, and ReferenceCount::ref().

Referenced by r_collect_vertex_normals().

int EggGroupNode::remove_invalid_primitives  ) 
 

Definition at line 614 of file eggGroupNode.cxx.

References _children, EggPrimitive::cleanup(), DCAST, get_class_type(), EggPrimitive::get_class_type(), and TypedObject::is_of_type().

int EggGroupNode::remove_unused_vertices  ) 
 

Definition at line 575 of file eggGroupNode.cxx.

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

EggGroupNode::reverse_iterator EggGroupNode::rend  )  const
 

Definition at line 130 of file eggGroupNode.cxx.

References _children.

void EggGroupNode::replace iterator  position,
PT(EggNode x
 

Definition at line 199 of file eggGroupNode.cxx.

References end(), prepare_add_child(), prepare_remove_child(), and x.

Referenced by r_load_externals().

void EggGroupNode::resolve_filenames const DSearchPath &  searchpath  ) 
 

Definition at line 285 of file eggGroupNode.cxx.

References _children, DCAST, ImageBuffer::get_alpha_filename(), get_class_type(), EggFilenameNode::get_class_type(), EggTexture::get_class_type(), EggFilenameNode::get_default_extension(), EggFilenameNode::get_filename(), ImageBuffer::get_filename(), ImageBuffer::has_alpha_filename(), TypedObject::is_of_type(), ImageBuffer::set_alpha_filename(), EggFilenameNode::set_filename(), ImageBuffer::set_filename(), and tex.

Referenced by EggData::post_read().

void EggGroupNode::reverse_vertex_ordering  ) 
 

Definition at line 323 of file eggGroupNode.cxx.

References _children, DCAST, get_class_type(), EggPrimitive::get_class_type(), TypedObject::is_of_type(), and EggPrimitive::reverse_vertex_ordering().

EggGroupNode::size_type EggGroupNode::size  )  const
 

Definition at line 150 of file eggGroupNode.cxx.

References _children.

void EggGroupNode::steal_children EggGroupNode &  other  ) 
 

Definition at line 263 of file eggGroupNode.cxx.

References _children, prepare_add_child(), and prepare_remove_child().

Referenced by load_egg_data(), EggData::merge(), EggXfmSAnim::normalize_by_rebuilding(), r_load_externals(), EggXfmSAnim::r_transform(), and EggData::read().

void EggGroupNode::strip_normals  ) 
 

Reimplemented in EggData.

Definition at line 487 of file eggGroupNode.cxx.

References _children, EggAttributes::clear_normal(), EggVertex::copy_grefs_from(), EggVertexPool::create_unique_vertex(), DCAST, get_class_type(), EggPrimitive::get_class_type(), EggVertex::get_pool(), EggPrimitive::get_vertex(), EggAttributes::has_normal(), TypedObject::is_of_type(), EggPrimitive::set_vertex(), and EggPrimitive::size().

int EggGroupNode::triangulate_polygons bool  convex_also  ) 
 

Definition at line 532 of file eggGroupNode.cxx.

References _children, Children, DCAST, get_class_type(), EggPolygon::get_class_type(), and TypedObject::is_of_type().

void EggGroupNode::update_under int  depth_offset  )  [protected, virtual]
 

Reimplemented from EggNode.

Definition at line 655 of file eggGroupNode.cxx.

References _children, and EggNode::update_under().

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

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

Implements EggNode.

Reimplemented in EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 87 of file eggGroupNode.cxx.

References begin(), end(), and iterator.

Referenced by EggXfmSAnim::write(), EggTable::write(), EggGroup::write(), and EggData::write().


Friends And Related Function Documentation

friend class EggMaterialCollection [friend]
 

Definition at line 182 of file eggGroupNode.h.

friend class EggTextureCollection [friend]
 

Definition at line 181 of file eggGroupNode.h.


Member Data Documentation

Children EggGroupNode::_children [private]
 

Definition at line 142 of file eggGroupNode.h.

Referenced by begin(), empty(), end(), erase(), find_coordsys_entry(), find_materials(), find_textures(), insert(), r_apply_texmats(), r_collect_vertex_normals(), r_flatten_transforms(), r_load_externals(), r_mark_coordsys(), r_transform(), r_transform_vertices(), rbegin(), recompute_polygon_normals(), remove_invalid_primitives(), remove_unused_vertices(), rend(), resolve_filenames(), reverse_vertex_ordering(), size(), steal_children(), strip_normals(), triangulate_polygons(), and update_under().

TypeHandle EggGroupNode::_type_handle [static, private]
 

Reimplemented from EggNode.

Reimplemented in EggBin, EggData, EggGroup, EggTable, and EggXfmSAnim.

Definition at line 39 of file eggGroupNode.cxx.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:12:05 2003 for Panda by doxygen1.3