Public Member Functions | Private Member Functions | Private Attributes
cost_map::LineIterator Class Reference

#include <line_iterator.hpp>

List of all members.

Public Member Functions

bool isPastEnd () const
 LineIterator (const cost_map::CostMap &gridMap, const Position &start, const Position &end)
 LineIterator (const cost_map::CostMap &gridMap, const Index &start, const Index &end)
bool operator!= (const LineIterator &other) const
const Indexoperator* () const
LineIteratoroperator++ ()
LineIteratoroperator= (const LineIterator &other)

Private Member Functions

bool getIndexLimitedToMapRange (const cost_map::CostMap &cost_map, const Position &start, const Position &end, Index &index)
bool initialize (const cost_map::CostMap &cost_map, const Index &start, const Index &end)
void initializeIterationParameters ()

Private Attributes

Size bufferSize_
Index bufferStartIndex_
int denominator_
Index end_
 Ending index of the line.
unsigned int iCell_
 Current cell number.
Size increment1_
 Helper variables for Bresenham Line Drawing algorithm.
Size increment2_
Index index_
 Current index.
Length mapLength_
 Map information needed to get position from iterator.
Position mapPosition_
unsigned int nCells_
 Number of cells in the line.
int numerator_
int numeratorAdd_
double resolution_
Index start_
 Starting index of the line.

Detailed Description

Iterator class to iterate over a line in the map. Based on Bresenham Line Drawing algorithm.

Definition at line 17 of file line_iterator.hpp.


Constructor & Destructor Documentation

cost_map::LineIterator::LineIterator ( const cost_map::CostMap gridMap,
const Position start,
const Position end 
)

Constructor.

Parameters:
gridMapthe grid map to iterate on.
startthe starting point of the line.
endthe ending point of the line.

Definition at line 16 of file src/lib/iterators/line_iterator.cpp.

cost_map::LineIterator::LineIterator ( const cost_map::CostMap gridMap,
const Index start,
const Index end 
)

Constructor.

Parameters:
gridMapthe grid map to iterate on.
startthe starting index of the line.
endthe ending index of the line.

Definition at line 26 of file src/lib/iterators/line_iterator.cpp.


Member Function Documentation

bool cost_map::LineIterator::getIndexLimitedToMapRange ( const cost_map::CostMap cost_map,
const Position start,
const Position end,
Index index 
) [private]

Finds the index of a position on a line within the limits of the map.

Parameters:
[in]cost_mapthe grid map that defines the map boundaries.
[in]startthe position that will be limited to the map range.
[in]endthe ending position of the line.
[out]indexthe index of the moved start position.
Returns:
true if successful, false otherwise.

Definition at line 93 of file src/lib/iterators/line_iterator.cpp.

bool cost_map::LineIterator::initialize ( const cost_map::CostMap cost_map,
const Index start,
const Index end 
) [private]

Construct function.

Parameters:
cost_mapthe grid map to iterate on.
startthe starting index of the line.
endthe ending index of the line.
Returns:
true if successful, false otherwise.

Definition at line 78 of file src/lib/iterators/line_iterator.cpp.

Computes the parameters requires for the line drawing algorithm.

Definition at line 107 of file src/lib/iterators/line_iterator.cpp.

Indicates if iterator is past end.

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

Definition at line 73 of file src/lib/iterators/line_iterator.cpp.

bool cost_map::LineIterator::operator!= ( const LineIterator other) const

Compare to another iterator.

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

Definition at line 51 of file src/lib/iterators/line_iterator.cpp.

const Index & cost_map::LineIterator::operator* ( ) const

Dereference the iterator with const.

Returns:
the value to which the iterator is pointing.

Definition at line 56 of file src/lib/iterators/line_iterator.cpp.

LineIterator & cost_map::LineIterator::operator++ ( )

Increase the iterator to the next element.

Returns:
a reference to the updated iterator.

Definition at line 61 of file src/lib/iterators/line_iterator.cpp.

LineIterator & cost_map::LineIterator::operator= ( const LineIterator other)

Assignment operator.

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

Definition at line 31 of file src/lib/iterators/line_iterator.cpp.


Member Data Documentation

Definition at line 117 of file line_iterator.hpp.

Definition at line 118 of file line_iterator.hpp.

Definition at line 111 of file line_iterator.hpp.

Ending index of the line.

Definition at line 101 of file line_iterator.hpp.

unsigned int cost_map::LineIterator::iCell_ [private]

Current cell number.

Definition at line 104 of file line_iterator.hpp.

Helper variables for Bresenham Line Drawing algorithm.

Definition at line 110 of file line_iterator.hpp.

Definition at line 110 of file line_iterator.hpp.

Current index.

Definition at line 95 of file line_iterator.hpp.

Map information needed to get position from iterator.

Definition at line 114 of file line_iterator.hpp.

Definition at line 115 of file line_iterator.hpp.

unsigned int cost_map::LineIterator::nCells_ [private]

Number of cells in the line.

Definition at line 107 of file line_iterator.hpp.

Definition at line 111 of file line_iterator.hpp.

Definition at line 111 of file line_iterator.hpp.

Definition at line 116 of file line_iterator.hpp.

Starting index of the line.

Definition at line 98 of file line_iterator.hpp.


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


cost_map_core
Author(s): Daniel Stonier
autogenerated on Thu Jun 6 2019 20:27:46