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

Detailed Description

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

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

Public Member Functions

bool drawEntity (TSL3DEntity *entity)
 
bool DUToLatLon (const TSLDeviceUnits x, const TSLDeviceUnits y, double &latitude, double &longitude) const
 
void clearPickData ()
 
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
 
TSL3DRenderingModeEnum getRenderingMode () const
 
TSLDeviceContext handleToDrawable () const
 
TSLDrawableHandle handleToDrawable (TSLDisplayHandle &xDisplay) const
 
bool handleToX11DrawingParameters (TSLVisualHandle &visual, TSLScreenHandle &screen, TSLColourmapHandle &colourmap) const
 
bool intersectsViewingVolume (const TSL3DBoundingBox &boundingBox) const
 
bool isCoordInViewingVolume (const TSL3DCoord *point) const
 
bool setupAreaAttributes (TSLStyleID style, TSLStyleID colour, short opacity=-1)
 
bool setupEdgeAttributes (TSLStyleID style, TSLStyleID colour, double thickness=1.0, TSLDimensionUnits thicknessUnits=TSLDimensionUnitsPixels, short opacity=-1)
 
void setPickData (int id)
 
void * userWord () const
 
double viewRotation () const
 

Member Function Documentation

◆ clearPickData()

void TSL3DRenderingInterface::clearPickData ( )

This method clears the current user data that is associated with primitives drawn in a custom 3D data layer.

The data is used during picking to identify the primitives that were selected.

◆ drawEntity()

bool TSL3DRenderingInterface::drawEntity ( TSL3DEntity * entity)

Draw a TSL3DEntity.

The entity should can be created using the static ::create method for the particular entity to be drawn.

Entity rendering styles should be set up using the setRendering function on the entity itself.

Parameters
entitythe entity to draw

◆ DUToLatLon()

bool TSL3DRenderingInterface::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.

Parameters
xScreen pixel x position
yScreen pixel y position
latitudereturned latitude
longitudereturned longitude
Returns
true if ok. Otherwise the latitude and longitude are undefined.

The screen x and y must be part of the visible screen.

◆ geocentricToGeodetic()

bool TSL3DRenderingInterface::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).

Parameters
x,y,zinput geocentric coordinates
lat,lon,altoutput geodetic coordinates
Returnvalue

Error code.

Parameters
Seealso geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld

◆ geocentricToWorld()

bool TSL3DRenderingInterface::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.

Parameters
x,y,zinput geocentric coordinates
x1,y1,z1output World coordinates
Returnvalue

Error code.

Parameters
Seealso geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld

◆ geodeticToGeocentric()

bool TSL3DRenderingInterface::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).

Parameters
lat,lon,altinput geodetic coordinates
x,y,zoutput geocentric coordinates
Returnvalue

Error code.

Parameters
Seealso geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld

◆ geodeticToWorld()

bool TSL3DRenderingInterface::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.

Parameters
lat,lon,altinput geodetic coordinates
x,y,zoutput World coordinates
Returnvalue

Error code.

Parameters
Seealso geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld

◆ getRenderingMode()

TSL3DRenderingModeEnum TSL3DRenderingInterface::getRenderingMode ( ) const

Gets the current mode that the rendering interface has been configured for.

When rendering custom datalayers, this function should be called to determine whether the datalayer is being rendered to the display or a special operation such as a pick is taking place.

Return value description:

Enumerated type defining the current mode the TSLRenderingInterface is in:

TSL3DRenderingModeNormal : The TSLRenderingInterface is performing a regular rendering operation such as redrawing the drawing surface window.

TSL3DRenderingModePick : The TSLRenderingInterface is configured in a special mode to determine which items in a drawing surface are being picked by the user. Custom datalayers must perform one of the following to support picking depending on the type of custom datalayer: For datalayers that render using operations in the rendering interface, TSLRenderingInterface::setPickData() and TSLRenderingInterface::clearPick Data() must be used to identify the primitives that can be picked. For datalayers that render using OpenGL directory, the OpenGL glPushName() and glPopName() functions need to be used to identify the primitives that can be picked.

◆ handleToDrawable() [1/2]

TSLDeviceContext TSL3DRenderingInterface::handleToDrawable ( ) const

Query the handle to the drawable. This method is Microsoft specific.

This allows the called to directly draw to the handle that is attached to the TSLDrawingSurface, bypassing the MapLink rendering.

Returns the associated HDC.

◆ handleToDrawable() [2/2]

TSLDrawableHandle TSL3DRenderingInterface::handleToDrawable ( TSLDisplayHandle & xDisplay) const

Query the handle to the drawable. This method is X11 specific.

This allows the called to directly draw to the handle that is attached to the TSLDrawingSurface, bypassing the MapLink rendering.

Parameters
xDisplayThe pointer to the X Display is stored in this argument.
Returns
handle to the associated Drawable.

◆ handleToX11DrawingParameters()

bool TSL3DRenderingInterface::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 will more then likely change. The drawable and Display connection can be queried via handleToDrawable().

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.

◆ intersectsViewingVolume()

bool TSL3DRenderingInterface::intersectsViewingVolume ( const TSL3DBoundingBox & boundingBox) const

This method determines whether or not the given bounding box intersects the current viewing volume.

Parameters
boundingBoxthe bounding box to test for intersection

◆ isCoordInViewingVolume()

bool TSL3DRenderingInterface::isCoordInViewingVolume ( const TSL3DCoord * point) const

This method determines whether or not the given coordinate is contained by the viewing volume.

Parameters
pointthe 3D point to test

◆ setPickData()

void TSL3DRenderingInterface::setPickData ( int id)

This method sets user data to associated with primitives drawn in a custom 3D data layer.

This method should be called when you are drawing objects yourself using Open GL and when calling drawEntity.

The 'id' is used during picking to identify the primitive that was selected.

The current 'id' should be cleared with a call to clearPickData() when the primitive rendering is complete.

The 'id' should be set to greater than 0 for an object to be recognised. Do not use negative numbers and do not re-use numbers.

There should be a unique id for each entity drawn using drawEntity(). If you do not require an entity to be detected then do not provide it with an id. If necessary group the entities together and draw the group.

If you call drawEntity then the entity must be retained until the next draw Layer call on the layer or the object picked may result in an invalid memory access.

This method can be used to identify groups of primitives drawn using OpenGL within the Custom Data-layer (see TSL3DClientCustomDataLayer).

Parameters
idA positive integer to identify the primitive drawn.

◆ setupAreaAttributes()

bool TSL3DRenderingInterface::setupAreaAttributes ( TSLStyleID style,
TSLStyleID colour,
short opacity = -1 )

Setup the attributes to be used when rendering a 3D area.

Parameters
styleFill style of object, index as specified via TSLDrawingSurface::setupFillstyles. 0 is no fill.
colourFill colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no fill
opacityThe parameter is reserved for future enhancements
Returns
true if should be rendered, false otherwise.

◆ setupEdgeAttributes()

bool TSL3DRenderingInterface::setupEdgeAttributes ( TSLStyleID style,
TSLStyleID colour,
double thickness = 1.0,
TSLDimensionUnits thicknessUnits = TSLDimensionUnitsPixels,
short opacity = -1 )

Setup the attributes to be used when rendering an edge in 3D.

Parameters
styleEdge style of object, index as specified via TSLDrawingSurface::setupEdgestyles. 0 is no edge.
colourEdge colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no edge.
thicknessWidth of edge in device units or map units. 0 is no edge.
thicknessUnitsEnum value specifying the line thickness units e.g. Map units, Pixels etc.
opacityThe parameter is reserved for future enhancements
Returns
true if the object should be rendered, false otherwise.

◆ userWord()

void * TSL3DRenderingInterface::userWord ( ) const

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

◆ viewRotation()

double TSL3DRenderingInterface::viewRotation ( ) const

Returns the 2D view rotation in degrees.

The value returned is only valid if the following methods are not called on the camera

orientation translate