![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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 |
TSLRenderingInterface * | lockSurface () |
double | TMCsPerADU () const |
bool | TMCToADU (const TSLTMC xTMC, const TSLTMC yTMC, double &xADU, double &yADU) const |
void * | userWord () const |
void | unlockSurface () |
double | viewRotation () const |
bool TSLAcceleratedRenderingInterface::ADUsPerDU | ( | double & | xUnits, |
double & | yUnits ) const |
Returns the number of Accelerator Device Units (ADU) per Device Units (DU, pixels).
xUnits | number of ADU's per DU along the x-axis |
yUnits | number of ADU's per DU along the y-axis |
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.
xADU | x axis device unit to convert |
yADU | y axis device unit to convert |
lat | converted latitude |
lon | converted longitude. |
local | Indicates whether the lat/long co-ordinate is in WGS84 or the local datum. |
bool TSLAcceleratedRenderingInterface::ADUToTMC | ( | const double | xADU, |
const double | yADU, | ||
TSLTMC & | xTMC, | ||
TSLTMC & | yTMC ) const |
Returns the TMC position of ADU point.
xADU | ADU x position |
yADU | ADU y position |
xTMC | returned TMC x position |
yTMC | returned TMC y position |
void TSLAcceleratedRenderingInterface::displayCentre | ( | double & | x, |
double & | y ) const |
Returns the center of the display in Map Units.
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.
scaleX | Scale factor for the x-axis |
scaleY | Scale factor for the y-axis. |
Returns |
True if a scale is applied, false otherwise.
void TSLAcceleratedRenderingInterface::getDUExtent | ( | TSLDeviceUnits & | x1, |
TSLDeviceUnits & | y1, | ||
TSLDeviceUnits & | x2, | ||
TSLDeviceUnits & | y2 ) const |
The Screen extent in pixels.
x1,y1,x2,y2 | bottom left and top right corners of extent. |
void TSLAcceleratedRenderingInterface::getTMCExtent | ( | TSLEnvelope & | extent | ) | const |
Returns the TMC extent of the drawing area (unrotated).
extent | TSLEnvelope to store the extent in. |
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.
direct3d | Pointer to a LPDIRECT3D9. |
device | Pointer to a LPDIRECT3DDEVICE9. |
presentParameters | Pointer 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.
For | Example |
LPDIRECT3D9 direct3d = NULL; LPDIRECT3DDEVICE9 device = NULL; D3DPRESENT_PARAMETERS parameters;
bool result = acceleratedRenderinInterface-> getDirectXDrawingParameters((void **)&direct3d, (void **)&device, (void *)¶meters);
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.
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.
xDisplay | The Display* is stored in this parameter by the method. |
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.
visual | A TSLVisualHandle reference.This is used to store a pointer to a Visual |
screen | A TSLScreenHandle reference. This is used to store a pointer to a Screen |
colourmap | A TSLColourmapHandle reference. This is used to store the colourmap identifier. |
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.
lat | latitude to convert. |
lon | longitude to convert. |
xADU | x axis device unit position. |
yADU | y axis device unit position. |
local | Indicates whether the lat/long co-ordinate is in WGS84 or the local datum. |
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.
latitude | latitude |
longitude | longitude |
x | Screen pixel x position |
y | Screen pixel y position |
local | Indicates whether the lat/long co-ordinate is in WGS84 or the local datum. |
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.
double TSLAcceleratedRenderingInterface::TMCsPerADU | ( | ) | const |
Returns the TMC's per ADU.
bool TSLAcceleratedRenderingInterface::TMCToADU | ( | const TSLTMC | xTMC, |
const TSLTMC | yTMC, | ||
double & | xADU, | ||
double & | yADU ) const |
Returns the ADU position of a TMC point.
xTMC | TMC x position |
yTMC | TMC y position |
xADU | returned ADU x position |
yADU | returned ADU y position |
void TSLAcceleratedRenderingInterface::unlockSurface | ( | ) |
Unlocks the drawing surface.
This must be called if you are drawing using GDI on a DirectX Accelerated Surface.
void * TSLAcceleratedRenderingInterface::userWord | ( | ) | const |
Returns a pointer to the user data stored on the drawing surface.
double TSLAcceleratedRenderingInterface::viewRotation | ( | ) | const |
Returns the 2D view rotation in degrees.