Public Member Functions | Private Member Functions | Private Attributes | List of all members
grid_map::CircleIterator Class Reference

#include <CircleIterator.hpp>

Public Member Functions

 CircleIterator (const GridMap &gridMap, const Position &center, const double radius)
 
bool isPastEnd () const
 
bool operator!= (const CircleIterator &other) const
 
const Indexoperator* () const
 
CircleIteratoroperator++ ()
 
CircleIteratoroperator= (const CircleIterator &other)
 

Private Member Functions

void findSubmapParameters (const Position &center, const double radius, Index &startIndex, Size &bufferSize) const
 
bool isInside () const
 

Private Attributes

Size bufferSize_
 
Index bufferStartIndex_
 
Position center_
 Position of the circle center;. More...
 
std::shared_ptr< SubmapIteratorinternalIterator_
 Grid submap iterator. // TODO Think of using unique_ptr instead. More...
 
Length mapLength_
 Map information needed to get position from iterator. More...
 
Position mapPosition_
 
double radius_
 Radius of the circle. More...
 
double radiusSquare_
 Square of the radius (for efficiency). More...
 
double resolution_
 

Detailed Description

Iterator class to iterate through a circular area of the map.

Definition at line 23 of file CircleIterator.hpp.

Constructor & Destructor Documentation

grid_map::CircleIterator::CircleIterator ( const GridMap gridMap,
const Position center,
const double  radius 
)

Constructor.

Parameters
gridMapthe grid map to iterate on.
centerthe position of the circle center.
radiusthe radius of the circle.

Definition at line 16 of file CircleIterator.cpp.

Member Function Documentation

void grid_map::CircleIterator::findSubmapParameters ( const Position center,
const double  radius,
Index startIndex,
Size bufferSize 
) const
private

Finds the submap that fully contains the circle and returns the parameters.

Parameters
[in]centerthe position of the circle center.
[in]radiusthe radius of the circle.
[out]startIndexthe start index of the submap.
[out]bufferSizethe buffer size of the submap.

Definition at line 82 of file CircleIterator.cpp.

bool grid_map::CircleIterator::isInside ( ) const
private

Check if current index is inside the circle.

Returns
true if inside, false otherwise.

Definition at line 74 of file CircleIterator.cpp.

bool grid_map::CircleIterator::isPastEnd ( ) const

Indicates if iterator is past end.

Returns
true if iterator is out of scope, false if end has not been reached.

Definition at line 69 of file CircleIterator.cpp.

bool grid_map::CircleIterator::operator!= ( const CircleIterator other) const

Compare to another iterator.

Returns
whether the current iterator points to a different address than the other one.

Definition at line 47 of file CircleIterator.cpp.

const Index & grid_map::CircleIterator::operator* ( ) const

Dereference the iterator with const.

Returns
the value to which the iterator is pointing.

Definition at line 52 of file CircleIterator.cpp.

CircleIterator & grid_map::CircleIterator::operator++ ( )

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Definition at line 57 of file CircleIterator.cpp.

CircleIterator & grid_map::CircleIterator::operator= ( const CircleIterator other)

Assignment operator.

Parameters
iteratorthe iterator to copy data from.
Returns
a reference to *this.

Definition at line 33 of file CircleIterator.cpp.

Member Data Documentation

Size grid_map::CircleIterator::bufferSize_
private

Definition at line 100 of file CircleIterator.hpp.

Index grid_map::CircleIterator::bufferStartIndex_
private

Definition at line 101 of file CircleIterator.hpp.

Position grid_map::CircleIterator::center_
private

Position of the circle center;.

Definition at line 85 of file CircleIterator.hpp.

std::shared_ptr<SubmapIterator> grid_map::CircleIterator::internalIterator_
private

Grid submap iterator. // TODO Think of using unique_ptr instead.

Definition at line 94 of file CircleIterator.hpp.

Length grid_map::CircleIterator::mapLength_
private

Map information needed to get position from iterator.

Definition at line 97 of file CircleIterator.hpp.

Position grid_map::CircleIterator::mapPosition_
private

Definition at line 98 of file CircleIterator.hpp.

double grid_map::CircleIterator::radius_
private

Radius of the circle.

Definition at line 88 of file CircleIterator.hpp.

double grid_map::CircleIterator::radiusSquare_
private

Square of the radius (for efficiency).

Definition at line 91 of file CircleIterator.hpp.

double grid_map::CircleIterator::resolution_
private

Definition at line 99 of file CircleIterator.hpp.


The documentation for this class was generated from the following files:


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Tue Jun 25 2019 20:02:08