00001 // Author: Justin Kinney 00002 // Date: Sep 2008 00003 00004 #ifndef OCTREE_VISITOR_MEASURE_H 00005 #define OCTREE_VISITOR_MEASURE_H 00006 00007 #include "meshmorph.h" 00008 00009 #include "face.h" 00010 #include "Octree.h" 00011 #include <iostream> 00012 00013 using hxa7241_graphics::OctreeVisitor; 00014 using hxa7241_graphics::Vector3r; 00015 using hxa7241_graphics::OctreeCell; 00016 using hxa7241_graphics::OctreeData; 00017 using hxa7241_graphics::Array; 00018 using hxa7241_graphics::OctreeRoot; 00019 using hxa7241_graphics::dword; 00020 using hxa7241_graphics::OctreeBranch; 00021 00022 00023 class Octree_Visitor_Measure 00024 : public OctreeVisitor<Face> 00025 { 00027 public: 00028 Octree_Visitor_Measure(void); 00029 00030 virtual ~Octree_Visitor_Measure(); 00031 00032 int get_max_depth (void) 00033 { 00034 return max_depth; 00035 } 00036 int get_num_leaves (void) 00037 { 00038 return num_leaves; 00039 } 00040 private: 00041 Octree_Visitor_Measure( const Octree_Visitor_Measure& ); 00042 Octree_Visitor_Measure& operator=( const Octree_Visitor_Measure& ); 00043 00044 00047 protected: 00048 virtual void visitRoot ( const OctreeCell* pRootCell, 00049 const OctreeData& octreeData ); 00050 virtual void visitBranch( const OctreeCell* subCells[8], 00051 const OctreeData& octreeData ); 00052 virtual void visitLeaf ( const Array<const Face*>& items, 00053 const OctreeData& octreeData ); 00054 00055 // any other commands ... 00056 00057 00059 // any queries ... 00060 00061 00063 private: 00064 int max_depth; 00065 int num_leaves; 00066 }; 00067 00068 #endif