LineIterator.hpp
Go to the documentation of this file.
1 /*
2  * LineIterator.hpp
3  *
4  * Created on: Nov 13, 2014
5  * Author: Péter Fankhauser
6  * Institute: ETH Zurich, ANYbotics
7  */
8 
9 #pragma once
10 
13 
14 #include <Eigen/Core>
15 
16 namespace grid_map {
17 
23 {
24 public:
25 
32  LineIterator(const grid_map::GridMap& gridMap, const Position& start, const Position& end);
33 
40  LineIterator(const grid_map::GridMap& gridMap, const Index& start, const Index& end);
41 
47  LineIterator& operator =(const LineIterator& other);
48 
53  bool operator !=(const LineIterator& other) const;
54 
59  const Index& operator *() const;
60 
66 
71  bool isPastEnd() const;
72 
73 private:
74 
75 
83  bool initialize(const grid_map::GridMap& gridMap, const Index& start, const Index& end);
84 
89 
98  bool getIndexLimitedToMapRange(const grid_map::GridMap& gridMap, const Position& start,
99  const Position& end, Index& index);
100 
103 
106 
109 
111  unsigned int iCell_;
112 
114  unsigned int nCells_;
115 
119 
123  double resolution_;
126 
127  public:
128  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
129 };
130 
131 } /* namespace */
Eigen::Array2i Index
Definition: TypeDefs.hpp:22
unsigned int iCell_
Current cell number.
unsigned int nCells_
Number of cells in the line.
Eigen::Array2i Size
Definition: TypeDefs.hpp:23
Index end_
Ending index of the line.
LineIterator(const grid_map::GridMap &gridMap, const Position &start, const Position &end)
bool operator!=(const LineIterator &other) const
const Index & operator*() const
Length mapLength_
Map information needed to get position from iterator.
bool getIndexLimitedToMapRange(const grid_map::GridMap &gridMap, const Position &start, const Position &end, Index &index)
Eigen::Vector2d Position
Definition: TypeDefs.hpp:18
LineIterator & operator++()
Size increment1_
Helper variables for Bresenham Line Drawing algorithm.
Index start_
Starting index of the line.
bool initialize(const grid_map::GridMap &gridMap, const Index &start, const Index &end)
Eigen::Array2d Length
Definition: TypeDefs.hpp:24
LineIterator & operator=(const LineIterator &other)
Index index_
Current index.
bool isPastEnd() const


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