| 92 | } |
| 93 | |
| 94 | void Polygon::addPoint(const Transform::UnitVector& position, int pointIndex) |
| 95 | { |
| 96 | const Transform::UnitVector pVec = position.to<Transform::Units::SceneUnits>(); |
| 97 | if (pointIndex == -1 || pointIndex == m_points.size()) |
| 98 | m_points.push_back( |
| 99 | std::make_unique<PolygonPoint>(*this, m_points.size(), pVec)); |
| 100 | else if (pointIndex >= 0 && pointIndex < m_points.size()) |
| 101 | { |
| 102 | m_points.insert(m_points.begin() + pointIndex, |
| 103 | std::make_unique<PolygonPoint>(*this, pointIndex, pVec)); |
| 104 | for (point_index_t i = pointIndex; i < m_points.size(); i++) |
| 105 | m_points[i]->rw_index = i; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | PolygonPoint& Polygon::findClosestPoint(const Transform::UnitVector& position, |
| 110 | bool neighbor, const std::vector<point_index_t>& excludedPoints) |
no test coverage detected