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

NodePathCollection Class Reference

This is a set of zero or more NodePaths. More...

#include <nodePathCollection.h>

List of all members.

Public Member Functions

 NodePathCollection ()
 NodePathCollection (const NodePathCollection &copy)
void operator= (const NodePathCollection &copy)
 ~NodePathCollection ()
void add_path (const NodePath &node_path)
 Adds a new NodePath to the collection.

bool remove_path (const NodePath &node_path)
 Removes the indicated NodePath from the collection.

void add_paths_from (const NodePathCollection &other)
 Adds all the NodePaths indicated in the other collection to this path.

void remove_paths_from (const NodePathCollection &other)
 Removes from this collection all of the NodePaths listed in the other collection.

void remove_duplicate_paths ()
 Removes any duplicate entries of the same NodePaths on this collection.

bool has_path (const NodePath &path) const
 Returns true if the indicated NodePath appears in this collection, false otherwise.

void clear ()
 Removes all NodePaths from the collection.

bool is_empty () const
 Returns true if there are no NodePaths in the collection, false otherwise.

int get_num_paths () const
 Returns the number of NodePaths in the collection.

NodePath get_path (int index) const
 Returns the nth NodePath in the collection.

NodePath operator[] (int index) const
 Returns the nth NodePath in the collection.

void ls () const
 Lists all the nodes at and below each node in the collection hierarchically.

void ls (ostream &out, int indent_level=0) const
 Lists all the nodes at and below each node in the collection hierarchically.

NodePathCollection find_all_matches (const string &path) const
 Returns the complete set of all NodePaths that begin with any NodePath in this collection and can be extended by path.

void reparent_to (const NodePath &other)
 Reparents all the NodePaths in the collection to the indicated node.

void wrt_reparent_to (const NodePath &other)
 Reparents all the NodePaths in the collection to the indicated node, adjusting each transform so as not to move in world coordinates.

void show ()
 Shows all NodePaths in the collection.

void hide ()
 Hides all NodePaths in the collection.

void stash ()
 Stashes all NodePaths in the collection.

void unstash ()
 Unstashes all NodePaths in the collection.

void output (ostream &out) const
 Writes a brief one-line description of the NodePathCollection to the indicated output stream.

void write (ostream &out, int indent_level=0) const
 Writes a complete multi-line description of the NodePathCollection to the indicated output stream.


Private Types

typedef PointerToArray< NodePathNodePaths

Private Attributes

NodePaths _node_paths


Detailed Description

This is a set of zero or more NodePaths.

It's handy for returning from functions that need to return multiple NodePaths (for instance, NodePaths::get_children).

Definition at line 42 of file nodePathCollection.h.


Member Typedef Documentation

typedef PointerToArray< NodePath > NodePathCollection::NodePaths [private]
 

Definition at line 79 of file nodePathCollection.h.


Constructor & Destructor Documentation

NodePathCollection::NodePathCollection  ) 
 

Definition at line 36 of file nodePathCollection.cxx.

NodePathCollection::NodePathCollection const NodePathCollection &  copy  ) 
 

Definition at line 47 of file nodePathCollection.cxx.

References _node_paths.

NodePathCollection::~NodePathCollection  )  [inline]
 

Definition at line 31 of file nodePathCollection.I.

References INLINE, ls(), and nout.


Member Function Documentation

void NodePathCollection::add_path const NodePath node_path  ) 
 

Adds a new NodePath to the collection.

Definition at line 73 of file nodePathCollection.cxx.

References _node_paths.

Referenced by FindApproxLevelEntry::consider_node(), and NodePath::get_top_node().

void NodePathCollection::add_paths_from const NodePathCollection &  other  ) 
 

Adds all the NodePaths indicated in the other collection to this path.

The other paths are simply appended to the end of the paths in this list; duplicates are not automatically removed.

Definition at line 144 of file nodePathCollection.cxx.

void NodePathCollection::clear void   ) 
 

Removes all NodePaths from the collection.

Definition at line 239 of file nodePathCollection.cxx.

References _node_paths, nassertr, and PointerToArray< NodePath >::size().

NodePathCollection NodePathCollection::find_all_matches const string &  path  )  const
 

Returns the complete set of all NodePaths that begin with any NodePath in this collection and can be extended by path.

The shortest paths will be listed first.

Definition at line 340 of file nodePathCollection.cxx.

int NodePathCollection::get_num_paths  )  const
 

Returns the number of NodePaths in the collection.

Definition at line 267 of file nodePathCollection.cxx.

References FindApproxPath::add_string(), and path.

Referenced by FindApproxLevelEntry::consider_node(), get_path(), is_empty(), operator[](), reparent_to(), and wrt_reparent_to().

NodePath NodePathCollection::get_path int  index  )  const
 

Returns the nth NodePath in the collection.

Definition at line 280 of file nodePathCollection.cxx.

References FindApproxLevel::add_entry(), NodePath::get_max_search_depth(), get_num_paths(), and NodePath::r_find_matches().

Referenced by NodePath::get_children(), is_empty(), operator[](), remove_paths_from(), and wrt_reparent_to().

bool NodePathCollection::has_path const NodePath path  )  const
 

Returns true if the indicated NodePath appears in this collection, false otherwise.

Definition at line 221 of file nodePathCollection.cxx.

References _node_paths.

void NodePathCollection::hide  ) 
 

Hides all NodePaths in the collection.

Definition at line 419 of file nodePathCollection.cxx.

bool NodePathCollection::is_empty  )  const
 

Returns true if there are no NodePaths in the collection, false otherwise.

Definition at line 254 of file nodePathCollection.cxx.

References get_num_paths(), get_path(), indent(), and path.

Referenced by NodePath::get_children().

void NodePathCollection::ls ostream &  out,
int  indent_level = 0
const
 

Lists all the nodes at and below each node in the collection hierarchically.

Definition at line 316 of file nodePathCollection.cxx.

void NodePathCollection::ls  )  const [inline]
 

Lists all the nodes at and below each node in the collection hierarchically.

Definition at line 45 of file nodePathCollection.I.

Referenced by ~NodePathCollection().

void NodePathCollection::operator= const NodePathCollection &  copy  ) 
 

Definition at line 60 of file nodePathCollection.cxx.

References _node_paths, PointerToArray< NodePath >::get_ref_count(), and PointerToArray< NodePath >::v().

NodePath NodePathCollection::operator[] int  index  )  const
 

Returns the nth NodePath in the collection.

This is the same as get_path(), but it may be a more convenient way to access it.

Definition at line 299 of file nodePathCollection.cxx.

References get_num_paths(), get_path(), and NodePath::reparent_to().

void NodePathCollection::output ostream &  out  )  const
 

Writes a brief one-line description of the NodePathCollection to the indicated output stream.

Definition at line 466 of file nodePathCollection.cxx.

void NodePathCollection::remove_duplicate_paths  ) 
 

Removes any duplicate entries of the same NodePaths on this collection.

If a NodePath appears multiple times, the first appearance is retained; subsequent appearances are removed.

Definition at line 190 of file nodePathCollection.cxx.

bool NodePathCollection::remove_path const NodePath node_path  ) 
 

Removes the indicated NodePath from the collection.

Returns true if the path was removed, false if it was not a member of the collection.

Definition at line 101 of file nodePathCollection.cxx.

References _node_paths, and PointerToArray< NodePath >::v().

void NodePathCollection::remove_paths_from const NodePathCollection &  other  ) 
 

Removes from this collection all of the NodePaths listed in the other collection.

Definition at line 163 of file nodePathCollection.cxx.

References get_path(), and path.

void NodePathCollection::reparent_to const NodePath other  ) 
 

Reparents all the NodePaths in the collection to the indicated node.

Definition at line 370 of file nodePathCollection.cxx.

References get_num_paths().

void NodePathCollection::show  ) 
 

Shows all NodePaths in the collection.

Definition at line 404 of file nodePathCollection.cxx.

void NodePathCollection::stash  ) 
 

Stashes all NodePaths in the collection.

Definition at line 434 of file nodePathCollection.cxx.

void NodePathCollection::unstash  ) 
 

Unstashes all NodePaths in the collection.

Definition at line 449 of file nodePathCollection.cxx.

void NodePathCollection::write ostream &  out,
int  indent_level = 0
const
 

Writes a complete multi-line description of the NodePathCollection to the indicated output stream.

Definition at line 485 of file nodePathCollection.cxx.

void NodePathCollection::wrt_reparent_to const NodePath other  ) 
 

Reparents all the NodePaths in the collection to the indicated node, adjusting each transform so as not to move in world coordinates.

Definition at line 389 of file nodePathCollection.cxx.

References get_num_paths(), get_path(), and indent().


Member Data Documentation

NodePaths NodePathCollection::_node_paths [private]
 

Definition at line 80 of file nodePathCollection.h.

Referenced by add_path(), clear(), has_path(), NodePathCollection(), operator=(), and remove_path().


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