00001 /* 00002 * SubmapIterator.hpp 00003 * 00004 * Created on: Sep 12, 2014 00005 * Author: Péter Fankhauser 00006 * Institute: ETH Zurich, Autonomous Systems Lab 00007 */ 00008 00009 #pragma once 00010 00011 #include "grid_map_core/GridMap.hpp" 00012 #include "grid_map_core/SubmapGeometry.hpp" 00013 #include "grid_map_core/BufferRegion.hpp" 00014 00015 #include <Eigen/Core> 00016 00017 namespace grid_map { 00018 00024 class SubmapIterator 00025 { 00026 public: 00027 00032 SubmapIterator(const grid_map::SubmapGeometry& submap); 00033 00038 SubmapIterator(const grid_map::GridMap& gridMap, const grid_map::BufferRegion& bufferRegion); 00039 00046 SubmapIterator(const grid_map::GridMap& gridMap, const Index& submapStartIndex, 00047 const Size& submapSize); 00048 00053 SubmapIterator(const SubmapIterator* other); 00054 00060 SubmapIterator& operator =(const SubmapIterator& other); 00061 00066 bool operator !=(const SubmapIterator& other) const; 00067 00072 const Index& operator *() const; 00073 00078 const Index& getSubmapIndex() const; 00079 00084 SubmapIterator& operator ++(); 00085 00090 bool isPastEnd() const; 00091 00096 const Size& getSubmapSize() const; 00097 00098 private: 00099 00101 Size size_; 00102 00104 Index startIndex_; 00105 00107 Index index_; 00108 00110 Size submapSize_; 00111 00113 Index submapStartIndex_; 00114 00116 Index submapIndex_; 00117 00119 bool isPastEnd_; 00120 00121 public: 00122 EIGEN_MAKE_ALIGNED_OPERATOR_NEW 00123 }; 00124 00125 } /* namespace */