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

Detailed Description

Only include TSL3DWinGLSurface, if we already have windows included, otherwise just forward declare it. This is necessary since the Handle types are in windows.h but we don't want to be dependent upon this in all API files. Windows OpenGL specific implementation of the abstract TSL3DDrawingSurface class.

MapLink expects that the Open GL state is reset after any user drawing to the original settings. This can be achieved by calling glIsEnabled and reset the state after finishing drawing.

Point anti-aliasing is turned on by default.

Anti-aliasing may be turned on by the user for polygons and lines. By default these are turned off.

Only one OpenGL context per thread is allowed. Therefore there is a one to one relationship between the Drawing Surface and a thread.

Deprecated
Deprecated as of MapLink 11.1. Advised to use MapLink Earth SDK instead.

Public Member Functions

 TSL3DWinGLSurface (void *handle, bool handleIsHDC, bool swapBuffersManually=false)
 
 TSL3DWinGLSurface (void *handle, bool handleIsHDC, HGLRC context, bool swapBuffersManually=false)
 
TSL3DLightSourcecreateLightSource ()
 
void setOpenGLContext ()
 
virtual ~TSL3DWinGLSurface ()
 
void setATITriangleStripWorkaround (bool value)
 
- Public Member Functions inherited from TSL3DDrawingSurface
TSL3DCameracamera ()
 
const TSL3DCameracamera () 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)
 
- Public Member Functions inherited from TSLDrawingSurfaceBase
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)
 
TSLDataLayergetDataLayer (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)
 
TSLDynamicRenderergetDynamicRenderer (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)
 
TSLPickResultSetpick (TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth, TSLPickSelector *selector=0)
 
TSLPickResultSetpick (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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from TSL3DDrawingSurface
static bool loadStandardConfig (const char *path=0)
 
static bool setupModels (const char *filename)
 
- Static Public Member Functions inherited from TSLDrawingSurfaceBase
static bool addLoader (TSLFileLoader *loader)
 
static bool addPathList (TSLPathList *path_list)
 
static bool findFile (const char *filename, TSLSimpleString &foundPath)
 
static TSLFileLoadergetLoader ()
 
- Protected Member Functions inherited from TSL3DDrawingSurface
 TSL3DDrawingSurface ()
 
- Protected Member Functions inherited from TSLDrawingSurfaceBase
 TSLDrawingSurfaceBase ()
 
- Protected Attributes inherited from TSLDrawingSurfaceBase
void * m_classID
 

Constructor & Destructor Documentation

◆ TSL3DWinGLSurface() [1/2]

TSL3DWinGLSurface::TSL3DWinGLSurface ( void * handle,
bool handleIsHDC,
bool swapBuffersManually = false )

Construct a Windows OpenGL specific TSL3DDrawingSurface.

Parameters
handleReference to a Windows resource to which the TSL3DDrawingSurface is to be attached.
handleIsHDCTrue the resource passed is a device context, false if it is a window.
swapBuffersManuallyIf true the user calls the following method themselves: wglSwapLayerBuffers( handle, WGL_SWAP_MAIN_PLANE );

◆ TSL3DWinGLSurface() [2/2]

TSL3DWinGLSurface::TSL3DWinGLSurface ( void * handle,
bool handleIsHDC,
HGLRC context,
bool swapBuffersManually = false )

Construct a Windows OpenGL specific TSL3DDrawingSurface using an existing OpenGL context

Parameters
handleReference to a Windows resource to which the TSL3DDrawingSurface is to be attached.
handleIsHDCTrue the resource passed is a device context, false if it is a window.
contextThe existing OpenGL context. The drawing surface does not take ownership of this context.
swapBuffersManuallyIf true the user calls the following method themselves: wglSwapLayerBuffers( handle, WGL_SWAP_MAIN_PLANE );

◆ ~TSL3DWinGLSurface()

virtual TSL3DWinGLSurface::~TSL3DWinGLSurface ( )
virtual

Member Function Documentation

◆ createLightSource()

TSL3DLightSource * TSL3DWinGLSurface::createLightSource ( )

◆ setATITriangleStripWorkaround()

void TSL3DWinGLSurface::setATITriangleStripWorkaround ( bool value)

◆ setOpenGLContext()

void TSL3DWinGLSurface::setOpenGLContext ( )

Call to set the OpenGL context to the current thread.

This method should be called before a draw if multiple 3D drawing surfaces are being used in a single thread. Each Drawing Surface has its own OpenGL Context.

In multiple threads you need to call this method when the drawing surface is moved to a different thread.

If you are using multiple threads with MapLink you need to make sure that you minimise the sharing of layers between Drawing Surfaces in different threads and manage any editing of data very carefully.

Any layer which could contain a cache should not be shared between threads, for example, CADRG Data Layer, WMS Data Layer or the Terrain Data Layer. 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.

Any layer that contains dynamic data should not be shared between threads.

Any layer which is being edited should be made invisible in all Drawing surfaces or removed from all drawing surfaces before being edited. Changing rendering attributes is normally ok, though the update will not occur until next redraw.

NOTE: We have experienced problems with some graphics cards and as such support for multiple 3d drawing surfaces is experimental.