ArcGIS Runtime SDK for iOS: AGSMutablePartCollection Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSMutablePartCollection Class Reference

Description

Mutable collection of parts of a multipart geometry builder.

Instances of this class represent a mutable collection of parts of a multipart geometry builder (AGSMultipartBuilder). Not only is the collection modifiable, but it is made up of mutable parts and so the individual parts in the collection are also modifiable.

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

let collection:AGSMutablePartCollection = ... //A collection of parts
for part in collection {
//do something
}
Mutable collection of parts of a multipart geometry builder.
Definition: AGSMutablePartCollection.h:59

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

let collection:AGSMutablePartCollection = ... //A collection of parts
let part = collection[0] //The part at 0th index
collection[0] = newPart //Replace part at 0th index
Since
100
See also
AGSMultipartBuilder for multipart geometry builders
Inheritance diagram for AGSMutablePartCollection:
AGSObject

Instance Methods

(NSInteger) - addPart:
 
(NSArray< AGSMutablePart * > *) - array
 
(NSInteger) - indexOfPart:
 
(instancetype) - initWithSpatialReference:
 
(void) - insertPart:atIndex:
 
(AGSMutablePart *) - objectAtIndexedSubscript:
 
(AGSMutablePart *) - partAtIndex:
 
(AGSEnumerator *) - partEnumerator
 
(void) - removeAllParts
 
(void) - removePartAtIndex:
 
(void) - setObject:atIndexedSubscript:
 
(void) - setPart:atIndex:
 

Class Methods

(instancetype) + partCollectionWithSpatialReference:
 

Properties

NSInteger count
 
BOOL isEmpty
 
AGSSpatialReferencespatialReference
 
NSInteger totalPointCount
 

Method Documentation

◆ addPart:

- (NSInteger) addPart: (AGSMutablePart *)  part

Add a part to the end of this collection.

Parameters
partto add.
Returns
A position where the part was added. 0 is the first position.
Since
100

◆ array

- (NSArray<AGSMutablePart*>*) array

Returns an array of parts.

Since
100

◆ indexOfPart:

- (NSInteger) indexOfPart: (AGSMutablePart *)  part

Returns the index of the specified part.

Parameters
partwhose index needs to be located.
Returns
The index of specified part.
Since
100

◆ initWithSpatialReference:

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

Initialize a collection with specified spatial reference. All parts that belong to this collection 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 collection.
Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

◆ insertPart:atIndex:

- (void) insertPart: (AGSMutablePart *)  part
atIndex: (NSInteger)  index 

Insert a part at the specified position.

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

◆ objectAtIndexedSubscript:

- (AGSMutablePart*) objectAtIndexedSubscript: (NSInteger)  idx

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

AGSPolygonBuilder* polygonBldr = ... ; //polygon builder with 2 parts (rings)
AGSMutablePartCollection* parts = polygonBldr.parts;
AGSPart* part = parts[0]; //The 0th part
AGSMutablePartCollection * parts
Definition: AGSMultipartBuilder.h:62
Represents a single part of a multipart geometry (AGSPolygon or AGSPolyline).
Definition: AGSPart.h:67
A builder to build polygon geometries.
Definition: AGSPolygonBuilder.h:42
Parameters
idxAn index within the bounds of the collection.
Returns
The part located at the index.
Since
100

◆ partAtIndex:

- (AGSMutablePart*) partAtIndex: (NSInteger)  index

Returns the part at the specified index.

Parameters
indexAn index within the bounds of the collection.
Returns
The part located at the index.
Since
100

◆ partCollectionWithSpatialReference:

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

Create a new collection with specified spatial reference. All parts that belong to this collection 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 collection.
Returns
A new collection of parts.
Since
100
Note
Geometries that represent geographic locations should always have a spatial reference. Otherwise the coordinates of the geometry are meaningless.

◆ partEnumerator

- (AGSEnumerator*) partEnumerator

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

Since
100

◆ removeAllParts

- (void) removeAllParts

Remove all parts from this collection.

Since
100

◆ removePartAtIndex:

- (void) removePartAtIndex: (NSInteger)  index

Remove part at specified position.

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

◆ setObject:atIndexedSubscript:

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

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

AGSPolygonBuilder* polygonBldr = ... ; //polygon builder with 2 parts (rings)
AGSMutablePartCollection* parts = polygonBldr.parts;
parts[0] = newPart //The 0th part
Parameters
objpart to set.
idxsubscript index.
Since
100

◆ setPart:atIndex:

- (void) setPart: (AGSMutablePart *)  part
atIndex: (NSInteger)  index 

Replace existing part with the specified one.

Parameters
partto replace with.
indexof part to replace.
Since
100

Property Documentation

◆ count

- (NSInteger) count
readnonatomicassign

The number of parts in the collection.

Since
100

◆ isEmpty

- (BOOL) isEmpty
readnonatomicassign

Indicates whether the collection is empty or not.

Since
100

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstrong

The spatial reference associated with parts in the collection. It specifies the coordinate system for each part's x & y coordinate values. All parts in this collection 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.

◆ totalPointCount

- (NSInteger) totalPointCount
readnonatomicassign

The total number of points (vertices) across all parts of the geometry.

Since
100