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

Detailed Description

This callback class may be implemented by an application to:

  • Provide information required to load data sets
  • Receive feedback on the data loading process
  • Receive redraw requests from the data layer

The application is not required to implement this callback class nor all the methods. If a callback implementation is not provided the data layer will assume default actions.

To implement these callbacks the application should provide a class which inherits from TSLDirectImportDataLayerCallbacks and pass it to TSLDirectImportDataLayer::setCallbacks.

The application must clear the callbacks by calling TSLDirectImportDataLayer::setCallbacks( NULL ) before the data layer is destroyed.

These callbacks may be made from any thread, including the application's foreground/draw thread.

There are two mandatory methods that must be implemented:

  • requestRedraw
  • onDeviceCapabilitiesRequired

This is principally because the default actions are unlikely to be sensible for an application.

Public Member Functions

virtual void onDeviceCapabilitiesRequired (TSLDeviceCapabilities &capabilities)=0
 
virtual unsigned int onChoiceOfDrivers (const char *data, const TSLvector< const char * > *drivers)
 
virtual const TSLCoordinateSystemonNoCoordinateSystem (const TSLDirectImportDataSet *dataSet, TSLDirectImportDriver *driver)
 
virtual TSLMUExtent onNoExtent (const TSLDirectImportDataSet *dataSet, TSLDirectImportDriver *driver)
 
virtual void onDataSetLoadScheduled (const TSLDirectImportDataSet *dataSet, unsigned int numProcessingTotal)
 
virtual void onDataSetLoadCancelled (const TSLDirectImportDataSet *dataSet, unsigned int numProcessingTotal)
 
virtual void onDataSetLoadComplete (const TSLDirectImportDataSet *dataSet, unsigned int numProcessingTotal)
 
virtual void onTileLoadScheduled (const TSLDirectImportDataSet *dataSet, unsigned int numScheduled, unsigned int numProcessing, unsigned int numProcessingTotal)
 
virtual void onTileLoadCancelled (const TSLDirectImportDataSet *dataSet, unsigned int numProcessing, unsigned int numProcessingTotal)
 
virtual void onTileLoadFailed (const TSLDirectImportDataSet *dataSet, unsigned int numProcessing, unsigned int numProcessingTotal)
 
virtual void onTileLoadComplete (const TSLDirectImportDataSet *dataSet, unsigned int numProcessing, unsigned int numProcessingTotal)
 
virtual void requestRedraw ()=0
 

Protected Member Functions

virtual ~TSLDirectImportDataLayerCallbacks ()
 

Constructor & Destructor Documentation

◆ ~TSLDirectImportDataLayerCallbacks()

TSLDirectImportDataLayerCallbacks::~TSLDirectImportDataLayerCallbacks ( )
inlineprotectedvirtual

Member Function Documentation

◆ onChoiceOfDrivers()

virtual unsigned int TSLDirectImportDataLayerCallbacks::onChoiceOfDrivers ( const char * data,
const TSLvector< const char * > * drivers )
virtual

This function will be called during TSLDirectImportDataLayer::analyseData and TSLDirectImportDataLayer::loadData, if multiple drivers support the provided data.

If no callback has been provided, the datalayer will choose the first driver from the list.

Parameters
dataThe data being loaded
driversA list of drivers which support the data
Returns
The index in the list of the selected driver

◆ onDataSetLoadCancelled()

virtual void TSLDirectImportDataLayerCallbacks::onDataSetLoadCancelled ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessingTotal )
virtual

This function will be called when a data set load has been cancelled

Normally this will only happen if the data set is removed from the layer

Parameters
dataSetThe data set
numProcessingTotalThe total number of data sets being processed by the layer

◆ onDataSetLoadComplete()

virtual void TSLDirectImportDataLayerCallbacks::onDataSetLoadComplete ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessingTotal )
virtual

This function will be called when a data set load has completed

When the next redraw is performed the datalayer may now schedule tiles from this data set.

Parameters
dataSetThe data set
numProcessingTotalThe total number of data sets being processed by the layer

◆ onDataSetLoadScheduled()

virtual void TSLDirectImportDataLayerCallbacks::onDataSetLoadScheduled ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessingTotal )
virtual

This function will be called when the datalayer has scheduled a data set for processing

Parameters
dataSetThe scheduled data set
numProcessingTotalThe total number of data sets being processed by the layer

◆ onDeviceCapabilitiesRequired()

virtual void TSLDirectImportDataLayerCallbacks::onDeviceCapabilitiesRequired ( TSLDeviceCapabilities & capabilities)
pure virtual

This function will be called by the datalayer when performing automatic tiling calculations.

If the application contains multiple drawing surfaces these values should be set for the main map display, or for the surface with the largest display extent.

If the application fails to provide this information the layer will assume a 1024x768 display, at 72DPI.

See also
TSLDrawingSurface::getDeviceCapabilities.
Parameters
capabilitiesShould be populated with the device capabilities.

◆ onNoCoordinateSystem()

virtual const TSLCoordinateSystem * TSLDirectImportDataLayerCallbacks::onNoCoordinateSystem ( const TSLDirectImportDataSet * dataSet,
TSLDirectImportDriver * driver )
virtual

This function will be called if the direct import driver fails to provide the datalayer with a coordinate system.

The implementation of this function should return a valid coordinate system for the data, or NULL if one is not available. If no coordinate system is available the data will not be loaded.

A pointer to the direct import driver is provided to allow the application to query additional information from the driver. The state of the driver should not be modified during this callback.

Parameters
dataSetThe data set being loaded
driverThe direct import driver being used. The application must not delete this object.
Returns
The coordinate system of the data, or NULL.

◆ onNoExtent()

virtual TSLMUExtent TSLDirectImportDataLayerCallbacks::onNoExtent ( const TSLDirectImportDataSet * dataSet,
TSLDirectImportDriver * driver )
virtual

This function will be called if the direct import driver fails to provide the datalayer with an extent.

The implementation of this function should return a valid extent (in map units) for the data, or TSLMUExtent() if one is not available. If no extent can be determined the data will not be loaded.

A pointer to the direct import driver is provided to allow the application to query additional information from the driver. The state of the driver should not be modified during this callback.

Parameters
dataSetThe data set being loaded
driverThe direct import driver being used. The application must not delete this object.
Returns
The extent of the data, or TSLMUExtent().

◆ onTileLoadCancelled()

virtual void TSLDirectImportDataLayerCallbacks::onTileLoadCancelled ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessing,
unsigned int numProcessingTotal )
virtual

This function will be called when a tile has been cancelled

Normally this will only happen if the data set is removed from the layer

Parameters
dataSetThe dataSet for the tile
numProcessingThe number of tiles within dataSet which are being processed.
numProcessingTotalThe total number of tiles being processed by the layer.

◆ onTileLoadComplete()

virtual void TSLDirectImportDataLayerCallbacks::onTileLoadComplete ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessing,
unsigned int numProcessingTotal )
virtual

This function will be called when a tile has processed successfully

If numProcessing reaches zero the layer has finished processing all tiles within the data set.

If numProcessingTotal reaches zero the layer has finished processing all scheduled tiles. In this situation both this function and requestRedraw will be called.

If the application wishes to trigger a redraw for every tile, then it may do so in this callback. Under those circumstances, and the application is using buffering, then notifyChanged should be called on the layer. This is unnecessary if the application is setup to redraw constantly.

Parameters
dataSetThe dataSet for the tile
numProcessingThe number of tiles within dataSet which are being processed. The layer may still be processing tiles from other data sets.
numProcessingTotalThe total number of tiles being processed by the layer.

◆ onTileLoadFailed()

virtual void TSLDirectImportDataLayerCallbacks::onTileLoadFailed ( const TSLDirectImportDataSet * dataSet,
unsigned int numProcessing,
unsigned int numProcessingTotal )
virtual

This function will be called when a tile has failed to process

In most situations the failure should have been caught earlier on, during basic data analysis. For more information about the failure please see the MapLink error stack.

Empty tiles are not considered failures and will trigger onTileLoadComplete.

Parameters
dataSetThe dataSet for the tile
numProcessingThe number of tiles within dataSet which are being processed.
numProcessingTotalThe total number of tiles being processed by the layer.

◆ onTileLoadScheduled()

virtual void TSLDirectImportDataLayerCallbacks::onTileLoadScheduled ( const TSLDirectImportDataSet * dataSet,
unsigned int numScheduled,
unsigned int numProcessing,
unsigned int numProcessingTotal )
virtual

This function will be called when the datalayer has scheduled tiles for processing

Parameters
dataSetThe data set for the tiles
numScheduledThe number of tiles from dataSet which have just been scheduled
numProcessingThe number of tiles within dataSet which are being processed. This includes numScheduled.
numProcessingTotalThe total number of tiles being processed by the layer.

◆ requestRedraw()

virtual void TSLDirectImportDataLayerCallbacks::requestRedraw ( )
pure virtual

This function will be called by the datalayer to request that the application performs a draw operation.

If the application is setup to redraw constantly this function does not need to perform any action.

The data layer will not schedule any further tiles for loading until the application has performed a redraw.

When the application performs the redraw the datalayer will draw any tiles which are already loaded, and schedule any additional tiles within the draw extent.

Applications may also use onTileLoadComplete to trigger redraws, however this should not be done for every tile.

Performing a redraw before this method has been called may schedule additional tiles and delay the calling of this function.