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

#include <PolygonIterator.hpp>

Public Member Functions

bool isPastEnd () const
 
bool operator!= (const PolygonIterator &other) const
 
const Indexoperator* () const
 
PolygonIteratoroperator++ ()
 
 PolygonIterator (const grid_map::GridMap &gridMap, const grid_map::Polygon &polygon)
 

Private Member Functions

void findSubmapParameters (const grid_map::Polygon &polygon, Index &startIndex, Size &bufferSize) const
 
bool isInside () const
 

Private Attributes

Size bufferSize_
 
Index bufferStartIndex_
 
std::shared_ptr< SubmapIteratorinternalIterator_
 Grid submap iterator. More...
 
Length mapLength_
 Map information needed to get position from iterator. More...
 
Position mapPosition_
 
grid_map::Polygon polygon_
 Polygon to iterate on. More...
 
double resolution_
 

Detailed Description

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

Definition at line 22 of file PolygonIterator.hpp.

Constructor & Destructor Documentation

◆ PolygonIterator()

grid_map::PolygonIterator::PolygonIterator ( const grid_map::GridMap gridMap,
const grid_map::Polygon polygon 
)

Constructor.

Parameters
gridMapthe grid map to iterate on.
polygonthe polygonal area to iterate on.

Definition at line 16 of file PolygonIterator.cpp.

Member Function Documentation

◆ findSubmapParameters()

void grid_map::PolygonIterator::findSubmapParameters ( const grid_map::Polygon polygon,
Index startIndex,
Size bufferSize 
) const
private

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

Parameters
[in]polygonthe polygon to get the submap for.
[out]startIndexthe start index of the submap.
[out]bufferSizethe buffer size of the submap.

Definition at line 71 of file PolygonIterator.cpp.

◆ isInside()

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

Check if current index is inside polygon.

Returns
true if inside, false otherwise.

Definition at line 64 of file PolygonIterator.cpp.

◆ isPastEnd()

bool grid_map::PolygonIterator::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 59 of file PolygonIterator.cpp.

◆ operator!=()

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

Compare to another iterator.

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

Definition at line 33 of file PolygonIterator.cpp.

◆ operator*()

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

Dereference the iterator with const.

Returns
the value to which the iterator is pointing.

Definition at line 38 of file PolygonIterator.cpp.

◆ operator++()

PolygonIterator & grid_map::PolygonIterator::operator++ ( )

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Definition at line 43 of file PolygonIterator.cpp.

Member Data Documentation

◆ bufferSize_

Size grid_map::PolygonIterator::bufferSize_
private

Definition at line 83 of file PolygonIterator.hpp.

◆ bufferStartIndex_

Index grid_map::PolygonIterator::bufferStartIndex_
private

Definition at line 84 of file PolygonIterator.hpp.

◆ internalIterator_

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

Grid submap iterator.

Definition at line 77 of file PolygonIterator.hpp.

◆ mapLength_

Length grid_map::PolygonIterator::mapLength_
private

Map information needed to get position from iterator.

Definition at line 80 of file PolygonIterator.hpp.

◆ mapPosition_

Position grid_map::PolygonIterator::mapPosition_
private

Definition at line 81 of file PolygonIterator.hpp.

◆ polygon_

grid_map::Polygon grid_map::PolygonIterator::polygon_
private

Polygon to iterate on.

Definition at line 74 of file PolygonIterator.hpp.

◆ resolution_

double grid_map::PolygonIterator::resolution_
private

Definition at line 82 of file PolygonIterator.hpp.


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


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Wed Jul 5 2023 02:23:35