MCPcopy Create free account
hub / github.com/comaps/comaps / AddPoint

Method AddPoint

libs/geometry/spline.cpp:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25SplineEx::SplineEx(size_t reservedSize) : Spline(reservedSize) {}
26
27void 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
47void Spline::ReplacePoint(PointD const & pt)
48{

Callers 4

ClipPathByRectImplFunction · 0.45
UNIT_TESTFunction · 0.45
ConstructSplineListFunction · 0.45
UNIT_TESTFunction · 0.45

Calls 4

backMethod · 0.80
IsAlmostZeroMethod · 0.80
LengthMethod · 0.45
push_backMethod · 0.45

Tested by 3

UNIT_TESTFunction · 0.36
ConstructSplineListFunction · 0.36
UNIT_TESTFunction · 0.36