NodePathCollection¶
-
class
NodePathCollection
¶ This is a set of zero or more
NodePaths
. It’s handy for returning from functions that need to return multipleNodePaths
(for instance, NodePaths::get_children).Inheritance diagram
-
NodePathCollection
(void) = default¶
-
NodePathCollection
(PyObject *self, PyObject *sequence)¶
-
NodePathCollection
(NodePathCollection const&) = default¶
-
void
add_paths_from
(NodePathCollection const &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.
-
void
append
(NodePath const &node_path)¶ Method names to satisfy Python’s conventions.
Adds a new
NodePath
to the collection. This method duplicates theadd_path()
method; it is provided to satisfy Python’s naming convention.
-
bool
calc_tight_bounds
(LPoint3 &min_point, LPoint3 &max_point) const¶ 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.
-
void
compose_color_scale
(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0, int priority = 0)¶
-
void
compose_color_scale
(LVecBase4 const &scale, int priority = 0)¶ Applies color scales to all
NodePaths
in the collection. The existing color scale, if any, is multiplied by the specified color scale.
-
void
extend
(NodePathCollection const &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.
-
NodePathCollection
find_all_matches
(std::string const &path) const¶ Returns the complete set of all
NodePaths
that begin with anyNodePath
in this collection and can be extended by path. The shortest paths will be listed first.
-
CollideMask
get_collide_mask
(void) const¶ 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().
-
PyObject *
get_tight_bounds
(void) const¶
-
bool
has_path
(NodePath const &path) const¶ Returns true if the indicated
NodePath
appears in this collection, false otherwise.
-
bool
is_empty
(void) const¶ Returns true if there are no
NodePaths
in the collection, false otherwise.
-
void
ls
(void) const¶
-
void
ls
(std::ostream &out, int indent_level = 0) const¶ Handy operations on many
NodePaths
at once.Lists all the nodes at and below each node in the collection hierarchically.
Lists all the nodes at and below each node in the collection hierarchically.
-
void
output
(std::ostream &out) const¶ Writes a brief one-line description of the
NodePathCollection
to the indicated output stream.
-
void
remove_duplicate_paths
(void)¶ Removes any duplicate entries of the same
NodePaths
on this collection. If aNodePath
appears multiple times, the first appearance is retained; subsequent appearances are removed.
-
bool
remove_path
(NodePath const &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.
-
void
remove_paths_from
(NodePathCollection const &other)¶ Removes from this collection all of the
NodePaths
listed in the other collection.
-
void
reparent_to
(NodePath const &other)¶ Reparents all the
NodePaths
in the collection to the indicated node.
-
void
reserve
(std::size_t 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.
-
void
set_attrib
(RenderAttrib const *attrib, int priority = 0)¶ Applies the indicated
RenderAttrib
to allNodePaths
in the collection. An effort is made to apply the attrib to manyNodePaths
as quickly as possible; redundantRenderState
compositions are not duplicated.
-
void
set_collide_mask
(CollideMask new_mask, CollideMask bits_to_change = CollideMask::all_on(), TypeHandle node_type = TypeHandle::none())¶ 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.
-
void
set_color
(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0, int priority = 0)¶
-
void
set_color_scale
(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0, int priority = 0)¶
-
void
set_color_scale
(LVecBase4 const &scale, int priority = 0)¶ Applies color scales to all
NodePaths
in the collection. The existing color scale is replaced.
-
void
set_texture
(TextureStage *stage, Texture *tex, int priority = 0)¶ 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.
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.
-
void
set_texture_off
(int priority = 0)¶
-
void
set_texture_off
(TextureStage *stage, int priority = 0)¶ 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 aset_texture()
at a lower level).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 aset_texture()
at a lower level).
-
std::size_t
size
(void) const¶ Returns the number of paths in the collection. This is the same thing as
get_num_paths()
.
-
void
write
(std::ostream &out, int indent_level = 0) const¶ Writes a complete multi-line description of the
NodePathCollection
to the indicated output stream.
-