![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
TSLRenderingInterface class acts as an interface between the geometry model and the actual surface on which it will be drawn.
This allows the Geometry Model to be used independently of any specific drawing surface type since the RenderingInterface will act as a NULL interface in its own right.
It is only used in MapLink when using Display Objects.
To draw a particular object, call any 'setupXxxAttributes' methods, followed by any 'drawXxx' methods required.
Alternatively, the query methods of this class allow the entity's position to be determined and the entity drawn using, for example, raw GDI or X calls.
The types used to return OS specific drawing are as follows:
TSLDeviceContext : Windows 'HDC'. TSLWindowHandle : Windows 'HWND'. TSLBitmapHandle : Windows 'HBITMAP', X11 a pointer to a structure declared in tslplatformtypes.h. TSLDrawableHandle : X11 'Drawable'. TSLVisualHandle : X11 'Visual *'. TSLColourmapHandle : X11 'Colormap'. TSLScreenHandle : X11 'Screen *'. TSLDisplayHandle : X11 'Display *'.
If you pass a specific OS type to a method or you are querying a method which returns an OS specific type as defined above you may need to cast the result or argument to the type expected.
The methods that take a wchar_t should be avoided on non-Windows platforms as the character conversion is platform and potentially compiler specific.
Realtime reprojection introduces a number of complexities that need to be handled by the application, if enabled.
If the layer we are in has been enabled for realtime reprojection then drawing raster and vector is limited to Text and Symbols only.
The position of the Text and Symbols need to be updated as the TSLCoordinateSystem projection center or projection may have changed.
Public Member Functions | |
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) |
TSLRasterBuffer * | createRasterBuffer (unsigned int width, unsigned int height, TSLRasterBuffer::Format format, TSLRasterBuffer::FilterMode filterMode=TSLRasterBuffer::Linear) |
bool | drawArc (const TSLCoord ¢re_point, TSLTMC xradius, TSLTMC yradius, double start_angle, double end_angle, double rot_angle=0.0) |
bool | drawEllipse (const TSLCoord ¢re_point, TSLTMC xradius, TSLTMC yradius, double rot_angle=0.0) |
bool | drawEntity (TSLEntity *entity, const TSLEnvelope *tmcExtent=NULL) |
int | drawingSurfaceID () const |
bool | drawPolygon (const TSLCoordSet *outer, int numInners=0, const TSLCoordSet **inners=0, TSLEnvelope *extent=0) |
bool | drawPolygon (const TSLCoord *outer, int numOuterCoords, int numInners=0, const TSLCoord **inners=0, int *numCoordsInInner=0, TSLEnvelope *extent=0) |
bool | drawPolyline (const TSLCoordSet *edge, bool closed=false, TSLEnvelope *extent=0) |
bool | drawPolyline (const TSLCoord *edge, int numCoords, bool closed=false, TSLEnvelope *extent=0) |
bool | drawRaster (TSLTMC x, TSLTMC y, unsigned int width, unsigned int height, double angle, TSLRasterBuffer *raster) |
bool | drawSymbol (const TSLCoord &point, TSLTMC size=0, TSLEnvelope *rnd_env=0) |
bool | drawText (const TSLText *textObject, TSLEnvelope *rnd_env=0) |
bool | drawText (const TSLCoord &point, const char *value, TSLEnvelope *rnd_env=0) |
bool | drawText (const TSLCoord &point, const wchar_t *value, TSLEnvelope *rnd_env=0) |
TSLDrawModeEnum | drawPass () const |
void | DUToTMC (TSLDeviceUnits x_in, TSLDeviceUnits y_in, TSLTMC *x_out, TSLTMC *y_out) const |
void | DUToTMC (int num, TSLDeviceUnits *x_ins, TSLDeviceUnits *y_ins, TSLTMC *x_outs, TSLTMC *y_outs) const |
TSLEnvelope | extent () |
bool | extentExceedsDU (const TSLEnvelope &extentInTMC) |
TSLStyleID | getIDofNearestColour (int red, int green, int blue) |
TSLDeviceContext | handleToDrawable () const |
TSLDrawableHandle | handleToDrawable (TSLDisplayHandle &xDisplay) const |
bool | handleToX11DrawingParameters (TSLVisualHandle &visual, TSLScreenHandle &screen, TSLColourmapHandle &colourmap) const |
bool | isDecluttered (const char *featureName, TSLFeatureID featureID) const |
void | notifyRenderExtent (const TSLEnvelope &extent) |
const TSLCoordinateSystem * | queryCoordinateSystem () const |
const TSLCoordinateSystem * | queryScaledLatLongCoordinateSystem () const |
bool | realtimeReprojectionActive () const |
double | rotation () const |
bool | rotationActive () const |
TSLCoord | rotationCentre () const |
bool | scaledLatLonDrawingExtent (TSLEnvelope &left, TSLEnvelope &right) const |
void | screenResolution (double &xr, double &yr) const |
bool | setupAreaAttributes (TSLStyleID style, TSLStyleID colour, short opacity=-1, TSLStyleID backgroundColour=0) |
bool | setupEdgeAttributes (TSLStyleID style, TSLStyleID colour, double thickness, TSLDimensionUnits thicknessUnits=TSLDimensionUnitsPixels, int passNumber=0, bool *morePassesRequired=0, TSLEdgeJoinStyle joinStyle=TSLEdgeJoinStyleUndefined, TSLEdgeEndCapStyle endCapStyle=TSLEdgeEndCapStyleUndefined, short opacity=-1) |
bool | setupSymbolAttributes (TSLStyleID style, TSLStyleID colour, double sizeFactor=1.0, TSLDimensionUnits sizeFactorUnits=TSLDimensionUnitsMapUnits, TSLDeviceUnits minPixelSize=1, TSLDeviceUnits maxPixelSize=2000, double orientation=0.0, uint32_t fontCharacter=-1, short opacity=-1, TSLSymbolRotation symbolRotation=TSLSymbolRotationEnabled) |
bool | setupTextAttributes (TSLStyleID font, TSLStyleID colour, double sizeFactor=1.0, TSLDimensionUnits sizeFactorUnits=TSLDimensionUnitsMapUnits, TSLDeviceUnits minPixelHeight=1, TSLDeviceUnits maxPixelHeight=2000, double offsetX=0.0, double offsetY=0.0, TSLDimensionUnits offsetUnits=TSLDimensionUnitsUndefined, double orientation=0.0, TSLHorizontalAlignment halignment=TSLHorizontalAlignmentLeft, TSLVerticalAlignment valignment=TSLVerticalAlignmentFullBottom, TSLTextBackgroundMode backgroundMode=TSLTextBackgroundModeNone, TSLStyleID backgroundFillStyle=0, TSLStyleID backgroundFillOrHaloColour=0, TSLStyleID backgroundEdgeColour=0, TSLTextRotation textRotation=TSLTextRotationEnabled, short opacity=-1, TSLStyleID fillStyle=0, TSLStyleID fillBackgroundColour=0, float complexHaloRadius=-1.0f, TSLDimensionUnits complexHaloUnits=TSLDimensionUnitsUndefined) |
void | TMCPerDU (TSLTMC &xr, TSLTMC &yr) const |
double | TMCPerMU () const |
void | TMCToDU (TSLTMC x_in, TSLTMC y_in, TSLDeviceUnits *x_out, TSLDeviceUnits *y_out) const |
void | TMCToDU (int num, TSLTMC *x_ins, TSLTMC *y_ins, TSLDeviceUnits *x_outs, TSLDeviceUnits *y_outs) const |
void | TMCToDuAccurate (double &x, double &y) const |
void | TMCToDuAccurate (int num, double *xs, double *ys) const |
TSLDrawingSurfaceTypeEnum | type () const |
void * | userWord () const |
TSLStyleID TSLRenderingInterface::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 ) |
Creates a new font identifier object that can be used to specify a font used in drawing. Example usage:
name | The font name. |
meaningOfName | Specify TSLFontType::TSLFontTypeFontName. |
fontWeight | |
italic | true for italics |
underline | true for underline |
TSLRasterBuffer * TSLRenderingInterface::createRasterBuffer | ( | unsigned int | width, |
unsigned int | height, | ||
TSLRasterBuffer::Format | format, | ||
TSLRasterBuffer::FilterMode | filterMode = TSLRasterBuffer::Linear ) |
Creates a new object that can be used to draw rasters to a MapLink drawing surface through the TSLRenderingInterface. For details on how to use the returned object refer to the class documentation for TSLRasterBuffer.
width | The width in pixels of the raster to create. |
height | The height in pixels of the raster to create. |
format | The image format to use for the raster. |
filterMode | The filtering mode to use when drawing the raster at a different resolution to the underlying image data. |
bool TSLRenderingInterface::drawArc | ( | const TSLCoord & | centre_point, |
TSLTMC | xradius, | ||
TSLTMC | yradius, | ||
double | start_angle, | ||
double | end_angle, | ||
double | rot_angle = 0.0 ) |
Draw an arc.
The current edge attributes are used when drawing the edge. These should have been defined using the setupEdgeAttributes method.
All angles are specified in radians, +ve anti-clockwise from the +ve X axis. The arc is drawn anti-clockwise from the start_angle to the end_angle.
centre_point | Centre of the ellipse forming the arc. |
xradius | X radius of the ellipse forming the arc, before rotation. |
yradius | Y radius of the ellipse forming the arc, before rotation. |
start_angle | Angle to start drawing arc from. |
end_angle | Angle to stop drawing arc at. |
rot_angle | Angle of rotation of ellipse forming arc. |
A Circle is drawn regardless of rotation. An Ellipse is always drawn if there is no rotation on the Ellipse or drawing surface.
An Arc is drawn (if it forms part of a Circle). Rotation is not applied to the start/end angles if a rotation is specified. An Ellipse Arc is drawn if there is no rotation on the Arc or drawing surface.
An Ellipse/Arc will not be drawn if the coordinates when converted to X coordinates wrap. This occurs when you are zoomed in very close.
When the size of the Arc/Ellipse is > 3000 pixels a straight line approximation is drawn. This will usually occur when you are zoomed in.
If you require the drawing concept of Range Rings you should examine the NT C2Demo example code. The Range Ring DDO is easily ported to X. }
bool TSLRenderingInterface::drawEllipse | ( | const TSLCoord & | centre_point, |
TSLTMC | xradius, | ||
TSLTMC | yradius, | ||
double | rot_angle = 0.0 ) |
Draw an ellipse.
The current edge and area attributes are used when drawing the edge. These should have been defined using the setupEdgeAttributes and setupAreaAttributes methods.
All angles are specified in radians, +ve anti-clockwise from the +ve X axis.
centre_point | Centre of ellipse. |
xradius | X radius of ellipse, before rotation. |
yradius | Y radius of ellipse, before rotation. |
rot_angle | Angle of rotation of ellipse. |
A Circle is drawn regardless of rotation. An Ellipse is always drawn if there is no rotation on the Ellipse or drawing surface.
An Arc is drawn (if it forms part of a Circle). Rotation is not applied to the start/end angles if a rotation is specified. An Ellipse Arc is drawn if there is no rotation on the Arc or drawing surface.
An Ellipse/Arc will not be drawn if the coordinates when converted to X coordinates wrap. This occurs when you are zoomed in very close.
When the size of the Arc/Ellipse is > 3000 pixels a straight line approximation is drawn. This will usually occur when you are zoomed in.
If you require the drawing concept of Range Rings you should examine the NT C2Demo example code. The Range Ring DDO is easily ported to X. }
bool TSLRenderingInterface::drawEntity | ( | TSLEntity * | entity, |
const TSLEnvelope * | tmcExtent = NULL ) |
Draw a TSLEntity.
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.
entity | the entity to draw |
tmcExtent | The tmc extent of the drawing area. For a Dynamic Data Object this should be the extent passed to the draw method. The default extent is the un-rotated display extent. |
int TSLRenderingInterface::drawingSurfaceID | ( | ) | const |
Returns the user drawing surface ID.
TSLDrawModeEnum TSLRenderingInterface::drawPass | ( | ) | const |
The current draw pass.
The draw pass provides a hint as to what stage the drawing pipeline is currently executing.
Different Drawing Surfaces will have different pipeline stages. Normally there is only one stage.
You may get multiple stages for the TSLOpenGLSurface depending on if the layer has been marked for Realtime-Reprojection.
bool TSLRenderingInterface::drawPolygon | ( | const TSLCoord * | outer, |
int | numOuterCoords, | ||
int | numInners = 0, | ||
const TSLCoord ** | inners = 0, | ||
int * | numCoordsInInner = 0, | ||
TSLEnvelope * | extent = 0 ) |
Draw a polygon.
The current edge and area attributes are used when drawing the polygon. These should have been defined using the setupEdgeAttributes and setupAreaAttributes methods.
outer | Coordinates of outer of polygon. The first and last points will be joined automatically. |
numOuterCoords | Number of coordinates in outer array |
numInners | Number of inners in the 'inners' array. Defaults to 0. |
inners | Array of inners (holes) to removed from the polygon. Each entry is a pointer to an array of coordinates |
numCoordsInInner | Array of counts for each of the inners |
extent | Extent of polygon. This improves performance if specified. If not specified, then the outer coords array is analysed to determine the extent. |
bool TSLRenderingInterface::drawPolygon | ( | const TSLCoordSet * | outer, |
int | numInners = 0, | ||
const TSLCoordSet ** | inners = 0, | ||
TSLEnvelope * | extent = 0 ) |
Draw a polygon.
The current edge and area attributes are used when drawing the polygon. These should have been defined using the setupEdgeAttributes and setupAreaAttributes methods.
outer | Coordinates of outer of polygon. The first and last points will be joined automatically. |
numInners | Number of inners in the 'inners' array. Defaults to 0. |
inners | Array of inners (holes) to removed from the polygon. |
extent | Extent of polygon. This improves performance if specified. If not specified, then the outer coordset is analysed to determine the extent. |
bool TSLRenderingInterface::drawPolyline | ( | const TSLCoord * | edge, |
int | numCoords, | ||
bool | closed = false, | ||
TSLEnvelope * | extent = 0 ) |
Draw a polyline, using basic TSLCoords - used typically for dynamic rendering of Multi-part lines
The current edge attributes are used when drawing the polyline. These should have been defined using the setupEdgeAttributes method.
edge | Coordinates of polyline. |
numCoords | Number of coordinates in the 'edge' array |
closed | If true, then an additional segment is drawn between the first and last coordinate. |
extent | Extent of polyline. This improves performance if specified. If not specified, then the edge coords array is analysed to determine the extent. |
bool TSLRenderingInterface::drawPolyline | ( | const TSLCoordSet * | edge, |
bool | closed = false, | ||
TSLEnvelope * | extent = 0 ) |
Draw a polyline.
The current edge attributes are used when drawing the polyline. These should have been defined using the setupEdgeAttributes method.
edge | Coordinates of polyline. |
closed | If true, then an additional segment is drawn between the first and last coordinate. |
extent | Extent of polyline. This improves performance if specified. If not specified, then the edge coordset is analysed to determine the extent. |
bool TSLRenderingInterface::drawRaster | ( | TSLTMC | x, |
TSLTMC | y, | ||
unsigned int | width, | ||
unsigned int | height, | ||
double | angle, | ||
TSLRasterBuffer * | raster ) |
Draws a previously created raster.
The raster will be drawn such that the centre of the raster is at the given position. If the display width and height do not match the resolution of the raster being drawn, the raster will be scaled to the requested display size.
x | The x coordinate of the centre of the unrotated raster in TMCs. |
y | The t coordinate of the centre of the unrotated raster in TMCs. |
width | The display width of the unrotated raster in TMCs. |
height | The display height of the unrotated raster in TMCs. |
angle | The anti-clockwise rotation of the raster in radians. Rasters are rotated around their centre. |
raster | The raster object to display. |
bool TSLRenderingInterface::drawSymbol | ( | const TSLCoord & | point, |
TSLTMC | size = 0, | ||
TSLEnvelope * | rnd_env = 0 ) |
Draw a symbol.
The current attributes are used when drawing the symbol. These should have been defined using the setupSymbolAttributes method.
point | Position to draw symbol. |
size | Size of the symbol in internal TMC co-ordinates. |
rnd_env | For symbols that are fixed size in device coordinate space, the actual extent rendered may change each time the symbol is drawn. If this envelope is specified, then it is populated by the extent of the drawn symbol. |
bool TSLRenderingInterface::drawText | ( | const TSLCoord & | point, |
const char * | value, | ||
TSLEnvelope * | rnd_env = 0 ) |
Draw some text.
The current attributes are used when drawing the text. These should have been defined using the setupTextAttributes method.
point | Position to draw text. |
value | String to draw. |
rnd_env | For raster text, the actual extent rendered may change each time the text is drawn. If this envelope is specified, then it is populated by the extent of the drawn text. |
bool TSLRenderingInterface::drawText | ( | const TSLCoord & | point, |
const wchar_t * | value, | ||
TSLEnvelope * | rnd_env = 0 ) |
Draw some text.
The current attributes are used when drawing the text. These should have been defined using the setupTextAttributes method.
point | Position to draw text. |
value | String to draw. |
rnd_env | For raster text, the actual extent rendered may change each time the text is drawn. If this envelope is specified, then it is populated by the extent of the drawn text. |
bool TSLRenderingInterface::drawText | ( | const TSLText * | textObject, |
TSLEnvelope * | rnd_env = 0 ) |
Draw text from the specified object.
The current attributes are used when drawing the text. These should have been defined using the setupTextAttributes method.
textObject | Object containing text to draw. Text string and encoding are used. |
rnd_env | For raster text, the actual extent rendered may change each time the text is drawn. If this envelope is specified, then it is populated by the extent of the drawn text. |
void TSLRenderingInterface::DUToTMC | ( | int | num, |
TSLDeviceUnits * | x_ins, | ||
TSLDeviceUnits * | y_ins, | ||
TSLTMC * | x_outs, | ||
TSLTMC * | y_outs ) const |
This method converts a set of device unit (usually in pixel) values to their internal co-ordinate values.
(num) | the number of co-ordinates to convert. |
(x_ins,y_ins) | incoming device units |
(x_outs,y_outs) | array to receive the results of the conversions in internal co-ordinates. These arrays should be large enough to hold num values. |
void TSLRenderingInterface::DUToTMC | ( | TSLDeviceUnits | x_in, |
TSLDeviceUnits | y_in, | ||
TSLTMC * | x_out, | ||
TSLTMC * | y_out ) const |
This method converts a device unit (usually in pixel) value to an internal co-ordinate value.
(x_in,y_in) | incoming device unit |
(x_out,y_out) | reference to variables to receive the result of the conversion in internal co-ordinate. |
TSLEnvelope TSLRenderingInterface::extent | ( | ) |
Returns the current TMC extent displayed on the drawing surface. This is not necessarily the same as the area being rendered.
bool TSLRenderingInterface::extentExceedsDU | ( | const TSLEnvelope & | extentInTMC | ) |
Check for numeric overflow in screen space.
When zoomed in on a large entity, the extent of the entity may exceed the device unit coordinate space. This is an operating system dependent limit, typically 16 bit values. If the specified TMC extent would surpass these limits, then the transformation may cause distortion of the rendered object due to coordinates wrapping round.
If this method returns true, then the caller must take proper steps to ensure that the image is displayed correctly.
Returns true if the TMC extent passed in would exceed the device coordinate limits given the current view.
TSLStyleID TSLRenderingInterface::getIDofNearestColour | ( | int | red, |
int | green, | ||
int | blue ) |
Returns ID of the nearest colour to the specified RGB values. This will be an index in the currently loaded palette.
TSLDeviceContext TSLRenderingInterface::handleToDrawable | ( | ) | const |
Query the handle to the drawable. Microsoft Windows specific method
This allows the called to directly draw to the handle that is attached to the TSLDrawingSurface, bypassing the MapLink rendering.
Returns a HDC under Windows.
TSLDrawableHandle TSLRenderingInterface::handleToDrawable | ( | TSLDisplayHandle & | xDisplay | ) | const |
Query the handle to the drawable. X11 specific function.
This allows the called to directly draw to the handle that is attached to the TSLDrawingSurface, bypassing the MapLink rendering.
xDisplay | The Display* is stored in this parameter by the method. |
bool TSLRenderingInterface::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 TSLRenderingInterface::isDecluttered | ( | const char * | featureName, |
TSLFeatureID | featureID ) const |
Returns the Decluttered status of the feature.
Can pass in the featureName or the featureID. The featureID takes precedence over the featueName.
void TSLRenderingInterface::notifyRenderExtent | ( | const TSLEnvelope & | extent | ) |
Notifies the rendering interface of the extent about to be rendered.
This method should be called before rendering commences. It allows the TSLDrawingSurface to use optimised integer maths to allow fast display.
extent | Extent about to be rendered. |
const TSLCoordinateSystem * TSLRenderingInterface::queryCoordinateSystem | ( | ) | const |
Returns the TSLCoordinateSystem for the associated Drawing Surface's Coordinate Providing Layer.
If the associated Drawing Surface does not have a Coordinate Providing DataLayer or the layer does not have a valid Coordinate System, NULL is returned.
const TSLCoordinateSystem * TSLRenderingInterface::queryScaledLatLongCoordinateSystem | ( | ) | const |
Returns the Data TSLCoordinateSystem when realtime re-projection is enabled for the layer.
If the associated Drawing Surface does not have a Coordinate Providing DataLayer or the layer does not have a valid Data Coordinate System, NULL is returned.
bool TSLRenderingInterface::realtimeReprojectionActive | ( | ) | const |
Returns true if the layer being drawn is being realtime re-projected.
The draw pass can be queried by calling drawMode().
double TSLRenderingInterface::rotation | ( | ) | const |
Returns the current rotation angle of the view. This is in radians, +ve anti-clockwise from the +ve X axis.
bool TSLRenderingInterface::rotationActive | ( | ) | const |
Return true if the view is rotated.
TSLCoord TSLRenderingInterface::rotationCentre | ( | ) | const |
Returns the current centre of rotation.
bool TSLRenderingInterface::scaledLatLonDrawingExtent | ( | TSLEnvelope & | left, |
TSLEnvelope & | right ) const |
This method allows the caller to query the extent of the area being displayed as scaled latitude and longitude, if realtime re-projection is enabled for the layer.
The extent passed to the drawLayer() is the TMC extent of the currently displayed area. The TMC extent can be converted to latitude/longitude using the TSLCoordinateSystem returned by queryCoordinateSystem().
When realtime re-projection is active the data is stored as a scaled latitude and longitude.
This means that when drawing we need to take account of the dateline and thus we need to know what the left and right extents.
left | is the extent to the left of the screen. If the width and height is zero this extent should be ignored. |
right | is the extent to the right of the screen. if the width and height is zero this extent should be ignored. |
void TSLRenderingInterface::screenResolution | ( | double & | xr, |
double & | yr ) const |
Query the current view resolution, in both X and Y axis. These are usually the same value, but may differ when Dynamic Arc projections are used.
xr | Storage for X axis internal TMC units per Device Unit |
yr | Storage for Y axis internal TMC units per Device Unit |
bool TSLRenderingInterface::setupAreaAttributes | ( | TSLStyleID | style, |
TSLStyleID | colour, | ||
short | opacity = -1, | ||
TSLStyleID | backgroundColour = 0 ) |
Setup the attributes to be used when rendering an 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 |
The following parameters are reserved for future enhancements
opacity | reserved |
backgroundColour | reserved |
bool TSLRenderingInterface::setupEdgeAttributes | ( | TSLStyleID | style, |
TSLStyleID | colour, | ||
double | thickness, | ||
TSLDimensionUnits | thicknessUnits = TSLDimensionUnitsPixels, | ||
int | passNumber = 0, | ||
bool * | morePassesRequired = 0, | ||
TSLEdgeJoinStyle | joinStyle = TSLEdgeJoinStyleUndefined, | ||
TSLEdgeEndCapStyle | endCapStyle = TSLEdgeEndCapStyleUndefined, | ||
short | opacity = -1 ) |
Setup the attributes to be used when rendering an edge.
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. |
passNumber | The number of the current pass. This is used for rendering complex line styles, such as those for representing major roads etc. |
morePassesRequired | This parameter is used to determine whether another rendering pass is required when rendering complex line styles. Set to true if another pass is required. |
The following parameters are reserved for future enhancements
joinStyle | reserved |
endCapStyle | reserved |
opacity | reserved |
bool TSLRenderingInterface::setupSymbolAttributes | ( | TSLStyleID | style, |
TSLStyleID | colour, | ||
double | sizeFactor = 1.0, | ||
TSLDimensionUnits | sizeFactorUnits = TSLDimensionUnitsMapUnits, | ||
TSLDeviceUnits | minPixelSize = 1, | ||
TSLDeviceUnits | maxPixelSize = 2000, | ||
double | orientation = 0.0, | ||
uint32_t | fontCharacter = -1, | ||
short | opacity = -1, | ||
TSLSymbolRotation | symbolRotation = TSLSymbolRotationEnabled ) |
Setup the attributes to be used when rendering a symbol.
style | Symbol style of object, index as specified via TSLDrawingSurface::setupSymbols. 0 is no symbol. |
colour | Colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no symbol. Note that this will not apply to TMF or raster symbols, only vector symbols. |
sizeFactor | Specifies a scaling factor for the symbol size. Defaults to 1.0. |
sizeFactorUnits | Specifies the units to use for sizing the symbol, e.g. Map Units, pixels etc. |
minPixelSize | Specifies the minimum pixel size for the symbol. |
maxPixelSize | Specifies the maximum pixel size for the symbol. |
orientation | Rotation of symbol in radians, +ve anti-clockwise from the +ve X axis. |
fontCharacter | When using a font symbol, this character will be displayed in the font defined by the font symbol style. For all other symbol types, this value will be ignored. |
symbolRotation | The type of rotation to use when drawing symbols. If set to TSLSymbolRotationEnabled, symbols will be rotated with the drawing surface. If set to TSLSymbolRotationDisabled symbols will not be rotated with the drawing surface. |
The following parameters are reserved for future enhancements:
opacity | reserved |
bool TSLRenderingInterface::setupTextAttributes | ( | TSLStyleID | font, |
TSLStyleID | colour, | ||
double | sizeFactor = 1.0, | ||
TSLDimensionUnits | sizeFactorUnits = TSLDimensionUnitsMapUnits, | ||
TSLDeviceUnits | minPixelHeight = 1, | ||
TSLDeviceUnits | maxPixelHeight = 2000, | ||
double | offsetX = 0.0, | ||
double | offsetY = 0.0, | ||
TSLDimensionUnits | offsetUnits = TSLDimensionUnitsUndefined, | ||
double | orientation = 0.0, | ||
TSLHorizontalAlignment | halignment = TSLHorizontalAlignmentLeft, | ||
TSLVerticalAlignment | valignment = TSLVerticalAlignmentFullBottom, | ||
TSLTextBackgroundMode | backgroundMode = TSLTextBackgroundModeNone, | ||
TSLStyleID | backgroundFillStyle = 0, | ||
TSLStyleID | backgroundFillOrHaloColour = 0, | ||
TSLStyleID | backgroundEdgeColour = 0, | ||
TSLTextRotation | textRotation = TSLTextRotationEnabled, | ||
short | opacity = -1, | ||
TSLStyleID | fillStyle = 0, | ||
TSLStyleID | fillBackgroundColour = 0, | ||
float | complexHaloRadius = -1.0f, | ||
TSLDimensionUnits | complexHaloUnits = TSLDimensionUnitsUndefined ) |
Setup the attributes to be used when rendering text.
font | Font style of object, index as specified via TSLDrawingSurface::setupFonts. 0 is no text. |
colour | Colour of object, index as specified via TSLDrawingSurface::setupColours. 0 is no text. |
sizeFactor | Specifies the scaling factor for the text. |
sizeFactorUnits | Specifies the units to use for the text height, e.g. Map Units, Pixels etc. |
minPixelHeight | Specifies the minimum height for the text in pixels. |
maxPixelHeight | Specifies the maximum height for the text in pixels. |
offsetX | Specifies a horizontal offset for positioning the text. How this offset is applied depends on the 'offsetUnits' and 'textRotation' arguments. |
offsetY | Specifies a vertical offset for positioning the text. How this offset is applied depends on the 'offsetUnits' and 'textRotation' arguments. |
offsetUnits | Specifies the units to use when calculating the X and Y offsets specified in the previous two parameters. |
orientation | Rotation of text in radians, +ve anti-clockwise from the +ve X axis. Note that on Unix, only vector fonts may be rotated. If the 'textRotation' parameter is set to TSLTextRotationDisabled, this parameter is ignored. |
halignment | Horizontal text alignment. |
valignment | Vertical text alignment. |
backgroundMode | Specifies the type of background for the text, e.g. None, Halo, Rectangle etc. |
backgroundFillStyle | Specifies the fill style for the text background, |
backgroundFillOrHaloColour | Specifies the fill colour for the text background. |
backgroundEdgeColour | Specifies the edge colour for the text background. |
textRotation | The type of rotation to use when drawing text. If set to TSLTextRotationEnabled, text will be rotated with the drawing surface, and the X/Y offsets will be geographic. If set to TSLTextRotationDisabled, text will always be drawn horizontal, and the X/Y offsets will be relative to the screen. |
The following parameters are reserved for future enhancements
opacity | reserved |
fillStyle | reserved |
fillBackgroundColour | reserved |
complexHaloRadius | reserved |
complexHaloUnits | reserved |
void TSLRenderingInterface::TMCPerDU | ( | TSLTMC & | xr, |
TSLTMC & | yr ) const |
Query the current view resolution, in both X and Y axis. These are usually the same value, but may differ when Dynamic Arc projections are used.
This method is the same as screenResolution, but added for naming consistency.
xr | Storage for X axis internal TMC units per Device Unit |
yr | Storage for Y axis internal TMC units per Device Unit |
double TSLRenderingInterface::TMCPerMU | ( | ) | const |
Returns the number of internal (TMC) coordinates per map unit.
void TSLRenderingInterface::TMCToDU | ( | int | num, |
TSLTMC * | x_ins, | ||
TSLTMC * | y_ins, | ||
TSLDeviceUnits * | x_outs, | ||
TSLDeviceUnits * | y_outs ) const |
This method converts a set of internal co-ordinate values to their device unit (usually in pixel) values.
(num) | the number of co-ordinates to convert. |
(x_ins,y_ins) | incoming internal co-ordinates |
(x_outs,y_outs) | array to receive the results of the conversions in device units. These arrays should be large enough to hold num values. |
void TSLRenderingInterface::TMCToDU | ( | TSLTMC | x_in, |
TSLTMC | y_in, | ||
TSLDeviceUnits * | x_out, | ||
TSLDeviceUnits * | y_out ) const |
This method converts an internal co-ordinate value to a device unit (usually in pixel) value.
(x_in,y_in) | incoming internal co-ordinate |
(x_out,y_out) | reference to variables to receive the result of the conversion in device unit. |
void TSLRenderingInterface::TMCToDuAccurate | ( | double & | x, |
double & | y ) const |
This method converts an internal co-ordinate value to a device unit (usually in pixel) value.
This differs from TMCToDu, since the values returned are double-precision, not rounded, and may exceed the operating system dependent device unit limits.
(x,y) | Co-ordinate reference. It is modified with the DU coordinates. |
void TSLRenderingInterface::TMCToDuAccurate | ( | int | num, |
double * | xs, | ||
double * | ys ) const |
This method converts a set of internal co-ordinate values to their equivalent device unit (usually in pixel) values.
This differs from TMCToDu, since the values returned are double-precision, not rounded, and may exceed the operating system dependent device unit limits.
(num) | The number of co-ordinates to convert. |
(xs,ys) | Array of co-ordinates. It is modified with the equivalent DU coordinates. |
TSLDrawingSurfaceTypeEnum TSLRenderingInterface::type | ( | ) | const |
This method returns the type of the drawing surface.
There is no way of obtaining the actual Drawing Surface via the Rendering Interface. If necessary a pointer may be stored to the Drawing Surface using the userWord method on the Drawing Surface and accessed via the userWord method on the Rendering Interface.
void * TSLRenderingInterface::userWord | ( | ) | const |
Returns a pointer to the user data stored on the drawing surface.