tsc_PolylineParts

This class represents the parts that make up a polyline, specifically line parts and arc parts. Methods are provided to create, modify, merge, and iterate over the list.

A polyline always has a "next part start coordinate", which is generally the end point of the last part appended. When a part is appended by specifying its end point, it is drawn from the last end point of the polyline. If the polyline is empty (has zero parts) then we use the start point given to the constructor.

Constructors

explicit tsc_PolylineParts() = default;
explicit tsc_PolylineParts (const tsc_Grid& start);
Constructs an empty set of polyline parts, and optionally a starting point for the first line or arc to be added.

int Count() const;
Returns the number of parts in the polyline.

void Clear() noexcept;
Removes all parts.

void AppendLineTo (const tsc_Grid& end);
Adds a straight line from the previous end point to the supplied end point - which becomes the start for the next part.

void AppendArcTo (const tsc_Grid& mid, const tsc_Grid& end);
Adds an arc to the polyline. The arc is defined by three points; the previous end point, a point on the arc given by mid, and the end point given by end - which comes the next start point.

bool MergeLineInto(const tsc_Grid& start, const tsc_Grid& end, double tol = 0);
All points must have horizontal coordinates.
start and end define the line to be appended. If the start ordinate is not within tol meters of the previous end point then a line is first appended from the previous end point to start.
Returns true if merged (i.e. the additional line was required).  

bool MergeArcInto(const tsc_Grid& start, const tsc_Grid& mid, const tsc_Grid& end, double tol = 0);
All points must have horizontal coordinates.
start, mid, and end define the arc to be appended. If the start ordinate is not within tol meters of the previous end point then a line is first appended from the previous end point to start.
Returns true if merged (i.e. the additional line was required).  

bool CompareExact(const tsc_PolylineParts& rhs) const;
Tests for exact equality of the polyline to rhs. Note that the coordinates of the parts are compared exactly with zero tolerance.

void VisitEach(class tsc_IPolylineVisitor& visitor) const;
Passes geometric data describing each component part of the polyline to visitor.
See tsc_IPolylineVisitor.

tsc_Grid Start;
The starting coordinate of the (first part of the) polyline. Modifying this would alter only the start position of the first part.