| 25 | SplineEx::SplineEx(size_t reservedSize) : Spline(reservedSize) {} |
| 26 | |
| 27 | void Spline::AddPoint(PointD const & pt) |
| 28 | { |
| 29 | if (!IsEmpty()) |
| 30 | { |
| 31 | /// @todo remove this check when fix generator. |
| 32 | /// Now we have line objects with zero length segments |
| 33 | /// https://jira.mail.ru/browse/MAPSME-3561 |
| 34 | PointD const dir = pt - m_position.back(); |
| 35 | if (dir.IsAlmostZero()) |
| 36 | return; |
| 37 | |
| 38 | double const len = dir.Length(); |
| 39 | ASSERT_GREATER(len, 0, ()); |
| 40 | m_length.push_back(len); |
| 41 | m_direction.push_back(dir / len); |
| 42 | } |
| 43 | |
| 44 | m_position.push_back(pt); |
| 45 | } |
| 46 | |
| 47 | void Spline::ReplacePoint(PointD const & pt) |
| 48 | { |