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 
33  LineIterator(const grid_map::GridMap& gridMap, const Position& start, const Position& end);
34 
41  LineIterator(const grid_map::GridMap& gridMap, const Index& start, const Index& end);
42 
47  bool operator !=(const LineIterator& other) const;
48 
53  const Index& operator *() const;
54 
60 
65  bool isPastEnd() const;
66 
67 private:
68 
69 
77  bool initialize(const grid_map::GridMap& gridMap, const Index& start, const Index& end);
78 
83 
92  static bool getIndexLimitedToMapRange(const grid_map::GridMap& gridMap, const Position& start,
93  const Position& end, Index& index);
94 
97 
100 
103 
105  unsigned int iCell_ = 0;
106 
108  unsigned int nCells_ = 0;
109 
113 
117  double resolution_{NAN};
120 
121  public:
122  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
123 };
124 
125 } // namespace grid_map
126 
bool operator!=(const LineIterator &other) const
unsigned int iCell_
Current cell number.
unsigned int nCells_
Number of cells in the line.
Index end_
Ending index of the line.
LineIterator(const grid_map::GridMap &gridMap, const Position &start, const Position &end)
Length mapLength_
Map information needed to get position from iterator.
static bool getIndexLimitedToMapRange(const grid_map::GridMap &gridMap, const Position &start, const Position &end, Index &index)
const Index & operator*() const
Eigen::Vector2d Position
Definition: TypeDefs.hpp:18
Eigen::Array2i Index
Definition: TypeDefs.hpp:22
Eigen::Array2i Size
Definition: TypeDefs.hpp:23
Eigen::Array2d Length
Definition: TypeDefs.hpp:24
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)
void initializeIterationParameters()
Index index_
Current index.


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