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

Detailed Description

TSLAcceleratedRenderingInterface class acts as an interface between the geometry model and the actual surface on which it will be drawn.

Drawing using GDI or X11 to an OpenGL Accelerated surface is not supported.

Drawing using GDI to a DirectX Accelerated surface is supported. The methods lockSurface and unlockSurface have been provided to lock and unlock the surface.

lockSurface should be called before any GDI calls and unlockSurface should be called when any DirectX calls are made.

If unlockSurface is not called then the surface will remain locked until all Client Custom Accelerated layers have had their drawLayer methods called.

A sensible strategy is to call lockSurface in each drawLayer method that calls GDI methods and to call unlockSurface in any drawLayer method that uses DirectX methods.

Locking and unlocking will cause a performance hit because DirectX will have to wait for the pipeline to complete before allowing GDI methods to be called.

Public Member Functions

bool ADUsPerDU (double &xUnits, double &yUnits) const
 
bool ADUToLatLon (const double xADU, const double yADU, double &lat, double &lon, bool local=false) const
 
bool ADUToTMC (const double xADU, const double yADU, TSLTMC &xTMC, TSLTMC &yTMC) const
 
void displayCentre (double &x, double &y) const
 
bool displayScale (double &scaleX, double &scaleY) const
 
void getDUExtent (TSLDeviceUnits &x1, TSLDeviceUnits &y1, TSLDeviceUnits &x2, TSLDeviceUnits &y2) const
 
void getTMCExtent (TSLEnvelope &extent) const
 
TSLDrawableHandle handleToDrawable (TSLDisplayHandle &xDisplay) const
 
TSLDeviceContext handleToDrawable () const
 
bool handleToDirectXDrawingParameters (void **direct3d, void **device, void *presentParameters) const
 
bool handleToX11DrawingParameters (TSLVisualHandle &visual, TSLScreenHandle &screen, TSLColourmapHandle &colourmap) const
 
bool latLonToADU (const double lat, const double lon, double &xADU, double &yADU, bool local=false) const
 
bool latLonToDU (const double latitude, const double longitude, TSLDeviceUnits &x, TSLDeviceUnits &y, bool local=false) const
 
TSLRenderingInterfacelockSurface ()
 
double TMCsPerADU () const
 
bool TMCToADU (const TSLTMC xTMC, const TSLTMC yTMC, double &xADU, double &yADU) const
 
void * userWord () const
 
void unlockSurface ()
 
double viewRotation () const
 

Member Function Documentation

◆ ADUsPerDU()

bool TSLAcceleratedRenderingInterface::ADUsPerDU ( double & xUnits,
double & yUnits ) const

Returns the number of Accelerator Device Units (ADU) per Device Units (DU, pixels).

Parameters
xUnitsnumber of ADU's per DU along the x-axis
yUnitsnumber of ADU's per DU along the y-axis
Returns
True if the values are set, otherwise false.

◆ ADUToLatLon()

bool TSLAcceleratedRenderingInterface::ADUToLatLon ( const double xADU,
const double yADU,
double & lat,
double & lon,
bool local = false ) const

Convert Accelerator Device Units to Latitude and Longitude.

These units are OpenGL device units not pixels.

Parameters
xADUx axis device unit to convert
yADUy axis device unit to convert
latconverted latitude
lonconverted longitude.
localIndicates whether the lat/long co-ordinate is in WGS84 or the local datum.
Returns
true on success, false otherwise.

◆ ADUToTMC()

bool TSLAcceleratedRenderingInterface::ADUToTMC ( const double xADU,
const double yADU,
TSLTMC & xTMC,
TSLTMC & yTMC ) const

Returns the TMC position of ADU point.

Parameters
xADUADU x position
yADUADU y position
xTMCreturned TMC x position
yTMCreturned TMC y position
Returns
true if the conversion was ok.

◆ displayCentre()

void TSLAcceleratedRenderingInterface::displayCentre ( double & x,
double & y ) const

Returns the center of the display in Map Units.

◆ displayScale()

bool TSLAcceleratedRenderingInterface::displayScale ( double & scaleX,
double & scaleY ) const

Returns the OpenGL scale factor's applied.

This method should be used if you need to draw an object which is not distorted by the dynamic arc projection.

Parameters
scaleXScale factor for the x-axis
scaleYScale factor for the y-axis.
Returns

True if a scale is applied, false otherwise.

◆ getDUExtent()

void TSLAcceleratedRenderingInterface::getDUExtent ( TSLDeviceUnits & x1,
TSLDeviceUnits & y1,
TSLDeviceUnits & x2,
TSLDeviceUnits & y2 ) const

The Screen extent in pixels.

Parameters
x1,y1,x2,y2bottom left and top right corners of extent.

◆ getTMCExtent()

void TSLAcceleratedRenderingInterface::getTMCExtent ( TSLEnvelope & extent) const

Returns the TMC extent of the drawing area (unrotated).

Parameters
extentTSLEnvelope to store the extent in.

◆ handleToDirectXDrawingParameters()

bool TSLAcceleratedRenderingInterface::handleToDirectXDrawingParameters ( void ** direct3d,
void ** device,
void * presentParameters ) const

This method is specific to DirectX.

The method provides access to the additional parameters passed into the associated Drawing Surface on construction.

Parameters
direct3dPointer to a LPDIRECT3D9.
devicePointer to a LPDIRECT3DDEVICE9.
presentParametersPointer to a D3DPRESENT_PARAMETERS. The data is copied to the area pointed too.

If a pointer passed is NULL data is not returned via that parameter.

Returns
true if data is returned, false otherwise.
Parameters
ForExample

LPDIRECT3D9 direct3d = NULL; LPDIRECT3DDEVICE9 device = NULL; D3DPRESENT_PARAMETERS parameters;

bool result = acceleratedRenderinInterface-> getDirectXDrawingParameters((void **)&direct3d, (void **)&device, (void *)&parameters);

◆ handleToDrawable() [1/2]

TSLDeviceContext TSLAcceleratedRenderingInterface::handleToDrawable ( ) const

Query the handle to the drawable. Microsoft Windows specific method.

This allows the user to setup a separate drawing surface which is compatible to the original one created. This would allow the user to draw symbols or APP6A entity sets, into a bitmap which could then drawn as a texture on a polygon.

Returns a HDC under Windows for the OpenGL Accelerated Surface and a LPDIRECT3DDEVICE9 for the DirectX Accelerated Surface.

Note: You can not mix OpenGL and DirectX within a single application.

◆ handleToDrawable() [2/2]

TSLDrawableHandle TSLAcceleratedRenderingInterface::handleToDrawable ( TSLDisplayHandle & xDisplay) const

Query the handle to the drawable. X11 specific function

This allows the user to setup a separate drawing surface which is compatible to the original one created. This would allow the user to draw symbols or APP6A entity sets, into a bitmap which could then drawn as a texture on a polygon.

Parameters
xDisplayThe Display* is stored in this parameter by the method.
Returns
handle to the associated Drawable under X.

◆ handleToX11DrawingParameters()

bool TSLAcceleratedRenderingInterface::handleToX11DrawingParameters ( TSLVisualHandle & visual,
TSLScreenHandle & screen,
TSLColourmapHandle & colourmap ) const

This method is specific to X11.

The method provides access to the additional parameters passed into the associated Drawing Surface on construction.

These parameters will not change unless you do an attach or detach on the Drawing Surface.

The Drawable should always be queried as this may change.

Parameters
visualA TSLVisualHandle reference.This is used to store a pointer to a Visual
screenA TSLScreenHandle reference. This is used to store a pointer to a Screen
colourmapA TSLColourmapHandle reference. This is used to store the colourmap identifier.
Note
Depth is available via the Visual and Screen structures.
Returns
true if data is returned, false otherwise.

◆ latLonToADU()

bool TSLAcceleratedRenderingInterface::latLonToADU ( const double lat,
const double lon,
double & xADU,
double & yADU,
bool local = false ) const

Convert latitude and longitude to accelerator device units.

These units are OpenGL device units not pixels.

The points returned by latLonToADU are un-rotated points.

Parameters
latlatitude to convert.
lonlongitude to convert.
xADUx axis device unit position.
yADUy axis device unit position.
localIndicates whether the lat/long co-ordinate is in WGS84 or the local datum.
Returns
true on success, false otherwise.

◆ latLonToDU()

bool TSLAcceleratedRenderingInterface::latLonToDU ( const double latitude,
const double longitude,
TSLDeviceUnits & x,
TSLDeviceUnits & y,
bool local = false ) const

Given a latitude and longitude the method calculates the Screen X & Y.

Parameters
latitudelatitude
longitudelongitude
xScreen pixel x position
yScreen pixel y position
localIndicates whether the lat/long co-ordinate is in WGS84 or the local datum.
Returns
true if ok. Otherwise x and y are undefined.

◆ lockSurface()

TSLRenderingInterface * TSLAcceleratedRenderingInterface::lockSurface ( )

Locks the drawing surface.

This must be called if you are drawing using GDI on a DirectX Accelerated Surface.

Returns the GDI based TSLRenderingInterface.

If NULL is returned then the lock failed.

You can obtain the HDC from the returned TSLRenderingInterface.

◆ TMCsPerADU()

double TSLAcceleratedRenderingInterface::TMCsPerADU ( ) const

Returns the TMC's per ADU.

◆ TMCToADU()

bool TSLAcceleratedRenderingInterface::TMCToADU ( const TSLTMC xTMC,
const TSLTMC yTMC,
double & xADU,
double & yADU ) const

Returns the ADU position of a TMC point.

Parameters
xTMCTMC x position
yTMCTMC y position
xADUreturned ADU x position
yADUreturned ADU y position
Returns
true if the conversion was ok.

◆ unlockSurface()

void TSLAcceleratedRenderingInterface::unlockSurface ( )

Unlocks the drawing surface.

This must be called if you are drawing using GDI on a DirectX Accelerated Surface.

◆ userWord()

void * TSLAcceleratedRenderingInterface::userWord ( ) const

Returns a pointer to the user data stored on the drawing surface.

◆ viewRotation()

double TSLAcceleratedRenderingInterface::viewRotation ( ) const

Returns the 2D view rotation in degrees.