![]() |
MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Platform interface class for Windows for the OpenGL drawing surface, using OpenGL and WGL.
This drawing surface requires graphics hardware that is OpenGL 2.1 compliant. OpenGL 3.2 or newer compliant hardware is recommended.
For OpenGL 2.1 hardware support for the following extension is required:
Hardware with support for the following OpenGL extensions is recommended, but not required. For OpenGL 3.2 or newer hardware:
This drawing surface cannot be attached to a bitmap unless the graphics driver supports hardware accelerating rendering to bitmaps. The drawing surface will fail to attach if the driver does not support this.
Non-native rendering for this drawing surface is implemented through an off-screen bitmap. During the draw of a non-native layer (identified by the TSLPropertyNonNativeDrawing data layer property), the handleToDrawable method of TSLRenderingInterface will return an HDC with a memory bitmap already selected into it. This HDC will be different to the HDC used when creating the drawing surface. The application should draw the contents of the layer into this bitmap, which the drawing surface will then composite onto the framebuffer.
By default it is assumed that non-native rendering is performed through GDI or another non-alpha aware drawing technology. See the enableNonNative GDIAlphaCorrection method when using GDI+ or another alpha-aware drawing technology.
Public Member Functions | |
TSLWGLSurface (void *handle, bool handleIsHDC, const TSLOpenGLSurfaceCreationParameters &creationProperties, HGLRC context=NULL) | |
TSLWGLSurface (void *handle, bool handleIsHDC, HGLRC context, const TSLOpenGLSurfaceCreationParameters &creationProperties) | |
virtual | ~TSLWGLSurface () |
bool | attach (void *handle, bool handleIsHDC, HGLRC context) |
HGLRC | context () |
void | enableNonNativeGDIAlphaCorrection (bool enable) |
bool | makeContextCurrent () |
virtual TSLOpenGLSurface * | caw () |
![]() | |
virtual | ~TSLOpenGLSurface () |
float | acquireDepthSlice () |
virtual TSLDrawingSurface * | clone (bool copyUserData=false) |
double | coordinateCentreX () const |
double | coordinateCentreY () const |
TSLOpenGLSurface * | createChildSurface () |
float | currentDepthSlice () const |
float | depthSliceIncrement () const |
void | flushPendingDraws () |
void | enableRealtimeReprojection (const char *name, bool enable) |
double | getSwitchRangeForFP64 () const |
bool | getLayerStorageStrategy (const char *layerName, TSLOpenGLStorageStrategyEnum &strategy) const |
bool | getLayerTransparencyHint (const char *layerName, TSLOpenGLTransparencyHintEnum &hint) const |
float | incrementDepthSlice (uint32_t numDrawItems) |
const float * | modelViewMatrix () const |
const float * | projectionMatrix () const |
bool | setAntialiasingMode (TSLOpenGLAntialiasModeEnum mode) |
bool | targetFrameBuffer (GLuint fbo) |
GLuint | targetFrameBuffer () const |
float | setDepthSlice (uint32_t numDrawItems) |
bool | setDisplayMetrics (double dpiX, double dpiY, int horizontalSizePixels, int verticalSizePixels) |
void | setSwitchRangeForFP64 (double range) |
bool | setLayerStorageStrategy (const char *layerName, TSLOpenGLStorageStrategyEnum strategy) |
bool | setLayerTransparencyHint (const char *layerName, TSLOpenGLTransparencyHintEnum hint) |
void | setRGBABackgroundColour (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
TSLOpenGLStateTracker * | stateTracker () |
void | shaderPreloadEnabled (bool enabled) |
bool | shaderPreloadEnabled () const |
bool | preloadProjectionShaders (const TSLCoordinateSystem *cs, bool loadfp64Variant) |
void | flushLoadedShaders () |
void | rasterProjectionControlPointParameters (unsigned int minPointsPerRaster, unsigned int maxPointsPerRaster, unsigned int gridSizePixels) |
void | textRoundingEnabled (bool enabled) |
bool | textRoundingEnabled () const |
void | textRoundingAmount (unsigned int px) |
unsigned int | textRoundingAmount () const |
![]() | |
bool | clearAllRendering () |
bool | clearDynamicColours () |
TSLRasterBuffer * | createRasterBuffer (unsigned int width, unsigned int height, TSLRasterBuffer::Format format, TSLRasterBuffer::FilterMode filterMode=TSLRasterBuffer::Linear) |
bool | declutterIsVisible (const char *feature_name, double resolution=0.0, const char *layer_name=0) const |
bool | drawDU (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2, bool clear, bool updateExtentOnly=false) |
bool | drawUU (double x1, double y1, double x2, double y2, bool clear, bool updateExtentOnly=false) |
bool | DUToLatLong (TSLDeviceUnits x, TSLDeviceUnits y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const |
bool | DUToMU (TSLDeviceUnits x1, TSLDeviceUnits y1, double *x2, double *y2) const |
bool | DUToTMC (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLTMC *x2, TSLTMC *y2) const |
bool | DUToUU (TSLDeviceUnits x1, TSLDeviceUnits y1, double *x2, double *y2) const |
TSLEntity * | findEntityDU (TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth, const char *feature_name=NULL) |
TSLEntity * | findEntityUU (double x, double y, double aperture, int depth, const char *feature_name=NULL) |
TSLEntity * | findSelectedEntityDU (TSLDeviceUnits x, TSLDeviceUnits y, TSLDeviceUnits aperture, int depth=-1, bool ignoreMapDataLayers=false) |
TSLEntity * | findSelectedEntityUU (double x, double y, double aperture, int depth=-1, bool ignoreMapDataLayers=false) |
bool | getColourIndices (int **indices, int *num) |
TSLDataLayer * | getCoordinateProvidingLayer () |
const TSLDataLayer * | getCoordinateProvidingLayer () const |
bool | getDeclutterRange (const char *featureName, double *innerLimit, double *outerLimit, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | getDeviceCapabilities (int &horizontalSizeMM, int &verticalSizeMM, int &horizontalSizePixels, int &verticalSizePixels) const |
bool | getDeviceCapabilities (TSLDeviceCapabilities &capabilities) const |
void | getDUExtent (TSLDeviceUnits *x1, TSLDeviceUnits *y1, TSLDeviceUnits *x2, TSLDeviceUnits *y2) const |
bool | getFillStyleIndices (int **indices, int *num) |
bool | getFontStyleIndices (int **indices, int *num) |
bool | getLineStyleIndices (int **indices, int *num) |
void | getMUExtent (double *x1, double *y1, double *x2, double *y2) const |
bool | getSymbolStyleIndices (int **indices, int *num) |
TSLDrawingSurfaceTiledBufferControl * | getTiledBufferController () |
void | getTMCExtent (TSLEnvelope &extent) const |
void | getUUExtent (double *x1, double *y1, double *x2, double *y2) const |
bool | getViewedLatLongRange (double *latitude, double *longitude, double *range, bool local=false, bool boundCheck=true) const |
bool | latLongToDU (double latitude, double longitude, TSLDeviceUnits *x, TSLDeviceUnits *y, bool local=false) const |
bool | latLongToMU (double latitude, double longitude, double *x, double *y, bool local=false) const |
bool | latLongToTMC (double latitude, double longitude, TSLTMC *x, TSLTMC *y, bool local=false) const |
bool | latLongToUU (double latitude, double longitude, double *x, double *y, bool local=false) const |
bool | MUToDU (double x1, double y1, TSLDeviceUnits *x2, TSLDeviceUnits *y2) const |
bool | MUToLatLong (double x, double y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const |
bool | MUToTMC (double x1, double y1, TSLTMC *x2, TSLTMC *y2) const |
bool | MUToUU (double x1, double y1, double *x2, double *y2) const |
bool | pan (double x1, double y1, bool auto_redraw=true) |
bool | pan (double x1, double y1, TSLDeviceUnits xDU, TSLDeviceUnits yDU, bool auto_redraw=true) |
TSLMapQuery * | query (const char *layerName, TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, int depth=-1, const char *feature_name=NULL) const |
TSLMapQuery * | query (const char *layerName, TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, TSLSelector *selector) const |
bool | redraw () |
bool | reset (bool auto_redraw=true) |
bool | resize (double x1, double y1, double x2, double y2, bool auto_redraw=true, bool keep_aspect=false) |
bool | rotate (double angle) |
double | rotation () const |
bool | setDeclutterRange (const char *featureName, double innerLimit, double outerLimit, const char *dataLayerName=0, const char *detailLayerName=0) |
bool | setDeviceCapabilities (const int horizontalSizeMM=0, const int verticalSizeMM=0, const int horizontalSizePixels=0, const int verticalSizePixels=0) |
bool | setDeviceCapabilities (const TSLDeviceCapabilities &capabilities) |
void | setRedrawCallback (TSLDrawingSurfaceDrawCallback *callback) |
bool | setupDynamicColours (const char *filename) |
bool | setViewedLatLongRange (double latitude, double longitude, double range, bool local=false, bool auto_redraw=true, bool keep_aspect=false) |
void | TMCperDU (double &xr, double &yr) |
double | TMCperUU () |
bool | TMCToDU (TSLTMC x1, TSLTMC y1, TSLDeviceUnits *x2, TSLDeviceUnits *y2) const |
bool | TMCToLatLong (TSLTMC x, TSLTMC y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const |
bool | TMCToMU (TSLTMC x1, TSLTMC y1, double *x2, double *y2) const |
bool | TMCToUU (TSLTMC x1, TSLTMC y1, double *x2, double *y2) const |
bool | updateEntityExtent (TSLEntity *entity, const char *layerName) |
void | userUnitOrigin (double x_origin, double y_origin) |
void | userUnitOrigin (TSLUUEnum origin_enum) |
void | userUnits (double factor) |
double | userUnits () |
bool | UUToDU (double x1, double y1, TSLDeviceUnits *x2, TSLDeviceUnits *y2) const |
bool | UUToLatLong (double x, double y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const |
bool | UUToMU (double x1, double y1, double *x2, double *y2) const |
bool | UUToTMC (double x1, double y1, TSLTMC *x2, TSLTMC *y2) const |
bool | wndResize (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2, bool auto_redraw=true, TSLResizeActionEnum action=TSLResizeActionNone) |
bool | zoom (double percent, bool zoom_in, bool auto_redraw=true) |
TSLDrawingSurface () | |
virtual | ~TSLDrawingSurface () |
void | clearSymbolList () |
void | clearFontList () |
void | clearLineList () |
void | clearFillList () |
bool | removeFillStyle (TSLStyleID style) |
bool | removeLineStyle (TSLStyleID style) |
bool | removeSymbolStyle (TSLStyleID style) |
bool | removeFontStyle (TSLStyleID style) |
TSLStyleID | createFontID (const TSLSimpleString &name, TSLFontType meaningOfName, int fontWeight, bool italic=false, bool underline=false, bool antiAliased=false, const unsigned char *memoryBlock=NULL, TSLSize memoryBlockSize=0) |
TSLStyleID | createStandardLineID (const unsigned char *pattern, TSLSize patternLength, int initialOffset, TSLLineScalingType scaleType) |
TSLStyleID | createSymbolLineID (int symbolID, double size=0.0, TSLDimensionUnits sizeUnits=TSLDimensionUnitsUndefined, float rotation=0.0f, double anchorPointX=0.0, double anchorPointY=0.0, TSLDimensionUnits anchorPointUnits=TSLDimensionUnitsUndefined) |
TSLStyleID | createStandardFillID (const unsigned char *pattern=NULL, TSLSize patternSizeInBytes=0, int patternXSize=0, int patternYSize=0) |
TSLStyleID | createSymbolFillID (int symbolID, double size=0.0, TSLDimensionUnits sizeUnits=TSLDimensionUnitsUndefined, float rotation=0.0f, double anchorPointX=0.0, double anchorPointY=0.0, TSLDimensionUnits anchorPointUnits=TSLDimensionUnitsUndefined) |
TSLStyleID | createSVGSymbolID (const TSLSimpleString &name, const unsigned char *memoryBlock=NULL, TSLSize memoryBlockSize=0) |
TSLStyleID | createFontSymbolID (const TSLSimpleString &name, TSLFontType meaningOfName, const unsigned char *memoryBlock=NULL, TSLSize memoryBlockSize=0) |
TSLStyleID | createRasterSymbolID (const TSLSimpleString &name, int xorigin, int yorigin, bool scaleable, const unsigned char *memoryBlock=NULL, TSLSize memoryBlockSize=0) |
TSLStyleID | createSymbolIDFromSymbol (TSLStyleID symbolID, int numberofColourPairs, const int *colourFrom, const int *colourTo) |
![]() | |
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) |
virtual void | setOption (TSLOptionEnum option, bool value) |
double | TMCperMU () |
TSLDrawingSurfaceTypeEnum | type () const |
void | userWord (void *ptr) const |
void * | userWord () const |
bool | cloneDynamicRenderersFrom (const TSLDrawingSurfaceBase *otherSurface) |
void | addDuplicateLayers (bool value) |
virtual | ~TSLDrawingSurfaceBase () |
Protected Member Functions | |
TSLWGLSurface () | |
![]() | |
TSLOpenGLSurface () | |
![]() | |
TSLDrawingSurfaceBase () | |
Additional Inherited Members | |
![]() | |
static void | cleanup () |
static bool | copy (TSLDrawingSurface *copyTo, TSLDrawingSurface *copyFrom, bool copyUserData=false) |
static TSLStyleID | getIDOfNearestColour (int r, int g, int b) |
static bool | loadStandardConfig (const char *path=0, bool delayLoadIncludes=false) |
static bool | setupColours (const char *filename) |
static bool | setupFillStyles (const char *filename, bool delayLoadIncludes=false) |
static bool | setupFonts (const char *filename, bool delayLoadIncludes=false) |
static bool | setupLineStyles (const char *filename, bool delayLoadIncludes=false) |
static bool | setupSymbols (const char *filename, bool delayLoadIncludes=false) |
static void | disableAntiAliasFonts () |
static void | enableAntiAliasFonts () |
![]() | |
static bool | addLoader (TSLFileLoader *loader) |
static bool | addPathList (TSLPathList *path_list) |
static bool | findFile (const char *filename, TSLSimpleString &foundPath) |
static TSLFileLoader * | getLoader () |
![]() | |
void * | m_classID |
TSLWGLSurface::TSLWGLSurface | ( | void * | handle, |
bool | handleIsHDC, | ||
const TSLOpenGLSurfaceCreationParameters & | creationProperties, | ||
HGLRC | context = NULL ) |
Constructs a new drawing surface, creating a new OpenGL context and attaching it to the given window. The drawing surface owns the context created.
This constructor cannot be used to create a drawing surface attached to a bitmap.
To check if the drawing surface has successfully attached, check that the context() method returns non-zero.
handle | The HWND to attach the surface to, or the HDC for the HWND to attach the surface to. |
handleIsHDC | Set this flag to true if handle is an HDC, or false if it is an HWND. |
creationProperties | Options that affect the creation of the drawing surface. See the documentation for TSLOpenGLSurfaceCreationParameters for the available options. |
TSLWGLSurface::TSLWGLSurface | ( | void * | handle, |
bool | handleIsHDC, | ||
HGLRC | context, | ||
const TSLOpenGLSurfaceCreationParameters & | creationProperties ) |
Constructs a new drawing surface using an existing OpenGL context. The drawing surface does not assume ownership of the context.
To check if the drawing surface has successfully attached, check that the context() method returns non-zero.
handle | The HWND or the HDC used to create the existing OpenGL context. |
handleIsHDC | Set this flag to true if handle is an HDC, or false if it is an HWND. |
context | The existing OpenGL context. This context should have already been made current in the current thread. |
creationProperties | Options that affect the creation of the drawing surface. See the documentation for TSLOpenGLSurfaceCreationParameters for the available options. |
|
virtual |
|
protected |
bool TSLWGLSurface::attach | ( | void * | handle, |
bool | handleIsHDC, | ||
HGLRC | context ) |
Attaches the drawing surface to the given window using the given OpenGL context. This will detach the drawing surface from any window it is currently attached to.
handle | Reference to a Windows resource to which the drawing surface is to be attached. |
handleIsHDC | True the resource passed is an HDC, false if it is an HWND. |
context | The OpenGL context the drawing surface should use. Ownership of the context remains with the caller. |
|
virtual |
HGLRC TSLWGLSurface::context | ( | ) |
Returns the OpenGL context in use by the drawing surface. If this returns NULL, the drawing surface did not attach successfully and cannot be used.
void TSLWGLSurface::enableNonNativeGDIAlphaCorrection | ( | bool | enable | ) |
This option controls whether the drawing surface will correct the contents of any non-native layer drawing performed by technologies that do not support alpha such as GDI. When enabled the drawing surface assumes that any pixels written to the non-native bitmap will have the alpha byte cleared to 0, and any pixels not drawn to will have the alpha byte left untouched.
When using an alpha-aware drawing technology (such as GDI+) to draw to the bitmap this option should be disabled.
This option applies to all non-native layers in the drawing surface.
By default this option is enabled.
bool TSLWGLSurface::makeContextCurrent | ( | ) |
Binds the OpenGL context held by the drawing surface to the current thread. This method can be used to change the thread used for drawing to the drawing surface.
Returns true if the context was made current in this thread, or false if there was an error or the drawing surface was not attached.