Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::MarkerSketches Class Reference

Sketches collection. More...

Inheritance diagram for gem::MarkerSketches:
Collaboration diagram for gem::MarkerSketches:

Public Member Functions

MarkerSketchesadd (const Marker &marker, const MarkerRenderSettings &settings, int index=-1) noexcept
 Add a new sketch with specific render settings.
const MarkerRenderSettingsgetRenderSettings (int index) const noexcept
 Get sketch render settings.
MarkerSketchessetRenderSettings (int index, const MarkerRenderSettings &settings) noexcept
 Set sketch render settings.
bool operator== (const MarkerCollection &markerCollection) const
 Comparison operator equal.
bool operator!= (const MarkerCollection &coll) const
 Comparison operator not equal.
LargeInteger getId () const noexcept
 Get collection id.
EMarkerType getType () const noexcept
 Get collection type.
const StringRef getName () const noexcept
 Get collection name.
void setName (const String &name) noexcept
 Set collection name.
int size () const noexcept
 Get marker count.
MarkerRef getMarkerAt (int index) const noexcept
 Get the marker at the given index.
Marker getMarkerById (LargeInteger id) const noexcept
 Get the marker with the given id.
int indexOf (const Marker &marker) const noexcept
 Get the index of the given marker.
int indexOf (LargeInteger id) const noexcept
 Get the index of the given marker id.
MarkerRef getPointsGroupHead (LargeInteger markerId) const
 Gets the points group head for the given marker id.
MarkerList getPointsGroupComponents (LargeInteger groupId) const
 Gets the points group components.
MarkerCollectiondel (int index) noexcept
 Delete a marker by index.
void clear () noexcept
 Delete all markers.
void hitTest (const RectangleGeographicArea &area, MarkerMatchList &list, const Marker *ignore=nullptr) const noexcept
 Hit test in collection markers.
RectangleGeographicArea getArea () const noexcept
 Get whole collection enclosing area.
template<typename TCollector>
bool iterateMarkers (TCollector collector) const noexcept
 Iterate marker collection markers and call collector for each.
int save (DataBuffer &buffer) const noexcept
 Serialize to buffer.

Static Public Member Functions

static std::pair< MarkerCollection, int > load (const DataBuffer &buffer) noexcept
 Create & load from buffer.

Detailed Description

Sketches collection.

Sketches collection contains markers with individual render settings

Sketches collections are always on top of the other marker collection

Sketches collections are in the following Z-order: polygon sketches, polylines sketches, points sketches

Member Function Documentation

◆ add()

MarkerSketches & gem::MarkerSketches::add ( const Marker & marker,
const MarkerRenderSettings & settings,
int index = -1 )
inlinenoexcept

Add a new sketch with specific render settings.

Parameters
[in]markerThe marker added to the collection
[in]settingsThe marker render settings
[in]indexThe new marker position in collection. -1 means at the collection end ( topmost )
Returns
MarkerSketches reference

◆ del()

MarkerCollection & gem::MarkerCollection::del ( int index)
inlinenoexceptinherited

Delete a marker by index.

Parameters
[in]indexThe marker index to be deleted
Returns
MarkerCollection reference

◆ getArea()

RectangleGeographicArea gem::MarkerCollection::getArea ( ) const
inlinenoexceptinherited

Get whole collection enclosing area.

Returns
Collection rectangle geographic area

◆ getId()

LargeInteger gem::MarkerCollection::getId ( ) const
inlinenoexceptinherited

Get collection id.

Returns
Collection id

◆ getMarkerAt()

MarkerRef gem::MarkerCollection::getMarkerAt ( int index) const
inlinenoexceptinherited

Get the marker at the given index.

Return empty if index is not valid

Parameters
[in]indexThe marker index
Returns
Marker reference

◆ getMarkerById()

Marker gem::MarkerCollection::getMarkerById ( LargeInteger id) const
inlinenoexceptinherited

Get the marker with the given id.

Parameters
[in]idMarker id
Returns
Marker

◆ getName()

const StringRef gem::MarkerCollection::getName ( ) const
inlinenoexceptinherited

Get collection name.

Returns
Collection name

◆ getPointsGroupComponents()

MarkerList gem::MarkerCollection::getPointsGroupComponents ( LargeInteger groupId) const
inlineinherited

Gets the points group components.

Parameters
[in]groupIdThe group id

This requires the collection to be added to a map view collection with MarkerCollectionRenderSettings::buildPointsGroupConfig set to true

If points group head info is not available the function will return a default list and will set the API error accordingly

Returns
Points group components list

◆ getPointsGroupHead()

MarkerRef gem::MarkerCollection::getPointsGroupHead ( LargeInteger markerId) const
inlineinherited

Gets the points group head for the given marker id.

Parameters
[in]markerIdThe marker id belonging to the points group

This requires the collection to be added to a map view collection with MarkerCollectionRenderSettings::buildPointsGroupConfig set to true

If points group head info is not available the function will return a reference to the queried marker and will set the API error accordingly

If markerId is already a points group head the function will return a reference to the queried marker and will set the API error accordingly

Returns
Points group head marker reference

◆ getRenderSettings()

const MarkerRenderSettings * gem::MarkerSketches::getRenderSettings ( int index) const
inlinenoexcept

Get sketch render settings.

Parameters
[in]indexThe marker index
Returns
Marker render settings

◆ getType()

EMarkerType gem::MarkerCollection::getType ( ) const
inlinenoexceptinherited

Get collection type.

Returns
Collection type

◆ hitTest()

void gem::MarkerCollection::hitTest ( const RectangleGeographicArea & area,
MarkerMatchList & list,
const Marker * ignore = nullptr ) const
noexceptinherited

Hit test in collection markers.

Parameters
[in]areaThe geographic area to be tested
[out]listThe list of markers that intersect the area
[in]ignoreThe marker to be ignored in the test

◆ indexOf() [1/2]

int gem::MarkerCollection::indexOf ( const Marker & marker) const
inlinenoexceptinherited

Get the index of the given marker.

Parameters
[in]markerThe marker
Returns
Marker index

◆ indexOf() [2/2]

int gem::MarkerCollection::indexOf ( LargeInteger id) const
inlinenoexceptinherited

Get the index of the given marker id.

Parameters
[in]idThe marker id
Returns
Marker index

◆ iterateMarkers()

template<typename TCollector>
bool gem::MarkerCollection::iterateMarkers ( TCollector collector) const
inlinenoexceptinherited

Iterate marker collection markers and call collector for each.

Collector should return true if iteration should continue and false if iteration should stop

Template Parameters
TCollectorThe collector function type
Parameters
[in]collectorThe collector function
Returns
true if iteration was completed, false if it was stopped by the collector

◆ load()

std::pair< MarkerCollection, int > gem::MarkerCollection::load ( const DataBuffer & buffer)
inlinestaticnoexceptinherited

Create & load from buffer.

Parameters
[in]bufferThe buffer to load from
Returns
MarkerCollection and error code

◆ operator!=()

bool gem::MarkerCollection::operator!= ( const MarkerCollection & coll) const
inlineinherited

Comparison operator not equal.

Parameters
[in]collMarkerCollection
Returns
true if not equal

◆ operator==()

bool gem::MarkerCollection::operator== ( const MarkerCollection & markerCollection) const
inlineinherited

Comparison operator equal.

Parameters
[in]markerCollectionMarkerCollection
Returns
true if equal

◆ save()

int gem::MarkerCollection::save ( DataBuffer & buffer) const
inlinenoexceptinherited

Serialize to buffer.

Parameters
[out]bufferThe buffer to serialize to
Returns
Error code

◆ setName()

void gem::MarkerCollection::setName ( const String & name)
inlinenoexceptinherited

Set collection name.

Parameters
[in]nameCollection name

◆ setRenderSettings()

MarkerSketches & gem::MarkerSketches::setRenderSettings ( int index,
const MarkerRenderSettings & settings )
inlinenoexcept

Set sketch render settings.

Parameters
[in]indexThe marker index
[in]settingsThe marker render settings
Returns
MarkerSketches reference

◆ size()

int gem::MarkerCollection::size ( ) const
inlinenoexceptinherited

Get marker count.

Returns
Marker count