MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLDirectImportScaleBand Class Reference

Detailed Description

A scale band within a TSLDirectImportDataLayer.

This scale band may contain TSLDirectImportDataSets, and is used to define the scales at which this data is displayed.

When the TSLDirectImportDataLayer is drawn by a TSLDrawingSurface it will select a scale band to draw. This is based on the minimum scale of each band, and the scale the data is being drawn at.

This class may be created by using TSLDirectImportDataLayer::addScaleBand and will always be owned by the direct import layer.

Public Types

enum  TilingMethod { TilingMethodRegularGrid , TilingMethodPolarOptimised }
 Tiling methods, used to decide the layout of the tiles. More...
 

Public Member Functions

void tilingMethod (TSLDirectImportScaleBand::TilingMethod method)
 
TSLDirectImportScaleBand::TilingMethod tilingMethod ()
 
void setPolarTilingFactors (double startThreshold, double interval)
 
const char * name () const
 
double minScale () const
 
unsigned int tilesX () const
 
unsigned int tilesY () const
 
bool automaticTiling () const
 Query whether the tiling was automatically setup or specified by the application.
 
const TSLDirectImportDataSetloadData (TSLDirectImportDataSet *dataSet, const TSLFeatureClassConfig *config=NULL)
 
unsigned int numDataSets () const
 
const TSLDirectImportDataSetgetDataSet (unsigned int index) const
 
TSLDirectImportDataSetgetDataSet (unsigned int index)
 
bool moveData (unsigned int from, unsigned int to)
 
bool moveDataSet (const TSLDirectImportDataSet *dataSetFrom, const TSLDirectImportDataSet *dataSetTo, bool placeBehind=true)
 
bool moveDataToBack (unsigned int from)
 
bool moveDataSetToBack (const TSLDirectImportDataSet *dataSetFrom)
 
bool moveDataToFront (unsigned int from)
 
bool moveDataSetToFront (const TSLDirectImportDataSet *dataSetFrom)
 
bool removeData (unsigned int index)
 
bool removeDataSet (const TSLDirectImportDataSet *dataSet)
 

Member Enumeration Documentation

◆ TilingMethod

Tiling methods, used to decide the layout of the tiles.

Enumerator
TilingMethodRegularGrid 

TilingMethodRegularGrid is the default. Tiles are constructed in a regular grid where every tile is the same size. Best for Mercator-like display projections.

TilingMethodPolarOptimised 

TilingMethodPolarOptimised reduces the number of tiles near the poles. Past a set latitude threshold, the width of tiles is increased nearer to the poles, decreasing the number of tiles at the poles. Improves performance on Stereoscopic-like display projections, where the longitude lines converge at the poles.

Member Function Documentation

◆ automaticTiling()

bool TSLDirectImportScaleBand::automaticTiling ( ) const

Query whether the tiling was automatically setup or specified by the application.

◆ getDataSet() [1/2]

TSLDirectImportDataSet * TSLDirectImportScaleBand::getDataSet ( unsigned int index)

Query a dataset

The application takes ownership of the returned pointer and must call TSLDirectImportDataSet::destroy when finished with it.

The application may modify the returned dataset. Any modified settings will not be applied until the application calls TSLDirectImportDataSet::reprocess or the data is otherwise reloaded by the layer.

Parameters
indexThe index of the dataset within this scale band.
Returns
The requested dataset, or NULL on error.

◆ getDataSet() [2/2]

const TSLDirectImportDataSet * TSLDirectImportScaleBand::getDataSet ( unsigned int index) const

Query a dataset

Parameters
indexThe index of the dataset within this scale band.
Returns
The requested dataset, or NULL on error.

◆ loadData()

const TSLDirectImportDataSet * TSLDirectImportScaleBand::loadData ( TSLDirectImportDataSet * dataSet,
const TSLFeatureClassConfig * config = NULL )

Load some data for display.

The provided TSLFeatureClassConfig will be used to determine feature masking, classification, and rendering of the data.

The provided data will be scheduled to load asynchronously. The application must provide an implementation of TSLDirectImportDataLayerCallbacks in order to be notified when the load/processing has completed.

The data will be loaded into this scale band regardless of the data's scale. Data may be sorted into an appropriate band automatically by calling TSLDirectImportDatalayer::loadData.

TSLDirectImportDataSet::minDisplayScale and TSLDirectImportDataSet::maxDisplayScale may be used to further limit the display of the dataset within the band.

If a TSLDirectImportDataSetMultiLevelRaster is loaded then any child data sets will be used in order to provide efficient processing/display within the scale band. The min/max display scale of the base data set and each child will be set accordingly in order to achieve this.

Features will be rendered based on the definition in the provided TSLFeatureClassConfig.

Parameters
dataSetThe data to load. This object may be created by calling TSLDirectImportDataLayer::createDataSets. The application retains ownership of this object.
configThe feature configuration object to use. This must be provided for vector datasets.
Returns
The loaded dataset, or NULL on error.

◆ minScale()

double TSLDirectImportScaleBand::minScale ( ) const

Query the minimum display scale of this band.

Returns
The minimum scale of this band.

◆ moveData()

bool TSLDirectImportScaleBand::moveData ( unsigned int from,
unsigned int to )

Move a dataset to the specified index

This method may be used to modify the draw order of data within the scale band. This operation will be performed synchronously.

Parameters
fromThe index of the dataset to move
toThe index to move the dataset to. If a dataset exists at this index the moved dataset will be placed behind it. Passing numDataSets() will move the dataset to the front.
Returns
true if the dataset was moved, false otherwise

◆ moveDataSet()

bool TSLDirectImportScaleBand::moveDataSet ( const TSLDirectImportDataSet * dataSetFrom,
const TSLDirectImportDataSet * dataSetTo,
bool placeBehind = true )

Move a dataset infront/behind another dataset

This method may be used to modify the draw order of data within the scale band. This operation will be performed synchronously.

Parameters
dataSetFromThe dataset to move
dataSetToThe dataset to move infront/behind of
placeBehindif true dataSetFront will be placed behind dataSetTo, otherwise it will be placed infront.
Returns
true if the dataset was moved, false otherwise

◆ moveDataSetToBack()

bool TSLDirectImportScaleBand::moveDataSetToBack ( const TSLDirectImportDataSet * dataSetFrom)

Move a dataset to the back

Parameters
dataSetFromThe dataset to move
Returns
true if the dataset was moved, false otherwise

◆ moveDataSetToFront()

bool TSLDirectImportScaleBand::moveDataSetToFront ( const TSLDirectImportDataSet * dataSetFrom)

Move a dataset to the front

Parameters
dataSetFromThe dataset to move
Returns
true if the dataset was moved, false otherwise

◆ moveDataToBack()

bool TSLDirectImportScaleBand::moveDataToBack ( unsigned int from)

Move a dataset to the back

Parameters
fromThe index of the dataset to move
Returns
true if the dataset was moved, false otherwise

◆ moveDataToFront()

bool TSLDirectImportScaleBand::moveDataToFront ( unsigned int from)

Move a dataset to the front

Parameters
fromThe index of the dataset to move
Returns
true if the dataset was moved, false otherwise

◆ name()

const char * TSLDirectImportScaleBand::name ( ) const

Query the name of this band.

This name may be used to identify the band within the layer, and to set band-specific rendering via a TSLFeature.

Returns
The name of this band. An empty string will be returned for the default scale band.

◆ numDataSets()

unsigned int TSLDirectImportScaleBand::numDataSets ( ) const

Query the number of datasets within this scale band.

Returns
The number of datasets loaded into this scale band.

◆ removeData()

bool TSLDirectImportScaleBand::removeData ( unsigned int index)

Remove a dataset from the scale band

This operation will be performed synchronously.

If this method returns true the application should perform a redraw. This method will not trigger TSLDirectImportDataLayerCallbacks::requestRedraw.

Parameters
indexThe index of the dataset to remove
Returns
true if the dataset was removed, false otherwise

◆ removeDataSet()

bool TSLDirectImportScaleBand::removeDataSet ( const TSLDirectImportDataSet * dataSet)

Remove a dataset from the scale band

This operation will be performed synchronously.

If this method returns true the application should perform a redraw. This method will not trigger TSLDirectImportDataLayerCallbacks::requestRedraw.

Parameters
datasetThe dataset to remove
Returns
true if the dataset was removed, false otherwise

◆ setPolarTilingFactors()

void TSLDirectImportScaleBand::setPolarTilingFactors ( double startThreshold,
double interval )

Set the factors used for calculating tiles in the PolarOptimised method

The PolarOptimised tiling method will reduce the number of tiles at the poles, by increasing their width past a certain latitude threshold. This method uses intervals to decide the factor by which the number of tiles is reduced. This factor doubles with each interval past the threshold, meaning that with each interval, the number of tiles is progressively halved. By default, tiles will be optimised above and below a threshold of 70 degrees Latitude, with an interval of 10 degrees.

These values will always be interpreted as positive.

Parameters
startThresholdThe starting latitude threshold.
intervalThe latitude value between intervals.

◆ tilesX()

unsigned int TSLDirectImportScaleBand::tilesX ( ) const

Query the number of horizontal tiles within the band

The value may be manually specified, or automatically calculated when the scale band is added.

Note
These tiles will form a grid across the full TMC range. They may not align exactly with the edges of datasets.
A dataset covering the world should have tiling close to this number, but may not match exactly due to the grid alignment.
Returns
The number of horizontal tiles within the band.

◆ tilesY()

unsigned int TSLDirectImportScaleBand::tilesY ( ) const

Query the number of vertical tiles within the band

The value may be manually specified, or automatically calculated when the scale band is added.

Note
These tiles will form a grid across the full TMC range. They may not align exactly with the edges of datasets.
A dataset covering the world should have tiling close to this number, but may not match exactly due to the grid alignment.
Returns
The number of vertical tiles within the band.

◆ tilingMethod() [1/2]

TSLDirectImportScaleBand::TilingMethod TSLDirectImportScaleBand::tilingMethod ( )

Get the tiling method.

Returns
The method being used.

◆ tilingMethod() [2/2]

void TSLDirectImportScaleBand::tilingMethod ( TSLDirectImportScaleBand::TilingMethod method)

Set the tiling method.

Parameters
methodThe method to use.