Skip To Content ArcGIS for Developers Sign In Dashboard

Part QML Type

A mutable collection of Segments that together define the shape of a part in a Multipart geometry under construction. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

This type is used in PolygonBuilder and PolylineBuilder, and by the MultipartBuilder parts property.

The spatial reference must be set before adding points or segments and cannot be changed after points or segments have been added.

Use the inherited methods to define and change the shape of the geometry by adding, removing, or changing its segments. Additionally, the addPoint and removePoint Point-based helper methods allow working with points that represent the vertices of the part, instead of working with segments.

The spatial reference of any geometries added to a part must match that of the part, or be unspecified (in which case the geometry is assumed to have the same spatial reference as the part). Added geometries are not reprojected.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

Property Documentation

empty : bool

Returns whether the Part contains any points or segments (read-only).


pointCount : int

Returns the number of points contained in the Part (read-only).


segmentCount : int

Returns the number of segments contained in the Part (read-only).


[default] spatialReference : SpatialReference

The SpatialReference of the Part.

Note: The SpatialReference can only be changed while the Part is empty.

See also empty.


Signal Documentation

emptyChanged()

Emitted when the empty property changes.


pointCountChanged()

Emitted when the pointCount property changes.


segmentCountChanged()

Emitted when the segmentCount property changes.


spatialReferenceChanged()

Emitted when the spatialReference property changes.


Method Documentation

int addPoint(Point point)

Adds point to the Part.

Returns the index where the Point was added or -1 on error.


int addPointXY(double x, double y)

Adds a point to the Part from x and y values.

Returns the index where the point was added or -1 on error.

Note: the coordinates must be in the spatial reference of the Part.


int addPointXYZ(double x, double y, double z)

Adds a point to the Part from x, y and z values.

Returns the index where the point was added or -1 on error.

Note: the coordinates must be in the spatial reference of the Part.


void addPoints(list<Point> points)

Adds a list of points to the Part.

This QML method was introduced in Esri.ArcGISRuntime 100.1.


int addSegment(Segment segment)

Adds segment to the Part.

Returns the index where the Segment was added or -1 on error.


Point endPoint()

Gets the end point of this part.

Returns null if there are no points in this part.


int endPointIndexFromSegmentIndex(int segmentIndex)

Gets the end point index from the given segmentIndex.

Returns the end point index or -1 on error or invalid index.


void insertPoint(int pointIndex, Point point)

Inserts point into the Part at pointIndex.


void insertPointXY(int pointIndex, double x, double y)

Inserts a point into the Part at pointIndex from x and y values.

The coordinates must be in the spatial reference of the Part.


void insertPointXYZ(int pointIndex, double x, double y, double z)

Inserts a point into the Part at pointIndex from x, y and z values.

The coordinates must be in the spatial reference of the Part.


void insertSegment(int segmentIndex, Segment segment)

Inserts segment at segmentIndex.


Point point(int pointIndex)

Gets the point at index pointIndex.

Returns null if the point is not found.


Gets the collection of points in this part.


void removeAll()

Removes all the points and segments.


void removePoint(int pointIndex)

Removes the point at pointIndex.


void removeSegment(int segmentIndex)

Removes the segment at segmentIndex.


Segment segment(int segmentIndex)

Gets the Segment at segmentIndex.

Returns the Segment or null if the index isn't valid.


int segmentEndPointIndexFromPointIndex(int pointIndex)

Gets the segment end point index from the given pointIndex.

Returns the segment end point index or -1 on error or invalid index.


int segmentIndexFromEndPointIndex(int pointIndex)

Gets the segment index from the end point index pointIndex.

Returns the segment point index or -1 on error or invalid index.


int segmentIndexFromStartPointIndex(int pointIndex)

Gets the segment index from the start point index pointIndex.

Returns the segment point index or -1 on error or invalid index.


int segmentStartPointIndexFromPointIndex(int pointIndex)

Gets the segment start point index from the given pointIndex.

Returns the segment start point index or -1 on error or invalid index.


void setPoint(int pointIndex, Point point)

Reassigns the point at pointIndex to point.


void setSegment(int segmentIndex, Segment segment)

Reassigns the segment at segmentIndex to segment.


Point startPoint()

Gets the start point of this part.

Returns null if there are no points in this part.


int startPointIndexFromSegmentIndex(int segmentIndex)

Gets the start point index from the given segmentIndex.

Returns the start point index or -1 on error or invalid index.



Feedback on this topic?