ArcGIS Runtime SDK for iOS
100.15
|
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 -
This class also provides subscripting support. So you can access and set segments using the subscript syntax. For example -
Prior to v100.12, the only supported segment type was AGSLineSegment
.
From v100.12, curve segments can be added to an AGSMutablePart
and used to build polygon and polyline geometries. A part may contain a mix of linear and curve segments.
Class Methods | |
(instancetype) | + partWithPoints: |
(instancetype) | + partWithSpatialReference: |
Properties | |
BOOL | empty |
AGSPoint * | endPoint |
BOOL | hasCurves |
NSInteger | pointCount |
AGSPointCollection * | points |
NSInteger | segmentCount |
AGSSpatialReference * | spatialReference |
AGSPoint * | startPoint |
- (NSInteger) addPoint: | (AGSPoint *) | point |
Add a vertex to the end of this part.
point | vertex to add. |
- (void) addPoints: | (NSArray< AGSPoint * > *) | points |
Add points from the provided array to the end of this part.
points | to add. |
- (NSInteger) addPointWithX: | (double) | x | |
y: | (double) | y | |
Add a vertex to the end of this part.
x | coordinate of the vertex. |
y | coordinate of the vertex. |
- (NSInteger) addPointWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
Add a vertex to the end of this part.
x | coordinate of the vertex. |
y | coordinate of the vertex. |
z | coordinate of the vertex. |
- (NSInteger) addSegment: | (AGSSegment *) | segment |
Add a segment to the end of this part.
segment | to add. |
- (NSArray<AGSSegment*>*) array |
Returns an array of segments.
- (NSInteger) endPointIndexForSegmentIndex: | (NSInteger) | segmentIndex |
Position of ending vertex for the specified segment.
segmentIndex | representing the position of the segment whose ending vertex is desired. |
0
is the first position. - (instancetype) initWithPoints: | (NSArray< AGSPoint * > *) | points |
Initialize a part with points.
points | for the part to be constructed. |
- (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.
spatialReference | of the part. |
- (void) insertPoint: | (AGSPoint *) | point | |
atIndex: | (NSInteger) | index | |
Insert a vertex at the specified position.
point | vertext to add. |
index | of desired position. 0 is the first position. |
- (void) insertPointWithX: | (double) | x | |
y: | (double) | y | |
atIndex: | (NSInteger) | index | |
Insert a vertex at the specified position.
x | coordinate of the vertex. |
y | coordinate of the vertex. |
index | of desired position. 0 is the first position. |
- (void) insertPointWithX: | (double) | x | |
y: | (double) | y | |
z: | (double) | z | |
atIndex: | (NSInteger) | index | |
Insert a vertex at the specified position.
x | coordinate of the vertex. |
y | coordinate of the vertex. |
z | coordinate of the vertex. |
index | of desired position. 0 is the first position. |
- (void) insertSegment: | (AGSSegment *) | segment | |
atIndex: | (NSInteger) | index | |
Insert a segment at the specified position.
segment | to add. |
index | of desired position. 0 is the first position. |
+ (instancetype) partWithPoints: | (NSArray< AGSPoint * > *) | points |
Create a new part with points.
points | for the part to be constructed. |
+ (instancetype) partWithSpatialReference: | (nullable AGSSpatialReference *) | spatialReference |
Create a new 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.
spatialReference | of the part. |
- (AGSPoint*) pointAtIndex: | (NSInteger) | index |
Vertex at specified position in the part.
index | of desired position. 0 is the first position. |
- (AGSEnumerator*) pointEnumerator |
Returns an enumerator object that lets you access each point in the segment collection.
- (void) removeAllSegments |
Remove all segments (and thereby also vertices) from the part.
- (void) removePointAtIndex: | (NSInteger) | index |
Remove vertex at specified position.
index | of desired position. 0 is the first position. |
- (void) removeSegmentAtIndex: | (NSInteger) | index |
Remove segment at specified position.
index | of desired position. 0 is the first position. |
- (AGSSegment*) segmentAtIndex: | (NSInteger) | index |
Segment at specified position in the part.
index | of desired position. 0 is the first position. |
- (AGSEnumerator*) segmentEnumerator |
Returns an enumerator object that lets you access each segment in the segment collection.
- (NSInteger) segmentIndexForEndPointIndex: | (NSInteger) | pointIndex |
Position of segment that contains the specified vertex as its ending point.
pointIndex | representing the position of vertex which serves as the ending point for the segment. |
0
is the first position. - (void) segmentIndexForPointIndex: | (NSInteger) | pointIndex | |
outSegmentStartPointIndex: | (NSInteger *) | outSegmentStartPointIndex | |
outSegmentEndPointIndex: | (NSInteger *) | outSegmentEndPointIndex | |
Returns the segment start and end indices from the given pointIndex
.
If the point is not a start or end point a value equivalent to -1 is set.
pointIndex | Zero-based index of the point. |
outSegmentStartPointIndex | This is set to the segment index using the point as a start point. |
outSegmentEndPointIndex | This is set to the segment index using the point as an end point. |
- (NSInteger) segmentIndexForStartPointIndex: | (NSInteger) | pointIndex |
Position of segment that contains the specified vertex as its starting point.
pointIndex | representing the position of vertex which serves as the starting point for the segment. |
0
is the first position. - (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 -
idx | subscript index |
/** Sets the segment at the specified index. Supports assigning an individual segment using array-style subscript expressions. For example -
obj | segment to set |
idx | subscript index |
- (void) setPoint: | (AGSPoint *) | point | |
atIndex: | (NSInteger) | index | |
Replace a point in the part at the specified point index. Segments that use this point will be changed.
The points in the part are the start and end points of segments. Setting a new point will affect 1 or 2 segments using the point at the specified index. Affected segments will become line segments and reference the new point.
The points in the part correspond to start and end points of segments. Setting a new point will affect one or two segments using the point at the specified index. The type of affected segment(s) (AGSLineSegment
, AGSCubicBezierSegment
, or AGSEllipticArcSegment
) will remain 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.
point | vertex to replace with. |
index | of vertex to replace. |
- (void) setPointWithX: | (double) | x | |
y: | (double) | y | |
atIndex: | (NSInteger) | index | |
Replace existing vertex at the specified position.
x | coordinate of the vertex. |
y | coordinate of the vertex. |
index | of desired position. 0 is the first position. |
- (void) setSegment: | (AGSSegment *) | segment | |
atIndex: | (NSInteger) | index | |
Replace existing segment with the specified one.
segment | to replace with. |
index | of segment to replace. |
- (NSInteger) startPointIndexForSegmentIndex: | (NSInteger) | segmentIndex |
Position of staring vertex for the specified segment.
segmentIndex | representing the position of the segment whose starting vertex is desired. |
0
is the first position.
|
readnonatomicassign |
Indicates whether the part contains any segments.
|
readnonatomiccopy |
Ending vertex of the last segment in the part.
|
readnonatomicassign |
Indicates whether the part contains any curve segments.
Prior to v100.12, only AGSLineSegment
linear segments were available to be added to mutable parts when building geometries.
From v100.12, geometry builders support curve segments. This property returns YES
if any segments where AGSSegment::curve
is YES
have been added to the part.
|
readnonatomicassign |
Number of vertices in the part. Each segment contains 2 vertices (start and end). Connected segments can share a vertex.
|
readnonatomiccopy |
All the vertices in this part.
|
readnonatomicassign |
Number of segments in the part.
|
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.
|
readnonatomiccopy |
Starting vertex of the first segment in the part.