| 278 | } |
| 279 | |
| 280 | bool Polygon::isCentroidAroundPosition(const Transform::UnitVector& position, |
| 281 | const Transform::UnitVector& tolerance) const |
| 282 | { |
| 283 | const Transform::UnitVector pVec = position.to<Transform::Units::SceneUnits>(); |
| 284 | const Transform::UnitVector pTolerance |
| 285 | = tolerance.to<Transform::Units::SceneUnits>(); |
| 286 | const Transform::UnitVector centroid = this->getCentroid(); |
| 287 | if (Utils::Math::isBetween( |
| 288 | pVec.x, centroid.x - pTolerance.x, centroid.x + pTolerance.x)) |
| 289 | { |
| 290 | if (Utils::Math::isBetween( |
| 291 | pVec.y, centroid.y - pTolerance.x, centroid.y + pTolerance.y)) |
| 292 | return true; |
| 293 | } |
| 294 | return false; |
| 295 | } |
| 296 | |
| 297 | PolygonSegment Polygon::getSegment(const point_index_t segment) |
| 298 | { |
no test coverage detected