Table of Contents

Class Polyline

Namespace
CADability.GeoObject
Assembly
CADability.dll

A polyline as a IGeoObject implementing ICurve: a sequence of straight segments through the given vertices, open or closed. A polyline need not be planar. Special cases are the rectangle and the parallelogram, which are created with SetRectangle(GeoPoint, GeoVector, GeoVector) and SetParallelogram(GeoPoint, GeoVector, GeoVector) and keep their shape when edited. Create one with the static Construct() method; Decompose() splits a polyline into individual Line objects.

public class Polyline : IGeoObjectImpl, IFeedBack, ICloneable, IColorDef, ILineWidth, ILinePattern, ICurve, IGeoObject, ILayer, IStyle, IOctTreeInsertable, IComparable, ISerializable, IExtentedableCurve, IJsonSerialize, IExportStep
Inheritance
Polyline
Implements
Inherited Members

Constructors

Polyline()

Creates a polyline without vertices and raises Constructed. Protected: use Construct() or FromPoints(GeoPoint[], bool) to create a polyline.

protected Polyline()

Polyline(SerializationInfo, StreamingContext)

Constructor required by deserialization

protected Polyline(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

SerializationInfo

context StreamingContext

StreamingContext

Fields

Constructor

Optional hook for polymorphic construction. When set, Construct() calls this delegate instead of creating a plain Polyline, so that an application can have its own derived class instantiated wherever CADability creates a polyline.

public static Polyline.ConstructionDelegate Constructor

Field Value

Polyline.ConstructionDelegate

OnPaintTo3D

Static hook called at the beginning of PaintTo3D(IPaintTo3D) for every polyline. Set it to replace or extend the way polylines are displayed; when the handler returns true, the default painting is skipped.

public static Polyline.PaintTo3DDelegate OnPaintTo3D

Field Value

Polyline.PaintTo3DDelegate

Properties

ColorDef

The color of this polyline, null if it has none of its own. Setting it is an undoable attribute change that raises the change events; a "color from parent" value is resolved against the Block that owns this object.

public ColorDef ColorDef { get; set; }

Property Value

ColorDef

Description

Returns a textual description of the GeoObject. Mainly used for debugging purposes

public override string Description { get; }

Property Value

string

EndDirection

The direction of the last segment: from the second last to the last vertex, or from the last vertex back to the first one for a closed polyline. The vector is not normalized, its length is the length of the segment.

public GeoVector EndDirection { get; }

Property Value

GeoVector

Exceptions

PolylineException

with NoPoints when the polyline has less than two vertices

EndPoint

The last vertex of an open polyline, or the first vertex of a closed one. Setting it moves that vertex, like SetPoint(int, GeoPoint); the change is undoable and raises the change events.

public GeoPoint EndPoint { get; set; }

Property Value

GeoPoint

Exceptions

PolylineException

with NoPoints when the polyline has no vertices

IsClosed

Whether the last vertex is connected to the first one. Setting it opens or closes the polyline without changing the vertices; the change is undoable and raises the change events.

public bool IsClosed { get; set; }

Property Value

bool

IsParallelogram

true if this polyline is a closed quadrilateral whose opposite sides are parallel (and not all vertices are collinear), i.e. it was created with SetParallelogram(GeoPoint, GeoVector, GeoVector) or SetRectangle(GeoPoint, GeoVector, GeoVector) or happens to have that shape. Only then the Parallelogram... properties may be used.

public bool IsParallelogram { get; }

Property Value

bool

IsRectangle

true if this polyline is a parallelogram (see IsParallelogram) whose sides are perpendicular. Only then the Rectangle... properties may be used.

public bool IsRectangle { get; }

Property Value

bool

IsSingular

true if the polyline consists of a single vertex only.

public bool IsSingular { get; }

Property Value

bool

Length

The sum of the lengths of all segments, including the closing segment of a closed polyline.

public double Length { get; }

Property Value

double

LinePattern

The line pattern (dashes) used to display this polyline, null for a solid line. Setting it is an undoable attribute change that raises the change events.

public LinePattern LinePattern { get; set; }

Property Value

LinePattern

LineWidth

The line width used to display this polyline, null for the default. Setting it is an undoable attribute change that raises the change events.

public LineWidth LineWidth { get; set; }

Property Value

LineWidth

ParallelogramAngle

The angle from the first side to the second side of a parallelogram. Setting it rotates the second side about the normal of the parallelogram to the given angle, keeping its length and the first side; 0 is not allowed. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public SweepAngle ParallelogramAngle { get; set; }

Property Value

SweepAngle

ParallelogramHeight

The length of the second side of a parallelogram (from vertex 0 to vertex 3). Setting it keeps vertex 0 and the directions of the sides and moves vertices 2 and 3. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public double ParallelogramHeight { get; set; }

Property Value

double

ParallelogramLocation

The first vertex of a parallelogram. Setting it translates the whole parallelogram. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public GeoPoint ParallelogramLocation { get; set; }

Property Value

GeoPoint

ParallelogramMainDirection

The first side of a parallelogram as a vector (from vertex 0 to vertex 1). Setting it rotates the whole parallelogram about vertex 0 in its plane so that the first side points in the given direction (projected into the plane); the length of the value is ignored. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public GeoVector ParallelogramMainDirection { get; set; }

Property Value

GeoVector

ParallelogramSecondaryDirection

The second side of a parallelogram as a vector (from vertex 0 to vertex 3). Setting it replaces that side by the given vector, direction and length, keeping vertex 0 and the first side. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public GeoVector ParallelogramSecondaryDirection { get; set; }

Property Value

GeoVector

ParallelogramWidth

The length of the first side of a parallelogram (from vertex 0 to vertex 1). Setting it keeps vertex 0 and the directions of the sides and moves vertices 1 and 2. Only valid when IsParallelogram is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public double ParallelogramWidth { get; set; }

Property Value

double

PointCount

The number of vertices. A closed polyline does not repeat its first vertex at the end, so a closed polyline with n vertices has n segments, an open one n-1.

public int PointCount { get; }

Property Value

int

PreferredStyle

Returns the preferred style for this objects, see Style.EDefaultFor.

public override Style.EDefaultFor PreferredStyle { get; }

Property Value

Style.EDefaultFor

RectangleHeight

The length of the second side of a rectangle (from vertex 0 to vertex 3). Setting it keeps vertex 0 and the directions of the sides and moves vertices 2 and 3. Only valid when IsRectangle is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public double RectangleHeight { get; set; }

Property Value

double

RectangleLocation

The first vertex of a rectangle. Setting it translates the whole rectangle. Only valid when IsRectangle is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public GeoPoint RectangleLocation { get; set; }

Property Value

GeoPoint

RectangleWidth

The length of the first side of a rectangle (from vertex 0 to vertex 1). Setting it keeps vertex 0 and the directions of the sides and moves vertices 1 and 2; the value must not be 0. Only valid when IsRectangle is true, otherwise a PolylineException is thrown. The change is undoable and raises the change events.

public double RectangleWidth { get; set; }

Property Value

double

StartDirection

The direction of the first segment, from vertex 0 to vertex 1. The vector is not normalized, its length is the length of the segment.

public GeoVector StartDirection { get; }

Property Value

GeoVector

Exceptions

PolylineException

with NoPoints when the polyline has less than two vertices

StartPoint

The first vertex. Setting it moves that vertex, like SetPoint(int, GeoPoint) with index 0; the change is undoable and raises the change events.

public GeoPoint StartPoint { get; set; }

Property Value

GeoPoint

Exceptions

PolylineException

with NoPoints when the polyline has no vertices

Vertices

A copy of the vertices in order; a closed polyline does not repeat its first vertex at the end. Modifying the returned array has no effect on the polyline, use SetPoints(GeoPoint[], bool) or SetPoint(int, GeoPoint) for that.

public GeoPoint[] Vertices { get; }

Property Value

GeoPoint[]

Methods

AddPoint(GeoPoint)

Appends a vertex at the end of the polyline. The change is undoable and raises the change events.

public void AddPoint(GeoPoint p)

Parameters

p GeoPoint

The vertex to append

ApproximateByBSpline(double)

Creates a BSpline that approximates this polyline: a cubic spline through a subset of the vertices, chosen so that no vertex is farther than precision from the spline (see Approximate(GeoPoint[], double)). This polyline is not changed.

public BSpline ApproximateByBSpline(double precision)

Parameters

precision double

Maximum distance of the vertices from the resulting spline

Returns

BSpline

The approximating spline

AttributeChanged(INamedAttribute)

Overrides AttributeChanged(INamedAttribute). Checks all CADability attributes. Checking your own attributes is left to your code.

public override bool AttributeChanged(INamedAttribute attribute)

Parameters

attribute INamedAttribute

Returns

bool

Clone()

Clones this GeoObject.

public override IGeoObject Clone()

Returns

IGeoObject

the cloned GeoObject

Construct()

Creates a new polyline. This is the only way to create one, the constructor is protected. The returned polyline has no vertices; define it with SetPoints(GeoPoint[], bool), AddPoint(GeoPoint), SetRectangle(GeoPoint, GeoVector, GeoVector) or SetParallelogram(GeoPoint, GeoVector, GeoVector), or use FromPoints(GeoPoint[], bool).

public static Polyline Construct()

Returns

Polyline

A new Polyline, or an object of the derived class provided by Constructor

CopyGeometry(IGeoObject)

Copies the geometrical aspects of the given GeoObject to this GeoObject. Both objects must be of the same type. The attributes are not copied.

public override void CopyGeometry(IGeoObject ToCopyFrom)

Parameters

ToCopyFrom IGeoObject

GeoObject to copy from

Decompose()

Decomposes the object into simpler objects, see Decompose(). The default implementation returns null: the object cannot be decomposed.

public override GeoObjectList Decompose()

Returns

GeoObjectList

the parts, or null

DirectionAt(double)

Returns the direction of the curve at a specified point. The parameter position of the start-point is 0.0, the parameter position of the endpoint is 1.0. Directions of a position outside this interval may be undefined.

public GeoVector DirectionAt(double Position)

Parameters

Position double

Position on the curve

Returns

GeoVector

The requested direction

FindSnapPoint(SnapPointFinder)

Asks the object to add its snap points (end points, centres, intersections...) of the kinds that spf asks for. The default implementation adds none; objects with geometry override it.

public override void FindSnapPoint(SnapPointFinder spf)

Parameters

spf SnapPointFinder

definition and collection of the snap points

FromPoints(GeoPoint[], bool)

Creates a polyline through the given points (see SetPoints(GeoPoint[], bool)): consecutive identical points are merged, and for a closed polyline a last point that equals the first one is dropped.

public static Polyline FromPoints(GeoPoint[] pnts, bool closed = false)

Parameters

pnts GeoPoint[]

The vertices in order, at least two different points

closed bool

true to connect the last vertex with the first one

Returns

Polyline

The new polyline

Exceptions

PolylineException

when there are less than two different points

GetBoundingCube()

Returns a bounding cube of the object. The object must fir into this cube. There may be a smaller cube that contains the object if it is to expensive to calculate the exact cube.

public override BoundingCube GetBoundingCube()

Returns

BoundingCube

the bounding cube

GetExtent(Projection, ExtentPrecision)

Returns the 2d extent of the object as it appears in the given projection, in the coordinates of the projection's plane (not in pixels).

public override BoundingRect GetExtent(Projection projection, ExtentPrecision extentPrecision)

Parameters

projection Projection

the projection

extentPrecision ExtentPrecision

Exact for the exact extent, Raw for a quick estimate that may be larger

Returns

BoundingRect

the extent in the projection's 2d coordinates

GetExtent(double)

Gets the 3-dimensional extent of an object

public override BoundingCube GetExtent(double precision)

Parameters

precision double

Precision of the test

Returns

BoundingCube

The minmax cube

GetObjectData(IJsonWriteData)

Writes the data of this base class (user data, layer, style, user attributes and actuator) for the JSON serialization (IJsonSerialize). Derived classes override it, call the base implementation and add their own properties.

public override void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

receives the data

GetObjectData(SerializationInfo, StreamingContext)

Writes the data of this object for the legacy binary serialization (ISerializable). Files are written in the JSON format (IJsonSerialize) now; the binary format is still read.

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

receives the data

context StreamingContext

the destination of the serialization

GetPlanarState()

Determins the state of the curve in space. A curve may be either Planar (e.g. a cicle), NonPlanar (e.g. a polyline with vertices that dont shear a common plane) or UnderDetermined (e.g. a line defines a sheaf of planes (Ebenenbüschel))

public PlanarState GetPlanarState()

Returns

PlanarState

GetPlane()

Determins the plane in which the curve resides. Throws CurveException if the curve's PlanarState is NonPlanar or UnderDetermined.

public Plane GetPlane()

Returns

Plane

The plane

GetPoint(int)

Returns the vertex with the given index.

public GeoPoint GetPoint(int Index)

Parameters

Index int

Index of the vertex, 0 to PointCount-1

Returns

GeoPoint

The vertex

GetProjectedCurve(Plane)

Orthogonally projects this curve into the given plane. Returns the 2D curve in the coordinate system of the given plane.

public ICurve2D GetProjectedCurve(Plane p)

Parameters

p Plane

The plane this curve will be projected on

Returns

ICurve2D

The 2D curve in the given plane

GetQuadTreeItem(Projection, ExtentPrecision)

Returns an item for a 2d quad tree of the projected objects, used for hit tests in a projection: it knows the 2d extent of the object, whether a 2d rectangle hits it, and the depth (z position) of the object at a 2d point. Composite objects (blocks, solids, paths) return a collection of the items of their parts.

public override IQuadTreeInsertableZ GetQuadTreeItem(Projection projection, ExtentPrecision extentPrecision)

Parameters

projection Projection

the projection

extentPrecision ExtentPrecision

precision of the extent, see GetExtent(Projection, ExtentPrecision)

Returns

IQuadTreeInsertableZ

the item for the quad tree

GetShowProperties(IFrame)

Should be overridden and return a IPropertyEntry derived object that handles the display and modification of the properties of the IGeoObject derived object. Default implementation return null.

public override IPropertyEntry GetShowProperties(IFrame Frame)

Parameters

Frame IFrame

Returns

IPropertyEntry

HasValidData()

Default implementation of IGeoObject.HasValidData. Returns true. Override if the derived object can decide itself.

public override bool HasValidData()

Returns

bool

true

HitTest(ref BoundingCube, double)

Tests whether an object is touched by the provided cube

public override bool HitTest(ref BoundingCube cube, double precision)

Parameters

cube BoundingCube

To test with

precision double

Required precision

Returns

bool

true if the object strikes the cube

HitTest(Projection, BoundingRect, bool)

Tests whether an object is inside or touched by the rectangle when projected with the provided projection

public override bool HitTest(Projection projection, BoundingRect rect, bool onlyInside)

Parameters

projection Projection

The projection for the test

rect BoundingRect

The rectangle to test the position

onlyInside bool

true: the object must be totaly inside the rectangle, false: the object must be totaly or partially inside the rectangle

Returns

bool

true when the test succeedes, false otherwise

HitTest(PickArea, bool)

Tests whether an object is inside or touched by the provided area

public override bool HitTest(Projection.PickArea area, bool onlyInside)

Parameters

area Projection.PickArea

The area to check for

onlyInside bool

true: the object must be totaly inside the area, false: the object must be totaly or partially inside the area

Returns

bool

true when the test succeedes, false otherwise

InsertPoint(double)

Inserts a new vertex on the polyline at the given curve position without changing the shape: the segment that contains the position is split in two. The change is undoable and raises the change events.

public void InsertPoint(double position)

Parameters

position double

Position on the curve from 0 (start point) to 1 (end point), as used by PointAt(double)

InsertPoint(int, GeoPoint)

Inserts a vertex in front of the vertex with the given index, or at the end when Index equals PointCount. The change is undoable and raises the change events.

public void InsertPoint(int Index, GeoPoint p)

Parameters

Index int

Index the new vertex will have

p GeoPoint

The new vertex

IsInPlane(Plane)

Determines whether the curve resides in the given plane.

public bool IsInPlane(Plane p)

Parameters

p Plane

The plane for the test

Returns

bool

true, when the curve resides in the plane

Modify(ModOp)

Modifies this GeoObject with the given modification operation (includes moving, rotating, reflecting, scaling etc.).

public override void Modify(ModOp m)

Parameters

m ModOp

Operation to be applied

PaintTo3D(IPaintTo3D)

Paints the object with the methods of paintTo3D: lines, triangles, text... The views implement IPaintTo3D (with OpenGL or GDI) and collect what the object paints in a display list, so this is called rarely, after PrepareDisplayList(double) has done the expensive work (triangulation, approximation).

public override void PaintTo3D(IPaintTo3D paintTo3D)

Parameters

paintTo3D IPaintTo3D

where to paint

PointAndDerivativesAt(double, int)

Returns all derivatives up to grad. The first vector is actually the point at this position.

public IReadOnlyList<GeoVector> PointAndDerivativesAt(double position, int grad)

Parameters

position double

Where to calculate the derivatives

grad int

Number of derivatives. grad==2 returns the point, the first and the second derivative

Returns

IReadOnlyList<GeoVector>

Sequence of derivatives: element 0 = point-vector (P), 1 = first derivative (P'), 2 = second (P''), … . Length ≥ grad+1.

PointAt(double)

Returns the point of the given position. The parameter position of the start-point is 0.0, the parameter position of the endpoint is 1.0. Points of a position outside this interval may be undefined. The correlation between the parameter Position and the resulting point may be not linear.

public GeoPoint PointAt(double Position)

Parameters

Position double

Position on the curve

Returns

GeoPoint

The requested point

Position(GeoPoint, GeoVector, double)

Computes the parameter value along the given ray (fromHere + t * direction) where it intersects the polyline (if any). Returns double.MaxValue if no intersection is found or if the polyline is planar and the ray is parallel to the plane.

public override double Position(GeoPoint fromHere, GeoVector direction, double precision)

Parameters

fromHere GeoPoint

Start point of the ray.

direction GeoVector

Direction of the ray.

precision double

Tolerance for intersection tests (not used here).

Returns

double

The parameter t where the intersection occurs, or double.MaxValue if no hit.

PositionOf(GeoPoint)

Returns the parametric position of the point on the curve. This function is inverse to DirectionAt(double). If the given point is not on the curve, the result is the position of a point on the curve, that is close to the given point, but not necessary of the closest point.

public double PositionOf(GeoPoint p)

Parameters

p GeoPoint

Point, for which the position is requested

Returns

double

the requested position

PositionOf(GeoPoint, Plane)

Similar to the PointAt(double) method. Returns the same result, if the point is on the curve. If the point is not on the curve the problem is looked at in the given plane. i.e. the closest point on the projected 2d curve from the projected 2d point is used.

public double PositionOf(GeoPoint p, Plane pl)

Parameters

p GeoPoint

Point, whos position is requested

pl Plane

Plane for the computation of the closest point

Returns

double

the requested position

PositionOf(GeoPoint, double)

Similar to PositionOf(GeoPoint). If the point is not on the curve and there are several solutions then the solution closest to the parameter prefer will be returned.

public double PositionOf(GeoPoint p, double prefer)

Parameters

p GeoPoint

Point, for which the position is requested

prefer double

preferable solution close to this value

Returns

double

the requested position

PrepareDisplayList(double)

Called before PaintTo3D(IPaintTo3D) is called, should implement the time consuming work for the display (like calculationg the triangulation of Faces or Polylines of Curves). Not normally used by user code.

public override void PrepareDisplayList(double precision)

Parameters

precision double

Required precision

RemoveDoublePoints()

Removes every vertex that coincides with its predecessor (within eps). Raises the change events when something was removed, but is not recorded for undo.

public void RemoveDoublePoints()

RemovePoint(int)

Removes the vertex with the given index; its two neighbours become connected. The change is undoable and raises the change events.

public void RemovePoint(int Index)

Parameters

Index int

Index of the vertex to remove, 0 to PointCount-1

Reverse()

Reverses the direction of the curve.

public void Reverse()

SetClosedPolylineStartIndex(int)

Let the closed polyline start with the vertex with the specified index. The vertex array will be rotated

public bool SetClosedPolylineStartIndex(int startIndex)

Parameters

startIndex int

Index of vertex with which to start

Returns

bool

true on success

SetObjectData(IJsonReadData)

Reads the data written by GetObjectData(IJsonWriteData) back from the JSON serialization. Derived classes override it, call the base implementation and read their own properties. Objects referenced by the data may still be incomplete at this time, see IJsonSerializeDone.

public override void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

provides the data

SetParallelogram(GeoPoint, GeoVector, GeoVector)

Makes this polyline a closed parallelogram with the vertices location, location+directionX, location+directionX+directionY and location+directionY. The directions should be neither parallel nor zero, otherwise the result is not a parallelogram. The change is undoable and raises the change events.

public void SetParallelogram(GeoPoint location, GeoVector directionX, GeoVector directionY)

Parameters

location GeoPoint

First vertex of the parallelogram

directionX GeoVector

First side as a vector

directionY GeoVector

Second side as a vector

SetPoint(int, GeoPoint)

Moves the vertex with the given index. The change is undoable and raises the change events.

public void SetPoint(int Index, GeoPoint p)

Parameters

Index int

Index of the vertex, 0 to PointCount-1

p GeoPoint

New position of the vertex

SetPoints(GeoPoint[], bool)

Replaces all vertices. Consecutive identical points are merged, and when closed is true and the last point equals the first one, the last point is dropped. The change is undoable and raises the change events.

public void SetPoints(GeoPoint[] points, bool closed)

Parameters

points GeoPoint[]

The new vertices in order

closed bool

true to connect the last vertex with the first one

Exceptions

PolylineException

with NoPoints when less than two different points remain; the vertices are then unchanged

SetRectangle(GeoPoint, GeoVector, GeoVector)

Makes this polyline a closed rectangle with the vertices location, location+directionX, location+directionX+directionY and location+directionY. If the two directions are not perpendicular, directionY is replaced by the vector perpendicular to directionX in the plane of both vectors, keeping its length. The change is undoable and raises the change events.

public void SetRectangle(GeoPoint location, GeoVector directionX, GeoVector directionY)

Parameters

location GeoPoint

First vertex of the rectangle

directionX GeoVector

First side as a vector, its length is the width

directionY GeoVector

Second side as a vector, its length is the height

Exceptions

PolylineException

with RectangleSameDirections when the two directions are parallel

Split(double)

Splits the curve at the given position. The position must be in the interval 0..1 and the curve must not be closed. For closed curves Split(double, double).

public ICurve[] Split(double Position)

Parameters

Position double

Where to split

Returns

ICurve[]

the splitted curve(s)

Split(double, double)

Splits the closed curve into two open curves at the given positions.

public ICurve[] Split(double Position1, double Position2)

Parameters

Position1 double

first Position

Position2 double

second Position

Returns

ICurve[]

the splitted curve(s)

Trim(double, double)

Modifies start and endpoint of this curve. StartPos must be less than EndPos. if StartPos is less than 0.0 or EndPos greater than 1.0 this only works for lines and (circular or elliptical) arcs.

public void Trim(double StartPos, double EndPos)

Parameters

StartPos double

New start position

EndPos double

New end position

TryPointDeriv2At(double, out GeoPoint, out GeoVector, out GeoVector)

Tries to get the point and the first and second derivative of the curve at the specified position. (0..1) Some curves do not implement the second derivative and hence will return false.

public virtual bool TryPointDeriv2At(double position, out GeoPoint point, out GeoVector deriv, out GeoVector deriv2)

Parameters

position double

Position where to calculate point and derivatives

point GeoPoint

The point at the required position

deriv GeoVector
deriv2 GeoVector

The second derivative at the provided parameter

Returns

bool

TrySetPoints(GeoPoint[], bool)

Replaces all vertices like SetPoints(GeoPoint[], bool), but returns false instead of throwing when less than two different points remain. Unlike SetPoints(GeoPoint[], bool) it keeps a last point that equals the first one of a closed polyline.

public bool TrySetPoints(GeoPoint[] points, bool closed)

Parameters

points GeoPoint[]

The new vertices in order

closed bool

true to connect the last vertex with the first one

Returns

bool

true on success, false when there are less than two different points (the vertices are then unchanged)

Events

Constructed

Raised from the constructor whenever a new polyline is created, i.e. for every Construct() call, every clone and every polyline read from a file. The handler gets the new object; when it comes from Construct(), it has no vertices yet.

public static event Polyline.ConstructedDelegate Constructed

Event Type

Polyline.ConstructedDelegate