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 
48  LineIterator& operator =(const LineIterator& other);
49 
54  bool operator !=(const LineIterator& other) const;
55 
60  const Index& operator *() const;
61 
67 
72  bool isPastEnd() const;
73 
74 private:
75 
76 
84  bool initialize(const grid_map::GridMap& gridMap, const Index& start, const Index& end);
85 
90 
99  bool getIndexLimitedToMapRange(const grid_map::GridMap& gridMap, const Position& start,
100  const Position& end, Index& index);
101 
104 
107 
110 
112  unsigned int iCell_ = 0;
113 
115  unsigned int nCells_ = 0;
116 
120 
124  double resolution_;
127 
128  public:
129  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
130 };
131 
132 } /* 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 1 2021 02:13:27