16 CircleIterator::CircleIterator(
const GridMap& gridMap,
const Position& center,
const double radius)
26 Index submapStartIndex;
27 Index submapBufferSize;
54 return *(*internalIterator_);
59 ++(*internalIterator_);
78 double squareNorm = (position -
center_).array().square().sum();
83 Index& startIndex,
Size& bufferSize)
const 85 Position topLeft = center.array() + radius;
86 Position bottomRight = center.array() - radius;
const Length & getLength() const
double radiusSquare_
Square of the radius (for efficiency).
bool operator!=(const CircleIterator &other) const
double radius_
Radius of the circle.
const Index & getStartIndex() const
bool getPosition(const Index &index, Position &position) const
Position center_
Position of the circle center;.
const Index & operator*() const
CircleIterator & operator++()
bool getIndexFromPosition(Index &index, const Position &position, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
double getResolution() const
void findSubmapParameters(const Position ¢er, const double radius, Index &startIndex, Size &bufferSize) const
Size getSubmapSizeFromCornerIndeces(const Index &topLeftIndex, const Index &bottomRightIndex, const Size &bufferSize, const Index &bufferStartIndex)
CircleIterator & operator=(const CircleIterator &other)
bool getPositionFromIndex(Position &position, const Index &index, const Length &mapLength, const Position &mapPosition, const double &resolution, const Size &bufferSize, const Index &bufferStartIndex=Index::Zero())
void boundPositionToRange(Position &position, const Length &mapLength, const Position &mapPosition)
Length mapLength_
Map information needed to get position from iterator.
std::shared_ptr< SubmapIterator > internalIterator_
Grid submap iterator. // TODO Think of using unique_ptr instead.
const Size & getSize() const