Panda3D
Classes | Public Member Functions | Friends
FindApproxPath Class Reference

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

#include "findApproxPath.h"

List of all members.

Classes

class  Component

Public Member Functions

bool add_component (string str_component)
 Adds a single component to the path sequence, defined by a string as might appear between slashes in the path string.
bool add_flags (const string &str_flags)
 Adds a sequence of control flags.
void add_match_exact_type (TypeHandle type, int flags)
 Adds a component that must match the type of a node exactly, with no derived types matching.
void add_match_inexact_type (TypeHandle type, int flags)
 Adds a component that must match the type of a node or be a base class of the node's type.
void add_match_many (int flags)
 Adds a component that will match a chain of zero or more consecutive nodes.
void add_match_name (const string &name, int flags)
 Adds a component that must match the name of a node exactly.
void add_match_name_glob (const string &glob, int flags)
 Adds a component that must match the name of a node using standard shell globbing rules, with wildcard characters accepted.
void add_match_one (int flags)
 Adds a component that will match any node (but not a chain of many nodes).
void add_match_pointer (PandaNode *pointer, int flags)
 Adds a component that must match a particular node exactly, by pointer.
void add_match_tag (const string &key, int flags)
 Adds a component that will match a node that has a tag with the indicated key, no matter what the value is.
void add_match_tag_value (const string &key, const string &value, int flags)
 Adds a component that will match a node that has a tag with the indicated key.
bool add_string (const string &str_path)
 Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence of control flags, to the path sequence.
bool case_insensitive () const
 Returns true if the search is case-insensitive, false if it is case-sensitive.
int get_num_components () const
 Returns the number of components in the path.
bool is_component_match_many (int index) const
 Returns true if the nth component is of type match_many, which will require special handling.
bool matches_component (int index, PandaNode *node) const
 Returns true if the nth component of the path matches the indicated node, false otherwise.
bool matches_stashed (int index) const
 Returns true if the nth component of the path matches a stashed node only, false otherwise.
void output (ostream &out) const
void output_component (ostream &out, int index) const
 Formats the nth component of the path to the indicated output stream.
bool return_hidden () const
 Returns true if this path allows returning of hidden nodes, false otherwise.
bool return_stashed () const
 Returns true if this path allows returning of stashed nodes, false otherwise.

Friends

ostream & operator<< (ostream &, FindApproxPath::ComponentType)
ostream & operator<< (ostream &, const FindApproxPath::Component &)

Detailed Description

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

It chops a string path, as supplied to find_up() or find_down(), and breaks it up into its component pieces.

Definition at line 33 of file findApproxPath.h.


Member Function Documentation

bool FindApproxPath::add_component ( string  str_component)

Adds a single component to the path sequence, defined by a string as might appear between slashes in the path string.

Returns true if successful, false if the string component was in some way invalid.

Definition at line 232 of file findApproxPath.cxx.

References add_match_exact_type(), add_match_inexact_type(), add_match_many(), add_match_name_glob(), add_match_one(), add_match_tag(), add_match_tag_value(), TypeRegistry::find_type(), TypeHandle::none(), and TypeRegistry::ptr().

Referenced by add_string().

bool FindApproxPath::add_flags ( const string &  str_flags)

Adds a sequence of control flags.

This will be a sequence of letters preceded by either '+' or '-', with no intervening punctuation. Returns true if successful, false otherwise.

Definition at line 173 of file findApproxPath.cxx.

Referenced by add_string().

void FindApproxPath::add_match_exact_type ( TypeHandle  type,
int  flags 
)

Adds a component that must match the type of a node exactly, with no derived types matching.

Definition at line 342 of file findApproxPath.cxx.

Referenced by add_component().

void FindApproxPath::add_match_inexact_type ( TypeHandle  type,
int  flags 
)

Adds a component that must match the type of a node or be a base class of the node's type.

Definition at line 357 of file findApproxPath.cxx.

Referenced by add_component().

void FindApproxPath::add_match_many ( int  flags)

Adds a component that will match a chain of zero or more consecutive nodes.

Definition at line 420 of file findApproxPath.cxx.

Referenced by add_component(), NodePath::find_all_paths_to(), and NodePath::find_path_to().

void FindApproxPath::add_match_name ( const string &  name,
int  flags 
)

Adds a component that must match the name of a node exactly.

Definition at line 303 of file findApproxPath.cxx.

Referenced by add_match_name_glob().

void FindApproxPath::add_match_name_glob ( const string &  glob,
int  flags 
)

Adds a component that must match the name of a node using standard shell globbing rules, with wildcard characters accepted.

Definition at line 319 of file findApproxPath.cxx.

References add_match_name().

Referenced by add_component().

void FindApproxPath::add_match_one ( int  flags)

Adds a component that will match any node (but not a chain of many nodes).

Definition at line 406 of file findApproxPath.cxx.

Referenced by add_component().

void FindApproxPath::add_match_pointer ( PandaNode pointer,
int  flags 
)

Adds a component that must match a particular node exactly, by pointer.

Definition at line 434 of file findApproxPath.cxx.

Referenced by NodePath::find_all_paths_to(), and NodePath::find_path_to().

void FindApproxPath::add_match_tag ( const string &  key,
int  flags 
)

Adds a component that will match a node that has a tag with the indicated key, no matter what the value is.

Definition at line 373 of file findApproxPath.cxx.

Referenced by add_component().

void FindApproxPath::add_match_tag_value ( const string &  name,
const string &  value,
int  flags 
)

Adds a component that will match a node that has a tag with the indicated key.

The value may be "*" to match any value, or a particular glob pattern to match only those nodes with the indicated value.

Definition at line 390 of file findApproxPath.cxx.

Referenced by add_component().

bool FindApproxPath::add_string ( const string &  str_path)

Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence of control flags, to the path sequence.

Returns true if successful, false if the string contained an error.

Definition at line 123 of file findApproxPath.cxx.

References add_component(), and add_flags().

Referenced by NodePathCollection::find_all_matches().

bool FindApproxPath::case_insensitive ( ) const [inline]

Returns true if the search is case-insensitive, false if it is case-sensitive.

Definition at line 106 of file findApproxPath.I.

int FindApproxPath::get_num_components ( ) const [inline]

Returns the number of components in the path.

Definition at line 34 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::consider_next_step(), and FindApproxLevelEntry::is_solution().

bool FindApproxPath::is_component_match_many ( int  index) const [inline]

Returns true if the nth component is of type match_many, which will require special handling.

Definition at line 45 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::consider_next_step(), and FindApproxLevelEntry::consider_node().

bool FindApproxPath::matches_component ( int  index,
PandaNode node 
) const [inline]

Returns true if the nth component of the path matches the indicated node, false otherwise.

Definition at line 57 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::consider_next_step().

bool FindApproxPath::matches_stashed ( int  index) const [inline]

Returns true if the nth component of the path matches a stashed node only, false otherwise.

Definition at line 69 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::next_is_stashed().

void FindApproxPath::output_component ( ostream &  out,
int  index 
) const [inline]

Formats the nth component of the path to the indicated output stream.

Definition at line 117 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::output().

bool FindApproxPath::return_hidden ( ) const [inline]

Returns true if this path allows returning of hidden nodes, false otherwise.

Definition at line 84 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::consider_next_step().

bool FindApproxPath::return_stashed ( ) const [inline]

Returns true if this path allows returning of stashed nodes, false otherwise.

Definition at line 95 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::consider_node().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations