| 142 | } |
| 143 | |
| 144 | bool checkIfPositionWithinMap(const Position& position, |
| 145 | const Length& mapLength, |
| 146 | const Position& mapPosition) |
| 147 | { |
| 148 | Vector offset; |
| 149 | getVectorToOrigin(offset, mapLength); |
| 150 | Position positionTransformed = getMapFrameToBufferOrderTransformation().cast<double>() * (position - mapPosition - offset); |
| 151 | |
| 152 | if (positionTransformed.x() >= 0.0 && positionTransformed.y() >= 0.0 |
| 153 | && positionTransformed.x() < mapLength(0) && positionTransformed.y() < mapLength(1)) { |
| 154 | return true; |
| 155 | } |
| 156 | return false; |
| 157 | } |
| 158 | |
| 159 | void getPositionOfDataStructureOrigin(const Position& position, |
| 160 | const Length& mapLength, |