Panda3D
Public Member Functions | Static Public Member Functions | List of all members
PandaNodePipelineReader Class Reference

Encapsulates the data from a PandaNode, pre-fetched for one stage of the pipeline. More...

#include "pandaNode.h"

Public Member Functions

 PandaNodePipelineReader (const PandaNode *object, Thread *current_thread)
 
 PandaNodePipelineReader (const PandaNodePipelineReader &copy)
 
void check_cached (bool update_bounds) const
 Ensures that the draw masks etc. More...
 
bool compare_draw_mask (DrawMask running_draw_mask, DrawMask camera_mask) const
 Compares the running draw mask computed during a traversal with this node's net draw masks. More...
 
void compose_draw_mask (DrawMask &running_draw_mask) const
 Computes the result of applying this node's draw masks to a running draw mask, as during a traversal. More...
 
int find_child (PandaNode *node) const
 Returns the index of the indicated child node, if it is a child, or -1 if it is not. More...
 
int find_parent (PandaNode *node) const
 Returns the index of the indicated parent node, if it is a parent, or -1 if it is not. More...
 
int find_stashed (PandaNode *node) const
 Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not. More...
 
const BoundingVolumeget_bounds () const
 Returns the external bounding volume of this node: a bounding volume that contains the user bounding volume, the internal bounding volume, and all of the children's bounding volumes. More...
 
PandaNodeget_child (int n) const
 Returns the nth child node of this node. More...
 
int get_child_sort (int n) const
 Returns the sort index of the nth child node of this node (that is, the number that was passed to add_child()). More...
 
PandaNode::Children get_children () const
 Returns an object that can be used to walk through the list of children of the node. More...
 
Threadget_current_thread () const
 
const RenderEffectsget_effects () const
 Returns the complete RenderEffects that will be applied to this node. More...
 
int get_fancy_bits () const
 Returns the union of all of the enum FancyBits values corresponding to the various "fancy" attributes that are set on the node. More...
 
int get_nested_vertices () const
 Returns the total number of vertices that will be rendered by this node and all of its descendents. More...
 
CollideMask get_net_collide_mask () const
 Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below. More...
 
const PandaNodeget_node () const
 
int get_num_children () const
 Returns the number of child nodes this node has. More...
 
int get_num_parents () const
 Returns the number of parent nodes this node has. More...
 
int get_num_stashed () const
 Returns the number of stashed nodes this node has. More...
 
const RenderAttribget_off_clip_planes () const
 Returns a ClipPlaneAttrib which represents the union of all of the clip planes that have been turned *off* at this level and below. More...
 
PandaNodeget_parent (int n) const
 Returns the nth parent node of this node. More...
 
PandaNode::Parents get_parents () const
 Returns an object that can be used to walk through the list of parents of the node, similar to get_children() and get_stashed(). More...
 
const TransformStateget_prev_transform () const
 Returns the transform that has been set as this node's "previous" position. More...
 
PandaNodeget_stashed (int n) const
 Returns the nth stashed child of this node. More...
 
PandaNode::Stashed get_stashed () const
 Returns an object that can be used to walk through the list of children of the node. More...
 
int get_stashed_sort (int n) const
 Returns the sort index of the nth stashed node of this node (that is, the number that was passed to add_child()). More...
 
const RenderStateget_state () const
 Returns the complete RenderState that will be applied to all nodes at this level and below, as set on this node. More...
 
std::string get_tag (const std::string &key) const
 Retrieves the user-defined value that was previously set on this node for the particular key, if any. More...
 
const TransformStateget_transform () const
 Returns the transform that has been set on this particular node. More...
 
bool has_tag (const std::string &key) const
 Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set. More...
 
bool is_final () const
 Returns the current state of the "final" flag. More...
 
void operator= (const PandaNodePipelineReader &copy)
 
void release ()
 Releases the lock on this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

Encapsulates the data from a PandaNode, pre-fetched for one stage of the pipeline.

Definition at line 842 of file pandaNode.h.

Member Function Documentation

◆ check_cached()

void PandaNodePipelineReader::check_cached ( bool  update_bounds) const

Ensures that the draw masks etc.

are properly computed on this node. If update_bounds is true, also checks the bounding volume.

Definition at line 4106 of file pandaNode.cxx.

References Thread::get_pipeline_stage, and node_unref_delete().

Referenced by CullTraverserData::apply_transform_and_state().

◆ compare_draw_mask()

bool PandaNodePipelineReader::compare_draw_mask ( DrawMask  running_draw_mask,
DrawMask  camera_mask 
) const
inline

Compares the running draw mask computed during a traversal with this node's net draw masks.

Returns true if the node should be traversed into, or false if there is nothing at this level or below that will be visible to the indicated camera_mask.

Definition at line 1269 of file pandaNode.I.

◆ compose_draw_mask()

void PandaNodePipelineReader::compose_draw_mask ( DrawMask running_draw_mask) const
inline

Computes the result of applying this node's draw masks to a running draw mask, as during a traversal.

Definition at line 1256 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ find_child()

int PandaNodePipelineReader::find_child ( PandaNode node) const
inline

Returns the index of the indicated child node, if it is a child, or -1 if it is not.

Definition at line 1370 of file pandaNode.I.

◆ find_parent()

int PandaNodePipelineReader::find_parent ( PandaNode node) const
inline

Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.

Definition at line 1328 of file pandaNode.I.

◆ find_stashed()

int PandaNodePipelineReader::find_stashed ( PandaNode node) const
inline

Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.

Definition at line 1412 of file pandaNode.I.

References PandaNode::get_stashed.

◆ get_bounds()

const BoundingVolume * PandaNodePipelineReader::get_bounds ( ) const
inline

Returns the external bounding volume of this node: a bounding volume that contains the user bounding volume, the internal bounding volume, and all of the children's bounding volumes.

Definition at line 1505 of file pandaNode.I.

◆ get_child()

PandaNode * PandaNodePipelineReader::get_child ( int  n) const
inline

Returns the nth child node of this node.

See get_num_children(). Also see get_children(), if your intention is to iterate through the complete list of children; get_children() is preferable in this case.

Definition at line 1348 of file pandaNode.I.

◆ get_child_sort()

int PandaNodePipelineReader::get_child_sort ( int  n) const
inline

Returns the sort index of the nth child node of this node (that is, the number that was passed to add_child()).

See get_num_children().

Definition at line 1359 of file pandaNode.I.

◆ get_children()

PandaNode::Children PandaNodePipelineReader::get_children ( ) const
inline

Returns an object that can be used to walk through the list of children of the node.

When you intend to visit multiple children, using this is slightly faster than calling get_child() directly on the PandaNode, since this object avoids reopening the PipelineCycler each time.

This object also protects you from self-modifying loops (e.g. adding or removing children during traversal), since a virtual copy of the children is made ahead of time. The virtual copy is fast–it is a form of copy-on- write, so the list is not actually copied unless it is modified during the traversal.

Definition at line 1561 of file pandaNode.I.

◆ get_effects()

const RenderEffects * PandaNodePipelineReader::get_effects ( ) const
inline

Returns the complete RenderEffects that will be applied to this node.

Definition at line 1431 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ get_fancy_bits()

int PandaNodePipelineReader::get_fancy_bits ( ) const
inline

Returns the union of all of the enum FancyBits values corresponding to the various "fancy" attributes that are set on the node.

If this returns 0, the node has nothing interesting about it. This is intended to speed traversal by quickly skipping past nodes that don't particularly affect the render state.

Definition at line 1544 of file pandaNode.I.

◆ get_nested_vertices()

int PandaNodePipelineReader::get_nested_vertices ( ) const
inline

Returns the total number of vertices that will be rendered by this node and all of its descendents.

This is not necessarily an accurate count of vertices that will actually be rendered, since this will include all vertices of all LOD's, and it will also include hidden nodes. It may also omit or only approximate certain kinds of dynamic geometry. However, it will not include stashed nodes.

Definition at line 1520 of file pandaNode.I.

◆ get_net_collide_mask()

CollideMask PandaNodePipelineReader::get_net_collide_mask ( ) const
inline

Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.

Definition at line 1484 of file pandaNode.I.

◆ get_num_children()

int PandaNodePipelineReader::get_num_children ( ) const
inline

Returns the number of child nodes this node has.

The order of the child nodes *is* meaningful and is based on the sort number that was passed to add_child(), and also on the order in which the nodes were added.

Definition at line 1338 of file pandaNode.I.

◆ get_num_parents()

int PandaNodePipelineReader::get_num_parents ( ) const
inline

Returns the number of parent nodes this node has.

If this number is greater than 1, the node has been multiply instanced. The order of the parent nodes is not meaningful and is not related to the order in which the node was instanced to them.

Definition at line 1307 of file pandaNode.I.

◆ get_num_stashed()

int PandaNodePipelineReader::get_num_stashed ( ) const
inline

Returns the number of stashed nodes this node has.

These are former children of the node that have been moved to the special stashed list via stash_child().

Definition at line 1380 of file pandaNode.I.

◆ get_off_clip_planes()

const RenderAttrib * PandaNodePipelineReader::get_off_clip_planes ( ) const
inline

Returns a ClipPlaneAttrib which represents the union of all of the clip planes that have been turned *off* at this level and below.

Definition at line 1494 of file pandaNode.I.

◆ get_parent()

PandaNode * PandaNodePipelineReader::get_parent ( int  n) const
inline

Returns the nth parent node of this node.

See get_num_parents(). Also see get_parents(), if your intention is to iterate through the complete list of parents; get_parents() is preferable in this case.

Definition at line 1317 of file pandaNode.I.

◆ get_parents()

PandaNode::Parents PandaNodePipelineReader::get_parents ( ) const
inline

Returns an object that can be used to walk through the list of parents of the node, similar to get_children() and get_stashed().

Definition at line 1587 of file pandaNode.I.

◆ get_prev_transform()

const TransformState * PandaNodePipelineReader::get_prev_transform ( ) const
inline

Returns the transform that has been set as this node's "previous" position.

See set_prev_transform().

Definition at line 1450 of file pandaNode.I.

◆ get_stashed() [1/2]

PandaNode * PandaNodePipelineReader::get_stashed ( int  n) const
inline

Returns the nth stashed child of this node.

See get_num_stashed(). Also see get_stashed(), if your intention is to iterate through the complete list of stashed children; get_stashed() is preferable in this case.

Definition at line 1390 of file pandaNode.I.

◆ get_stashed() [2/2]

PandaNode::Stashed PandaNodePipelineReader::get_stashed ( ) const
inline

Returns an object that can be used to walk through the list of children of the node.

When you intend to visit multiple children, using this is slightly faster than calling get_stashed() directly on the PandaNode, since this object avoids reopening the PipelineCycler each time.

This object also protects you from self-modifying loops (e.g. adding or removing children during traversal), since a virtual copy of the children is made ahead of time. The virtual copy is fast–it is a form of copy-on- write, so the list is not actually copied unless it is modified during the traversal.

Definition at line 1578 of file pandaNode.I.

◆ get_stashed_sort()

int PandaNodePipelineReader::get_stashed_sort ( int  n) const
inline

Returns the sort index of the nth stashed node of this node (that is, the number that was passed to add_child()).

See get_num_stashed().

Definition at line 1401 of file pandaNode.I.

◆ get_state()

const RenderState * PandaNodePipelineReader::get_state ( ) const
inline

Returns the complete RenderState that will be applied to all nodes at this level and below, as set on this node.

This returns only the RenderState set on this particular node, and has nothing to do with state that might be inherited from above.

Definition at line 1423 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ get_tag()

std::string PandaNodePipelineReader::get_tag ( const std::string &  key) const
inline

Retrieves the user-defined value that was previously set on this node for the particular key, if any.

If no value has been previously set, returns the empty string.

Definition at line 1460 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ get_transform()

const TransformState * PandaNodePipelineReader::get_transform ( ) const
inline

Returns the transform that has been set on this particular node.

This is not the net transform from the root, but simply the transform on this particular node.

Definition at line 1441 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ has_tag()

bool PandaNodePipelineReader::has_tag ( const std::string &  key) const
inline

Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set.

Definition at line 1475 of file pandaNode.I.

Referenced by CullTraverserData::apply_transform_and_state().

◆ is_final()

bool PandaNodePipelineReader::is_final ( ) const
inline

Returns the current state of the "final" flag.

Initially, this flag is off (false), but it may be changed by an explicit call to set_final(). See set_final().

Definition at line 1531 of file pandaNode.I.

◆ release()

void PandaNodePipelineReader::release ( )
inline

Releases the lock on this object.

No future calls will be valid on this object.

Definition at line 1242 of file pandaNode.I.


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