Panda3D
Public Member Functions | List of all members
NodePathCollection Class Reference

This is a set of zero or more NodePaths. More...

Public Member Functions

 __init__ ()
 
 __init__ (const NodePathCollection)
 
 __init__ (object sequence)
 
object __reduce__ ()
 
 addPath (const NodePath node_path)
 Adds a new NodePath to the collection. More...
 
 addPathsFrom (const NodePathCollection other)
 Adds all the NodePaths indicated in the other collection to this path. More...
 
 append (const NodePath node_path)
 Adds a new NodePath to the collection. More...
 
bool calcTightBounds (LPoint3 min_point, LPoint3 max_point)
 Calculates the minimum and maximum vertices of all Geoms at these NodePath's bottom nodes and below This is a tight bounding box; it will generally be tighter than the bounding volume returned by get_bounds() (but it is more expensive to compute). More...
 
 clear ()
 Removes all NodePaths from the collection. More...
 
 composeColorScale (const LVecBase4 scale, int priority)
 Applies color scales to all NodePaths in the collection. More...
 
 composeColorScale (float r, float g, float b, float a, int priority)
 Applies color scales to all NodePaths in the collection. More...
 
 detach ()
 Detaches all NodePaths in the collection. More...
 
 extend (const NodePathCollection other)
 Appends the other list onto the end of this one. More...
 
NodePathCollection findAllMatches (str path)
 Returns the complete set of all NodePaths that begin with any NodePath in this collection and can be extended by path. More...
 
CollideMask getCollideMask ()
 Returns the union of all of the into_collide_masks for nodes at this level and below. More...
 
int getNumPaths ()
 Returns the number of NodePaths in the collection. More...
 
NodePath getPath (int index)
 Returns the nth NodePath in the collection. More...
 
list getPaths ()
 
object getTightBounds ()
 
bool hasPath (const NodePath path)
 Returns true if the indicated NodePath appears in this collection, false otherwise. More...
 
 hide ()
 Hides all NodePaths in the collection. More...
 
bool isEmpty ()
 Returns true if there are no NodePaths in the collection, false otherwise. More...
 
 ls ()
 Lists all the nodes at and below each node in the collection hierarchically. More...
 
 ls (Ostream out, int indent_level)
 Lists all the nodes at and below each node in the collection hierarchically. More...
 
NodePath operator [] (int index)
 
NodePathCollection operator+ (const NodePathCollection other)
 
NodePathCollection operator+= (const NodePathCollection other)
 
 output (Ostream out)
 Writes a brief one-line description of the NodePathCollection to the indicated output stream. More...
 
 removeDuplicatePaths ()
 Removes any duplicate entries of the same NodePaths on this collection. More...
 
bool removePath (const NodePath node_path)
 Removes the indicated NodePath from the collection. More...
 
 removePathsFrom (const NodePathCollection other)
 Removes from this collection all of the NodePaths listed in the other collection. More...
 
 reparentTo (const NodePath other)
 Reparents all the NodePaths in the collection to the indicated node. More...
 
 reserve (int num)
 This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding. More...
 
 setAttrib (const RenderAttrib attrib, int priority)
 Applies the indicated RenderAttrib to all NodePaths in the collection. More...
 
 setCollideMask (CollideMask new_mask, CollideMask bits_to_change, TypeHandle node_type)
 Recursively applies the indicated CollideMask to the into_collide_masks for all nodes at this level and below. More...
 
 setColor (const LColor color, int priority)
 Colors all NodePaths in the collection. More...
 
 setColor (float r, float g, float b, float a, int priority)
 Colors all NodePaths in the collection. More...
 
 setColorScale (const LVecBase4 scale, int priority)
 Applies color scales to all NodePaths in the collection. More...
 
 setColorScale (float r, float g, float b, float a, int priority)
 Applies color scales to all NodePaths in the collection. More...
 
 setTexture (Texture tex, int priority)
 Adds the indicated texture to the list of textures that will be rendered on the default texture stage. More...
 
 setTexture (TextureStage stage, Texture tex, int priority)
 Adds the indicated texture to the list of textures that will be rendered on the indicated multitexture stage. More...
 
 setTextureOff (TextureStage stage, int priority)
 Sets the geometry at this level and below to render using no texture, on the indicated stage. More...
 
 setTextureOff (int priority)
 Sets the geometry at this level and below to render using no texture, on any stage. More...
 
 show ()
 Shows all NodePaths in the collection. More...
 
int size ()
 Returns the number of paths in the collection. More...
 
 stash ()
 Stashes all NodePaths in the collection. More...
 
 unstash ()
 Unstashes all NodePaths in the collection. More...
 
 write (Ostream out, int indent_level)
 Writes a complete multi-line description of the NodePathCollection to the indicated output stream. More...
 
 wrtReparentTo (const NodePath other)
 Reparents all the NodePaths in the collection to the indicated node, adjusting each transform so as not to move in world coordinates. More...
 

Detailed Description

This is a set of zero or more NodePaths.

It's handy for returning from functions that need to return multiple NodePaths (for instance, NodePaths::get_children).

Member Function Documentation

◆ __init__() [1/3]

__init__ ( )

◆ __init__() [2/3]

__init__ ( const  NodePathCollection)

◆ __init__() [3/3]

__init__ ( object  sequence)

◆ __reduce__()

object __reduce__ ( )

◆ addPath()

addPath ( const NodePath  node_path)

Adds a new NodePath to the collection.

◆ addPathsFrom()

addPathsFrom ( const NodePathCollection  other)

Adds all the NodePaths indicated in the other collection to this path.

The other paths are simply appended to the end of the paths in this list; duplicates are not automatically removed.

◆ append()

append ( const NodePath  node_path)

Adds a new NodePath to the collection.

This method duplicates the add_path() method; it is provided to satisfy Python's naming convention.

◆ calcTightBounds()

bool calcTightBounds ( LPoint3  min_point,
LPoint3  max_point 
)

Calculates the minimum and maximum vertices of all Geoms at these NodePath's bottom nodes and below This is a tight bounding box; it will generally be tighter than the bounding volume returned by get_bounds() (but it is more expensive to compute).

The return value is true if any points are within the bounding volume, or false if none are.

◆ clear()

clear ( )

Removes all NodePaths from the collection.

◆ composeColorScale() [1/2]

composeColorScale ( const LVecBase4  scale,
int  priority 
)

Applies color scales to all NodePaths in the collection.

The existing color scale, if any, is multiplied by the specified color scale.

◆ composeColorScale() [2/2]

composeColorScale ( float  r,
float  g,
float  b,
float  a,
int  priority 
)

Applies color scales to all NodePaths in the collection.

The existing color scale, if any, is multiplied by the specified color scale.

◆ detach()

detach ( )

Detaches all NodePaths in the collection.

◆ extend()

extend ( const NodePathCollection  other)

Appends the other list onto the end of this one.

This method duplicates the += operator; it is provided to satisfy Python's naming convention.

◆ findAllMatches()

NodePathCollection findAllMatches ( str  path)

Returns the complete set of all NodePaths that begin with any NodePath in this collection and can be extended by path.

The shortest paths will be listed first.

◆ getCollideMask()

CollideMask getCollideMask ( )

Returns the union of all of the into_collide_masks for nodes at this level and below.

This is the same thing as node()->get_net_collide_mask().

If you want to return what the into_collide_mask of this node itself is, without regard to its children, use node()->get_into_collide_mask().

◆ getNumPaths()

int getNumPaths ( )

Returns the number of NodePaths in the collection.

◆ getPath()

NodePath getPath ( int  index)

Returns the nth NodePath in the collection.

◆ getPaths()

list getPaths ( )

◆ getTightBounds()

object getTightBounds ( )

◆ hasPath()

bool hasPath ( const NodePath  path)

Returns true if the indicated NodePath appears in this collection, false otherwise.

◆ hide()

hide ( )

Hides all NodePaths in the collection.

◆ isEmpty()

bool isEmpty ( )

Returns true if there are no NodePaths in the collection, false otherwise.

◆ ls() [1/2]

ls ( )

Lists all the nodes at and below each node in the collection hierarchically.

◆ ls() [2/2]

ls ( Ostream  out,
int  indent_level 
)

Lists all the nodes at and below each node in the collection hierarchically.

◆ operator []()

NodePath operator [] ( int  index)

◆ operator+()

NodePathCollection operator+ ( const NodePathCollection  other)

◆ operator+=()

NodePathCollection operator+= ( const NodePathCollection  other)

◆ output()

output ( Ostream  out)

Writes a brief one-line description of the NodePathCollection to the indicated output stream.

◆ removeDuplicatePaths()

removeDuplicatePaths ( )

Removes any duplicate entries of the same NodePaths on this collection.

If a NodePath appears multiple times, the first appearance is retained; subsequent appearances are removed.

◆ removePath()

bool removePath ( const NodePath  node_path)

Removes the indicated NodePath from the collection.

Returns true if the path was removed, false if it was not a member of the collection.

◆ removePathsFrom()

removePathsFrom ( const NodePathCollection  other)

Removes from this collection all of the NodePaths listed in the other collection.

◆ reparentTo()

reparentTo ( const NodePath  other)

Reparents all the NodePaths in the collection to the indicated node.

◆ reserve()

reserve ( int  num)

This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding.

◆ setAttrib()

setAttrib ( const RenderAttrib  attrib,
int  priority 
)

Applies the indicated RenderAttrib to all NodePaths in the collection.

An effort is made to apply the attrib to many NodePaths as quickly as possible; redundant RenderState compositions are not duplicated.

◆ setCollideMask()

setCollideMask ( CollideMask  new_mask,
CollideMask  bits_to_change,
TypeHandle  node_type 
)

Recursively applies the indicated CollideMask to the into_collide_masks for all nodes at this level and below.

The default is to change all bits, but if bits_to_change is not all bits on, then only the bits that are set in bits_to_change are modified, allowing this call to change only a subset of the bits in the subgraph.

◆ setColor() [1/2]

setColor ( const LColor  color,
int  priority 
)

Colors all NodePaths in the collection.

◆ setColor() [2/2]

setColor ( float  r,
float  g,
float  b,
float  a,
int  priority 
)

Colors all NodePaths in the collection.

◆ setColorScale() [1/2]

setColorScale ( const LVecBase4  scale,
int  priority 
)

Applies color scales to all NodePaths in the collection.

The existing color scale is replaced.

◆ setColorScale() [2/2]

setColorScale ( float  r,
float  g,
float  b,
float  a,
int  priority 
)

Applies color scales to all NodePaths in the collection.

The existing color scale is replaced.

◆ setTexture() [1/2]

setTexture ( Texture  tex,
int  priority 
)

Adds the indicated texture to the list of textures that will be rendered on the default texture stage.

This is the deprecated single-texture variant of this method; it is now superceded by set_texture() that accepts a stage and texture. However, this method may be used in the presence of multitexture if you just want to adjust the default stage.

◆ setTexture() [2/2]

setTexture ( TextureStage  stage,
Texture  tex,
int  priority 
)

Adds the indicated texture to the list of textures that will be rendered on the indicated multitexture stage.

If there are multiple texture stages specified (possibly on multiple different nodes at different levels), they will all be applied to geometry together, according to the stage specification set up in the TextureStage object.

◆ setTextureOff() [1/2]

setTextureOff ( TextureStage  stage,
int  priority 
)

Sets the geometry at this level and below to render using no texture, on the indicated stage.

This is different from not specifying a texture; rather, this specifically contradicts set_texture() at a higher node level (or, with a priority, overrides a set_texture() at a lower level).

◆ setTextureOff() [2/2]

setTextureOff ( int  priority)

Sets the geometry at this level and below to render using no texture, on any stage.

This is different from not specifying a texture; rather, this specifically contradicts set_texture() at a higher node level (or, with a priority, overrides a set_texture() at a lower level).

◆ show()

show ( )

Shows all NodePaths in the collection.

◆ size()

int size ( )

Returns the number of paths in the collection.

This is the same thing as get_num_paths().

◆ stash()

stash ( )

Stashes all NodePaths in the collection.

◆ unstash()

unstash ( )

Unstashes all NodePaths in the collection.

◆ write()

write ( Ostream  out,
int  indent_level 
)

Writes a complete multi-line description of the NodePathCollection to the indicated output stream.

◆ wrtReparentTo()

wrtReparentTo ( const NodePath  other)

Reparents all the NodePaths in the collection to the indicated node, adjusting each transform so as not to move in world coordinates.