CircleIterator.hpp
Go to the documentation of this file.
1 /*
2  * CircleIterator.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 #include <memory>
17 
18 namespace grid_map {
19 
24 {
25 public:
26 
33  CircleIterator(const GridMap& gridMap, const Position& center, double radius);
34 
39  bool operator !=(const CircleIterator& other) const;
40 
45  const Index& operator *() const;
46 
52 
57  bool isPastEnd() const;
58 
59 private:
60 
65  bool isInside() const;
66 
74  void findSubmapParameters(const Position& center, double radius,
75  Index& startIndex, Size& bufferSize) const;
76 
79 
81  double radius_;
82 
84  double radiusSquare_;
85 
87  std::shared_ptr<SubmapIterator> internalIterator_;
88 
92  double resolution_;
95 
96  public:
97  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
98 };
99 
100 } // namespace grid_map
101 
double radiusSquare_
Square of the radius (for efficiency).
void findSubmapParameters(const Position &center, double radius, Index &startIndex, Size &bufferSize) const
double radius_
Radius of the circle.
Position center_
Position of the circle center;.
CircleIterator & operator++()
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
CircleIterator(const GridMap &gridMap, const Position &center, double radius)
bool operator!=(const CircleIterator &other) const
Length mapLength_
Map information needed to get position from iterator.
const Index & operator*() const
std::shared_ptr< SubmapIterator > internalIterator_
Grid submap iterator. // TODO Think of using unique_ptr instead.


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