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

panda/src/pgraph/findApproxLevelEntry.h

Go to the documentation of this file.
00001 // Filename: findApproxLevelEntry.h
00002 // Created by:  drose (13Mar02)
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 FINDAPPROXLEVELENTRY_H
00020 #define FINDAPPROXLEVELENTRY_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "findApproxPath.h"
00025 #include "workingNodePath.h"
00026 
00027 class FindApproxLevel;
00028 class NodePathCollection;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : FindApproxLevelEntry
00032 // Description : This class is local to this package only; it doesn't
00033 //               get exported.  It represents a single node under
00034 //               consideration for matching at a single point in the
00035 //               breadth-first search.
00036 ////////////////////////////////////////////////////////////////////
00037 class FindApproxLevelEntry {
00038 public:
00039   INLINE FindApproxLevelEntry(const WorkingNodePath &node_path,
00040                               FindApproxPath &approx_path);
00041   INLINE FindApproxLevelEntry(const FindApproxLevelEntry &copy, int increment = 0);
00042   INLINE void operator = (const FindApproxLevelEntry &copy);
00043 
00044   INLINE bool next_is_stashed(int increment) const;
00045 
00046   void consider_node(NodePathCollection &result, FindApproxLevel &next_level,
00047                      int max_matches, int increment) const;
00048   void consider_next_step(NodePathCollection &result,
00049                           PandaNode *child_node, FindApproxLevel &next_level,
00050                           int max_matches, int increment) const;
00051   INLINE bool is_solution(int increment) const;
00052 
00053   void output(ostream &out) const;
00054 
00055   // _node_path represents the most recent node that we have
00056   // previously accepted as being a partial solution.
00057   WorkingNodePath _node_path;
00058 
00059   // _i represents the next component in the approx_path that must be
00060   // matched against all of the children of _node_path, above.  If _i
00061   // refers to the end of the approx_path, then _node_path is a
00062   // solution.
00063   int _i;
00064   FindApproxPath &_approx_path;
00065 };
00066 
00067 INLINE ostream &
00068 operator << (ostream &out, const FindApproxLevelEntry &entry) {
00069   entry.output(out);
00070   return out;
00071 }
00072 
00073 #include "findApproxLevelEntry.I"
00074 
00075 #endif

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