ArcGIS Runtime SDK for iOS: AGSMutablePart Class Reference
ArcGIS Runtime SDK for iOS  100.9
AGSMutablePart Class Reference

Description

A mutable part of a multipart geometry.

Instances of this class represent an individual, modifiable, part of a multipart geometry such as polygon or polyline. A part is a collection of segments that define the shape of the part. As a convenience, you can work with points that represent the vertices of the part, instead of working with segments.

The part is mutable so it can be modified which is useful when constructing or modifying geometries using builders.

This class adopts NSFastEnumeration which permits the part's segments to be enumerated conveniently using a for-in loop. For example -

let part:AGSMutablePart = ... //A part containing segments
for segment in part {
do something
}

This class also provides subscripting support. So you can access and set segments using the subscript syntax. For example -

let part:AGSMutablePart = ... //A part containing segments
let segment = part[0] //The segment at 0th index
let part[1] = newSegment //Set new segment at 1st index
Since
100
Inheritance diagram for AGSMutablePart:
AGSObject

Instance Methods

(NSInteger) - addPoint:
 
(void) - addPoints:
 
(NSInteger) - addPointWithX:y:
 
(NSInteger) - addPointWithX:y:z:
 
(NSInteger) - addSegment:
 
(NSArray< AGSSegment * > *) - array
 
(NSInteger) - endPointIndexForSegmentIndex:
 
(instancetype) - initWithPoints:
 
(instancetype) - initWithSpatialReference:
 
(void) - insertPoint:atIndex:
 
(void) - insertPointWithX:y:atIndex:
 
(void) - insertPointWithX:y:z:atIndex:
 
(void) - insertSegment:atIndex:
 
(AGSPoint *) - pointAtIndex:
 
(AGSEnumerator *) - pointEnumerator
 
(void) - removeAllSegments
 
(void) - removePointAtIndex:
 
(void) - removeSegmentAtIndex:
 
(AGSSegment *) - segmentAtIndex:
 
(AGSEnumerator *) - segmentEnumerator
 
(NSInteger) - segmentIndexForEndPointIndex:
 
(void) - segmentIndexForPointIndex:outSegmentStartPointIndex:outSegmentEndPointIndex:
 
(NSInteger) - segmentIndexForStartPointIndex:
 
(void) - setObject:atIndexedSubscript:
 
(void) - setPoint:atIndex:
 
(void) - setPointWithX:y:atIndex:
 
(void) - setSegment:atIndex:
 
(NSInteger) - startPointIndexForSegmentIndex:
 

Class Methods

(instancetype) + partWithPoints:
 
(instancetype) + partWithSpatialReference:
 

Properties

BOOL empty
 
AGSPointendPoint
 
NSInteger pointCount
 
AGSPointCollectionpoints
 
NSInteger segmentCount
 
AGSSpatialReferencespatialReference
 
AGSPointstartPoint
 

Method Documentation

§ addPoint:()

- (NSInteger) addPoint: (AGSPoint *)  point

Add a vertex to the the end of this part

Parameters
pointvertex to add
Returns
position where vertex was added
Since
100

§ addPoints:()

- (void) addPoints: (NSArray< AGSPoint * > *)  points

Add points from the provided array to the end of this part

Parameters
pointsto add
Since
100

§ addPointWithX:y:()

- (NSInteger) addPointWithX: (double)  x
y: (double)  y 

Add a vertex to the the end of this part

Parameters
xcoordinate of the vertex
ycoordinate of the vertex
Returns
position where vertex was added
Since
100

§ addPointWithX:y:z:()

- (NSInteger) addPointWithX: (double)  x
y: (double)  y
z: (double)  z 

Add a vertex to the the end of this part

Parameters
xcoordinate of the vertex
ycoordinate of the vertex
zcoordinate of the vertex
Returns
position where vertex was added
Since
100

§ addSegment:()

- (NSInteger) addSegment: (AGSSegment *)  segment

Add a segment to the the end of this part

Parameters
segmentto add
Returns
position where segment was added
Since
100

§ array()

- (NSArray<AGSSegment*>*) array

Returns an array of segments.

Since
100

§ endPointIndexForSegmentIndex:()

- (NSInteger) endPointIndexForSegmentIndex: (NSInteger)  segmentIndex

Position of ending vertex for the specified segment

Parameters
segmentIndexrepresenting the position of the segment whose ending vertex is desired
Returns
Position of the ending vertex. 0 is the first position
Since
100

§ initWithPoints:()

- (instancetype) initWithPoints: (NSArray< AGSPoint * > *)  points

Initialize a part with points.

Parameters
pointsfor the part to be constructed
Since
100

§ initWithSpatialReference:()

- (instancetype) initWithSpatialReference: (nullable AGSSpatialReference *)  spatialReference

Initialize a part with specified spatial reference. All segments and vertices that belong to this part must have the same spatial reference, or if they don't have a spatial reference, it will be assumed that they contain coordinates that match this spatial reference.

Parameters
spatialReferenceof the part
Returns
Initialized part
Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

§ insertPoint:atIndex:()

- (void) insertPoint: (AGSPoint *)  point
atIndex: (NSInteger)  index 

Insert a vertex at the specified position

Parameters
pointvertext to add
indexof desired position. 0 is the first position
Since
100

§ insertPointWithX:y:atIndex:()

- (void) insertPointWithX: (double)  x
y: (double)  y
atIndex: (NSInteger)  index 

Insert a vertex at the specified position

Parameters
xcoordinate of the vertex
ycoordinate of the vertex
indexof desired position. 0 is the first position
Since
100

§ insertPointWithX:y:z:atIndex:()

- (void) insertPointWithX: (double)  x
y: (double)  y
z: (double)  z
atIndex: (NSInteger)  index 

Insert a vertex at the specified position

Parameters
xcoordinate of the vertex
ycoordinate of the vertex
zcoordinate of the vertex
indexof desired position. 0 is the first position
Since
100

§ insertSegment:atIndex:()

- (void) insertSegment: (AGSSegment *)  segment
atIndex: (NSInteger)  index 

Insert a segment at the specified position

Parameters
segmentto add
indexof desired position. 0 is the first position
Since
100

§ partWithPoints:()

+ (instancetype) partWithPoints: (NSArray< AGSPoint * > *)  points

Initialize a part with points.

Parameters
pointsfor the part to be constructed
Since
100

§ partWithSpatialReference:()

+ (instancetype) partWithSpatialReference: (nullable AGSSpatialReference *)  spatialReference

Initialize a part with specified spatial reference. All segments and vertices that belong to this part must have the same spatial reference, or if they don't have a spatial reference, it will be assumed that they contain coordinates that match this spatial reference.

Parameters
spatialReferenceof the part
Returns
Initialized part
Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

§ pointAtIndex:()

- (AGSPoint*) pointAtIndex: (NSInteger)  index

Vertex at specified position in the part

Parameters
indexof desired position. 0 is the first position
Returns
vertex at specified index
Since
100

§ pointEnumerator()

- (AGSEnumerator*) pointEnumerator

Returns an enumerator object that lets you access each point in the segment collection.

Since
100

§ removeAllSegments()

- (void) removeAllSegments

Remove all segments (and thereby also vertices) from the part

Since
100

§ removePointAtIndex:()

- (void) removePointAtIndex: (NSInteger)  index

Remove vertex at specified position

Parameters
indexof desired position. 0 is the first position
Since
100

§ removeSegmentAtIndex:()

- (void) removeSegmentAtIndex: (NSInteger)  index

Remove segment at specified position

Parameters
indexof desired position. 0 is the first position
Since
100

§ segmentAtIndex:()

- (AGSSegment*) segmentAtIndex: (NSInteger)  index

Segment at specified position in the part

Parameters
indexof desired position. 0 is the first position
Returns
segment at specified index
Since
100

§ segmentEnumerator()

- (AGSEnumerator*) segmentEnumerator

Returns an enumerator object that lets you access each segment in the segment collection.

Since
100

§ segmentIndexForEndPointIndex:()

- (NSInteger) segmentIndexForEndPointIndex: (NSInteger)  pointIndex

Position of segment that contains the specified vertex as its ending point

Parameters
pointIndexrepresenting the position of vertex which serves as the ending point for the segment
Returns
Position of segment. 0 is the first position
Since
100

§ segmentIndexForPointIndex:outSegmentStartPointIndex:outSegmentEndPointIndex:()

- (void) segmentIndexForPointIndex: (NSInteger)  pointIndex
outSegmentStartPointIndex: (NSInteger *)  outSegmentStartPointIndex
outSegmentEndPointIndex: (NSInteger *)  outSegmentEndPointIndex 

§ segmentIndexForStartPointIndex:()

- (NSInteger) segmentIndexForStartPointIndex: (NSInteger)  pointIndex

Position of segment that contains the specified vertex as its starting point

Parameters
pointIndexrepresenting the position of vertex which serves as the starting point for the segment
Returns
Position of segment. 0 is the first position
Since
100

§ setObject:atIndexedSubscript:()

- (void) setObject: (AGSSegment *)  obj
atIndexedSubscript: (NSInteger)  idx 

Returns the segment at the specified index. Supports accessing an individual segment using array-style subscript expressions.

For example -

let part:AGSPart = ... //A part containing segments
let segment = part[0] //The segment at 0th index
Parameters
idxsubscript index
Returns
segment at subscript index
Since
100 */ -(AGSSegment*)objectAtIndexedSubscript:(NSInteger)idx;

/** Sets the segment at the specified index. Supports assigning an individual segment using array-style subscript expressions. For example -

let part:AGSPart = ... //A part containing segments
let segment:AGSSegment = ... //A new segment
let part[0] = segment //Set the new segment
Parameters
objsegment to set
idxsubscript index
Since
100

§ setPoint:atIndex:()

- (void) setPoint: (AGSPoint *)  point
atIndex: (NSInteger)  index 

Replace existing vertex with the specified one

Parameters
pointvertex to replace with
indexof vertex to replace
Since
100

§ setPointWithX:y:atIndex:()

- (void) setPointWithX: (double)  x
y: (double)  y
atIndex: (NSInteger)  index 

Replace existing vertex at the specified position

Parameters
xcoordinate of the vertex
ycoordinate of the vertex
indexof desired position. 0 is the first position
Since
100.5

§ setSegment:atIndex:()

- (void) setSegment: (AGSSegment *)  segment
atIndex: (NSInteger)  index 

Replace existing segment with the specified one

Parameters
segmentto replace with
indexof segment to replace
Since
100

§ startPointIndexForSegmentIndex:()

- (NSInteger) startPointIndexForSegmentIndex: (NSInteger)  segmentIndex

Position of staring vertex for the specified segment

Parameters
segmentIndexrepresenting the position of the segment whose starting vertex is desired
Returns
Position of the starting vertex. 0 is the first position
Since
100

Property Documentation

§ empty

- (BOOL) empty
readnonatomicassign

Indicates whether the part contains any segments

Since
100

§ endPoint

- (AGSPoint*) endPoint
readnonatomiccopy

Ending vertex of the last segment in the part

Since
100

§ pointCount

- (NSInteger) pointCount
readnonatomicassign

Number of vertices in the part. Each segment contains 2 vertices (start and end). Connected segments can share a vertex.

Since
100

§ points

- (AGSPointCollection*) points
readnonatomiccopy

All the vertices in this part

Since
100

§ segmentCount

- (NSInteger) segmentCount
readnonatomicassign

Number of segments in the part

Since
100

§ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstrong

The spatial reference associated with segments and vertices in this part. It specifies the coordinate system for each segment and vertex's x & y coordinate values. All segments and vertices that belong to this part must have the same spatial reference, or if they don't have a spatial reference, it will be assumed that they contain coordinates that match this spatial reference.

Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

§ startPoint

- (AGSPoint*) startPoint
readnonatomiccopy

Starting vertex of the first segment in the part

Since
100