Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
EggVertex Class Reference

Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal. More...

#include "eggVertex.h"

Inheritance diagram for EggVertex:
EggObject EggAttributes TypedReferenceCount MemoryBase TypedObject ReferenceCount MemoryBase MemoryBase

Public Types

typedef second_of_pair_iterator< AuxMap::const_iterator > aux_iterator
 
typedef AuxMap::size_type aux_size_type
 
typedef pmap< string, PT(EggVertexAux) > AuxMap
 
typedef aux_iterator const_aux_iterator
 
typedef uv_iterator const_uv_iterator
 
typedef pset< EggGroup * > GroupRef
 
typedef pmultiset< EggPrimitive * > PrimitiveRef
 
typedef second_of_pair_iterator< UVMap::const_iterator > uv_iterator
 
typedef UVMap::size_type uv_size_type
 
typedef pmap< string, PT(EggVertexUV) > UVMap
 

Public Member Functions

 EggVertex (const EggVertex &copy)
 Copies all properties of the vertex except its vertex pool, index number, and group membership. More...
 
const_aux_iterator aux_begin () const
 Returns an iterator that allows walking through the complete set of auxiliary data on the vertex. More...
 
const_aux_iterator aux_end () const
 Returns an iterator that allows walking through the complete set of auxiliary data on the vertex. More...
 
aux_size_type aux_size () const
 Returns the number of auxiliary datas on the vertex. More...
 
void clear_aux ()
 Removes all auxiliary data from the vertex. More...
 
void clear_aux (const string &name)
 Removes the named auxiliary data from the vertex. More...
 
void clear_grefs ()
 Removes all group references from the vertex, so that it is not assigned to any group. More...
 
void clear_uv ()
 Removes all UV coordinate pairs from the vertex. More...
 
void clear_uv (const string &name)
 Removes the named UV coordinate pair from the vertex, along with any UV morphs. More...
 
int compare_to (const EggVertex &other) const
 An ordering operator to compare two vertices for sorting order. More...
 
void copy_grefs_from (const EggVertex &other)
 Copies all the group references from the other vertex onto this one. More...
 
virtual TypeHandle force_init_type ()
 
const LVecBase4dget_aux (const string &name) const
 Returns the named auxiliary data quadruple on the vertex. More...
 
const EggVertexAuxget_aux_obj (const string &name) const
 Returns the named EggVertexAux object, which defines the auxiliary data for this name. More...
 
int get_external_index () const
 Returns the number set by set_external_index(). More...
 
int get_external_index2 () const
 Returns the number set by set_external_index2(). More...
 
int get_index () const
 Returns the index number of the vertex within its pool. More...
 
int get_num_dimensions () const
 Returns the number of dimensions the vertex uses. More...
 
int get_num_global_coord () const
 Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system. More...
 
int get_num_local_coord () const
 Returns the number of primitives that own this vertex whose vertices are interpreted to be in a local coordinate system. More...
 
EggVertexPoolget_pool () const
 Returns the vertex pool this vertex belongs in. More...
 
double get_pos1 () const
 Only valid if get_num_dimensions() returns 1. More...
 
LPoint2d get_pos2 () const
 Only valid if get_num_dimensions() returns 2. More...
 
LVertexd get_pos3 () const
 Valid if get_num_dimensions() returns 3 or 4. More...
 
LPoint4d get_pos4 () const
 This is always valid, regardless of the value of get_num_dimensions. More...
 
virtual TypeHandle get_type () const
 
LTexCoordd get_uv () const
 Returns the unnamed UV coordinate pair on the vertex. More...
 
LTexCoordd get_uv (const string &name) const
 Returns the named UV coordinate pair on the vertex. More...
 
const EggVertexUVget_uv_obj (const string &name) const
 Returns the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs. More...
 
const LTexCoord3dget_uvw (const string &name) const
 Returns the named UV coordinate triple on the vertex. More...
 
GroupRef::const_iterator gref_begin () const
 Returns an iterator that can, in conjunction with gref_end(), be used to traverse the entire set of groups that reference this vertex. More...
 
GroupRef::const_iterator gref_end () const
 Returns an iterator that can, in conjunction with gref_begin(), be used to traverse the entire set of groups that reference this vertex. More...
 
GroupRef::size_type gref_size () const
 Returns the number of elements between gref_begin() and gref_end(). More...
 
bool has_aux () const
 Returns true if the vertex has any auxiliary data, false otherwise. More...
 
bool has_aux (const string &name) const
 Returns true if the vertex has the named auxiliary data quadruple. More...
 
bool has_gref (const EggGroup *group) const
 Returns true if the indicated group references this vertex, false otherwise. More...
 
int has_pref (const EggPrimitive *prim) const
 Returns the number of times the vertex appears in the indicated primitive, or 0 if it does not appear. More...
 
bool has_uv () const
 Returns true if the vertex has an unnamed UV coordinate pair, false otherwise. More...
 
bool has_uv (const string &name) const
 Returns true if the vertex has the named UV coordinate pair, and the named UV coordinate pair is 2-d, false otherwise. More...
 
bool has_uvw (const string &name) const
 Returns true if the vertex has the named UV coordinate triple, and the named UV coordinate triple is 3-d, false otherwise. More...
 
bool is_forward_reference () const
 Returns true if the vertex is a forward reference to some vertex that hasn't been defined yet. More...
 
EggVertexAuxmodify_aux_obj (const string &name)
 Returns a modifiable pointer to the named EggVertexAux object, which defines the auxiliary data for this name. More...
 
EggVertexUVmodify_uv_obj (const string &name)
 Returns a modifiable pointer to the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs. More...
 
EggVertexoperator= (const EggVertex &copy)
 Copies all properties of the vertex except its vertex pool, index number, and group membership. More...
 
void output (ostream &out) const
 
PrimitiveRef::const_iterator pref_begin () const
 Returns an iterator that can, in conjunction with pref_end(), be used to traverse the entire set of primitives that reference this vertex. More...
 
PrimitiveRef::const_iterator pref_end () const
 Returns an iterator that can, in conjunction with pref_begin(), be used to traverse the entire set of primitives that reference this vertex. More...
 
PrimitiveRef::size_type pref_size () const
 Returns the number of elements between pref_begin() and pref_end(). More...
 
void set_aux (const string &name, const LVecBase4d &aux)
 Sets the indicated auxiliary data quadruple on the vertex. More...
 
void set_aux_obj (EggVertexAux *vertex_aux)
 Sets the indicated EggVertexAux on the vertex. More...
 
void set_external_index (int external_index)
 Sets a special index number that is associated with the EggVertex (but is not written to the egg file). More...
 
void set_external_index2 (int external_index2)
 Similar to set_external_index(), but this is a different number which may be used for a different purpose by the calling code. More...
 
void set_pos (double pos)
 Sets the vertex position. More...
 
void set_pos (const LPoint2d &pos)
 Sets the vertex position. More...
 
void set_pos (const LPoint3d &pos)
 Sets the vertex position. More...
 
void set_pos (const LPoint4d &pos)
 Sets the vertex position. More...
 
void set_pos4 (const LPoint4d &pos)
 This special flavor of set_pos() sets the vertex as a four-component value, but does not change the set number of dimensions. More...
 
void set_uv (const LTexCoordd &texCoord)
 Replaces the unnamed UV coordinate pair on the vertex with the indicated value. More...
 
void set_uv (const string &name, const LTexCoordd &texCoord)
 Sets the indicated UV coordinate pair on the vertex. More...
 
void set_uv_obj (EggVertexUV *vertex_uv)
 Sets the indicated EggVertexUV on the vertex. More...
 
void set_uvw (const string &name, const LTexCoord3d &texCoord)
 Sets the indicated UV coordinate triple on the vertex. More...
 
bool sorts_less_than (const EggVertex &other) const
 An ordering operator to compare two vertices for sorting order. More...
 
void test_gref_integrity () const
 
void test_pref_integrity () const
 
void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to the vertex. More...
 
const_uv_iterator uv_begin () const
 Returns an iterator that allows walking through the complete set of named UV's on the vertex. More...
 
const_uv_iterator uv_end () const
 Returns an iterator that allows walking through the complete set of named UV's on the vertex. More...
 
uv_size_type uv_size () const
 Returns the number of named UV's on the vertex. More...
 
void write (ostream &out, int indent_level) const
 Writes the vertex to the indicated output stream in Egg format. More...
 
- Public Member Functions inherited from EggObject
 EggObject (const EggObject &copy)
 
virtual EggTransformas_transform ()
 Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not. More...
 
void clear_user_data ()
 Removes *all* user data pointers from the node. More...
 
void clear_user_data (TypeHandle type)
 Removes the user data pointer of the indicated type. More...
 
EggUserDataget_user_data () const
 Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. More...
 
EggUserDataget_user_data (TypeHandle type) const
 Returns the user data pointer of the indicated type, if it exists, or NULL if it does not. More...
 
bool has_user_data () const
 Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. More...
 
bool has_user_data (TypeHandle type) const
 Returns true if the user data pointer of the indicated type has been set, false otherwise. More...
 
EggObjectoperator= (const EggObject &copy)
 
void set_user_data (EggUserData *user_data)
 Sets the user data associated with this object. More...
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 
- Public Member Functions inherited from EggAttributes
 EggAttributes (const EggAttributes &copy)
 
void clear_color ()
 
void clear_normal ()
 
int compare_to (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order. More...
 
void copy_color (const EggAttributes &other)
 Sets this color to be the same as the other's, include morphs. More...
 
void copy_normal (const EggAttributes &other)
 Sets this normal to be the same as the other's, include morphs. More...
 
LColor get_color () const
 Returns the color set on this particular attribute. More...
 
const LNormaldget_normal () const
 
bool has_color () const
 
bool has_normal () const
 
bool matches_color (const EggAttributes &other) const
 Returns true if this color matches that of the other EggAttributes object, include the morph list. More...
 
bool matches_normal (const EggAttributes &other) const
 Returns true if this normal matches that of the other EggAttributes object, include the morph list. More...
 
EggAttributesoperator= (const EggAttributes &copy)
 
void set_color (const LColor &Color)
 
void set_normal (const LNormald &normal)
 
bool sorts_less_than (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order. More...
 
void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to the attributes. More...
 
void write (ostream &out, int indent_level) const
 Writes the attributes to the indicated output stream in Egg format. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static PT (EggVertex) make_average(const EggVertex *first
 
- Static Public Member Functions inherited from EggObject
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from EggAttributes
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

EggMorphVertexList _dxyzs
 
static const EggVertexsecond
 
- Public Attributes inherited from EggAttributes
EggMorphNormalList _dnormals
 
EggMorphColorList _drgbas
 

Friends

class EggGroup
 
class EggPrimitive
 
class EggVertexPool
 

Detailed Description

Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.

Definition at line 41 of file eggVertex.h.

Constructor & Destructor Documentation

◆ EggVertex()

EggVertex::EggVertex ( const EggVertex copy)

Copies all properties of the vertex except its vertex pool, index number, and group membership.

Definition at line 57 of file eggVertex.cxx.

References operator=().

Member Function Documentation

◆ aux_begin()

EggVertex::const_aux_iterator EggVertex::aux_begin ( ) const
inline

Returns an iterator that allows walking through the complete set of auxiliary data on the vertex.

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

Definition at line 287 of file eggVertex.I.

References uv_end().

Referenced by clear_aux(), EggVertexPool::get_aux_names(), EggLoader::make_polyset(), and uv_begin().

◆ aux_end()

EggVertex::const_aux_iterator EggVertex::aux_end ( ) const
inline

Returns an iterator that allows walking through the complete set of auxiliary data on the vertex.

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

Definition at line 315 of file eggVertex.I.

References uv_size().

Referenced by clear_aux(), EggVertexPool::get_aux_names(), EggLoader::make_polyset(), and uv_end().

◆ aux_size()

EggVertex::aux_size_type EggVertex::aux_size ( ) const
inline

Returns the number of auxiliary datas on the vertex.

Definition at line 335 of file eggVertex.I.

References get_index().

Referenced by uv_size().

◆ clear_aux() [1/2]

void EggVertex::clear_aux ( )
inline

Removes all auxiliary data from the vertex.

Definition at line 259 of file eggVertex.I.

References uv_begin().

Referenced by clear_uv().

◆ clear_aux() [2/2]

void EggVertex::clear_aux ( const string &  name)

◆ clear_grefs()

void EggVertex::clear_grefs ( )

Removes all group references from the vertex, so that it is not assigned to any group.

Definition at line 875 of file eggVertex.cxx.

References pref_begin(), and EggGroup::unref_vertex().

Referenced by copy_grefs_from(), and EggVertexPool::remove_unused_vertices().

◆ clear_uv() [1/2]

void EggVertex::clear_uv ( )
inline

Removes all UV coordinate pairs from the vertex.

Definition at line 249 of file eggVertex.I.

References clear_aux().

Referenced by set_aux_obj(), and set_uv().

◆ clear_uv() [2/2]

void EggVertex::clear_uv ( const string &  name)

Removes the named UV coordinate pair from the vertex, along with any UV morphs.

Definition at line 387 of file eggVertex.cxx.

References clear_aux(), and EggVertexUV::filter_name().

◆ compare_to()

int EggVertex::compare_to ( const EggVertex other) const

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Group membership is not considered in this comparison. This is somewhat problematic, but cannot easily be helped, because considering group membership would make it difficult to add and remove groups from vertices. It also makes it impossible to meaningfully compare with a concrete EggVertex object (which cannot have group memberships).

However, this is not altogether bad, because two vertices that are identical in all other properties should generally also be identical in group memberships, else the vertices will tend to fly apart when the joints animate.

Definition at line 627 of file eggVertex.cxx.

References EggAttributes::compare_to(), and get_num_local_coord().

Referenced by sorts_less_than(), and write().

◆ copy_grefs_from()

void EggVertex::copy_grefs_from ( const EggVertex other)

Copies all the group references from the other vertex onto this one.

This assigns the current vertex to exactly the same groups, with exactly the same memberships, as the given one.

Warning: only an EggVertex allocated from the free store may have groups assigned to it. Do not attempt to call this on a temporary concrete EggVertex object; a core dump will certainly result.

Definition at line 848 of file eggVertex.cxx.

References clear_grefs(), EggGroup::get_vertex_membership(), gref_begin(), gref_end(), and EggGroup::ref_vertex().

Referenced by TextureReference::apply_properties_to_source(), EggPrimitive::copy_vertices(), has_gref(), EggLoader::make_polyset(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::strip_normals(), EggCompositePrimitive::unify_attributes(), and EggPrimitive::unify_attributes().

◆ get_aux()

const LVecBase4d & EggVertex::get_aux ( const string &  name) const

Returns the named auxiliary data quadruple on the vertex.

It is an error to call this if has_aux(name) returned false.

Definition at line 203 of file eggVertex.cxx.

References set_uv(), and LVecBase4d::zero().

Referenced by get_uvw(), and set_aux().

◆ get_aux_obj()

const EggVertexAux * EggVertex::get_aux_obj ( const string &  name) const

Returns the named EggVertexAux object, which defines the auxiliary data for this name.

This object might be shared between multiple vertices. You should not attempt to modify this object; instead, call modify_aux_object to return a modifiable pointer.

Definition at line 304 of file eggVertex.cxx.

References modify_uv_obj().

Referenced by clear_aux(), and get_uv_obj().

◆ get_external_index()

int EggVertex::get_external_index ( ) const
inline

◆ get_external_index2()

int EggVertex::get_external_index2 ( ) const
inline

Returns the number set by set_external_index2().

See set_external_index2().

Definition at line 401 of file eggVertex.I.

References sorts_less_than().

Referenced by MayaToEggConverter::clear(), and set_external_index2().

◆ get_index()

int EggVertex::get_index ( ) const
inline

Returns the index number of the vertex within its pool.

Definition at line 346 of file eggVertex.I.

References set_external_index().

Referenced by EggGroup::as_transform(), aux_size(), EggPrimitive::copy_vertices(), EggVertexPool::EggVertexPool(), has_pref(), and EggLoader::make_polyset().

◆ get_num_dimensions()

int EggVertex::get_num_dimensions ( ) const
inline

Returns the number of dimensions the vertex uses.

Usually this will be 3, but it may be 1, 2, 3, or 4.

Definition at line 122 of file eggVertex.I.

References get_pos1().

Referenced by EggVertexPool::get_num_dimensions(), set_pos4(), and EggToObjConverter::write_file().

◆ get_num_global_coord()

int EggVertex::get_num_global_coord ( ) const

Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system.

Definition at line 734 of file eggVertex.cxx.

References EggNode::is_local_coord(), pref_begin(), pref_end(), and transform().

Referenced by get_num_local_coord(), and EggVertexPool::transform().

◆ get_num_local_coord()

int EggVertex::get_num_local_coord ( ) const

Returns the number of primitives that own this vertex whose vertices are interpreted to be in a local coordinate system.

Definition at line 713 of file eggVertex.cxx.

References get_num_global_coord(), EggNode::is_local_coord(), pref_begin(), and pref_end().

Referenced by compare_to(), and EggVertexPool::transform().

◆ get_pool()

EggVertexPool * EggVertex::get_pool ( ) const
inline

◆ get_pos1()

double EggVertex::get_pos1 ( ) const
inline

Only valid if get_num_dimensions() returns 1.

Returns the position as a one-dimensional value.

Definition at line 134 of file eggVertex.I.

References get_pos2().

Referenced by get_num_dimensions(), and EggToObjConverter::write_file().

◆ get_pos2()

LPoint2d EggVertex::get_pos2 ( ) const
inline

Only valid if get_num_dimensions() returns 2.

Returns the position as a two-dimensional value.

Definition at line 147 of file eggVertex.I.

References get_pos3().

Referenced by get_pos1(), and EggToObjConverter::write_file().

◆ get_pos3()

LVertexd EggVertex::get_pos3 ( ) const
inline

◆ get_pos4()

LPoint4d EggVertex::get_pos4 ( ) const
inline

This is always valid, regardless of the value of get_num_dimensions.

It returns the position as a four-dimensional value. If the pos has fewer than four dimensions, this value represents the pos extended into four-dimensional homogenous space, e.g. by adding 1 as the fourth component.

Definition at line 178 of file eggVertex.I.

References has_uv().

Referenced by clear_aux(), get_pos3(), EggLoader::make_polyset(), and EggToObjConverter::write_file().

◆ get_uv() [1/2]

LTexCoordd EggVertex::get_uv ( ) const
inline

Returns the unnamed UV coordinate pair on the vertex.

It is an error to call this if has_uv() has returned false.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see get_uv(name) for the interface that supports multitexturing.

Definition at line 222 of file eggVertex.I.

References has_uv(), set_uv(), and LPoint2d::zero().

Referenced by TextureReference::apply_properties_to_source(), has_aux(), EggGroupNode::rebuild_vertex_pools(), XFileVertex::set_from_egg(), set_uv(), EggVertexUV::transform(), and EggToObjConverter::write_file().

◆ get_uv() [2/2]

LTexCoordd EggVertex::get_uv ( const string &  name) const

Returns the named UV coordinate pair on the vertex.

It is an error to call this if has_uv(name) returned false.

Definition at line 175 of file eggVertex.cxx.

References EggVertexUV::filter_name(), get_uvw(), and LPoint2d::zero().

◆ get_uv_obj()

const EggVertexUV * EggVertex::get_uv_obj ( const string &  name) const

Returns the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs.

This object might be shared between multiple vertices. You should not attempt to modify this object; instead, call modify_uv_object to return a modifiable pointer.

Definition at line 286 of file eggVertex.cxx.

References EggVertexUV::filter_name(), and get_aux_obj().

Referenced by clear_aux(), EggPrimitive::copy_vertices(), and set_aux().

◆ get_uvw()

const LTexCoord3d & EggVertex::get_uvw ( const string &  name) const

Returns the named UV coordinate triple on the vertex.

It is an error to call this if has_uvw(name) returned false.

Definition at line 189 of file eggVertex.cxx.

References EggVertexUV::filter_name(), get_aux(), and LPoint3d::zero().

Referenced by get_uv(), set_uvw(), EggVertexUV::transform(), and EggToObjConverter::write_file().

◆ gref_begin()

EggVertex::GroupRef::const_iterator EggVertex::gref_begin ( ) const

Returns an iterator that can, in conjunction with gref_end(), be used to traverse the entire set of groups that reference this vertex.

Each iterator returns a pointer to a group.

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

Definition at line 789 of file eggVertex.cxx.

References gref_end().

Referenced by copy_grefs_from(), CharacterMaker::egg_to_slider(), has_pref(), EggLoader::make_polyset(), QtessSurface::tesselate_auto(), and transform().

◆ gref_end()

EggVertex::GroupRef::const_iterator EggVertex::gref_end ( ) const

Returns an iterator that can, in conjunction with gref_begin(), be used to traverse the entire set of groups that reference this vertex.

Each iterator returns a pointer to a group.

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

Definition at line 805 of file eggVertex.cxx.

References gref_size().

Referenced by copy_grefs_from(), gref_begin(), has_pref(), EggLoader::make_polyset(), and QtessSurface::tesselate_auto().

◆ gref_size()

EggVertex::GroupRef::size_type EggVertex::gref_size ( ) const

Returns the number of elements between gref_begin() and gref_end().

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

Definition at line 819 of file eggVertex.cxx.

References has_gref().

Referenced by TextureReference::apply_properties_to_source(), CharacterMaker::egg_to_slider(), SoftToEggConverter::FindClosestTriVert(), gref_end(), and EggLoader::make_polyset().

◆ has_aux() [1/2]

bool EggVertex::has_aux ( ) const
inline

Returns true if the vertex has any auxiliary data, false otherwise.

Definition at line 205 of file eggVertex.I.

References get_uv().

Referenced by EggVertexPool::has_aux(), has_uv(), and has_uvw().

◆ has_aux() [2/2]

bool EggVertex::has_aux ( const string &  name) const

Returns true if the vertex has the named auxiliary data quadruple.

Definition at line 158 of file eggVertex.cxx.

References get_uv().

◆ has_gref()

bool EggVertex::has_gref ( const EggGroup group) const

Returns true if the indicated group references this vertex, false otherwise.

Definition at line 830 of file eggVertex.cxx.

References copy_grefs_from().

Referenced by gref_size(), and EggGroup::steal_vrefs().

◆ has_pref()

int EggVertex::has_pref ( const EggPrimitive prim) const

Returns the number of times the vertex appears in the indicated primitive, or 0 if it does not appear.

Definition at line 941 of file eggVertex.cxx.

References get_index(), get_pool(), EggGroup::get_vertex_membership(), gref_begin(), gref_end(), pref_begin(), pref_end(), and ReferenceCount::test_ref_count_integrity().

Referenced by EggPrimitive::copy_vertices(), and pref_size().

◆ has_uv() [1/2]

bool EggVertex::has_uv ( ) const
inline

Returns true if the vertex has an unnamed UV coordinate pair, false otherwise.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see has_uv(name) for the interface that supports multitexturing.

Definition at line 194 of file eggVertex.I.

References has_aux().

Referenced by TextureReference::apply_properties_to_source(), get_pos4(), get_uv(), EggVertexPool::has_uvs(), operator=(), EggGroupNode::rebuild_vertex_pools(), XFileVertex::set_from_egg(), and EggToObjConverter::write_file().

◆ has_uv() [2/2]

bool EggVertex::has_uv ( const string &  name) const

Returns true if the vertex has the named UV coordinate pair, and the named UV coordinate pair is 2-d, false otherwise.

Definition at line 125 of file eggVertex.cxx.

References EggVertexUV::filter_name(), has_uvw(), and EggVertexUV::has_w().

◆ has_uvw()

bool EggVertex::has_uvw ( const string &  name) const

Returns true if the vertex has the named UV coordinate triple, and the named UV coordinate triple is 3-d, false otherwise.

Definition at line 142 of file eggVertex.cxx.

References EggVertexUV::filter_name(), has_aux(), and EggVertexUV::has_w().

Referenced by has_uv(), and EggToObjConverter::write_file().

◆ is_forward_reference()

bool EggVertex::is_forward_reference ( ) const
inline

Returns true if the vertex is a forward reference to some vertex that hasn't been defined yet.

In this case, the vertex may not have any properties filled in yet.

This can only happen if you implicitly create a vertex via EggVertexPool::get_forward_vertex(). Presumably, when the vertex pool is later filled in, this vertex will be replaced with real data.

Definition at line 43 of file eggVertex.I.

References set_pos().

Referenced by EggVertexPool::add_vertex(), get_pool(), EggVertexPool::get_vertex(), EggVertexPool::has_defined_vertices(), and EggVertexPool::has_forward_vertices().

◆ modify_aux_obj()

EggVertexAux * EggVertex::modify_aux_obj ( const string &  name)

Returns a modifiable pointer to the named EggVertexAux object, which defines the auxiliary data for this name.

Returns NULL if there is no such named UV object.

Definition at line 343 of file eggVertex.cxx.

References set_uv_obj().

Referenced by modify_uv_obj().

◆ modify_uv_obj()

EggVertexUV * EggVertex::modify_uv_obj ( const string &  name)

Returns a modifiable pointer to the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs.

Returns NULL if there is no such named UV object.

Definition at line 321 of file eggVertex.cxx.

References EggVertexUV::filter_name(), and modify_aux_obj().

Referenced by get_aux_obj(), and EggGroupNode::rebuild_vertex_pools().

◆ operator=()

EggVertex & EggVertex::operator= ( const EggVertex copy)

Copies all properties of the vertex except its vertex pool, index number, and group membership.

Definition at line 82 of file eggVertex.cxx.

References has_uv().

Referenced by EggVertex().

◆ pref_begin()

EggVertex::PrimitiveRef::const_iterator EggVertex::pref_begin ( ) const

Returns an iterator that can, in conjunction with pref_end(), be used to traverse the entire set of primitives that reference this vertex.

Each iterator returns a pointer to a primitive.

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

Definition at line 900 of file eggVertex.cxx.

References pref_end().

Referenced by clear_grefs(), EggPrimitive::copy_vertices(), get_num_global_coord(), get_num_local_coord(), has_pref(), and QtessSurface::tesselate_auto().

◆ pref_end()

EggVertex::PrimitiveRef::const_iterator EggVertex::pref_end ( ) const

Returns an iterator that can, in conjunction with pref_begin(), be used to traverse the entire set of primitives that reference this vertex.

Each iterator returns a pointer to a primitive.

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

Definition at line 916 of file eggVertex.cxx.

References pref_size().

Referenced by EggPrimitive::copy_vertices(), get_num_global_coord(), get_num_local_coord(), has_pref(), pref_begin(), and QtessSurface::tesselate_auto().

◆ pref_size()

EggVertex::GroupRef::size_type EggVertex::pref_size ( ) const

Returns the number of elements between pref_begin() and pref_end().

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

Definition at line 930 of file eggVertex.cxx.

References has_pref().

Referenced by EggVertexPool::add_unused_vertices_to_prim(), pref_end(), and EggVertexPool::remove_unused_vertices().

◆ set_aux()

void EggVertex::set_aux ( const string &  name,
const LVecBase4d aux 
)

Sets the indicated auxiliary data quadruple on the vertex.

This replaces any auxiliary data with the same name already on the vertex.

Definition at line 262 of file eggVertex.cxx.

References get_aux(), and get_uv_obj().

Referenced by set_uvw().

◆ set_aux_obj()

void EggVertex::set_aux_obj ( EggVertexAux aux)

Sets the indicated EggVertexAux on the vertex.

This replaces any auxiliary data with the same name already on the vertex.

Definition at line 376 of file eggVertex.cxx.

References clear_uv().

Referenced by set_uv_obj().

◆ set_external_index()

void EggVertex::set_external_index ( int  external_index)
inline

Sets a special index number that is associated with the EggVertex (but is not written to the egg file).

This number is not interpreted by any egg code; it is simply maintained along with the vertex. It *is* used to differentiate otherwise identical vertices in EggVertexPool::create_unique_vertex(), however.

The intention of this number is as an aid for file converters, to associate an EggVertex back to the index number of the original source vertex.

Definition at line 365 of file eggVertex.I.

References get_external_index().

Referenced by MayaToEggConverter::clear(), MaxToEggConverter::convert(), XFileMesh::create_polygons(), SoftToEggConverter::find_morph_table(), get_index(), and EggLoader::make_polyset().

◆ set_external_index2()

void EggVertex::set_external_index2 ( int  external_index2)
inline

Similar to set_external_index(), but this is a different number which may be used for a different purpose by the calling code.

The egg library does not assign any meaning to this number or use it in any way.

Definition at line 390 of file eggVertex.I.

References get_external_index2().

Referenced by MayaToEggConverter::clear(), and get_external_index().

◆ set_pos() [1/4]

void EggVertex::set_pos ( double  pos)
inline

◆ set_pos() [2/4]

void EggVertex::set_pos ( const LPoint2d pos)
inline

Sets the vertex position.

This variant sets the vertex to a two-dimensional value.

Definition at line 67 of file eggVertex.I.

References set_pos().

◆ set_pos() [3/4]

void EggVertex::set_pos ( const LPoint3d pos)
inline

Sets the vertex position.

This variant sets the vertex to a three-dimensional value.

Definition at line 80 of file eggVertex.I.

References set_pos().

◆ set_pos() [4/4]

void EggVertex::set_pos ( const LPoint4d pos)
inline

Sets the vertex position.

This variant sets the vertex to a four-dimensional value.

Definition at line 93 of file eggVertex.I.

References set_pos4().

◆ set_pos4()

void EggVertex::set_pos4 ( const LPoint4d pos)
inline

This special flavor of set_pos() sets the vertex as a four-component value, but does not change the set number of dimensions.

It's handy for retrieving the vertex position via get_pos4, manipulating it, then storing it back again, without worrying about the number of dimensions it actually had.

Definition at line 110 of file eggVertex.I.

References get_num_dimensions().

Referenced by clear_aux(), and set_pos().

◆ set_uv() [1/2]

void EggVertex::set_uv ( const LTexCoordd uv)
inline

Replaces the unnamed UV coordinate pair on the vertex with the indicated value.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see set_uv(name, uv) for the interface that supports multitexturing.

Definition at line 239 of file eggVertex.I.

References clear_uv().

Referenced by EggSaver::add_node(), TextureReference::apply_properties_to_source(), CLwoSurface::check_material(), MayaToEggConverter::clear(), MaxToEggConverter::convert(), ObjToEggConverter::convert_file(), XFileMesh::create_polygons(), SoftToEggConverter::find_morph_table(), get_aux(), and get_uv().

◆ set_uv() [2/2]

void EggVertex::set_uv ( const string &  name,
const LTexCoordd uv 
)

Sets the indicated UV coordinate pair on the vertex.

This replaces any UV coordinate pair with the same name already on the vertex, but preserves UV morphs.

Definition at line 217 of file eggVertex.cxx.

References EggVertexUV::filter_name(), get_uv(), and set_uvw().

◆ set_uv_obj()

void EggVertex::set_uv_obj ( EggVertexUV uv)

Sets the indicated EggVertexUV on the vertex.

This replaces any UV coordinate pair with the same name already on the vertex, including UV morphs.

Definition at line 364 of file eggVertex.cxx.

References set_aux_obj().

Referenced by EggPrimitive::copy_vertices(), and modify_aux_obj().

◆ set_uvw()

void EggVertex::set_uvw ( const string &  name,
const LTexCoord3d uvw 
)

Sets the indicated UV coordinate triple on the vertex.

This replaces any UV coordinate pair or triple with the same name already on the vertex, but preserves UV morphs.

Definition at line 240 of file eggVertex.cxx.

References EggVertexUV::filter_name(), get_uvw(), and set_aux().

Referenced by ObjToEggConverter::convert_file(), and set_uv().

◆ sorts_less_than()

bool EggVertex::sorts_less_than ( const EggVertex other) const
inline

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 413 of file eggVertex.I.

References compare_to(), and sorts_less_than().

Referenced by get_external_index2(), and sorts_less_than().

◆ transform()

void EggVertex::transform ( const LMatrix4d mat)

Applies the indicated transformation matrix to the vertex.

Definition at line 755 of file eggVertex.cxx.

References gref_begin(), and EggAttributes::transform().

Referenced by EggPrimitive::copy_vertices(), XFileMesh::create_polygons(), get_num_global_coord(), and EggVertexPool::transform().

◆ uv_begin()

EggVertex::const_uv_iterator EggVertex::uv_begin ( ) const
inline

Returns an iterator that allows walking through the complete set of named UV's on the vertex.

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

Definition at line 273 of file eggVertex.I.

References aux_begin().

Referenced by clear_aux(), CharacterMaker::egg_to_slider(), EggVertexPool::get_uv_names(), EggCharacterCollection::make_character(), EggLoader::make_polyset(), and EggGroupNode::rebuild_vertex_pools().

◆ uv_end()

EggVertex::const_uv_iterator EggVertex::uv_end ( ) const
inline

Returns an iterator that allows walking through the complete set of named UV's on the vertex.

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

Definition at line 301 of file eggVertex.I.

References aux_end().

Referenced by aux_begin(), clear_aux(), CharacterMaker::egg_to_slider(), EggVertexPool::get_uv_names(), EggCharacterCollection::make_character(), EggLoader::make_polyset(), and EggGroupNode::rebuild_vertex_pools().

◆ uv_size()

EggVertex::uv_size_type EggVertex::uv_size ( ) const
inline

Returns the number of named UV's on the vertex.

Definition at line 325 of file eggVertex.I.

References aux_size().

Referenced by aux_end().

◆ write()

void EggVertex::write ( ostream &  out,
int  indent_level 
) const

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

Definition at line 555 of file eggVertex.cxx.

References compare_to(), and EggAttributes::write().


The documentation for this class was generated from the following files: