![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
TSL3DRenderingInterface class acts as an interface between the geometry model and the actual surface on which it will be drawn.
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 |
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.
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.
entity | the entity to draw |
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.
x | Screen pixel x position |
y | Screen pixel y position |
latitude | returned latitude |
longitude | returned longitude |
The screen x and y must be part of the visible screen.
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).
x,y,z | input geocentric coordinates |
lat,lon,alt | output geodetic coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
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.
x,y,z | input geocentric coordinates |
x1,y1,z1 | output World coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
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).
lat,lon,alt | input geodetic coordinates |
x,y,z | output geocentric coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, 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.
lat,lon,alt | input geodetic coordinates |
x,y,z | output World coordinates |
Return | value |
Error code.
See | also geocentricToGeodetic, geodeticToGeocentric, geocentricToWorld, geodeticToWorld |
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.
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.
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.
xDisplay | The pointer to the X Display is stored in this argument. |
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().
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 TSL3DRenderingInterface::intersectsViewingVolume | ( | const TSL3DBoundingBox & | boundingBox | ) | const |
This method determines whether or not the given bounding box intersects the current viewing volume.
boundingBox | the bounding box to test for intersection |
bool TSL3DRenderingInterface::isCoordInViewingVolume | ( | const TSL3DCoord * | point | ) | const |
This method determines whether or not the given coordinate is contained by the viewing volume.
point | the 3D point to test |
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).
id | A positive integer to identify the primitive drawn. |
bool TSL3DRenderingInterface::setupAreaAttributes | ( | TSLStyleID | style, |
TSLStyleID | colour, | ||
short | opacity = -1 ) |
Setup the attributes to be used when rendering a 3D area.
style | Fill style of object, index as specified via TSLDrawingSurface::setupFillstyles. 0 is no fill. |
colour | Fill colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no fill |
opacity | The parameter is reserved for future enhancements |
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.
style | Edge style of object, index as specified via TSLDrawingSurface::setupEdgestyles. 0 is no edge. |
colour | Edge colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no edge. |
thickness | Width of edge in device units or map units. 0 is no edge. |
thicknessUnits | Enum value specifying the line thickness units e.g. Map units, Pixels etc. |
opacity | The parameter is reserved for future enhancements |
void * TSL3DRenderingInterface::userWord | ( | ) | const |
Returns a pointer to the user data stored on the drawing surface.
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