00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FINDAPPROXLEVELENTRY_H
00016 #define FINDAPPROXLEVELENTRY_H
00017
00018 #include "pandabase.h"
00019
00020 #include "findApproxPath.h"
00021 #include "workingNodePath.h"
00022
00023 class NodePathCollection;
00024
00025
00026
00027
00028
00029
00030
00031
00032 class FindApproxLevelEntry {
00033 public:
00034 INLINE FindApproxLevelEntry(const WorkingNodePath &node_path,
00035 FindApproxPath &approx_path);
00036 INLINE FindApproxLevelEntry(const FindApproxLevelEntry &parent,
00037 PandaNode *child_node, int i,
00038 FindApproxLevelEntry *next);
00039 INLINE FindApproxLevelEntry(const FindApproxLevelEntry ©);
00040 INLINE void operator = (const FindApproxLevelEntry ©);
00041 ALLOC_DELETED_CHAIN(FindApproxLevelEntry);
00042
00043 INLINE bool next_is_stashed(int increment) const;
00044
00045 bool consider_node(NodePathCollection &result,
00046 FindApproxLevelEntry *&next_level,
00047 int max_matches, int increment) const;
00048 void consider_next_step(PandaNode *child_node,
00049 FindApproxLevelEntry *&next_level,
00050 int increment) const;
00051 INLINE bool is_solution(int increment) const;
00052
00053 void output(ostream &out) const;
00054 void write_level(ostream &out, int indent_level) const;
00055
00056
00057
00058 WorkingNodePath _node_path;
00059
00060
00061
00062
00063
00064 int _i;
00065 FindApproxPath &_approx_path;
00066 FindApproxLevelEntry *_next;
00067
00068 public:
00069 static TypeHandle get_class_type() {
00070 return _type_handle;
00071 }
00072 static void init_type() {
00073 register_type(_type_handle, "FindApproxLevelEntry");
00074 }
00075
00076 private:
00077 static TypeHandle _type_handle;
00078 };
00079
00080 INLINE ostream &
00081 operator << (ostream &out, const FindApproxLevelEntry &entry) {
00082 entry.output(out);
00083 return out;
00084 }
00085
00086 #include "findApproxLevelEntry.I"
00087
00088 #endif