Panda3D
Loading...
Searching...
No Matches
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 FindApproxLevelEntry &copy)
 
 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.
 
 FindApproxLevelEntry (const WorkingNodePath &node_path, FindApproxPath &approx_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 component of the path.
 
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.
 
bool is_solution (int increment) const
 Returns true if this entry represents a solution to the search; i.e.
 
bool next_is_stashed (int increment) const
 Returns true if the next node matched by this entry must be a stashed node, false otherwise.
 
void operator= (const FindApproxLevelEntry &copy)
 
void output (std::ostream &out) const
 Formats the entry for meaningful output.
 
void write_level (std::ostream &out, int indent_level) const
 Writes the entire level (a linked list of entries beginning at this entry).
 

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() [1/3]

FindApproxLevelEntry::FindApproxLevelEntry ( const WorkingNodePath & node_path,
FindApproxPath & approx_path )
inline

Definition at line 17 of file findApproxLevelEntry.I.

◆ FindApproxLevelEntry() [2/3]

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

References WorkingNodePath::is_valid.

◆ FindApproxLevelEntry() [3/3]

FindApproxLevelEntry::FindApproxLevelEntry ( const FindApproxLevelEntry & copy)
inline

Definition at line 47 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 128 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 58 of file findApproxLevelEntry.cxx.

References NodePathCollection::add_path(), consider_next_step(), consider_node(), 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 consider_node().

◆ get_class_type()

static TypeHandle FindApproxLevelEntry::get_class_type ( )
inlinestatic

Definition at line 65 of file findApproxLevelEntry.h.

◆ init_type()

static void FindApproxLevelEntry::init_type ( )
inlinestatic

Definition at line 68 of file findApproxLevelEntry.h.

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

References FindApproxPath::matches_stashed().

Referenced by consider_node().

◆ operator=()

void FindApproxLevelEntry::operator= ( const FindApproxLevelEntry & copy)
inline

Definition at line 60 of file findApproxLevelEntry.I.

◆ output()

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

Formats the entry for meaningful output.

For debugging only.

Definition at line 24 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 40 of file findApproxLevelEntry.cxx.

References indent().

Member Data Documentation

◆ _approx_path

FindApproxPath& FindApproxLevelEntry::_approx_path

Definition at line 61 of file findApproxLevelEntry.h.

◆ _i

int FindApproxLevelEntry::_i

Definition at line 60 of file findApproxLevelEntry.h.

◆ _next

FindApproxLevelEntry* FindApproxLevelEntry::_next

Definition at line 62 of file findApproxLevelEntry.h.

◆ _node_path

WorkingNodePath FindApproxLevelEntry::_node_path

Definition at line 55 of file findApproxLevelEntry.h.


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