Skip To Content ArcGIS for Developers Sign In Dashboard

PartCollection Class


A mutable collection of parts for creating a Multipart geometry from a MultipartBuilder. More...

Header: #include <PartCollection>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object and Iterable<Part *>

Public Functions

PartCollection(const SpatialReference &spatialReference, QObject *parent = nullptr)
int addPart(Part *part)
void addParts(const QList<Part *> &parts)
int indexOf(Part *part) const
void insertPart(int index, Part *part)
bool isEmpty() const
Part *part(int index) const
void removeAll()
void removePart(int index)
void setPart(int index, Part *part)
int size() const
SpatialReference spatialReference() const

Additional Inherited Members

Detailed Description

A mutable collection of parts for creating a Multipart geometry from a MultipartBuilder.

Parts can be added to, inserted into, and removed from PartCollections in order to define or change the complete shape of a Multipart (for example a Polygon or Polyline).

Member Function Documentation

PartCollection::PartCollection(const SpatialReference &spatialReference, QObject *parent = nullptr)

Constructor that takes a SpatialReference spatialReference and an optional parent.



int PartCollection::addPart(Part *part)

Adds a new Part part to the collection.

Returns -1 on error.

void PartCollection::addParts(const QList<Part *> &parts)

Adds new Parts parts to the collection.

This function was introduced in Esri::ArcGISRuntime 100.1.

int PartCollection::indexOf(Part *part) const

Gets the index of a part in the collection.

Returns -1 if the part is not found.

void PartCollection::insertPart(int index, Part *part)

Inserts part at index.

bool PartCollection::isEmpty() const

Gets whether this PartCollection is empty.

Returns true if this PartCollection contains no parts.

Part *PartCollection::part(int index) const

Gets the part at index.

Returns an empty Part on error.

See also setPart().

void PartCollection::removeAll()

Removes all the parts from this PartCollection.

void PartCollection::removePart(int index)

Removes the part at index.

void PartCollection::setPart(int index, Part *part)

Reassigns the part at index to part.

See also part().

int PartCollection::size() const

Gets the number of parts in this PartCollection.

Returns the number of parts.

SpatialReference PartCollection::spatialReference() const

Gets the spatial reference.

Feedback on this topic?