| 75 | } |
| 76 | |
| 77 | void PolygonIterator::findSubmapParameters(const grid_map::Polygon& polygon, Index& startIndex, Size& bufferSize) const |
| 78 | { |
| 79 | Position topLeft = polygon_.getVertices()[0]; |
| 80 | Position bottomRight = topLeft; |
| 81 | for (const auto& vertex : polygon_.getVertices()) { |
| 82 | topLeft = topLeft.array().max(vertex.array()); |
| 83 | bottomRight = bottomRight.array().min(vertex.array()); |
| 84 | } |
| 85 | boundPositionToRange(topLeft, mapLength_, mapPosition_); |
| 86 | boundPositionToRange(bottomRight, mapLength_, mapPosition_); |
| 87 | getIndexFromPosition(startIndex, topLeft, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_); |
| 88 | Index endIndex; |
| 89 | getIndexFromPosition(endIndex, bottomRight, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_); |
| 90 | bufferSize = getSubmapSizeFromCornerIndeces(startIndex, endIndex, bufferSize_, bufferStartIndex_); |
| 91 | } |
| 92 | |
| 93 | } /* namespace grid_map */ |
| 94 |
nothing calls this directly
no test coverage detected