# EggVertex

from pandac.PandaModules import EggVertex

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

## Inheritance:

EggVertex: EggObject EggAttributes
EggObject: TypedReferenceCount
TypedReferenceCount: TypedObject ReferenceCount
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase
EggAttributes:

## Methods of EggVertex:

EggVertex (Constructor)
clearGrefs
clearUv
copyGrefsFrom
getClassType
getExternalIndex
getIndex
getNumDimensions
getNumGlobalCoord
getNumLocalCoord
getPool
getPos1
getPos2
getPos3
getPos4
getUv
getUvObj
getUvw
hasGref
hasPref
hasUv
hasUvw
isForwardReference
modifyUvObj
operator =
output
setExternalIndex
setPos
setPos4
setUv
setUvObj
setUvw
sortsLessThan
testGrefIntegrity
testPrefIntegrity
transform
write

## Methods of EggObject:

EggObject (Constructor)
clearUserData
getClassType
getUserData
hasUserData
operator =
setUserData

## Methods of TypedReferenceCount:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Methods of EggAttributes:

EggAttributes (Constructor)
clearColor
clearNormal
compareTo
copyColor
copyNormal
getClassType
getColor
getNormal
hasColor
hasNormal
matchesColor
matchesNormal
operator =
setColor
setNormal
sortsLessThan
transform
write

EggVertex EggVertex::EggVertex(void); Description: Description: Copies all properties of the vertex except its vertex pool, index number, and group membership.

clearGrefs void EggVertex::clear_grefs(void); Description: Removes all group references from the vertex, so that it is not assigned to any group.

clearUv void EggVertex::clear_uv(void); Description: Removes all UV coordinate pairs from the vertex. Description: Removes the named UV coordinate pair from the vertex, along with any UV morphs.

copyGrefsFrom void EggVertex::copy_grefs_from(EggVertex const &other); Description: 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.

getClassType static TypeHandle EggVertex::get_class_type(void); Undocumented function.

getExternalIndex int EggVertex::get_external_index(void) const; Description: Returns the number set by set_external_index(). See set_external_index().

getIndex int EggVertex::get_index(void) const; Description: Returns the index number of the vertex within its pool.

getNumDimensions int EggVertex::get_num_dimensions(void) const; get_pos[123] return the pos as the corresponding type. It is an error to call any of these without first verifying that get_num_dimensions() matches the desired type. However, get_pos4() may always be called; it returns the pos as a four-component point in homogeneous space (with a 1.0 in the last position if the pos has fewer than four components). Description: Returns the number of dimensions the vertex uses. Usually this will be 3, but it may be 1, 2, 3, or 4.

getNumGlobalCoord int EggVertex::get_num_global_coord(void) const; Description: Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system.

getNumLocalCoord int EggVertex::get_num_local_coord(void) const; Description: Returns the number of primitives that own this vertex whose vertices are interpreted to be in a local coordinate system.

getPool EggVertexPool *EggVertex::get_pool(void) const; Description: Returns the vertex pool this vertex belongs in. This may be NULL if the vertex has not been added to a pool.

getPos1 double EggVertex::get_pos1(void) const; get_pos[123] return the pos as the corresponding type. It is an error to call any of these without first verifying that get_num_dimensions() matches the desired type. However, get_pos4() may always be called; it returns the pos as a four-component point in homogeneous space (with a 1.0 in the last position if the pos has fewer than four components). Description: Only valid if get_num_dimensions() returns 1. Returns the position as a one-dimensional value.

getPos2 LPoint2d EggVertex::get_pos2(void) const; Description: Only valid if get_num_dimensions() returns 2. Returns the position as a two-dimensional value.

getPos3 LPoint3d EggVertex::get_pos3(void) const; Description: Valid if get_num_dimensions() returns 3 or 4. Returns the position as a three-dimensional value.

getPos4 LPoint4d EggVertex::get_pos4(void) const; Description: 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.

getUv LPoint2d EggVertex::get_uv(void) const; Description: 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. Description: Returns the named UV coordinate pair on the vertex. vertex. It is an error to call this if has_uv(name) returned false.

getUvObj EggVertexUV const *EggVertex::get_uv_obj(string const &name) const; Description: 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.

getUvw LPoint3d const &EggVertex::get_uvw(string const &name) const; Description: Returns the named UV coordinate triple on the vertex. vertex. It is an error to call this if has_uvw(name) returned false.

hasGref bool EggVertex::has_gref(EggGroup const *group) const; Description: Returns true if the indicated group references this vertex, false otherwise.

hasPref int EggVertex::has_pref(EggPrimitive const *prim) const; Description: Returns the number of times the vertex appears in the indicated primitive, or 0 if it does not appear.

hasUv bool EggVertex::has_uv(void) const; Description: 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. Description: Returns true if the vertex has the named UV coordinate pair, and the named UV coordinate pair is 2-d, false otherwise.

hasUvw bool EggVertex::has_uvw(string const &name) const; Description: Returns true if the vertex has the named UV coordinate triple, and the named UV coordinate triple is 3-d, false otherwise.

isForwardReference bool EggVertex::is_forward_reference(void) const; Description: 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.

modifyUvObj EggVertexUV *EggVertex::modify_uv_obj(string const &name); Description: 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.

operator = EggVertex &EggVertex::operator =(EggVertex const &copy); Description: Copies all properties of the vertex except its vertex pool, index number, and group membership.

output void EggVertex::output(ostream &out) const; NDEBUG Description:

setExternalIndex void EggVertex::set_external_index(int external_index); Description: 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.

setPos void EggVertex::set_pos(double pos); The pos might have 1, 2, 3, or 4 dimensions. That complicates things a bit. Description: Sets the vertex position. This variant sets the vertex to a one-dimensional value. Description: Sets the vertex position. This variant sets the vertex to a two-dimensional value. Description: Sets the vertex position. This variant sets the vertex to a three-dimensional value. Description: Sets the vertex position. This variant sets the vertex to a four-dimensional value.

setPos4 void EggVertex::set_pos4(LPoint4d const &pos); Description: 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.

setUv void EggVertex::set_uv(LPoint2d const &texCoord); Description: 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. Description: 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.

setUvObj void EggVertex::set_uv_obj(EggVertexUV *vertex_uv); Description: Sets the indicated EggVertexUV on the vertex. This replaces any UV coordinate pair with the same name already on the vertex, including UV morphs.

setUvw void EggVertex::set_uvw(string const &name, LPoint3d const &texCoord); Description: 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.

sortsLessThan bool EggVertex::sorts_less_than(EggVertex const &other) const; Description: 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.

testGrefIntegrity void EggVertex::test_gref_integrity(void) const; Description: Verifies that the gref list is correct and that all the groups included actually exist and do reference the vertex.

testPrefIntegrity void EggVertex::test_pref_integrity(void) const; Description: Verifies that the pref list is correct and that all the primitives included actually exist and do reference the vertex.

transform void EggVertex::transform(LMatrix4d const &mat); Description: Applies the indicated transformation matrix to the vertex.

write void EggVertex::write(ostream &out, int indent_level) const; Description: Writes the vertex to the indicated output stream in Egg format.

EggObject EggObject::EggObject(void); Description:

clearUserData void EggObject::clear_user_data(void); Description: Removes *all* user data pointers from the node. Description: Removes the user data pointer of the indicated type.

getClassType static TypeHandle EggObject::get_class_type(void); Undocumented function.

getUserData EggUserData *EggObject::get_user_data(void) const; Description: Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. Description: Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.

hasUserData bool EggObject::has_user_data(void) const; Description: Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. Description: Returns true if the user data pointer of the indicated type has been set, false otherwise.

operator = EggObject &EggObject::operator =(EggObject const &copy); Description:

setUserData void EggObject::set_user_data(EggUserData *user_data); Description: Sets the user data associated with this object. This may be any EggUserData-derived object. The egg library will do nothing with this pointer, except to hold its reference count and return the pointer on request. The EggObject maintains multiple different EggUserData pointers, one for each unique type (as reported by get_type()). If you know that only one type of EggUserData object will be added in your application, you may use the query functions that accept no parameters, but it is recommended that in general you pass in the type of your particular user data, to allow multiple applications to coexist in the same egg data. This pointer is also copied by the copy assignment operator and copy constructor.

getClassType static TypeHandle TypedReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: 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().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

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

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: 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.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: 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 true if the new reference count is nonzero, false if it is zero.

EggAttributes EggAttributes::EggAttributes(void); Description:

clearColor void EggAttributes::clear_color(void); Description:

clearNormal void EggAttributes::clear_normal(void); Description:

compareTo int EggAttributes::compare_to(EggAttributes const &other) const; Description: An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

copyColor void EggAttributes::copy_color(EggAttributes const &other); Description: Sets this color to be the same as the other's, include morphs. If the other has no color, this clears the color.

copyNormal void EggAttributes::copy_normal(EggAttributes const &other); Description: Sets this normal to be the same as the other's, include morphs. If the other has no normal, this clears the normal.

getClassType static TypeHandle EggAttributes::get_class_type(void); Undocumented function.

getColor LVecBase4f EggAttributes::get_color(void) const; Description: Returns the color set on this particular attribute. If there is no color set, returns white.

getNormal LVector3d const &EggAttributes::get_normal(void) const; Description:

hasColor bool EggAttributes::has_color(void) const; Description:

hasNormal bool EggAttributes::has_normal(void) const; Description:

matchesColor bool EggAttributes::matches_color(EggAttributes const &other) const; Description: Returns true if this color matches that of the other EggAttributes object, include the morph list.

matchesNormal bool EggAttributes::matches_normal(EggAttributes const &other) const; Description: Returns true if this normal matches that of the other EggAttributes object, include the morph list.

operator = EggAttributes &EggAttributes::operator =(EggAttributes const &copy); Description:

setColor void EggAttributes::set_color(LVecBase4f const &Color); Description:

setNormal void EggAttributes::set_normal(LVector3d const &normal); Description:

sortsLessThan bool EggAttributes::sorts_less_than(EggAttributes const &other) const; Description: An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

transform void EggAttributes::transform(LMatrix4d const &mat); Description: Applies the indicated transformation matrix to the attributes.

write void EggAttributes::write(ostream &out, int indent_level) const; Description: Writes the attributes to the indicated output stream in Egg format.