Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
NodePathComponent Class Referencefinal

This is one component of a NodePath. More...

#include "nodePathComponent.h"

Inheritance diagram for NodePathComponent:
ReferenceCount MemoryBase

Public Member Functions

 NodePathComponent (const NodePathComponent &copy)=delete
 
bool fix_length (int pipeline_stage, Thread *current_thread)
 Checks that the length indicated by the component is one more than the length of its predecessor.
 
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).
 
int get_length (int pipeline_stage, Thread *current_thread) const
 Returns the length of the path to this node.
 
NodePathComponentget_next (int pipeline_stage, Thread *current_thread) const
 Returns the next component in the path.
 
PandaNodeget_node () const
 Returns the node referenced by this component.
 
bool has_key () const
 Returns true if the key for this component has already been generated, false otherwise.
 
bool is_top_node (int pipeline_stage, Thread *current_thread) const
 Returns true if this component represents the top node in the path.
 
NodePathComponentoperator= (const NodePathComponent &copy)=delete
 
void output (std::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.
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 
void ref () const
 Explicitly increments the reference count.
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero.
 
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.
 
virtual bool unref () const
 Explicitly decrements the reference count.
 
bool unref_if_one () const
 Atomically decreases the reference count of this object if it is one.
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object.
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object.
 
- Public Member Functions inherited from MemoryBase
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)
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Friends

class NodePath
 
class PandaNode
 

Additional Inherited Members

- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count.
 

Detailed Description

This is one component of a NodePath.

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 42 of file nodePathComponent.h.

Constructor & Destructor Documentation

◆ ~NodePathComponent()

NodePathComponent::~NodePathComponent ( )
inline

Definition at line 35 of file nodePathComponent.I.

Member Function Documentation

◆ fix_length()

bool NodePathComponent::fix_length ( int pipeline_stage,
Thread * current_thread )

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 100 of file nodePathComponent.cxx.

◆ get_class_type()

static TypeHandle NodePathComponent::get_class_type ( )
inlinestatic

Definition at line 114 of file nodePathComponent.h.

◆ get_key()

int NodePathComponent::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).

Definition at line 64 of file nodePathComponent.cxx.

◆ get_length()

int NodePathComponent::get_length ( int pipeline_stage,
Thread * current_thread ) const

Returns the length of the path to this node.

Definition at line 89 of file nodePathComponent.cxx.

Referenced by NodePath::verify_complete().

◆ get_next()

NodePathComponent * NodePathComponent::get_next ( int pipeline_stage,
Thread * current_thread ) const
inline

◆ get_node()

PandaNode * NodePathComponent::get_node ( ) const
inline

Returns the node referenced by this component.

Definition at line 44 of file nodePathComponent.I.

Referenced by NodePath::get_hidden_ancestor(), NodePath::get_stashed_ancestor(), output(), NodePath::verify_complete(), and NodePath::write_datagram().

◆ has_key()

bool NodePathComponent::has_key ( ) const
inline

Returns true if the key for this component has already been generated, false otherwise.

Even if this returns false, calling get_key() will still return a valid key; that will simply cause the key to be generated on-the- fly.

Definition at line 56 of file nodePathComponent.I.

◆ init_type()

static void NodePathComponent::init_type ( )
inlinestatic

Definition at line 117 of file nodePathComponent.h.

◆ is_top_node()

bool NodePathComponent::is_top_node ( int pipeline_stage,
Thread * current_thread ) const

Returns true if this component represents the top node in the path.

Definition at line 80 of file nodePathComponent.cxx.

Referenced by NodePath::get_top().

◆ output()

void NodePathComponent::output ( std::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.

Definition at line 123 of file nodePathComponent.cxx.

References PandaNode::find_parent(), PandaNode::find_stashed(), Thread::get_current_thread, get_next(), get_node(), Thread::get_pipeline_stage, Namable::has_name(), and output().

Referenced by output().

Friends And Related Symbol Documentation

◆ NodePath

friend class NodePath
friend

Definition at line 127 of file nodePathComponent.h.

◆ PandaNode

friend class PandaNode
friend

Definition at line 126 of file nodePathComponent.h.


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