Go to the documentation of this file.00001
00005 #pragma once
00006
00007 #include <Eigen/Core>
00008 #include "../iterators/submap_iterator.hpp"
00009 #include "../cost_map.hpp"
00010
00011 namespace cost_map {
00012
00017 class LineIterator
00018 {
00019 public:
00020
00027 LineIterator(const cost_map::CostMap& gridMap, const Position& start, const Position& end);
00028
00035 LineIterator(const cost_map::CostMap& gridMap, const Index& start, const Index& end);
00036
00042 LineIterator& operator =(const LineIterator& other);
00043
00048 bool operator !=(const LineIterator& other) const;
00049
00054 const Index& operator *() const;
00055
00060 LineIterator& operator ++();
00061
00066 bool isPastEnd() const;
00067
00068 private:
00076 bool initialize(const cost_map::CostMap& cost_map, const Index& start, const Index& end);
00077
00086 bool getIndexLimitedToMapRange(const cost_map::CostMap& cost_map, const Position& start,
00087 const Position& end, Index& index);
00088
00092 void initializeIterationParameters();
00093
00095 Index index_;
00096
00098 Index start_;
00099
00101 Index end_;
00102
00104 unsigned int iCell_;
00105
00107 unsigned int nCells_;
00108
00110 Size increment1_, increment2_;
00111 int denominator_, numerator_, numeratorAdd_;
00112
00114 Length mapLength_;
00115 Position mapPosition_;
00116 double resolution_;
00117 Size bufferSize_;
00118 Index bufferStartIndex_;
00119 };
00120
00121 }