![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Passive component for displaying 2D and 3D data to a user supplied window. This class is an abstract class, specifying the generic behaviour of a 3D Drawing Surface.
The TSL3DDrawingSurface component is responsible for the display of 2D and 3D data in a window supplied by the end user. As the TSL3DDrawingSurface is passive, there are no inherent event handling routines.
This component provides the following capabilities
Other capabilities such as feature rendering, decluttering and style queries are provided by the base TSLDrawingSurfaceBase class and the derived platform specific classes.
A TSL3DDrawingSurface must be connected to a user-supplied window (or HDC/Pixmap) before it can display anything. It does not create a window of its own. This gives the user control over what is displayed in the window.
A TSL3DDrawingSurface will display 3D data and draped 2D data from any data layers that are connected to it. Layer control is handled by the TSLDrawing SurfaceBase class.
The area of data displayed by the TSLDrawingSurface can be modified by the methods contained on the drawing surface 'camera'. See the documentation of TSL3DCamera for further details.
To redraw a specific area on the TSLDrawingSurface, use 'drawDU'. The user must inform the TSL3DDrawingSurface of any modifications to the window size (in pixels) using the method 'wndResize' so that the TSL3DDrawingSurface can correctly calculate the area to display in the window.
3D Model styles are loaded by the TSLDrawingSurface from a file by calling 'loadStandardConfig' or by an individual call to setupModels' These methods are static and need to be called only per application. To free the memory associated with these configurations, the 'cleanup' static method should be called when an application finishes. References to single styles take the form of an index into the list of styles loaded.
The following is experimental:
Sharing of data layers between multiple 3D drawing surfaces in different threads. For a list of data layers that are safe to share between drawing surfaces please refer to the Threading section of the MapLink Developer's Guide. Note that picking using TSLDrawingSurfaceBase::pick() on these data layers is not thread safe.
Public Member Functions | |
TSL3DCamera * | camera () |
const TSL3DCamera * | camera () const |
bool | drawDU (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2, bool clear, bool offscreenSurface=false) |
bool | DUToLatLon (const TSLDeviceUnits x, const TSLDeviceUnits y, double &latitude, double &longitude) const |
void | exaggerateTerrain (double asl, double bsl) |
bool | frameRateIdle (bool onOff) |
bool | geocentricToGeodetic (double x, double y, double z, double &lat, double &lon, double &alt) const |
bool | geodeticToGeocentric (double lat, double lon, double alt, double &x, double &y, double &z) const |
bool | geocentricToWorld (double x, double y, double z, double &x1, double &y1, double &z1) const |
bool | geodeticToWorld (double lat, double lon, double alt, double &x, double &y, double &z) const |
bool | get3DOption (TSL3DOptionEnum option) const |
bool | getAnisotropicFilter () const |
float | getAnisotropicFilterLevel () const |
void | getDUExtent (TSLDeviceUnits *x1, TSLDeviceUnits *y1, TSLDeviceUnits *x2, TSLDeviceUnits *y2) const |
int | getFrameRate () const |
bool | getLightingOption (TSL3DLightingOptionEnum option) const |
void | getLODConfiguration (TSL3DLODConfiguration &lodConfiguration) const |
int | getMaxMapTextureCacheSize () const |
bool | getTerrainHeight (double latitude, double longitude, double &altitude) const |
bool | getTerrainRendering (int *wireframeColour, int *solidColour, const char **bitmapFile) const |
void | getTextureCacheSize (int &fontMaxSize, int &symbolMaxSize, int &app6aMaxSize) const |
bool | globalAmbientLight (double red, double green, double blue, double alpha) |
bool | globalAmbientLight (double *red, double *green, double *blue, double *alpha) const |
bool | isMapThreadStopped () const |
bool | queryModelIndices (int **indices, int *num) const |
void | set3DOption (TSL3DOptionEnum option, bool value) |
void | setAnisotropicFilter (bool state) |
void | setFrameRate (int frameRate) |
void | setLightingOption (TSL3DLightingOptionEnum option, bool value) |
void | setAnisotropicFilterLevel (float level) |
bool | setLODConfiguration (const TSL3DLODConfiguration &lodConfiguration) |
void | setMaxMapTextureCacheSize (int cacheInMB) |
virtual void | setOption (TSLOptionEnum option, bool value) |
bool | setRenderingCallback (TSL3DRenderingCallback callback, void *arg) |
bool | setTerrainRendering (int wireframeColour, int solidColour, const char *bitmapFile) |
void | setTextureCacheSize (const int fontMaxSize, const int symbolMaxSize, const int app6aMaxSize) |
void | stopMapThread () |
void | startMapThread () |
void | swapBuffers () |
bool | wndResize (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2, bool auto_redraw=true) |
virtual | ~TSL3DDrawingSurface () |
virtual double | viewAspect () |
bool | setTerrainLoadedCallback (TSL3DRenderingCallback callback, void *arg) |
![]() | |
bool | addDataLayer (TSLDataLayer *data_layer_interface, const char *data_id) |
bool | addDynamicRenderer (TSLDynamicRenderer *renderer, TSLFeatureID featureID=-1, const char *layerName=0) |
bool | addFeatureRendering (const char *featureName, TSLFeatureID featureID) |
void | attach (TSLDeviceContext handle) |
void | attach (TSLWindowHandle handle) |
void | attach (TSLDrawableHandle handle) |
bool | bringInFrontof (const char *move_data_layer, const char *target_data_layer) |
bool | bringToFront (const char *move_data_layer) |
bool | clearAllDeclutterData (const char *layer_name=0) |
void | clearAllDynamicRenderers () |
bool | clearBackgroundColour () |
bool | clearDeclutterData (const char *feature_name, const char *layer_name=0) |
bool | clearDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0) |
bool | clearFeatureRendering (const char *featureName, TSLFeatureID featureID) |
bool | clearFrame () |
bool | copyDeclutterData (const char *src_feature_name, const char *dest_feature_name, const char *src_layer_name=0, const char *dest_layer_name=0) |
void | detach () |
void | detachAllDynamicRenderers () |
bool | detachDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0) |
const char * | featureClass (TSLFeatureID feature_id) |
bool | forceLayer (const char *data_id, const char *detail_layer_name) |
bool | getBackgroundColour (TSLStyleID *value) |
bool | getColourValue (int colour, unsigned char &r, unsigned char &g, unsigned char &b) |
TSLDataLayer * | getDataLayer (const char *data_id) |
bool | getDataLayerInfo (int N, TSLDataLayer **dataLayer, const char **layerName) const |
bool | getDataLayerProps (const char *data_id, TSLPropertyEnum property_id, TSLPropertyValue *old_value) |
bool | getDeclutterStatus (const char *feature_name, TSLDeclutterStatusResultEnum *value, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | getDeclutterStatus (TSLFeatureID feature_id, TSLDeclutterStatusResultEnum *value, const char *dataLayerName, const char *detailLayerName=0) |
TSLDynamicRenderer * | getDynamicRenderer (TSLFeatureID featureID=-1, const char *layerName=0) |
bool | getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int *result) const |
bool | getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double *result) const |
bool | getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool *result) const |
bool | getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *result) const |
int | getNumDataLayers () const |
bool | getOption (TSLOptionEnum option) |
void | id (int id_) |
int | id () const |
bool | idleProcess () |
bool | loadDeclutter (const char *filename) |
bool | loadRendering (const char *filename) |
TSLPickResultSet * | pick (TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth, TSLPickSelector *selector=0) |
TSLPickResultSet * | pick (const char *data_id, TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth=-1, TSLPickSelector *selector=0) |
bool | queryActiveLayer (const char *data_id, char *detail_layer_name, int detail_layer_name_size) |
bool | removeDataLayer (const char *data_id) |
bool | saveDeclutter (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION) |
bool | saveRendering (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION) |
bool | sendToBack (const char *move_data_layer) |
bool | sendToBackOf (const char *move_data_layer, const char *target_data_layer) |
bool | setBackgroundColour (int value) |
bool | setCoordinateProvidingLayer (const char *layer_name) |
bool | setDataLayerProps (const char *data_id, TSLPropertyEnum property_id, TSLPropertyValue new_value) |
bool | setDeclutterStatus (const char *feature_name, TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | setDeclutterStatus (TSLFeatureID feature_id, TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | setDeclutterStatusOnAllFeatures (TSLDeclutterStatusEnum value, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int value) |
bool | setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double value) |
bool | setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool value) |
bool | setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *value) |
bool | setFrame (int style, int colour, int thickness) |
double | TMCperMU () |
TSLDrawingSurfaceTypeEnum | type () const |
void | userWord (void *ptr) const |
void * | userWord () const |
bool | cloneDynamicRenderersFrom (const TSLDrawingSurfaceBase *otherSurface) |
void | addDuplicateLayers (bool value) |
virtual | ~TSLDrawingSurfaceBase () |
Static Public Member Functions | |
static bool | loadStandardConfig (const char *path=0) |
static bool | setupModels (const char *filename) |
![]() | |
static bool | addLoader (TSLFileLoader *loader) |
static bool | addPathList (TSLPathList *path_list) |
static bool | findFile (const char *filename, TSLSimpleString &foundPath) |
static TSLFileLoader * | getLoader () |
Protected Member Functions | |
TSL3DDrawingSurface () | |
![]() | |
TSLDrawingSurfaceBase () | |
Additional Inherited Members | |
![]() | |
void * | m_classID |
|
virtual |
|
inlineprotected |
Protected Constructor to prevent direct instantiation
TSL3DCamera * TSL3DDrawingSurface::camera | ( | ) |
Query function for the drawing surface camera.
The camera must not be destroyed by the user and will only be valid for the lifetime of the associated drawing surface.
const TSL3DCamera * TSL3DDrawingSurface::camera | ( | ) | const |
Query function for the drawing surface camera.
The camera must not be destroyed by the user and will only be valid for the lifetime of the associated drawing surface.
bool TSL3DDrawingSurface::drawDU | ( | TSLDeviceUnits | x1, |
TSLDeviceUnits | y1, | ||
TSLDeviceUnits | x2, | ||
TSLDeviceUnits | y2, | ||
bool | clear, | ||
bool | offscreenSurface = false ) |
Draw area of map onto drawing surface.
This method requests the TSL3DDrawingSurface to redraw the MapLink data within the area defined by the input co-ordinates. This method may be called whenever a part of the Drawing Surface has been exposed through some action.
(x1,y1) | Bottom left co-ordinate (in device units) of the area to redraw. |
(x2,y2) | Top right co-ordinate (in device units) of the area to redraw. |
clear | If true this will clear the specified area before drawing any of the data. |
offscreenSurface | If the destination for the draw is an offscreen rendering surface such as an OpenGL pixel buffer (PBuffer) or framebuffer object (FBO), set this flag to true. This allows for corrections to be applied to the drawing to account for the destination surface being inverted compared |
to | the screen. Items that are affected by this flag are
|
If the same drawing surface is being used to draw to both the screen and an offscreen surface notifyChanged() should be called on any data layers within the drawing surface whenever the active render target is changed. Not doing so may cause any necessary corrections to not be applied.
bool TSL3DDrawingSurface::DUToLatLon | ( | const TSLDeviceUnits | x, |
const TSLDeviceUnits | y, | ||
double & | latitude, | ||
double & | longitude ) const |
Given a Screen X & Y the method calculates the latitude and longitude of the X & Y.
The method takes no account of any terrain database loaded into the 3D (see TSLTerrainLOS for information on how to use the latitude and longitude returned by this method to find an intersection with the terrain).
x | Screen pixel x position |
y | Screen pixel y position |
latitude | returned latitude |
longitude | returned longitude |
The screen x and y must be part of the visible screen.
The angles are used to project a ray from the view frustum eye point to the clipping plane and thus to obtain an x, y, and z intersection with either the plane (Flat earth) or sphere (Ellipsoid Earth).
Given that we are currently using a Sphere for the calculating the intersections with the Earth the accuracy of the intersection will not be particularly high when the viewer is not looking straight down.
void TSL3DDrawingSurface::exaggerateTerrain | ( | double | asl, |
double | bsl ) |
Set the terrain exaggeration factors.
asl | The 'above sea level' exaggeration factor. |
bsl | The 'below sea level' exaggeration factor. |
bool TSL3DDrawingSurface::frameRateIdle | ( | bool | onOff | ) |
Calling this method allows the user to ask MapLink 3D to limit the number of frames per second that are drawn.
The frame rate limiting is done my inserting a small sleep after the swap buffers (swapBuffers) call to the underlying graphics library.
Enabling the frame rate limit means that MapLink 3D attempts to limit the update rate to the rate specified.
MapLink 3D relies upon the user causing a redraw to occur so the frame rate limiting is very much an approximation.
onOff | enable (true) the frame rate limit or disable (false) the frame rate limit. |
bool TSL3DDrawingSurface::geocentricToGeodetic | ( | double | x, |
double | y, | ||
double | z, | ||
double & | lat, | ||
double & | lon, | ||
double & | alt ) const |
This function converts from geocentric coordinates (x, y, z from the centre of the earth in metres) to geodetic coordinates (lat, lon, alt).
x,y,z | input geocentric coordinates |
lat,lon,alt | output geodetic coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
bool TSL3DDrawingSurface::geocentricToWorld | ( | double | x, |
double | y, | ||
double | z, | ||
double & | x1, | ||
double & | y1, | ||
double & | z1 ) const |
This function converts from geocentric coordinates (x, y, z from the centre of the earth in metres) to World coordinates (coordinates for use with the underlying 3D drawing API).
Note: Do not store the World coordinate values as they will change with altitude.
x,y,z | input geocentric coordinates |
x1,y1,z1 | output World coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
bool TSL3DDrawingSurface::geodeticToGeocentric | ( | double | lat, |
double | lon, | ||
double | alt, | ||
double & | x, | ||
double & | y, | ||
double & | z ) const |
This function converts from geodetic coordinates (lat, lon, alt) to geocentric coordinates (x, y, z from the centre of the earth in metres).
lat,lon,alt | input geodetic coordinates |
x,y,z | output geocentric coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
bool TSL3DDrawingSurface::geodeticToWorld | ( | double | lat, |
double | lon, | ||
double | alt, | ||
double & | x, | ||
double & | y, | ||
double & | z ) const |
This function converts from geodetic coordinates (lat, lon, alt) to World coordinates (coordinates for use with the underlying 3D drawing API).
Note: Do not store the World coordinate values as they will change with altitude.
lat,lon,alt | input geodetic coordinates |
x,y,z | output World coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
bool TSL3DDrawingSurface::get3DOption | ( | TSL3DOptionEnum | option | ) | const |
Query option flag.
option | Enumeration value specifying option to query |
bool TSL3DDrawingSurface::getAnisotropicFilter | ( | ) | const |
Queries the Anisotropic filter state.
float TSL3DDrawingSurface::getAnisotropicFilterLevel | ( | ) | const |
This method gets the anisotropic filter level
void TSL3DDrawingSurface::getDUExtent | ( | TSLDeviceUnits * | x1, |
TSLDeviceUnits * | y1, | ||
TSLDeviceUnits * | x2, | ||
TSLDeviceUnits * | y2 ) const |
Query extent of window.
This method allows the user to query the extent of the window handle currently displayed in terms of device units. This is the same extent that will have been passed in the last call to 'wndResize'.
(x1,y1) | Storage for top left co-ordinate of the extent in device units. |
(x2,y2) | Storage for bottom right co-ordinate of the extent in device units. |
int TSL3DDrawingSurface::getFrameRate | ( | ) | const |
Gets the display frame rate limit.
Enabling the frame rate limit means that MapLink 3D attempts to limit the update rate to the rate specified.
MapLink 3D relies upon the user causing a redraw to occur so the frame rate limiting is an approximation.
Returns the number of frames per second MapLink 3D is limiting too.
bool TSL3DDrawingSurface::getLightingOption | ( | TSL3DLightingOptionEnum | option | ) | const |
Query option flag.
option | Enumeration value specifying option to query |
void TSL3DDrawingSurface::getLODConfiguration | ( | TSL3DLODConfiguration & | lodConfiguration | ) | const |
Returns the Level Of Detail current configuration.
lodConfiguration | returned LOD configuration. |
int TSL3DDrawingSurface::getMaxMapTextureCacheSize | ( | ) | const |
Returns the size in MB of the map texture cache.
A value of 0 indicates that there is no limit imposed on the number of textures allocated. This should be fine for cards with 256MB of graphics memory.
Cards with less then 256MB should work as the OpenGL driver should swap out textures to main memory.
bool TSL3DDrawingSurface::getTerrainHeight | ( | double | latitude, |
double | longitude, | ||
double & | altitude ) const |
Returns the altitude of the latitude and longitude specified, taking into account any terrain loaded.
latitude | latitude in degrees |
longitude | longitude in degrees |
alt | returned altitude in meters |
bool TSL3DDrawingSurface::getTerrainRendering | ( | int * | wireframeColour, |
int * | solidColour, | ||
const char ** | bitmapFile ) const |
Query the rendering for Terrain when no draped layers are available.
type | Storage for type of terrain rendering |
wireframeColour | Colour for wireframe rendering, typically index into tslcolours.dat |
solidColour | Colour for solid rendering, typically index into tslcolours.dat |
bitmapFile | Storage for name of bitmap file for bitmap rendering. |
If solid rendering is in use, then bitmapFile will be 0.
void TSL3DDrawingSurface::getTextureCacheSize | ( | int & | fontMaxSize, |
int & | symbolMaxSize, | ||
int & | app6aMaxSize ) const |
This method allows the user to query the maximumTexture cache size in MB.
fontMaxSize | cache size for texture fonts. |
symbolMaxSize | cache size for standard symbols |
app6aMaxSize | cache size for APP6A composite symbols |
bool TSL3DDrawingSurface::globalAmbientLight | ( | double * | red, |
double * | green, | ||
double * | blue, | ||
double * | alpha ) const |
Return global ambient light colour.
Default is a dull grey (0.2, 0.2, 0.2).
red | red component of global ambient light colour, value between 0 and 1 |
green | green component of global ambient light colour, value between 0 and 1 |
blue | blue component of global ambient light colour, value between 0 and 1 |
alpha | alpha component of global ambient light colour to set, value between 0 and 1 |
bool TSL3DDrawingSurface::globalAmbientLight | ( | double | red, |
double | green, | ||
double | blue, | ||
double | alpha ) |
Set global ambient light colour.
Default is a dull grey (0.2, 0.2, 0.2).
red | red component of global ambient light colour to set, value between 0 and 1 |
green | green component of global ambient light colour to set, value between 0 and 1 |
blue | blue component of global ambient light colour to set, value between 0 and 1 |
alpha | alpha component of global ambient light colour to set, value between 0 and 1 |
bool TSL3DDrawingSurface::isMapThreadStopped | ( | ) | const |
Queries if the background map thread is stopped.
Returns true if stopped, false if running.
|
static |
Loads the 3D related tsl*.dat files with the default names into all drawing surfaces. This is equivalent to firstly adding a pathlist configured to find data files, fonts, symbols and so on in the default subdirectories (e.g. addKeyedDirectory(root+"model", 0, ".3ds", TSLCompressedDefault) ),
and secondly calling:
setupModels( "tsl3dmodels.dat" ) ;
path | If supplied, this is the path from which the configuration files are to be loaded. If null, then the files are assumed to be present in the \config subdirectory of the maplink installation on the local machine (whose location is found using TSLUtilityFunctions::getMapLinkHome()) |
bool TSL3DDrawingSurface::queryModelIndices | ( | int ** | indices, |
int * | num ) const |
Query Model indices.
indices | Storage for pointer to indices. Populated if successful. |
num | Storage for number of indices in array. |
void TSL3DDrawingSurface::set3DOption | ( | TSL3DOptionEnum | option, |
bool | value ) |
Set option bitfield.
option | Enumeration value specifying option to query |
value | New value for option flag. |
void TSL3DDrawingSurface::setAnisotropicFilter | ( | bool | state | ) |
This method sets the anisotropic filter state.
Anisotropic filtering can be used to improve the quality of the displayed map data by reducing the swimming effect of textures displayed in the distance.
Turning on anisotropic filtering will impact performance. The amount of impact will depend on the level of anisotropic filtering applied and the graphics card being used.
state | true turn on the anisotropic filter, false turn the filter off. |
void TSL3DDrawingSurface::setAnisotropicFilterLevel | ( | float | level | ) |
This method sets the anisotropic filter level
Anisotropic filtering can be used to improve the quality of the displayed map data by reducing the swimming effect of textures displayed in the distance.
Turning on anisotropic filtering will impact performance. The amount of impact will depend on the level of anisotropic filtering applied and the graphics card being used.
A value of 1.0 means that the filtering will not be applied.
The maximum value that can be set is dependent on the graphics driver.
If a value less then 1.0 or greater then the maximum is set then the level is limited.
level | Anisotropic filter level. |
void TSL3DDrawingSurface::setFrameRate | ( | int | frameRate | ) |
Sets the display frame rate to aim for,
Enabling the frame rate limit means that MapLink 3D attempts to limit the update rate to the rate specified.
MapLink 3D relies upon the user causing a redraw to occur so the frame rate limiting is an approximation.
The frame rate limit must be set on (see frameRateIdle).
frameRate | number of frames per second to limit the redrawing too. |
void TSL3DDrawingSurface::setLightingOption | ( | TSL3DLightingOptionEnum | option, |
bool | value ) |
Set lighting option bitfield.
option | enumeration value specifying option to set |
value | new value |
bool TSL3DDrawingSurface::setLODConfiguration | ( | const TSL3DLODConfiguration & | lodConfiguration | ) |
Sets the Level Of Detail Configuration parameters.
lodConfiguration | configuration required. |
void TSL3DDrawingSurface::setMaxMapTextureCacheSize | ( | int | cacheInMB | ) |
Sets the size in MB of the map texture cache.
A value of 0 indicates that there is no limit imposed on the number of textures allocated. This should be fine for cards with 256MB of graphics memory. However this is very dependent on how many fonts, symbols and application textures are used.
Cards with less then 256MB should work as the OpenGL driver should swap out textures to main memory.
If problems occur (such as missing textures or OpenGL errors) then a limit should be imposed. If you do not have a problem then leave on the default as performance will be affected.
Note: The cache will basically unload textures which have not been used in the previous display 60 frames.
cacheInMB | maximum map texture cache size in MB. |
|
virtual |
Set option bitfield.
option | Enumeration value specifying option to query |
value | New value for option flag. |
Reimplemented from TSLDrawingSurfaceBase.
bool TSL3DDrawingSurface::setRenderingCallback | ( | TSL3DRenderingCallback | callback, |
void * | arg ) |
Register a callback to be triggered when draped data is ready to be rendered.
The 3D Drawing Surface renders 2D draped information in a background thread. This callback is triggered when the background thread has new information ready to be draped.
The function called should trigger a redraw of drawing surface. However since the callback will be called from the background thread, it must not call the draw method directly unless the application has locked out any redraw calls in the main thread. Typically a message is posted to the view which is picked up by the main thread message handler.
Arguments :
callback: Pointer to callback function. See TSL3DRenderingCallback for signature
arg: Application argument passed to callback.
bool TSL3DDrawingSurface::setTerrainLoadedCallback | ( | TSL3DRenderingCallback | callback, |
void * | arg ) |
experimental
bool TSL3DDrawingSurface::setTerrainRendering | ( | int | wireframeColour, |
int | solidColour, | ||
const char * | bitmapFile ) |
Set the rendering for Terrain when no draped layers are available.
wireframeColour | Colour for wireframe rendering, typically index into tslcolours.dat |
solidColour | Colour for solid rendering, typically index into tslcolours.dat |
bitmapFile | Name of bitmap file for bitmap rendering. |
If solid rendering is required, then set bitmapFile to 0.
void TSL3DDrawingSurface::setTextureCacheSize | ( | const int | fontMaxSize, |
const int | symbolMaxSize, | ||
const int | app6aMaxSize ) |
This method allows the user to set the maximum Texture cache size in MB.
fontMaxSize | cache size for texture fonts. |
symbolMaxSize | cache size for standard symbols. |
app6aMaxSize | cache size for APP6A composite symbols. |
|
static |
Load 3D model definition file.
This method allows the user to set up the list of models that will be used by all TSL3DDrawingSurfaces.
If addPathList or loadStandardConfig has been called then the pathlist is used to search for the file in suitable directories (using keying), if not then the system Path and the environment variable MAPLINK_PATH are used to search for the file, or alternatively the filename may be fully qualified.
Note: this need to be done only once per application. Calling this more than once will not have any effects on the original symbol list.
filename | Name of the models file. |
void TSL3DDrawingSurface::startMapThread | ( | ) |
Start the background map rendering thread.
void TSL3DDrawingSurface::stopMapThread | ( | ) |
Stops the background map rendering thread.
You would normally stop the thread if you wished to edit the contents of a layer.
You should keep the time you have the thread stopped as short as possible.
Adding and removing a layer is thread safe.
Making the layer invisible is also a sensible approach while the layer is edited. This should be done in conjunction with stopping the thread to ensure that the layer is not still being referenced in the background thread.
Locking is kept to a minimum within MapLink to ensure that performance is not affected.
void TSL3DDrawingSurface::swapBuffers | ( | ) |
Swaps the drawing buffers.
|
virtual |
Returns the aspect ratio of the view
bool TSL3DDrawingSurface::wndResize | ( | TSLDeviceUnits | x1, |
TSLDeviceUnits | y1, | ||
TSLDeviceUnits | x2, | ||
TSLDeviceUnits | y2, | ||
bool | auto_redraw = true ) |
The user application should call this function on a window resize.
This methods informs the TS3DLDrawingSurface of a change in size of the attached window handle. If the handle is resized and the TSLDrawingSurface is not informed then the displayed area will remain the same though it may be clipped if the attached handle is reduced in size. All input co-ordinates are given in device units; this is typically in pixels.
Note: when the Drawing Surface is first attached to a handle it must be given the co-ordinates of the area that it is to display. This is not necessarily the full area of the handle.
(x1,y1) | Top left co-ordinate (in device units) of the area to draw. For device units 0,0 is the top-left corner, y positive downwards. |
(x2,y2) | Bottom right co-ordinate (in device units) of the area to draw. For device units 0,0 is the top-left corner, y positive downwards. |
auto_redraw If true, will result in the whole drawing surface area being redrawn.