Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

FindApproxPath Class Reference

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

#include <findApproxPath.h>

List of all members.

Public Member Functions

 FindApproxPath ()
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 add_flags (const string &str_flags)
 Adds a sequence of control flags.

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.

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_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_one (int flags)
 Adds a component that will match any node (but not a chain of many nodes).

void add_match_many (int flags)
 Adds a component that will match a chain of zero or more consecutive nodes.

void add_match_pointer (PandaNode *pointer, int flags)
 Adds a component that must match a particular node exactly, by pointer.

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.

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.

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.


Private Types

typedef pvector< ComponentPath
enum  ComponentType {
  CT_match_name, CT_match_name_glob, CT_match_exact_type, CT_match_inexact_type,
  CT_match_one, CT_match_many, CT_match_pointer
}
enum  ComponentFlags { CF_stashed = 0x001 }

Private Attributes

Path _path
bool _return_hidden
bool _return_stashed

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 45 of file findApproxPath.h.


Member Typedef Documentation

typedef pvector<Component> FindApproxPath::Path [private]
 

Definition at line 102 of file findApproxPath.h.


Member Enumeration Documentation

enum FindApproxPath::ComponentFlags [private]
 

Enumeration values:
CF_stashed 

Definition at line 86 of file findApproxPath.h.

enum FindApproxPath::ComponentType [private]
 

Enumeration values:
CT_match_name 
CT_match_name_glob 
CT_match_exact_type 
CT_match_inexact_type 
CT_match_one 
CT_match_many 
CT_match_pointer 

Definition at line 77 of file findApproxPath.h.


Constructor & Destructor Documentation

FindApproxPath::FindApproxPath  )  [inline]
 

Definition at line 31 of file findApproxPath.I.

References FindApproxPath::Component::_flags, FindApproxPath::Component::_name, _path, FindApproxPath::Component::_type, CT_match_name, and INLINE.


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 223 of file findApproxPath.cxx.

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 162 of file findApproxPath.cxx.

void FindApproxPath::add_match_exact_type TypeHandle  type,
int  flags
[inline]
 

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

Definition at line 87 of file findApproxPath.I.

References _path.

void FindApproxPath::add_match_inexact_type TypeHandle  type,
int  flags
[inline]
 

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

Definition at line 106 of file findApproxPath.I.

References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_type, CT_match_many, and INLINE.

void FindApproxPath::add_match_many int  flags  )  [inline]
 

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

Definition at line 143 of file findApproxPath.I.

void FindApproxPath::add_match_name const string &  name,
int  flags
[inline]
 

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

Definition at line 47 of file findApproxPath.I.

References FindApproxPath::Component::_flags, FindApproxPath::Component::_name, _path, FindApproxPath::Component::_type, CT_match_name_glob, and INLINE.

void FindApproxPath::add_match_name_glob const string &  glob,
int  flags
[inline]
 

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

Definition at line 68 of file findApproxPath.I.

References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_type, FindApproxPath::Component::_type_handle, CT_match_exact_type, and INLINE.

void FindApproxPath::add_match_one int  flags  )  [inline]
 

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

Definition at line 125 of file findApproxPath.I.

References FindApproxPath::Component::_flags, _path, FindApproxPath::Component::_pointer, FindApproxPath::Component::_type, CT_match_pointer, and INLINE.

void FindApproxPath::add_match_pointer PandaNode pointer,
int  flags
[inline]
 

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

Definition at line 161 of file findApproxPath.I.

References _path, INLINE, and nassertr.

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 115 of file findApproxPath.cxx.

Referenced by NodePathCollection::get_num_paths(), and NodePath::set_billboard_axis().

int FindApproxPath::get_num_components  )  const [inline]
 

Returns the number of components in the path.

Definition at line 178 of file findApproxPath.I.

References _path, and CF_stashed.

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 193 of file findApproxPath.I.

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 209 of file findApproxPath.I.

References _path, INLINE, and nassertv.

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 225 of file findApproxPath.I.

Referenced by FindApproxLevelEntry::operator=().

void FindApproxPath::output ostream &  out  )  const
 

Definition at line 294 of file findApproxPath.cxx.

References CT_match_many, CT_match_one, and CT_match_pointer.

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 274 of file findApproxPath.I.

bool FindApproxPath::return_hidden  )  const [inline]
 

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

Definition at line 244 of file findApproxPath.I.

bool FindApproxPath::return_stashed  )  const [inline]
 

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

Definition at line 259 of file findApproxPath.I.


Friends And Related Function Documentation

ostream& operator<< ostream &  out,
const FindApproxPath::Component component
[friend]
 

Definition at line 116 of file findApproxPath.h.

ostream& operator<< ostream &  ,
FindApproxPath::ComponentType 
[friend]
 

Definition at line 309 of file findApproxPath.cxx.


Member Data Documentation

Path FindApproxPath::_path [private]
 

Definition at line 103 of file findApproxPath.h.

Referenced by add_match_exact_type(), add_match_inexact_type(), add_match_name(), add_match_name_glob(), add_match_one(), add_match_pointer(), FindApproxPath(), get_num_components(), and matches_component().

bool FindApproxPath::_return_hidden [private]
 

Definition at line 105 of file findApproxPath.h.

bool FindApproxPath::_return_stashed [private]
 

Definition at line 106 of file findApproxPath.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:50:37 2003 for Panda by doxygen1.3