Panda3D
nodePathCollection.I
1 // Filename: nodePathCollection.I
2 // Created by: drose (06Mar02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: NodePathCollection::Destructor
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE NodePathCollection::
22 ~NodePathCollection() {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: NodePathCollection::operator +=
27 // Access: Published
28 // Description: Appends the other list onto the end of this one.
29 ////////////////////////////////////////////////////////////////////
30 INLINE void NodePathCollection::
32  add_paths_from(other);
33 }
34 
35 ////////////////////////////////////////////////////////////////////
36 // Function: NodePathCollection::operator +
37 // Access: Published
38 // Description: Returns a NodePathCollection representing the
39 // concatenation of the two lists.
40 ////////////////////////////////////////////////////////////////////
42 operator + (const NodePathCollection &other) const {
43  NodePathCollection a(*this);
44  a += other;
45  return a;
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function: NodePathCollection::append
50 // Access: Published
51 // Description: Adds a new NodePath to the collection. This method
52 // duplicates the add_path() method; it is provided to
53 // satisfy Python's naming convention.
54 ////////////////////////////////////////////////////////////////////
56 append(const NodePath &node_path) {
57  add_path(node_path);
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: NodePathCollection::extend
62 // Access: Published
63 // Description: Appends the other list onto the end of this one.
64 // This method duplicates the += operator; it is
65 // provided to satisfy Python's naming convention.
66 ////////////////////////////////////////////////////////////////////
67 INLINE void NodePathCollection::
68 extend(const NodePathCollection &other) {
69  operator += (other);
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function: NodePathCollection::ls
74 // Access: Published
75 // Description: Lists all the nodes at and below each node in the
76 // collection hierarchically.
77 ////////////////////////////////////////////////////////////////////
78 INLINE void NodePathCollection::
79 ls() const {
80  ls(nout);
81 }
82 
83 ////////////////////////////////////////////////////////////////////
84 // Function: NodePathCollection::set_color
85 // Access: Published
86 // Description: Colors all NodePaths in the collection
87 ////////////////////////////////////////////////////////////////////
88 INLINE void NodePathCollection::
89 set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a, int priority) {
90  set_color(LColor(r, g, b, a), priority);
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: NodePathCollection::set_color_scale
95 // Access: Published
96 // Description: Applies color scales to all NodePaths in the
97 // collection. The existing color scale is replaced.
98 ////////////////////////////////////////////////////////////////////
99 INLINE void NodePathCollection::
100 set_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a, int priority) {
101  set_color_scale(LVecBase4(r, g, b, a), priority);
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: NodePathCollection::compose_color_scale
106 // Access: Published
107 // Description: Applies color scales to all NodePaths in the
108 // collection. The existing color scale, if any, is
109 // multiplied by the specified color scale.
110 ////////////////////////////////////////////////////////////////////
111 INLINE void NodePathCollection::
112 compose_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a, int priority) {
113  compose_color_scale(LVecBase4(r, g, b, a), priority);
114 }
void ls() const
Lists all the nodes at and below each node in the collection hierarchically.
void add_path(const NodePath &node_path)
Adds a new NodePath to the collection.
void operator+=(const NodePathCollection &other)
Appends the other list onto the end of this one.
NodePathCollection operator+(const NodePathCollection &other) const
Returns a NodePathCollection representing the concatenation of the two lists.
void add_paths_from(const NodePathCollection &other)
Adds all the NodePaths indicated in the other collection to this path.
void append(const NodePath &node_path)
Adds a new NodePath to the collection.
void compose_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0, int priority=0)
Applies color scales to all NodePaths in the collection.
void set_color_scale(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0, int priority=0)
Applies color scales to all NodePaths in the collection.
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0, int priority=0)
Colors all NodePaths in the collection.
void extend(const NodePathCollection &other)
Appends the other list onto the end of this one.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
This is a set of zero or more NodePaths.