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

panda/src/pgraph/nodePathCollection.h

Go to the documentation of this file.
00001 // Filename: nodePathCollection.h
00002 // Created by:  drose (06Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef NODEPATHCOLLECTION_H
00020 #define NODEPATHCOLLECTION_H
00021 
00022 #include "pandabase.h"
00023 #include "nodePath.h"
00024 #include "pointerToArray.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : NodePathCollection
00028 // Description : This is a set of zero or more NodePaths.  It's handy
00029 //               for returning from functions that need to return
00030 //               multiple NodePaths (for instance,
00031 //               NodePaths::get_children).
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDA NodePathCollection {
00034 PUBLISHED:
00035   NodePathCollection();
00036   NodePathCollection(const NodePathCollection &copy);
00037   void operator = (const NodePathCollection &copy);
00038   INLINE ~NodePathCollection();
00039 
00040   void add_path(const NodePath &node_path);
00041   bool remove_path(const NodePath &node_path);
00042   void add_paths_from(const NodePathCollection &other);
00043   void remove_paths_from(const NodePathCollection &other);
00044   void remove_duplicate_paths();
00045   bool has_path(const NodePath &path) const;
00046   void clear();
00047 
00048   bool is_empty() const;
00049   int get_num_paths() const;
00050   NodePath get_path(int index) const;
00051   NodePath operator [] (int index) const;
00052 
00053   // Handy operations on many NodePaths at once.
00054   INLINE void ls() const;
00055   void ls(ostream &out, int indent_level = 0) const;
00056 
00057   NodePathCollection find_all_matches(const string &path) const;
00058   void reparent_to(const NodePath &other);
00059   void wrt_reparent_to(const NodePath &other);
00060 
00061   void show();
00062   void hide();
00063   void stash();
00064   void unstash();
00065 
00066   void output(ostream &out) const;
00067   void write(ostream &out, int indent_level = 0) const;
00068 
00069 private:
00070   typedef PTA(NodePath) NodePaths;
00071   NodePaths _node_paths;
00072 };
00073 
00074 INLINE ostream &operator << (ostream &out, const NodePathCollection &col) {
00075   col.output(out);
00076   return out;
00077 }
00078 
00079 #include "nodePathCollection.I"
00080 
00081 #endif
00082 
00083 

Generated on Fri May 2 00:41:59 2003 for Panda by doxygen1.3