| 82 | } |
| 83 | |
| 84 | void SlidingWindowIterator::setup(const GridMap& gridMap) |
| 85 | { |
| 86 | if (!gridMap.isDefaultStartIndex()) throw std::runtime_error( |
| 87 | "SlidingWindowIterator cannot be used with grid maps that don't have a default buffer start index."); |
| 88 | if (windowSize_ % 2 == 0) throw std::runtime_error( |
| 89 | "SlidingWindowIterator has a wrong window size!"); |
| 90 | windowMargin_ = (windowSize_ - 1) / 2; |
| 91 | |
| 92 | if (edgeHandling_ == EdgeHandling::INSIDE) { |
| 93 | if (!dataInsideMap()) { |
| 94 | operator++(); |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | bool SlidingWindowIterator::dataInsideMap() const |
| 100 | { |
nothing calls this directly
no test coverage detected