Panda3D
|
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal. More...
#include "eggVertex.h"
Public Types | |
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 ©) | |
Copies all properties of the vertex except its vertex pool, index number, and group membership. | |
virtual EggTransform * | as_transform () |
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
void | clear_color () |
void | clear_grefs () |
Removes all group references from the vertex, so that it is not assigned to any group. | |
void | clear_normal () |
void | clear_user_data (TypeHandle type) |
Removes the user data pointer of the indicated type. | |
void | clear_user_data () |
Removes *all* user data pointers from the node. | |
void | clear_uv () |
Removes all UV coordinate pairs from the vertex. | |
void | clear_uv (const string &name) |
Removes the named UV coordinate pair from the vertex, along with any UV morphs. | |
int | compare_to (const EggVertex &other) const |
An ordering operator to compare two vertices for sorting order. | |
int | compare_to (const EggAttributes &other) const |
An ordering operator to compare two vertices for sorting order. | |
void | copy_color (const EggAttributes &other) |
Sets this color to be the same as the other's, include morphs. | |
void | copy_grefs_from (const EggVertex &other) |
Copies all the group references from the other vertex onto this one. | |
void | copy_normal (const EggAttributes &other) |
Sets this normal to be the same as the other's, include morphs. | |
virtual TypeHandle | force_init_type () |
int | get_best_parent_from_Set (const std::set< int > &) const |
Colorf | get_color () const |
Returns the color set on this particular attribute. | |
int | get_external_index () const |
Returns the number set by set_external_index(). | |
int | get_index () const |
Returns the index number of the vertex within its pool. | |
const Normald & | get_normal () const |
int | get_num_dimensions () const |
Returns the number of dimensions the vertex uses. | |
int | get_num_global_coord () const |
Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system. | |
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. | |
EggVertexPool * | get_pool () const |
Returns the vertex pool this vertex belongs in. | |
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 |
Valid if get_num_dimensions() returns 3 or 4. | |
LPoint4d | get_pos4 () const |
This is always valid, regardless of the value of get_num_dimensions. | |
int | get_ref_count () const |
Returns the current reference count. | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
EggUserData * | get_user_data () const |
Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. | |
EggUserData * | get_user_data (TypeHandle type) const |
Returns the user data pointer of the indicated type, if it exists, or NULL if it does not. | |
TexCoordd | get_uv () const |
Returns the unnamed UV coordinate pair on the vertex. | |
TexCoordd | get_uv (const string &name) const |
Returns the named UV coordinate pair on the vertex. | |
const EggVertexUV * | 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. | |
const TexCoord3d & | get_uvw (const string &name) const |
Returns the named UV coordinate triple on the vertex. | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
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_color () const |
bool | has_gref (const EggGroup *group) const |
Returns true if the indicated group references this vertex, false otherwise. | |
bool | has_normal () const |
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. | |
bool | has_user_data () const |
Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. | |
bool | has_user_data (TypeHandle type) const |
Returns true if the user data pointer of the indicated type has been set, false otherwise. | |
bool | has_uv () const |
Returns true if the vertex has an unnamed UV coordinate pair, false otherwise. | |
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. | |
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. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_forward_reference () const |
Returns true if the vertex is a forward reference to some vertex that hasn't been defined yet. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
bool | matches_color (const EggAttributes &other) const |
Returns true if this color matches that of the other EggAttributes object, include the morph list. | |
bool | matches_normal (const EggAttributes &other) const |
Returns true if this normal matches that of the other EggAttributes object, include the morph list. | |
EggVertexUV * | 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. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size, void *ptr) |
EggVertex & | operator= (const EggVertex ©) |
Copies all properties of the vertex except its vertex pool, index number, and group membership. | |
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. | |
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(). | |
void | ref () const |
Explicitly increments the reference count. | |
void | set_color (const Colorf &Color) |
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). | |
void | set_normal (const Normald &normal) |
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_pos (double 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. | |
void | set_user_data (EggUserData *user_data) |
Sets the user data associated with this object. | |
void | set_uv (const TexCoordd &texCoord) |
Replaces the unnamed UV coordinate pair on the vertex with the indicated value. | |
void | set_uv (const string &name, const TexCoordd &texCoord) |
Sets the indicated UV coordinate pair on the vertex. | |
void | set_uv_obj (EggVertexUV *vertex_uv) |
Sets the indicated EggVertexUV on the vertex. | |
void | set_uvw (const string &name, const TexCoord3d &texCoord) |
Sets the indicated UV coordinate triple on the vertex. | |
bool | sorts_less_than (const EggVertex &other) const |
An ordering operator to compare two vertices for sorting order. | |
bool | sorts_less_than (const EggAttributes &other) const |
An ordering operator to compare two vertices for sorting order. | |
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. | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
void | transform (const LMatrix4d &mat) |
Applies the indicated transformation matrix to the vertex. | |
virtual bool | unref () const |
Explicitly decrements the reference count. | |
const_uv_iterator | uv_begin () const |
Returns an iterator that allows walking through the complete set of named UV's on the vertex. | |
const_uv_iterator | uv_end () const |
Returns an iterator that allows walking through the complete set of named UV's on the vertex. | |
uv_size_type | uv_size () const |
Returns the number of named UV's on the vertex. | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. | |
void | write (ostream &out, int indent_level) const |
Writes the vertex to the indicated output stream in Egg format. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Public Attributes | |
EggMorphNormalList | _dnormals |
EggMorphColorList | _drgbas |
EggMorphVertexList | _dxyzs |
Protected Member Functions | |
bool | do_test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | do_test_ref_count_nonzero () const |
Returns true if the reference count is nonzero, false otherwise. | |
Friends | |
class | EggGroup |
class | EggPrimitive |
class | EggVertexPool |
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
Definition at line 40 of file eggVertex.h.
EggVertex::EggVertex | ( | const EggVertex & | copy | ) |
Copies all properties of the vertex except its vertex pool, index number, and group membership.
Definition at line 56 of file eggVertex.cxx.
References test_gref_integrity(), and test_pref_integrity().
EggTransform * EggObject::as_transform | ( | ) | [virtual, inherited] |
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.
Reimplemented in EggGroup, and EggTexture.
Definition at line 183 of file eggObject.cxx.
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
void EggVertex::clear_grefs | ( | ) |
Removes all group references from the vertex, so that it is not assigned to any group.
Definition at line 603 of file eggVertex.cxx.
References EggGroup::unref_vertex().
Referenced by copy_grefs_from(), and EggVertexPool::remove_unused_vertices().
void EggObject::clear_user_data | ( | ) | [inherited] |
Removes *all* user data pointers from the node.
Definition at line 153 of file eggObject.cxx.
void EggObject::clear_user_data | ( | TypeHandle | type | ) | [inherited] |
Removes the user data pointer of the indicated type.
Definition at line 164 of file eggObject.cxx.
void EggVertex::clear_uv | ( | ) | [inline] |
Removes all UV coordinate pairs from the vertex.
Definition at line 238 of file eggVertex.I.
void EggVertex::clear_uv | ( | const string & | name | ) |
Removes the named UV coordinate pair from the vertex, along with any UV morphs.
Definition at line 279 of file eggVertex.cxx.
References EggVertexUV::filter_name().
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 385 of file eggVertex.cxx.
References EggMorphList< MorphType >::compare_to(), and LVecBase4d::compare_to().
Referenced by sorts_less_than().
int EggAttributes::compare_to | ( | const EggAttributes & | other | ) | const [inherited] |
An ordering operator to compare two vertices for sorting order.
This imposes an arbitrary ordering useful to identify unique vertices.
Definition at line 111 of file eggAttributes.cxx.
References LVecBase4f::compare_to(), EggMorphList< MorphType >::compare_to(), and LVecBase3d::compare_to().
Referenced by EggAttributes::sorts_less_than(), and EggCompositePrimitive::write_body().
void EggAttributes::copy_color | ( | const EggAttributes & | other | ) | [inline, inherited] |
Sets this color to be the same as the other's, include morphs.
If the other has no color, this clears the color.
Definition at line 165 of file eggAttributes.I.
References EggAttributes::get_color().
Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().
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 576 of file eggVertex.cxx.
References clear_grefs(), EggGroup::get_vertex_membership(), gref_begin(), gref_end(), EggGroup::ref_vertex(), and test_gref_integrity().
Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::r_apply_texmats(), EggPrimitive::r_flatten_transforms(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::strip_normals(), EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().
void EggAttributes::copy_normal | ( | const EggAttributes & | other | ) | [inline, inherited] |
Sets this normal to be the same as the other's, include morphs.
If the other has no normal, this clears the normal.
Definition at line 84 of file eggAttributes.I.
Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().
bool ReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 29 of file referenceCount.cxx.
Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().
bool ReferenceCount::do_test_ref_count_nonzero | ( | ) | const [protected, inherited] |
Returns true if the reference count is nonzero, false otherwise.
Definition at line 56 of file referenceCount.cxx.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by ReferenceCount::test_ref_count_nonzero().
Colorf EggAttributes::get_color | ( | ) | const [inline, inherited] |
Returns the color set on this particular attribute.
If there is no color set, returns white.
Definition at line 110 of file eggAttributes.I.
Referenced by EggVertexPool::check_overall_color(), EggAttributes::copy_color(), EggTriangleStrip::do_triangulate(), EggTriangleFan::do_triangulate(), EggRenderState::fill_state(), EggVertexPool::has_nonwhite_colors(), EggAttributes::matches_color(), EggPrimitive::post_apply_flat_attribute(), EggCompositePrimitive::post_apply_flat_attribute(), XFileVertex::set_from_egg(), XFileMaterial::set_from_egg(), EggPolysetMaker::sorts_less(), EggPrimitive::unify_attributes(), EggAttributes::write(), and EggToDXFLayer::write_polyline().
int EggVertex::get_external_index | ( | ) | const [inline] |
Returns the number set by set_external_index().
See set_external_index().
Definition at line 317 of file eggVertex.I.
Referenced by XFileMesh::create_polygons(), and SoftToEggConverter::FindClosestTriVert().
int EggVertex::get_index | ( | ) | const [inline] |
Returns the index number of the vertex within its pool.
Definition at line 287 of file eggVertex.I.
Referenced by EggVertexPool::EggVertexPool(), EggPrimitive::write_body(), and EggGroup::write_vertex_ref().
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.
Referenced by EggVertexPool::get_num_dimensions().
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 462 of file eggVertex.cxx.
References EggNode::is_local_coord(), pref_begin(), pref_end(), and test_pref_integrity().
Referenced by EggVertexPool::transform().
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 441 of file eggVertex.cxx.
References EggNode::is_local_coord(), pref_begin(), pref_end(), and test_pref_integrity().
Referenced by EggVertexPool::transform().
EggVertexPool * EggVertex::get_pool | ( | ) | const [inline] |
Returns the vertex pool this vertex belongs in.
This may be NULL if the vertex has not been added to a pool.
Definition at line 25 of file eggVertex.I.
Referenced by EggPrimitive::prepare_add_vertex(), EggPrimitive::r_apply_texmats(), EggPrimitive::r_flatten_transforms(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::strip_normals(), EggPrimitive::unify_attributes(), EggCompositePrimitive::unify_attributes(), EggPrimitive::write_body(), and EggGroup::write_vertex_ref().
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.
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.
Vertexd EggVertex::get_pos3 | ( | ) | const [inline] |
Valid if get_num_dimensions() returns 3 or 4.
Returns the position as a three-dimensional value.
Definition at line 160 of file eggVertex.I.
Referenced by EggPolygon::calculate_normal(), EggMesherFanMaker::compute_angle(), EggMesherEdge::compute_box(), EggMesherEdge::compute_length(), EggMesherStrip::convex_quad(), SoftToEggConverter::FindClosestTriVert(), SoftNodeDesc::make_vertex_offsets(), XFileVertex::set_from_egg(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_polyline().
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.
int ReferenceCount::get_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 155 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by TransformState::clear_cache(), RenderState::clear_cache(), RenderState::finalize(), RenderEffects::finalize(), RenderEffect::finalize(), RenderAttrib::finalize(), InternalName::finalize(), TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), TransformState::list_cycles(), RenderState::list_cycles(), GeomVertexFormat::remove_column(), TransformState::unref(), RenderState::unref(), RenderState::~RenderState(), and TransformState::~TransformState().
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
EggUserData * EggObject::get_user_data | ( | ) | const [inherited] |
Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.
Definition at line 102 of file eggObject.cxx.
Referenced by MayaNodeTree::get_egg_group(), and EggBinner::sorts_less().
EggUserData * EggObject::get_user_data | ( | TypeHandle | type | ) | const [inherited] |
Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.
Definition at line 113 of file eggObject.cxx.
TexCoordd EggVertex::get_uv | ( | const string & | name | ) | const |
Returns the named UV coordinate pair on the vertex.
vertex. It is an error to call this if has_uv(name) returned false.
Definition at line 154 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and LPoint2d::zero().
TexCoordd 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 211 of file eggVertex.I.
References has_uv(), and LPoint2d::zero().
Referenced by XFileVertex::set_from_egg(), and set_uv().
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 230 of file eggVertex.cxx.
References EggVertexUV::filter_name().
Referenced by EggPrimitive::r_apply_texmats().
const TexCoord3d & EggVertex::get_uvw | ( | const string & | name | ) | const |
Returns the named UV coordinate triple on the vertex.
vertex. It is an error to call this if has_uvw(name) returned false.
Definition at line 168 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and LPoint3d::zero().
Referenced by set_uvw().
WeakReferenceList * ReferenceCount::get_weak_list | ( | ) | const [inline, inherited] |
Returns the WeakReferenceList associated with this ReferenceCount object.
If there has never been a WeakReferenceList associated with this object, creates one now.
Definition at line 307 of file referenceCount.I.
Referenced by ReferenceCount::weak_ref().
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 517 of file eggVertex.cxx.
Referenced by copy_grefs_from(), and test_gref_integrity().
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 533 of file eggVertex.cxx.
Referenced by copy_grefs_from(), and test_gref_integrity().
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 547 of file eggVertex.cxx.
bool EggVertex::has_gref | ( | const EggGroup * | group | ) | const |
Returns true if the indicated group references this vertex, false otherwise.
Definition at line 558 of file eggVertex.cxx.
Referenced by EggGroup::test_vref_integrity().
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 669 of file eggVertex.cxx.
Referenced by EggPrimitive::test_vref_integrity().
bool EggObject::has_user_data | ( | ) | const [inherited] |
Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.
Definition at line 130 of file eggObject.cxx.
Referenced by MayaNodeTree::get_egg_group().
bool EggObject::has_user_data | ( | TypeHandle | type | ) | const [inherited] |
Returns true if the user data pointer of the indicated type has been set, false otherwise.
Definition at line 141 of file eggObject.cxx.
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 120 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and EggVertexUV::has_w().
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.
Referenced by get_uv(), EggVertexPool::has_uvs(), and XFileVertex::set_from_egg().
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 137 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and EggVertexUV::has_w().
bool ReferenceCount::has_weak_list | ( | ) | const [inline, inherited] |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).
Definition at line 294 of file referenceCount.I.
Referenced by ReferenceCount::weak_unref().
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
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.
Referenced by EggVertexPool::add_vertex(), EggVertexPool::get_vertex(), EggVertexPool::has_defined_vertices(), and EggVertexPool::has_forward_vertices().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
void ReferenceCount::local_object | ( | ) | [inline, inherited] |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.
Definition at line 276 of file referenceCount.I.
Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().
bool EggAttributes::matches_color | ( | const EggAttributes & | other | ) | const [inline, inherited] |
Returns true if this color matches that of the other EggAttributes object, include the morph list.
Definition at line 146 of file eggAttributes.I.
References EggMorphList< MorphType >::compare_to(), and EggAttributes::get_color().
Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().
bool EggAttributes::matches_normal | ( | const EggAttributes & | other | ) | const [inline, inherited] |
Returns true if this normal matches that of the other EggAttributes object, include the morph list.
Definition at line 65 of file eggAttributes.I.
References EggMorphList< MorphType >::compare_to().
Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().
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 247 of file eggVertex.cxx.
References EggVertexUV::filter_name().
Copies all properties of the vertex except its vertex pool, index number, and group membership.
Definition at line 79 of file eggVertex.cxx.
References test_gref_integrity(), and test_pref_integrity().
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 628 of file eggVertex.cxx.
Referenced by get_num_global_coord(), get_num_local_coord(), and test_pref_integrity().
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 644 of file eggVertex.cxx.
Referenced by get_num_global_coord(), get_num_local_coord(), and test_pref_integrity().
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 658 of file eggVertex.cxx.
Referenced by EggVertexPool::remove_unused_vertices().
void ReferenceCount::ref | ( | ) | const [inline, inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
Definition at line 179 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().
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 306 of file eggVertex.I.
Referenced by XFileMesh::create_polygons().
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.
void EggVertex::set_pos | ( | double | pos | ) | [inline] |
Sets the vertex position.
This variant sets the vertex to a one-dimensional value.
Definition at line 54 of file eggVertex.I.
Referenced by DXFToEggLayer::add_vertex(), XFileMesh::create_polygons(), and EggVertexPool::make_new_vertex().
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.
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.
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.
void EggObject::set_user_data | ( | EggUserData * | user_data | ) | [inherited] |
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.
Definition at line 89 of file eggObject.cxx.
Referenced by MayaNodeTree::get_egg_group(), and EggBinner::prepare_node().
void EggVertex::set_uv | ( | const string & | name, |
const TexCoordd & | 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 182 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and get_uv().
void EggVertex::set_uv | ( | const TexCoordd & | 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 228 of file eggVertex.I.
Referenced by XFileMesh::create_polygons().
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 268 of file eggVertex.cxx.
Referenced by EggPrimitive::r_apply_texmats().
void EggVertex::set_uvw | ( | const string & | name, |
const TexCoord3d & | 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 205 of file eggVertex.cxx.
References EggVertexUV::filter_name(), and get_uvw().
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 329 of file eggVertex.I.
References compare_to().
bool EggAttributes::sorts_less_than | ( | const EggAttributes & | other | ) | const [inline, inherited] |
An ordering operator to compare two vertices for sorting order.
This imposes an arbitrary ordering useful to identify unique vertices.
Definition at line 182 of file eggAttributes.I.
References EggAttributes::compare_to().
void EggVertex::test_gref_integrity | ( | ) | const |
Verifies that the gref list is correct and that all the groups included actually exist and do reference the vertex.
Definition at line 683 of file eggVertex.cxx.
References EggGroup::get_vertex_membership(), gref_begin(), gref_end(), and ReferenceCount::test_ref_count_integrity().
Referenced by copy_grefs_from(), EggVertex(), operator=(), and write().
void EggVertex::test_pref_integrity | ( | ) | const |
Verifies that the pref list is correct and that all the primitives included actually exist and do reference the vertex.
Definition at line 706 of file eggVertex.cxx.
References pref_begin(), pref_end(), and ReferenceCount::test_ref_count_integrity().
Referenced by EggPrimitive::add_vertex(), EggVertex(), get_num_global_coord(), get_num_local_coord(), operator=(), EggVertexPool::remove_unused_vertices(), EggPrimitive::remove_vertex(), EggPrimitive::replace(), write(), and EggPrimitive::write_body().
bool ReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 236 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by EggGroupNode::add_child(), InternalName::find_ancestor(), InternalName::get_ancestor(), ReferenceCount::get_ref_count(), InternalName::get_top(), ReferenceCount::ref(), test_gref_integrity(), test_pref_integrity(), EggNode::test_under_integrity(), EggPrimitive::test_vref_integrity(), EggGroup::test_vref_integrity(), MouseWatcher::throw_event_pattern(), ReferenceCount::unref(), and EggNode::update_under().
bool ReferenceCount::test_ref_count_nonzero | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
Definition at line 252 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_nonzero().
Referenced by CopyOnWritePointer::test_ref_count_nonzero().
void EggVertex::transform | ( | const LMatrix4d & | mat | ) |
Applies the indicated transformation matrix to the vertex.
Reimplemented from EggAttributes.
Definition at line 483 of file eggVertex.cxx.
Referenced by XFileMesh::create_polygons(), EggPrimitive::r_flatten_transforms(), and EggVertexPool::transform().
bool ReferenceCount::unref | ( | ) | const [inline, virtual, inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) 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.
Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.
Definition at line 214 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().
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 252 of file eggVertex.I.
Referenced by EggVertexPool::get_uv_names().
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 266 of file eggVertex.I.
Referenced by EggVertexPool::get_uv_names().
EggVertex::uv_size_type EggVertex::uv_size | ( | ) | const [inline] |
Returns the number of named UV's on the vertex.
Definition at line 276 of file eggVertex.I.
void ReferenceCount::weak_ref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Adds the indicated PointerToVoid as a weak reference to this object.
Definition at line 321 of file referenceCount.I.
References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().
void ReferenceCount::weak_unref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Removes the indicated PointerToVoid as a weak reference to this object.
It must have previously been added via a call to weak_ref().
Definition at line 334 of file referenceCount.I.
References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().
void EggVertex::write | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the vertex to the indicated output stream in Egg format.
Reimplemented from EggAttributes.
Definition at line 318 of file eggVertex.cxx.
References test_gref_integrity(), and test_pref_integrity().