15 #include "findApproxLevelEntry.h"
16 #include "nodePathCollection.h"
17 #include "pandaNode.h"
30 out <<
"(" << _node_path <<
"):";
50 entry = entry->_next) {
51 indent(out, indent_level);
52 out << *entry <<
"\n";
71 int max_matches,
int increment)
const {
76 if (max_matches > 0 && result.
get_num_paths() >= max_matches) {
100 if (
consider_node(result, next_level, max_matches, increment + 1)) {
106 nassertr(this_node != (
PandaNode *)NULL,
false);
114 for (
int i = 0; i < num_children; i++) {
124 for (
int i = 0; i < num_stashed; i++) {
145 int increment)
const {
146 nassertv(child_node != _node_path.
node());
165 (*
this, child_node, _i + increment, next_level);
171 (*
this, child_node, _i + increment + 1, next_level);
bool matches_component(int index, PandaNode *node) const
Returns true if the nth component of the path matches the indicated node, false otherwise.
A basic node of the scene graph or data graph.
bool consider_node(NodePathCollection &result, FindApproxLevelEntry *&next_level, int max_matches, int increment) const
Considers the node represented by the entry for matching the find path.
void add_path(const NodePath &node_path)
Adds a new NodePath to the collection.
PandaNode * get_child(int n) const
Returns the nth child of the node.
void consider_next_step(PandaNode *child_node, FindApproxLevelEntry *&next_level, int increment) const
Compares the indicated child node (which is assumed to be a child of _node_path) with the next compon...
This class is local to this package only; it doesn't get exported.
bool return_hidden() const
Returns true if this path allows returning of hidden nodes, false otherwise.
bool is_solution(int increment) const
Returns true if this entry represents a solution to the search; i.e.
int get_num_paths() const
Returns the number of NodePaths in the collection.
PandaNode * node() const
Returns the node traversed to so far.
PandaNode * get_stashed(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the nth stashed child of this node.
NodePath get_node_path() const
Constructs and returns an actual NodePath that represents the same path we have just traversed...
int get_num_children() const
Returns the number of children of the node.
void output_component(ostream &out, int index) const
Formats the nth component of the path to the indicated output stream.
bool return_stashed() const
Returns true if this path allows returning of stashed nodes, false otherwise.
int get_num_components() const
Returns the number of components in the path.
Children get_children(Thread *current_thread=Thread::get_current_thread()) const
Returns an object that can be used to walk through the list of children of the node.
bool is_component_match_many(int index) const
Returns true if the nth component is of type match_many, which will require special handling...
int get_num_stashed(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of stashed nodes this node has.
void write_level(ostream &out, int indent_level) const
Writes the entire level (a linked list of entries beginning at this entry).
bool next_is_stashed(int increment) const
Returns true if the next node matched by this entry must be a stashed node, false otherwise...
TypeHandle is the identifier used to differentiate C++ class types.
void output(ostream &out) const
Formats the entry for meaningful output.
This is a set of zero or more NodePaths.
bool is_overall_hidden() const
Returns true if the node has been hidden to all cameras by clearing its overall bit.