![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This callback class may be implemented by an application to:
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:
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 TSLCoordinateSystem * | onNoCoordinateSystem (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 () |
|
inlineprotectedvirtual |
|
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.
data | The data being loaded |
drivers | A list of drivers which support the data |
|
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
dataSet | The data set |
numProcessingTotal | The total number of data sets being processed by the layer |
|
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.
dataSet | The data set |
numProcessingTotal | The total number of data sets being processed by the layer |
|
virtual |
This function will be called when the datalayer has scheduled a data set for processing
dataSet | The scheduled data set |
numProcessingTotal | The total number of data sets being processed by the layer |
|
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.
capabilities | Should be populated with the device capabilities. |
|
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.
dataSet | The data set being loaded |
driver | The direct import driver being used. The application must not delete this object. |
|
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.
dataSet | The data set being loaded |
driver | The direct import driver being used. The application must not delete this object. |
|
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
dataSet | The dataSet for the tile |
numProcessing | The number of tiles within dataSet which are being processed. |
numProcessingTotal | The total number of tiles being processed by the layer. |
|
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.
dataSet | The dataSet for the tile |
numProcessing | The number of tiles within dataSet which are being processed. The layer may still be processing tiles from other data sets. |
numProcessingTotal | The total number of tiles being processed by the layer. |
|
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.
dataSet | The dataSet for the tile |
numProcessing | The number of tiles within dataSet which are being processed. |
numProcessingTotal | The total number of tiles being processed by the layer. |
|
virtual |
This function will be called when the datalayer has scheduled tiles for processing
dataSet | The data set for the tiles |
numScheduled | The number of tiles from dataSet which have just been scheduled |
numProcessing | The number of tiles within dataSet which are being processed. This includes numScheduled. |
numProcessingTotal | The total number of tiles being processed by the layer. |
|
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.