00001 00005 #pragma once 00006 00007 #include <Eigen/Core> 00008 00009 // unique_ptr 00010 #include <memory> 00011 #include "../iterators/submap_iterator.hpp" 00012 #include "../cost_map.hpp" 00013 00014 namespace cost_map { 00015 00019 class CircleIterator 00020 { 00021 public: 00022 00029 CircleIterator(const CostMap& gridMap, const Position& center, const double radius); 00030 00036 CircleIterator& operator =(const CircleIterator& other); 00037 00042 bool operator !=(const CircleIterator& other) const; 00043 00048 const Index& operator *() const; 00049 00054 CircleIterator& operator ++(); 00055 00060 bool isPastEnd() const; 00061 00062 private: 00063 00068 bool isInside() const; 00069 00077 void findSubmapParameters(const Position& center, const double radius, 00078 Index& startIndex, Size& bufferSize) const; 00079 00081 Position center_; 00082 00084 double radius_; 00085 00087 double radiusSquare_; 00088 00090 std::shared_ptr<SubmapIterator> internalIterator_; 00091 00093 Length mapLength_; 00094 Position mapPosition_; 00095 double resolution_; 00096 Size bufferSize_; 00097 Index bufferStartIndex_; 00098 }; 00099 00100 } /* namespace */