Changeset 1288 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
- Timestamp:
- 08/28/06 03:42:51 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1287 r1288 59 59 60 60 61 62 /** View space partition statistics. 63 */ 64 class HierarchyStatistics: public StatisticsBase 65 { 66 public: 67 68 /// total number of nodes 69 int nodes; 70 71 /// maximal reached depth 72 int maxDepth; 73 74 /// accumulated depth 75 int accumDepth; 76 77 // Constructor 78 HierarchyStatistics() 79 { 80 Reset(); 81 } 82 83 int Nodes() const {return nodes;} 84 int Interior() const { return nodes / 2; } 85 int Leaves() const { return (nodes / 2) + 1; } 86 87 // TODO: computation wrong 88 double AvgDepth() const { return accumDepth / (double)Leaves();} 89 90 91 void Reset() 92 { 93 nodes = 0; 94 maxDepth = 0; 95 accumDepth = 0; 96 } 97 98 99 void Print(ostream &app) const; 100 101 friend ostream &operator<<(ostream &s, const HierarchyStatistics &stat) 102 { 103 stat.Print(s); 104 return s; 105 } 106 }; 107 108 61 109 typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue; 62 110 … … 213 261 const ObjectContainer &objects); 214 262 263 void ParseEnvironment(); 264 265 215 266 protected: 216 267 … … 235 286 float mTotalCost; 236 287 288 HierarchyStatistics mHierarchyStats; 289 290 int mMaxLeaves; 237 291 ofstream mSubdivisionStats; 238 292 };
Note: See TracChangeset
for help on using the changeset viewer.