GridIterator.h
00001 #ifndef gridripper_amr1d_GridIterator_h
00002 #define gridripper_amr1d_GridIterator_h
00003
00004 namespace gridripper { namespace amr1d {
00005
00006 class Grid;
00007
00015 class GridIterator
00016 {
00017 private:
00018 const Grid* topGrid;
00019 const Grid* currentGrid;
00020 int currentIndex;
00021 int refinementRatio;
00022
00023 public:
00024 GridIterator(const GridIterator& it) {
00025 currentGrid = it.currentGrid;
00026 topGrid = it.topGrid;
00027 currentIndex = it.currentIndex;
00028 refinementRatio = it.refinementRatio;
00029 }
00030
00031 GridIterator(const Grid* g, const Grid* top);
00032
00033 int count();
00034
00035 const Grid* getGrid() {
00036 return currentGrid;
00037 }
00038
00039 double getLocationX();
00040
00041 int getLocationI() {
00042 return currentIndex;
00043 }
00044
00045 bool next();
00046 };
00047
00048 } }
00049
00050 #endif