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 (std::ostream &out) const
 Formats the entry for meaningful output. More...
 
void write_level (std::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 29 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 32 of file findApproxLevelEntry.I.

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 129 of file findApproxLevelEntry.cxx.

◆ 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 59 of file findApproxLevelEntry.cxx.

References NodePathCollection::add_path(), WorkingNodePath::get_node_path, NodePathCollection::get_num_paths, FindApproxPath::is_component_match_many(), is_solution(), and WorkingNodePath::node().

◆ 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 83 of file findApproxLevelEntry.I.

References FindApproxPath::get_num_components().

Referenced by consider_node(), 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 74 of file findApproxLevelEntry.I.

References FindApproxPath::matches_stashed().

◆ output()

void FindApproxLevelEntry::output ( std::ostream &  out) const

Formats the entry for meaningful output.

For debugging only.

Definition at line 25 of file findApproxLevelEntry.cxx.

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

◆ write_level()

void FindApproxLevelEntry::write_level ( std::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 41 of file findApproxLevelEntry.cxx.

References indent().


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