Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FindApproxLevelEntry Class Reference

This class is local to this package only; it doesn't get exported. More...

#include "findApproxLevelEntry.h"

Public Member Functions

 FindApproxLevelEntry (const WorkingNodePath &node_path, FindApproxPath &approx_path)
 
 FindApproxLevelEntry (const FindApproxLevelEntry &parent, PandaNode *child_node, int i, FindApproxLevelEntry *next)
 This constructor is used to construct the next entry based on a child node of the previous entry's node. More...
 
 FindApproxLevelEntry (const FindApproxLevelEntry &copy)
 
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 component of the path. More...
 
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. More...
 
bool is_solution (int increment) const
 Returns true if this entry represents a solution to the search; i.e. More...
 
bool next_is_stashed (int increment) const
 Returns true if the next node matched by this entry must be a stashed node, false otherwise. More...
 
void operator= (const FindApproxLevelEntry &copy)
 
void output (ostream &out) const
 Formats the entry for meaningful output. More...
 
void write_level (ostream &out, int indent_level) const
 Writes the entire level (a linked list of entries beginning at this entry). More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

FindApproxPath_approx_path
 
int _i
 
FindApproxLevelEntry_next
 
WorkingNodePath _node_path
 

Detailed Description

This class is local to this package only; it doesn't get exported.

It represents a single node under consideration for matching at a single point in the breadth-first search.

Definition at line 32 of file findApproxLevelEntry.h.

Constructor & Destructor Documentation

◆ FindApproxLevelEntry()

FindApproxLevelEntry::FindApproxLevelEntry ( const FindApproxLevelEntry parent,
PandaNode child_node,
int  i,
FindApproxLevelEntry next 
)
inline

This constructor is used to construct the next entry based on a child node of the previous entry's node.

Definition at line 38 of file findApproxLevelEntry.I.

References WorkingNodePath::is_valid(), and next_is_stashed().

Member Function Documentation

◆ consider_next_step()

void FindApproxLevelEntry::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 component of the path.

If it matches, generates whatever additional entries are appropriate and stores them in next_level.

Definition at line 144 of file findApproxLevelEntry.cxx.

References FindApproxPath::get_num_components(), FindApproxPath::is_component_match_many(), PandaNode::is_overall_hidden(), FindApproxPath::matches_component(), WorkingNodePath::node(), and FindApproxPath::return_hidden().

Referenced by consider_node().

◆ consider_node()

bool FindApproxLevelEntry::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.

If a solution is found, it is added to result; if the children of this node should be considered, the appropriate entries are added to next_level.

The return value is true if result now contains max_matches solutions, or false if we should keep looking.

Definition at line 70 of file findApproxLevelEntry.cxx.

References NodePathCollection::add_path(), consider_next_step(), PandaNode::Children::get_child(), PandaNode::get_children(), WorkingNodePath::get_node_path(), PandaNode::Children::get_num_children(), NodePathCollection::get_num_paths(), PandaNode::get_num_stashed(), PandaNode::get_stashed(), FindApproxPath::is_component_match_many(), is_solution(), next_is_stashed(), WorkingNodePath::node(), and FindApproxPath::return_stashed().

Referenced by write_level().

◆ is_solution()

bool FindApproxLevelEntry::is_solution ( int  increment) const
inline

Returns true if this entry represents a solution to the search; i.e.

all the components of the path have been successfully matched.

Definition at line 98 of file findApproxLevelEntry.I.

References FindApproxPath::get_num_components().

Referenced by consider_node(), next_is_stashed(), and output().

◆ next_is_stashed()

bool FindApproxLevelEntry::next_is_stashed ( int  increment) const
inline

Returns true if the next node matched by this entry must be a stashed node, false otherwise.

Definition at line 86 of file findApproxLevelEntry.I.

References is_solution(), and FindApproxPath::matches_stashed().

Referenced by consider_node(), and FindApproxLevelEntry().

◆ output()

void FindApproxLevelEntry::output ( ostream &  out) const

Formats the entry for meaningful output.

For debugging only.

Definition at line 29 of file findApproxLevelEntry.cxx.

References is_solution(), FindApproxPath::output_component(), and write_level().

◆ write_level()

void FindApproxLevelEntry::write_level ( ostream &  out,
int  indent_level 
) const

Writes the entire level (a linked list of entries beginning at this entry).

For debugging only.

Definition at line 47 of file findApproxLevelEntry.cxx.

References consider_node().

Referenced by output().


The documentation for this class was generated from the following files: