#include <eggVertex.h>
Inheritance diagram for EggVertex:
Public Types | |
typedef pset< EggGroup * > | GroupRef |
typedef pmultiset< EggPrimitive * > | PrimitiveRef |
Public Member Functions | |
EggVertex () | |
EggVertex (const EggVertex ©) | |
Copies all properties of the vertex except its vertex pool, index number, and group membership. | |
EggVertex & | operator= (const EggVertex ©) |
Copies all properties of the vertex except its vertex pool, index number, and group membership. | |
virtual | ~EggVertex () |
EggVertexPool * | get_pool () const |
void | set_pos (double pos) |
Sets the vertex position. | |
void | set_pos (const LPoint2d &pos) |
Sets the vertex position. | |
void | set_pos (const LPoint3d &pos) |
Sets the vertex position. | |
void | set_pos (const LPoint4d &pos) |
Sets the vertex position. | |
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. | |
int | get_num_dimensions () const |
Returns the number of dimensions the vertex uses. | |
double | get_pos1 () const |
Only valid if get_num_dimensions() returns 1. | |
LPoint2d | get_pos2 () const |
Only valid if get_num_dimensions() returns 2. | |
Vertexd | get_pos3 () const |
Only valid if get_num_dimensions() returns 3. | |
LPoint4d | get_pos4 () const |
This is always valid, regardless of the value of get_num_dimensions. | |
int | get_index () const |
Returns the index number of the vertex within its pool. | |
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). | |
int | get_external_index () const |
Returns the number set by set_external_index(). | |
void | write (ostream &out, int indent_level) const |
Writes the vertex to the indicated output stream in Egg format. | |
bool | sorts_less_than (const EggVertex &other) const |
An ordering operator to compare two vertices for sorting order. | |
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. | |
int | get_num_global_coord () const |
Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system. | |
void | transform (const LMatrix4d &mat) |
Applies the indicated transformation matrix to the vertex. | |
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. | |
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. | |
GroupRef::size_type | gref_size () const |
Returns the number of elements between gref_begin() and gref_end(). | |
bool | has_gref (const EggGroup *group) const |
Returns true if the indicated group references this vertex, false otherwise. | |
void | copy_grefs_from (const EggVertex &other) |
Copies all the group references from the other vertex onto this one. | |
void | clear_grefs () |
Removes all group references from the vertex, so that it is not assigned to any group. | |
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. | |
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. | |
PrimitiveRef::size_type | pref_size () const |
Returns the number of elements between pref_begin() and pref_end(). | |
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. | |
void | test_gref_integrity () const |
Verifies that the gref list is correct and that all the groups included actually exist and do reference the vertex. | |
void | test_pref_integrity () const |
Verifies that the pref list is correct and that all the primitives included actually exist and do reference the vertex. | |
void | output (ostream &out) const |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
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. | |
bool | has_normal () const |
const Normald & | get_normal () const |
void | set_normal (const Normald &normal) |
void | clear_normal () |
bool | has_uv () const |
const TexCoordd & | get_uv () const |
void | set_uv (const TexCoordd &texCoord) |
void | clear_uv () |
bool | has_color () const |
Colorf | get_color () const |
Returns the color set on this particular attribute. | |
void | set_color (const Colorf &Color) |
void | clear_color () |
bool | sorts_less_than (const EggAttributes &other) const |
An ordering operator to compare two vertices for sorting order. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
EggMorphVertexList | _dxyzs |
EggMorphNormalList | _dnormals |
EggMorphTexCoordList | _duvs |
EggMorphColorList | _drgbas |
Private Attributes | |
EggVertexPool * | _pool |
int | _index |
int | _external_index |
LPoint4d | _pos |
short | _num_dimensions |
GroupRef | _gref |
PrimitiveRef | _pref |
Static Private Attributes | |
TypeHandle | _type_handle |
Friends | |
class | EggVertexPool |
class | EggGroup |
class | EggPrimitive |
Definition at line 49 of file eggVertex.h.
|
Definition at line 51 of file eggVertex.h. |
|
Definition at line 52 of file eggVertex.h. |
|
Definition at line 48 of file eggVertex.cxx. |
|
Copies all properties of the vertex except its vertex pool, index number, and group membership.
Definition at line 68 of file eggVertex.cxx. |
|
Definition at line 115 of file eggVertex.cxx. References GroupRefEntry::_group, GroupRefEntry::_membership, Namable::get_name(), GroupRefEntry::GroupRefEntry(), GroupRefEntry::operator<(), and GroupRefEntry::output(). |
|
Definition at line 177 of file eggAttributes.I. |
|
Removes all group references from the vertex, so that it is not assigned to any group.
Definition at line 425 of file eggVertex.cxx. References get_index(), Namable::get_name(), get_pool(), and NULL. Referenced by get_num_global_coord(). |
|
Definition at line 71 of file eggAttributes.I. References EggAttributes::_flags, and EggAttributes::F_has_uv. Referenced by EggGroupNode::find_textures(), and EggPolygon::operator=(). |
|
Definition at line 121 of file eggAttributes.I. References EggAttributes::_color, Colorf, EggAttributes::has_color(), and INLINE. |
|
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 394 of file eggVertex.cxx. |
|
Reimplemented from EggObject. Definition at line 142 of file eggVertex.h. |
|
Reimplemented from EggAttributes. Definition at line 129 of file eggVertex.h. |
|
Returns the color set on this particular attribute. If there is no color set, returns white. Definition at line 148 of file eggAttributes.I. References EggAttributes::_flags, and EggAttributes::F_has_color. |
|
Returns the number set by set_external_index(). See set_external_index(). Definition at line 277 of file eggVertex.I. |
|
Returns the index number of the vertex within its pool.
Definition at line 231 of file eggVertex.I. Referenced by clear_grefs(), and EggGroup::string_dcs_type(). |
|
Definition at line 45 of file eggAttributes.I. References EggAttributes::_flags, EggAttributes::_normal, EggAttributes::F_has_normal, and INLINE. Referenced by EggAttributes::~EggAttributes(). |
|
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 140 of file eggVertex.I. References _num_dimensions, _pos, INLINE, nassertr, and Vertexd. |
|
Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system.
Definition at line 312 of file eggVertex.cxx. References clear_grefs(), gref_begin(), gref_end(), nassertv, NULL, and test_gref_integrity(). |
|
Returns the number of primitives that own this vertex whose vertices are interpreted to be in a local coordinate system.
Definition at line 286 of file eggVertex.cxx. |
|
Definition at line 32 of file eggVertex.I. References _num_dimensions, _pos, and INLINE. Referenced by clear_grefs(), and EggGroup::string_dcs_type(). |
|
Only valid if get_num_dimensions() returns 1. Returns the position as a one-dimensional value. Definition at line 156 of file eggVertex.I. |
|
Only valid if get_num_dimensions() returns 2. Returns the position as a two-dimensional value. Definition at line 173 of file eggVertex.I. |
|
Only valid if get_num_dimensions() returns 3. Returns the position as a three-dimensional value. Definition at line 190 of file eggVertex.I. References _external_index, and INLINE. Referenced by EggPolygon::cleanup(), EggGroupNode::find_textures(), EggLoader::make_collision_polygon(), EggPolygon::triangulate_in_place(), and EggPolygon::write(). |
|
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 215 of file eggVertex.I. |
|
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(). |
|
Reimplemented from EggObject. Definition at line 139 of file eggVertex.h. |
|
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. |
|
Definition at line 95 of file eggAttributes.I. References EggAttributes::_flags, EggAttributes::F_has_uv, and INLINE. |
|
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 303 of file eggVertex.I. References INLINE, and sorts_less_than(). Referenced by get_num_global_coord(), and split_vertex(). |
|
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 328 of file eggVertex.I. Referenced by get_num_global_coord(), and split_vertex(). |
|
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 349 of file eggVertex.I. |
|
Definition at line 133 of file eggAttributes.I. References EggAttributes::_color, EggAttributes::_flags, EggAttributes::F_has_color, and INLINE. Referenced by EggAttributes::clear_uv(). |
|
Returns true if the indicated group references this vertex, false otherwise.
Definition at line 365 of file eggVertex.cxx. References _pref. |
|
Definition at line 33 of file eggAttributes.I. References EggAttributes::_normal, INLINE, nassertr, and Normald. Referenced by EggAttributes::~EggAttributes(). |
|
Returns the number of times the vertex appears in the indicated primitive, or 0 if it does not appear.
Definition at line 449 of file eggVertex.cxx. |
|
Definition at line 83 of file eggAttributes.I. Referenced by EggAttributes::~EggAttributes(). |
|
Reimplemented from EggAttributes. Definition at line 132 of file eggVertex.h. References EggAttributes::get_class_type(). |
|
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(). |
|
|
Copies all properties of the vertex except its vertex pool, index number, and group membership.
Definition at line 93 of file eggVertex.cxx. |
|
Definition at line 522 of file eggVertex.cxx. |
|
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 375 of file eggVertex.I. Referenced by sorts_less_than(). |
|
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 400 of file eggVertex.I. Referenced by sorts_less_than(). |
|
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 421 of file eggVertex.I. |
|
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(). |
|
Definition at line 164 of file eggAttributes.I. |
|
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 262 of file eggVertex.I. |
|
Definition at line 58 of file eggAttributes.I. References EggAttributes::_flags, EggAttributes::F_has_normal, and INLINE. Referenced by EggPolygon::operator=(). |
|
Sets the vertex position. This variant sets the vertex to a four-dimensional value. Definition at line 99 of file eggVertex.I. References _num_dimensions, and INLINE. |
|
Sets the vertex position. This variant sets the vertex to a three-dimensional value. Definition at line 82 of file eggVertex.I. |
|
Sets the vertex position. This variant sets the vertex to a two-dimensional value. Definition at line 65 of file eggVertex.I. References _num_dimensions, and _pos. |
|
Sets the vertex position. This variant sets the vertex to a one-dimensional value. Definition at line 48 of file eggVertex.I. References _num_dimensions, _pos, and INLINE. Referenced by EggVertexPool::make_new_vertex(). |
|
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 124 of file eggVertex.I. References _num_dimensions, _pos, INLINE, and nassertr. |
|
Definition at line 108 of file eggAttributes.I. References EggAttributes::_flags, EggAttributes::F_has_color, and INLINE. |
|
An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices. Definition at line 149 of file eggAttributes.cxx. |
|
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 253 of file eggVertex.cxx. References EggNode::is_local_coord(), pref_begin(), pref_end(), and test_pref_integrity(). Referenced by gref_begin(). |
|
Verifies that the gref list is correct and that all the groups included actually exist and do reference the vertex.
Definition at line 468 of file eggVertex.cxx. Referenced by get_num_global_coord(). |
|
Verifies that the pref list is correct and that all the primitives included actually exist and do reference the vertex.
Definition at line 496 of file eggVertex.cxx. Referenced by sorts_less_than(). |
|
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(). |
|
Applies the indicated transformation matrix to the vertex.
Reimplemented from EggAttributes. Definition at line 337 of file eggVertex.cxx. |
|
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(). |
|
Writes the vertex to the indicated output stream in Egg format.
Reimplemented from EggAttributes. Definition at line 172 of file eggVertex.cxx. |
|
Definition at line 148 of file eggVertex.h. |
|
Definition at line 149 of file eggVertex.h. |
|
Definition at line 147 of file eggVertex.h. |
|
Definition at line 80 of file eggAttributes.h. Referenced by EggAttributes::EggAttributes(), and EggAttributes::~EggAttributes(). |
|
Definition at line 82 of file eggAttributes.h. Referenced by EggAttributes::EggAttributes(). |
|
Definition at line 81 of file eggAttributes.h. Referenced by EggAttributes::EggAttributes(), and EggAttributes::~EggAttributes(). |
|
Definition at line 117 of file eggVertex.h. |
|
Definition at line 122 of file eggVertex.h. Referenced by get_pos3(). |
|
Definition at line 125 of file eggVertex.h. Referenced by EggGroup::determine_depth_test_mode(), get_index(), get_pos4(), and operator=(). |
|
Definition at line 121 of file eggVertex.h. Referenced by EggVertexPool::add_vertex(), and get_pos2(). |
|
Definition at line 124 of file eggVertex.h. Referenced by get_num_dimensions(), get_pool(), set_pos(), and set_pos4(). |
|
Definition at line 120 of file eggVertex.h. Referenced by EggVertexPool::add_vertex(), EggVertexPool::end(), and operator=(). |
|
Definition at line 123 of file eggVertex.h. Referenced by get_num_dimensions(), get_pool(), get_pos1(), set_pos(), and set_pos4(). |
|
Definition at line 126 of file eggVertex.h. Referenced by get_external_index(), has_gref(), operator=(), and set_external_index(). |
|
Reimplemented from EggAttributes. Definition at line 37 of file eggVertex.cxx. |