Part QML Type

  • Esri.ArcGISRuntime
  • Part
  • Represents a single part of a multipart builder. More...

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

    Object

    Properties

    Signals

    Methods

    Detailed Description

    Multipart builder is the base class of PolygonBuilder or PolylineBuilder. A part is made up of a collection of segments making the edge of the multipart. Additionally, access and midification using the points (vertexes) of segments is available. Adjacent segments that share an end point and a start point are connected, and the shared vertex is not duplicated when accessing points.

    The part can represent gaps between one end point and an adjacent start. However, this is only recommended as a temporary state while modifying a multipart builder. When using GeometryBuilder::geometry the gaps are closed with line segments.

    Prior to Esri::ArcGISRuntime 100.12, the only supported segment type was LineSegment.

    From Esri::ArcGISRuntime 100.12, curve segments can be added to a Part and used build polygon and polyline geometries. A part may contain a mix of linear and curve segments.

    See also CubicBezierSegment, EllipticArcSegment, and LineSegment.

    Property Documentation

    [read-only] empty : bool

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


    [read-only, since Esri.ArcGISRuntime 100.12] hasCurves : bool

    Indicates if the part contains any curve segments (read-only).

    Prior to Esri.ArcGISRuntime 100.12, only LineSegment linear segments were available to be added to mutable parts when building geometries.

    From Esri.ArcGISRuntime 100.12, geometry builders support curve segments. This property returns true if any segments where Segment::isCurve is true have been added to the part.

    This property was introduced in Esri.ArcGISRuntime 100.12.

    See also Geometry::hasCurves, GeometryBuilder::hasCurves, and Segment::isCurve.


    [read-only] pointCount : int

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


    [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.

    Note: The corresponding handler is onEmptyChanged.


    pointCountChanged()

    Emitted when the pointCount property changes.

    Note: The corresponding handler is onPointCountChanged.


    segmentCountChanged()

    Emitted when the segmentCount property changes.

    Note: The corresponding handler is onSegmentCountChanged.


    spatialReferenceChanged()

    Emitted when the spatialReference property changes.

    Note: The corresponding handler is onSpatialReferenceChanged.


    Method Documentation

    int addPoint(Point point)

    Adds a new point to the end of the part.

    A new line segment will be added to connect the new point to the previous point. The points in the part are the start and end points of segments. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point will update this line segment to gain a distinct end point. Adding a third or more points will add new line segments.

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


    int addPointXY(double x, double y)

    Add a new Point to the end of the part by specifying the point's x, and y coordinates.

    A new line segment will be added to connect the new point to the previous point. The points in the part are the start and end points of segments. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point will update this line segment to gain a distinct end point. Adding a third or more points will add new line segments.

    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.

    Adds a new Point to the end of the part by specifying the point's x, y, and z coordinates. A new line segment is added to connect the new point to the previous.

    A new line segment will be added to connect the new point to the previous point. The points in the part are the start and end points of segments. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point will update this line segment to gain a distinct end point. Adding a third or more points will add new line segments.


    [since Esri.ArcGISRuntime 100.1] void addPoints(list<Point> points)

    Adds a list of points to the Part.

    This method was introduced in Esri.ArcGISRuntime 100.1.


    int addSegment(Segment segment)

    A new segment is added to the end.

    If the start point of the segment matches the previous end point, the segment shares this point. The count of points increases by 1 if the segment connects, or 2 points if it is disconnected. A more efficient way to add a LineSegment to a part is to use one of the addPoint methods. For example Part::addPoint.

    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 a point into the part at the specified pointIndex.

    Line segments will be added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connecting the point before or after the point index is removed. Inserting a new point will insert new line segments connecting the adjacent points.


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

    Inserts a Point specified by its x and y coordinates into the part at the specified pointIndex.

    Line segments will be added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connecting the point before or after the point index is removed. Inserting a new point will insert new line segments connecting the adjacent points.

    .


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

    Inserts a point specified by its x, y, and z coordinates into the part at the specified pointIndex.

    Line segments will be added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connecting the point before or after the point index is removed. Inserting a new point will insert new line segments connecting the adjacent points.

    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.

    See also setPoint().


    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.

    See also setSegment().


    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.

    The points in the part correspond to start and end points of segments. Setting a new point affects one or two segments using the point at the specified index. The type of affected segment(s) (LineSegment, CubicBezierSegment or EllipticArcSegment) remains the same.

    For affected cubic bezier segments, the shape of the curve may change because the control points remain the same, as does the unchanged start or end point location. For elliptic arc segments, the arc parameters are adjusted enough to ensure the unchanged start or end point location remains the same.

    See also point().


    void setSegment(int segmentIndex, Segment segment)

    Reassigns the segment at segmentIndex to segment.

    See also 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.


    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.