#include <nodePathComponent.h>
Inheritance diagram for NodePathComponent:
Public Member Functions | |
~NodePathComponent () | |
PandaNode * | get_node () const |
Returns the node referenced by this component. | |
int | get_key () const |
Returns an index number that is guaranteed to be unique for this particular NodePathComponent, and not to be reused for the lifetime of the application (barring integer overflow). | |
bool | is_top_node () const |
Returns true if this component represents the top node in the path. | |
bool | is_collapsed () const |
Returns true if this component has been collapsed with another component. | |
NodePathComponent * | get_next () const |
Returns the next component in the path. | |
int | get_length () const |
Returns the length of the path to this node. | |
NodePathComponent * | get_collapsed () const |
If is_collapsed() returns true, this is the component that this one has been collapsed with, and should be replaced with. | |
bool | fix_length () |
Checks that the length indicated by the component is one more than the length of its predecessor. | |
NodePathComponent * | uncollapse () |
Returns this component pointer if the component is not collapsed; or if it has been collapsed, returns the pointer it has been collapsed into. | |
void | output (ostream &out) const |
The recursive implementation of NodePath::output(), this writes the names of each node component in order from beginning to end, by first walking to the end of the linked list and then outputting from there. | |
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. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef CycleDataReader< CData > | CDReader |
typedef CycleDataWriter< CData > | CDWriter |
Private Member Functions | |
NodePathComponent (PandaNode *node, NodePathComponent *next=NULL) | |
Constructs a new NodePathComponent from the indicated node. | |
NodePathComponent (const NodePathComponent ©) | |
NodePathComponents should not be copied. | |
void | operator= (const NodePathComponent ©) |
NodePathComponents should not be copied. | |
void | set_next (NodePathComponent *next) |
Sets the next pointer in the path. | |
void | set_top_node () |
Severs any connection to the next pointer in the path and makes this component a top node. | |
void | collapse_with (NodePathComponent *next) |
Indicates that this component pointer is no longer valid, and that the indicated component should be used instead. | |
Private Attributes | |
PointerTo< PandaNode > | _node |
int | _key |
PipelineCycler< CData > | _cycler |
Static Private Attributes | |
int | _next_key = 1 |
TypeHandle | _type_handle |
Friends | |
class | PandaNode |
These are stored on each PandaNode, as many as one for each of the possible instances of the node (but they only exist when they are requested, to minimize memory waste). A NodePath represents a singly-linked list of these from an arbitrary component in the graph to the root.
This whole NodePath system is used to disambiguate instances in the scene graph, and the NodePathComponents are stored in the nodes themselves to allow the nodes to keep these up to date as the scene graph is manipulated.
Definition at line 65 of file nodePathComponent.h.
|
Definition at line 112 of file nodePathComponent.h. |
|
Definition at line 113 of file nodePathComponent.h. |
|
Constructs a new NodePathComponent from the indicated node. Don't try to call this directly; ask the PandaNode to do it for you. Definition at line 62 of file nodePathComponent.I. |
|
NodePathComponents should not be copied.
Definition at line 86 of file nodePathComponent.I. |
|
Definition at line 112 of file nodePathComponent.I. |
|
Indicates that this component pointer is no longer valid, and that the indicated component should be used instead. This is done whenever two NodePathComponents have been collapsed together due to an instance being removed higher up in the graph. Definition at line 301 of file nodePathComponent.cxx. |
|
Checks that the length indicated by the component is one more than the length of its predecessor. If this is broken, fixes it and returns true indicating the component has been changed; otherwise, returns false. Definition at line 155 of file nodePathComponent.cxx. References get_collapsed(), and is_collapsed(). |
|
Reimplemented from ReferenceCount. Definition at line 118 of file nodePathComponent.h. Referenced by NodePathComponent::CData::CData(). |
|
If is_collapsed() returns true, this is the component that this one has been collapsed with, and should be replaced with.
Definition at line 167 of file nodePathComponent.I. Referenced by fix_length(), is_top_node(), NodePathComponent::CData::make_copy(), and output(). |
|
Returns an index number that is guaranteed to be unique for this particular NodePathComponent, and not to be reused for the lifetime of the application (barring integer overflow).
Definition at line 58 of file nodePathComponent.cxx. Referenced by NodePathComponent::CData::make_copy(). |
|
Returns the length of the path to this node.
Definition at line 101 of file nodePathComponent.cxx. References NULL. Referenced by NodePath::do_billboard_axis(), get_next(), and is_top_node(). |
|
Returns the next component in the path.
Definition at line 118 of file nodePathComponent.cxx. References _cycler, get_length(), and is_top_node(). Referenced by NodePath::clear_two_sided(), NodePath::do_billboard_axis(), NodePath::do_billboard_point_eye(), and NodePath::do_billboard_point_world(). |
|
Returns the node referenced by this component.
Definition at line 126 of file nodePathComponent.I. References _cycler, INLINE, is_collapsed(), nassertr, and NULL. Referenced by NodePath::clear_two_sided(), NodePath::do_billboard_point_eye(), NodePath::do_billboard_point_world(), and PandaNode::is_geom_node(). |
|
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 ReferenceCount. Definition at line 121 of file nodePathComponent.h. |
|
Returns true if this component has been collapsed with another component. In this case, the component itself is invalid, and the collapsed component should be used instead. Definition at line 149 of file nodePathComponent.I. Referenced by fix_length(), get_node(), NodePathComponent::CData::make_copy(), and output(). |
|
Returns true if this component represents the top node in the path.
Definition at line 84 of file nodePathComponent.cxx. References get_collapsed(), and get_length(). Referenced by get_next(), and PandaNode::is_geom_node(). |
|
NodePathComponents should not be copied.
Definition at line 99 of file nodePathComponent.I. |
|
The recursive implementation of NodePath::output(), this writes the names of each node component in order from beginning to end, by first walking to the end of the linked list and then outputting from there.
Definition at line 217 of file nodePathComponent.cxx. References _cycler, get_collapsed(), is_collapsed(), NULL, and set_top_node(). |
|
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(). |
|
Sets the next pointer in the path.
Definition at line 254 of file nodePathComponent.cxx. References _key. Referenced by PandaNode::is_geom_node(). |
|
Severs any connection to the next pointer in the path and makes this component a top node.
Definition at line 275 of file nodePathComponent.cxx. Referenced by output(). |
|
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(). |
|
Returns this component pointer if the component is not collapsed; or if it has been collapsed, returns the pointer it has been collapsed into. Collapsing can happen at any time to any component in the path and we have to deal with it. It happens when a node is removed further up the path that results in two instances becoming the same thing. Definition at line 192 of file nodePathComponent.cxx. References Namable::get_name(). |
|
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(). |
|
Definition at line 129 of file nodePathComponent.h. |
|
Definition at line 111 of file nodePathComponent.h. Referenced by get_next(), get_node(), output(), and ~NodePathComponent(). |
|
Definition at line 98 of file nodePathComponent.h. Referenced by NodePathComponent::CData::CData(), and set_next(). |
|
Definition at line 27 of file nodePathComponent.cxx. |
|
Definition at line 97 of file nodePathComponent.h. Referenced by NodePathComponent::CData::CData(), NodePathComponent(), and operator=(). |
|
Reimplemented from ReferenceCount. Definition at line 28 of file nodePathComponent.cxx. |