MutablePart

Represents a single part of a multipart builder. 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 modified using the points (vertexes) of segments is available. Adjacent segments which share an end point and a start point are connected and the shared vertex is not duplicated when accessing points. The mutable 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.toGeometry the gaps are closed with line segments.

Both linear segments (represented by LineSegment) and curve segments (represented by CubicBezierSegment or EllipticArcSegment) are supported. Curve and linear segments can be mixed together in the same geometry.

Since

200.1.0

See also

Constructors

Link copied to clipboard
constructor(spatialReference: SpatialReference? = null)

Creates a part with a specified spatial reference.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The end point of the last segment in the part. Returns null if the collection is empty.

Link copied to clipboard

True if the part contains any curve segments, false otherwise. Both linear segments (represented by LineSegment) and curve segments (represented by CubicBezierSegment or EllipticArcSegment) are supported in a MutablePart. This property returns true if any curve segments (Segment.isCurve is true) are currently present in this part.

Link copied to clipboard

The count of points in the part. The points in the part are the start and end points of segments. Segments can share a point if the end point of one segment matches the start point of the next.

Link copied to clipboard

An Iterable for iterating over the points in the part.

Link copied to clipboard

The count of segments in the part.

Link copied to clipboard
open override val size: Int

The count of segments in the part.

Link copied to clipboard

The spatial reference for the part. If the mutable_part does not have a spatial reference null is returned.

Link copied to clipboard

The start point of the first segment in the part. Returns null if the collection is empty.

Functions

Link copied to clipboard
open override fun add(index: Int, element: Segment)

Inserts a segment into the part at the specified index. The new segment is inserted at the specified index. This index may be equal to the segment count which is equivalent to adding to the end of the collection. The number of points in the part increases to connect in the new segment.

Link copied to clipboard
fun addPoint(point: Point)

Add a new point to the end of the part. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. 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 updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.

fun addPoint(x: Double, y: Double)

Add a new point to the end of the part by specifying the points x,y coordinates. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. 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 updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.

fun addPoint(pointIndex: Int, point: Point)

Inserts a point into the part at the specified point index. Line segments are 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 connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.

fun addPoint(x: Double, y: Double, z: Double)

Add a new point to the end of the part by specifying the points x,y,z coordinates. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. 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 updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.

fun addPoint(pointIndex: Int, x: Double, y: Double)

Inserts a point specified by its x,y coordinates into the part at the specified point index. Line segments are 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 connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.

fun addPoint(pointIndex: Int, x: Double, y: Double, z: Double)

Inserts a point specified by its x,y,z coordinate into the part at the specified point index. Line segments are 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 connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.

Link copied to clipboard
fun addPoints(points: Iterable<Point>)

Adds the points in points to the end of the part.

fun addPoints(startIndex: Int, points: Iterable<Point>)

Adds the points in points to the part, starting at index startIndex.

Link copied to clipboard
open override fun clear()

Remove all segments from the part. After calling this method the part is empty.

Link copied to clipboard
open operator override fun get(index: Int): Segment

Gets a segment at a specified segment index.

Link copied to clipboard

For a segment at a specified segmentIndex the method returns the point index of the segment's end point.

Link copied to clipboard
fun getPoint(pointIndex: Int): Point

Returns a point at a specified point index. The points in the part are the start and end points of segments. Segments can share a point if the end point of one segment matches the start point of the next.

Link copied to clipboard

Converts from a point index to a segment index that uses the given point as an end point. If the point is not an end point then -1 is returned.

Link copied to clipboard

Converts from a point index to a segment index that uses the given point as a start point. If the point is not a start point then -1 is returned.

Link copied to clipboard

For a segment at a specified segmentIndex the method returns the point index of the segment's start point.

Link copied to clipboard
open override fun isEmpty(): Boolean

Indicates if the part contains no segments.

Link copied to clipboard
open override fun removeAt(index: Int): Segment

Remove a segment at the specified index from the part. If the segment connected to adjacent segments, then after a segment is removed a gap can be left behind.

Link copied to clipboard
fun removePoint(pointIndex: Int): Point

Removes a point from the part. Segments connecting to this point are removed and the gap filled with a new line segment. The points in the part are the start and end points of segments. Removing a point can remove the two adjacent segments. A new line segment reconnects the gap.

Link copied to clipboard
open operator override fun set(index: Int, element: Segment): Segment

Replaces a segment at the specified index in the part. The points of the part can change if the input segment is not coincident with the start and end points of the segment that's being replaced.

Link copied to clipboard
fun setPoint(pointIndex: Int, point: Point): Point

Replace a point in the part at the specified point index. Segments that use this point are changed. The points in the part correspond to start and end points of segments. Setting a new point affects 1 or 2 segments using the point at the specified index. The type of affected segment(s) (LineSegment, CubicBezierSegment or EllipticArcSegment) remains the same.

Inherited functions

Link copied to clipboard
abstract override fun add(element: Segment): Boolean
Link copied to clipboard
abstract override fun addAll(elements: Collection<Segment>): Boolean
abstract fun addAll(index: Int, elements: Collection<Segment>): Boolean
Link copied to clipboard
open override fun addFirst(p0: Segment)
Link copied to clipboard
open override fun addLast(p0: Segment)
Link copied to clipboard
abstract operator override fun contains(element: Segment): Boolean
Link copied to clipboard
abstract override fun containsAll(elements: Collection<Segment>): Boolean
Link copied to clipboard
open fun forEach(p0: Consumer<in Segment>)
Link copied to clipboard
open override fun getFirst(): Segment
Link copied to clipboard
open override fun getLast(): Segment
Link copied to clipboard
abstract fun indexOf(element: Segment): Int
Link copied to clipboard
abstract operator override fun iterator(): Iterator<Segment>
Link copied to clipboard
abstract fun lastIndexOf(element: Segment): Int
Link copied to clipboard
abstract override fun listIterator(): MutableListIterator<Segment>
abstract override fun listIterator(index: Int): MutableListIterator<Segment>
Link copied to clipboard
Link copied to clipboard
abstract override fun remove(element: Segment): Boolean
Link copied to clipboard
abstract override fun removeAll(elements: Collection<Segment>): Boolean
Link copied to clipboard
open override fun removeFirst(): Segment
Link copied to clipboard
open fun removeIf(p0: Predicate<in Segment>): Boolean
Link copied to clipboard
open override fun removeLast(): Segment
Link copied to clipboard
Link copied to clipboard
abstract override fun retainAll(elements: Collection<Segment>): Boolean
Link copied to clipboard
open override fun reversed(): MutableList<Segment>
Link copied to clipboard
open fun sort(p0: Comparator<in Segment>)
Link copied to clipboard
open override fun spliterator(): Spliterator<Segment>
Link copied to clipboard
open fun stream(): Stream<Segment>
Link copied to clipboard
abstract override fun subList(fromIndex: Int, toIndex: Int): MutableList<Segment>
Link copied to clipboard
open fun toArray(): Array<Any>
open fun <T : Any> toArray(p0: Array<T>): Array<T>
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>