MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTrackAggregatorDensity Class Reference
Inheritance diagram for TSLTrackAggregatorDensity:

Detailed Description

A track aggregator which dynamically aggregates co-located tracks of the same type within a gridded layout

This aggregator uses a dynamic configuration based on track attributes and a grid layout.

To configure this aggregator the application must:

  • Create a number of tracks
  • Ensure that each track has a named attribute, which specifies the type of the track
  • Create an instance of the aggregator, providing the name of the track attribute to use
  • Set the aggregator on any tracks which will be aggregated
  • Add one or more ZoomLevels to the aggregator to specify the grid layout of the calculation
  • Add one or more rules to each ZoomLevel to specify the parameters of the aggregation algorithm

Classes

struct  AggregationRule
 
struct  ZoomLevel
 

Public Member Functions

 TSLTrackAggregatorDensity (const char *attribName)
 
virtual ~TSLTrackAggregatorDensity ()
 Destructor.
 
void attributeName (const char *attribName)
 
const char * attributeName () const
 
uint32_t numZoomLevels () const
 
ZoomLeveladdZoomLevel (double triggerLevel, uint32_t gridX, uint32_t gridY)
 
void removeZoomLevel (uint32_t index)
 
ZoomLevelqueryZoomLevel (uint32_t index) const
 
ZoomLeveloperator[] (uint32_t index) const
 
virtual TSLTrackAggregator::AggregatorType type () const
 
virtual void preProcess ()
 
virtual TSLTrackBaseaggregateTrack (TSLTrackBase *track, const TSLRenderingInterface *renderingInterface)
 
virtual void postProcess ()
 
virtual uint32_t numAdditionalTracks () const
 Query the number of additional tracks provided by this aggregator.
 
virtual TSLTrackBasegetAdditionalTrack (uint32_t index) const
 Query an additional track provided by this aggregator.
 
- Public Member Functions inherited from TSLTrackAggregator
virtual ~TSLTrackAggregator ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from TSLTrackAggregator
enum  AggregatorType { AggregatorCustom , AggregatorByEchelon , AggregatorByDensity }
 The types of aggregator provided by the MapLink API. More...
 
- Protected Member Functions inherited from TSLTrackAggregator
 TSLTrackAggregator ()
 

Constructor & Destructor Documentation

◆ TSLTrackAggregatorDensity()

TSLTrackAggregatorDensity::TSLTrackAggregatorDensity ( const char * attribName)

Constructor

The density aggregator must be provided with an attribute name. During aggregation the value of this attribute will be queried by calling TSLTrackBase::getAttributeValue( attribName ). Any tracks which do not have a valid value for this attribute will be ignored by the aggregator.

Parameters
attribNameThe name of the track attribute to use

◆ ~TSLTrackAggregatorDensity()

virtual TSLTrackAggregatorDensity::~TSLTrackAggregatorDensity ( )
virtual

Destructor.

Member Function Documentation

◆ addZoomLevel()

ZoomLevel * TSLTrackAggregatorDensity::addZoomLevel ( double triggerLevel,
uint32_t gridX,
uint32_t gridY )

Configure/add a new ZoomLevel

Parameters
triggerLevelThe resolution for the zoom level, in Map Units Per Pixel
gridXThe number of horizontal cells (columns) within the aggregation grid
gridYThe number of vertical cells (rows) within the aggregation grid
Returns
The ZoomLevel which has been added to the aggregator. The application may modify this object however must not delete it

◆ aggregateTrack()

virtual TSLTrackBase * TSLTrackAggregatorDensity::aggregateTrack ( TSLTrackBase * track,
const TSLRenderingInterface * renderingInterface )
virtual

This method will be called by the track manager to check whether a track is aggregated or not. The implementation of the aggregator performs its algorithm to determine this, and return the correct TSLTrackBase instance which should be rendered. If NULL is returned the provided track will not be rendered by the track manager

The algorithm will return null if:

  • the input track is null.
  • the rendering interface is null.
  • no zoom levels are configured.
  • the matching zoom level is not the first level. If the matching zoom level is the first level then the current track is returned for display. If the matching zoom level is not the first level then the current track is added to the additional tracks for processing in the postProcess function.

The rendering interface is required to allow the aggregator access to draw-specific settings such as the extent of the drawing surface, or the zoom level of the display.

Parameters
trackThe input track
renderingInterfaceThe current rendering interface
Returns
the TSLTrackBase instance to be rendered.

Implements TSLTrackAggregator.

◆ attributeName() [1/2]

const char * TSLTrackAggregatorDensity::attributeName ( ) const

Query the attribute name used by the aggregation calculation

Returns
The attribute name

◆ attributeName() [2/2]

void TSLTrackAggregatorDensity::attributeName ( const char * attribName)

Set the attribute name for the aggregation calculation

The value of this attribute will be queried from any tracks passed to the aggregator, and will be used to select aggregation rules

Parameters
attribNameThe name of the attribute

◆ getAdditionalTrack()

virtual TSLTrackBase * TSLTrackAggregatorDensity::getAdditionalTrack ( uint32_t index) const
virtual

Query an additional track provided by this aggregator.

Reimplemented from TSLTrackAggregator.

◆ numAdditionalTracks()

virtual uint32_t TSLTrackAggregatorDensity::numAdditionalTracks ( ) const
virtual

Query the number of additional tracks provided by this aggregator.

Reimplemented from TSLTrackAggregator.

◆ numZoomLevels()

uint32_t TSLTrackAggregatorDensity::numZoomLevels ( ) const

Query the number of ZoomLevels configured for the aggregator

Returns
The number of zoom levels

◆ operator[]()

ZoomLevel * TSLTrackAggregatorDensity::operator[] ( uint32_t index) const

Array operator - Will query zoom levels within the aggregator

See also
queryZoomLevel

◆ postProcess()

virtual void TSLTrackAggregatorDensity::postProcess ( )
virtual

Perform any required post processing

This method is called by the track manager during each draw

  • This method is called after all applicable tracks have been passed to aggregateTrack
  • This method is called before the track manager reads any additional tracks from the aggregator

The aggregator uses this method to determine whether there are sufficient tracks stored from the aggregateTrack function i.e. those that are in the required area at the current zoom level of the same type to meet the minimum number for the current rule to form a trackgroup. Any tracks not meeting this criteria are added to the list to be drawn. If a trackgroup is formed then that is also added to the additional track list.

Reimplemented from TSLTrackAggregator.

◆ preProcess()

virtual void TSLTrackAggregatorDensity::preProcess ( )
virtual

Reset the aggregator and perform any required pre processing

This method will be called by the track manager at the start of each draw to allow the aggregator to perform any setup or reset operations required.

Reimplemented from TSLTrackAggregator.

◆ queryZoomLevel()

ZoomLevel * TSLTrackAggregatorDensity::queryZoomLevel ( uint32_t index) const

Query a ZoomLevel

The application may modify the returned object however must not delete it

Parameters
indexThe index of the level to query
Returns
The requested level or NULL on error

◆ removeZoomLevel()

void TSLTrackAggregatorDensity::removeZoomLevel ( uint32_t index)

Remove a ZoomLevel

Parameters
indexThe index of the level to remove

◆ type()

virtual TSLTrackAggregator::AggregatorType TSLTrackAggregatorDensity::type ( ) const
virtual

Query the type of the aggregator

Returns
The type of the aggregator

Implements TSLTrackAggregator.