25output(std::ostream &out)
const {
26 out <<
"(" << _node_path <<
"):";
31 _approx_path.output_component(out, _i);
41write_level(std::ostream &out,
int indent_level)
const {
42 for (
const FindApproxLevelEntry *entry =
this;
44 entry = entry->_next) {
46 out << *entry <<
"\n";
60 int max_matches,
int increment)
const {
64 result.
add_path(_node_path.get_node_path());
65 if (max_matches > 0 && result.
get_num_paths() >= max_matches) {
74 if (_approx_path.is_component_match_many(_i + increment)) {
89 if (
consider_node(result, next_level, max_matches, increment + 1)) {
95 nassertr(this_node !=
nullptr,
false);
103 for (
int i = 0; i < num_children; i++) {
110 if (_approx_path.return_stashed() || stashed_only) {
113 for (
int i = 0; i < num_stashed; i++) {
130 int increment)
const {
131 nassertv(child_node != _node_path.node());
139 nassertv(_i + increment < _approx_path.get_num_components());
141 if (_approx_path.is_component_match_many(_i + increment)) {
147 next_level =
new FindApproxLevelEntry
148 (*
this, child_node, _i + increment, next_level);
151 if (_approx_path.matches_component(_i + increment, child_node)) {
153 next_level =
new FindApproxLevelEntry
154 (*
this, child_node, _i + increment + 1, next_level);
bool next_is_stashed(int increment) const
Returns true if the next node matched by this entry must be a stashed node, false otherwise.
bool is_solution(int increment) const
Returns true if this entry represents a solution to the search; i.e.
void write_level(std::ostream &out, int indent_level) const
Writes the entire level (a linked list of entries beginning at this entry).
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 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...
void output(std::ostream &out) const
Formats the entry for meaningful output.
This is a set of zero or more NodePaths.
void add_path(const NodePath &node_path)
Adds a new NodePath to the collection.
get_num_paths
Returns the number of NodePaths in the collection.
PandaNode * get_child(size_t n) const
Returns the nth child of the node.
size_t get_num_children() const
Returns the number of children of the node.
A basic node of the scene graph or data graph.
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
get_num_stashed
Returns the number of stashed nodes this node has.
get_stashed
Returns the nth stashed child of this node.
get_children
Returns an object that can be used to walk through the list of children of the node.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.