Class Subpath
As subpath is a part of a path comprising a sequence of connected segments.
public class Subpath
- Inheritance
-
Subpath
- Inherited Members
Constructors
Subpath()
Creates a new SubPath instance.
public Subpath()
Subpath(float, float)
Constructs a new subpath starting at the given point.
public Subpath(float startPointX, float startPointY)
Parameters
startPointX
floatx-coordinate of the start point of subpath
startPointY
floaty-coordinate of the start point of subpath
Subpath(Point)
Constructs a new subpath starting at the given point.
public Subpath(Point startPoint)
Parameters
startPoint
Pointthe point this subpath starts at
Subpath(Subpath)
Copy constructor.
public Subpath(Subpath subpath)
Parameters
Methods
AddSegment(IShape)
Adds a segment to the subpath.
public virtual void AddSegment(IShape segment)
Parameters
segment
IShapenew segment.
Remarks
Adds a segment to the subpath. Note: each new segment shall start at the end of the previous segment.
GetLastPoint()
public virtual Point GetLastPoint()
Returns
- Point
The last point of the subpath.
GetPiecewiseLinearApproximation()
public virtual IList<Point> GetPiecewiseLinearApproximation()
Returns
GetSegments()
public virtual IList<IShape> GetSegments()
Returns
GetStartPoint()
public virtual Point GetStartPoint()
Returns
- Point
The point this subpath starts at.
IsClosed()
Returns a boolean
value indicating whether the subpath must be closed or not.
public virtual bool IsClosed()
Returns
- bool
boolean
value indicating whether the path must be closed or not.
Remarks
Returns a boolean
value indicating whether the subpath must be closed or not.
Ignore this value if the subpath is a rectangle because in this case it is already closed
(of course if you paint the path using re
operator)
IsDegenerate()
Returns a boolean
indicating whether the subpath is degenerate or not.
public virtual bool IsDegenerate()
Returns
- bool
boolean
value indicating whether the path is degenerate or not.
Remarks
Returns a boolean
indicating whether the subpath is degenerate or not.
A degenerate subpath is the subpath consisting of a single-point closed path or of
two or more points at the same coordinates.
IsEmpty()
Checks whether subpath is empty or not.
public virtual bool IsEmpty()
Returns
- bool
true if the subpath is empty, false otherwise.
IsSinglePointClosed()
public virtual bool IsSinglePointClosed()
Returns
- bool
true
if this subpath contains only one point and it is closed,false
otherwise
IsSinglePointOpen()
public virtual bool IsSinglePointOpen()
Returns
- bool
true
if this subpath contains only one point and it is not closed,false
otherwise
SetClosed(bool)
See IsClosed()
public virtual void SetClosed(bool closed)
Parameters
closed
boolboolean
value indicating whether the path is closed or not.
SetStartPoint(float, float)
Sets the start point of the subpath.
public virtual void SetStartPoint(float x, float y)
Parameters
SetStartPoint(Point)
Sets the start point of the subpath.
public virtual void SetStartPoint(Point startPoint)
Parameters
startPoint
Pointthe point this subpath starts at