MapLink Pro .
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
Inheritance diagram for TSLText:

Detailed Description

Text specific access methods.

This class represents the access methods that are specific to a text. They also allow setting of the various attributes.

The methods that take a wchar_t should be avoided on non-Windows platforms as the character conversion is platform and potentially compiler specific.

Rendering attributes can be set directly to this geometry using the inherited TSLEntityBase::setRendering method. This is called 'Entity Rendering'.

Rendering can be applied to a large range of geometry using 'Feature Rendering' which is set by the datalayer using TSLDataLayer::addFeatureRendering which creates a featureID. The featureID can then have attributes applied to it using TSLDataLayer::setFeatureRendering.

A featureID can be applied to geometry on creation, or it can be added later using TSLEntityBase::featureID.

Valid Rendering Attributes for TSLText:

  • TSLRenderingAttributeTextColour
  • TSLRenderingAttributeTextFont
  • TSLRenderingAttributeTextSizeFactor
  • TSLRenderingAttributeTextSizeFactorUnits

The above is not a complete list, see TSLRenderingAttributeInt, TSLRenderingAttributeDouble and TSLRenderingAttributeBool for more details.

Public Member Functions

TSLTMC height () const
void height (TSLTMC newValue)
TSLHorizontalAlignment horizontalAlignment () const
void horizontalAlignment (TSLHorizontalAlignment align)
const TSLCoordposition () const
void position (const TSLCoord &newPosition)
const char * value () const
void value (const char *newValue)
void value (const wchar_t *newValue)
TSLVerticalAlignment verticalAlignment () const
void verticalAlignment (TSLVerticalAlignment align)
Public Member Functions inherited from TSLEntity
TSLCoord centroid () const
TSLEntityclone () const
bool contains (const TSLEntity *other) const
bool crosses (const TSLEntity *other) const
void alwaysMergeDifferences (bool _alwaysMergeDifferences)
TSLEntitydifference (const TSLEntity *other) const
double distance (const TSLCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
TSLEnvelope envelope (int surfaceID=-1) const
bool equals (const TSLEntity *other) const
TSLEntityintersection (const TSLEntity *other) const
bool intersects (const TSLEntity *other) const
bool intersects (const TSLEnvelope *envelope) const
bool move (const TSLCoord &location, const TSLCoord &reference)
bool overlaps (const TSLEntity *other) const
TSLEntitySetparent ()
const TSLEntitySetparent () const
void renderLevel (int level)
int renderLevel () const
bool rotate (double angle, const TSLCoord *origin=NULL)
double rotation () const
bool rotation (double newValue)
bool scale (double scaleParam, TSLCoord *origin=0)
bool scaleXY (double scaleX, double scaleY, TSLCoord *origin=0)
double squareDistance (const TSLCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
double squareDistance (const TSLEntity *otherEntity) const
bool touches (const TSLEntity *other) const
bool translate (TSLTMC xoffset, TSLTMC yoffset)
TSLEntityunionWith (const TSLEntity *other) const
bool within (const TSLEntity *other) const
TSLCoord adjustedWeightedCentroid ()
 reserved for future use
TSLCoord centreOfGravity ()
 reserved for future use
Public Member Functions inherited from TSLEntityBase
bool addDataSet ()
bool addDataSet (TSLDataHandler *toUseDataHandler)
bool clearRenderingAttributes ()
TSLDataSetdataSet ()
const TSLDataSetdataSet () const
short dataSourceID () const
void dataSourceID (short dataSourceID)
bool deleteDataSet ()
void destroy ()
TSLEntityID entityID () const
void entityID (TSLEntityID value)
TSLFeatureID featureID () const
void featureID (TSLFeatureID newValue)
bool getRendering (TSLRenderingAttributeInt attribute, int *result) const
bool getRendering (TSLRenderingAttributeDouble attribute, double *result) const
bool getRendering (TSLRenderingAttributeBool attribute, bool *result) const
bool getRendering (TSLRenderingAttributes &result) const
TSL3DEntityis3DEntity ()
const TSL3DEntityis3DEntity () const
TSLEntityisEntity ()
const TSLEntityisEntity () const
bool isOptimisedEntity () const
void name (const char *newValue)
const char * name () const
void releaseResources (int surfaceID)
bool setRendering (TSLRenderingAttributeInt attribute, int value)
bool setRendering (TSLRenderingAttributeDouble attribute, double value)
bool setRendering (TSLRenderingAttributeBool attribute, bool value)
bool setRendering (const TSLRenderingAttributes &attributes)
void sourceID (int value)
int sourceID () const
TSLGeometryType type () const
void version (TSLVersion value)
TSLVersion version () const

Static Public Member Functions

static TSLTextcreate (TSLFeatureID featureID, TSLTMC x, TSLTMC y, const char *value, TSLTMC height=100, TSLHorizontalAlignment xalign=TSLHorizontalAlignmentCentre, TSLVerticalAlignment yalign=TSLVerticalAlignmentMiddle, double rotation=0)
static TSLTextcreate (TSLFeatureID featureID, TSLTMC x, TSLTMC y, const wchar_t *value, TSLTMC height=100, TSLHorizontalAlignment xalign=TSLHorizontalAlignmentCentre, TSLVerticalAlignment yalign=TSLVerticalAlignmentMiddle, double rotation=0)
static const TSLTextisText (const TSLEntity *entity)
static TSLTextisText (TSLEntity *entity)
Static Public Member Functions inherited from TSLEntity
static TSLEntitycreateFromWKB (const unsigned char *wkb, unsigned int wkbLength, double TMCPerMU, double mapOffsetX=0.0, double mapOffsetY=0.0, bool multiAsEntitySet=false, double maxCurveAngle=0.0)
static TSLEntitycreateFromWKT (const char *wkt, double TMCPerMU, double mapOffsetX=0.0, double mapOffsetY=0.0, bool multiAsEntitySet=false, double maxCurveAngle=0.0)

Protected Member Functions

TSLTextoperator= (const TSLText &text)
 TSLText ()
 ~TSLText ()
 TSLText (const TSLText &)
Protected Member Functions inherited from TSLEntity
 ~TSLEntity ()
Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()

Constructor & Destructor Documentation

◆ TSLText() [1/2]

TSLText::TSLText ( )
protected

Private constructor to prevent user creation.

◆ ~TSLText()

TSLText::~TSLText ( )
protected

◆ TSLText() [2/2]

TSLText::TSLText ( const TSLText & )
protected

Member Function Documentation

◆ create() [1/2]

TSLText * TSLText::create ( TSLFeatureID featureID,
TSLTMC x,
TSLTMC y,
const char * value,
TSLTMC height = 100,
TSLHorizontalAlignment xalign = TSLHorizontalAlignmentCentre,
TSLVerticalAlignment yalign = TSLVerticalAlignmentMiddle,
double rotation = 0 )
static

Creates a text object with the specified parameters.

This call should only be used for temporary entities. For example, this call may be used to create entities that are used in the spatial tests.

Parameters
featureIDID of the feature code to assign to the entity. This is used when rendering map features if no specific attribute set has been created for the entity.
xX coordinate of text position.
yY coordinate of text position.
valueText string to be displayed.
heightSize of symbol in TMC units.
xalignX alignment of text. This position of the text string is placed at the x coordinate.
yalignY alignment of text. This position of the text string is placed at the y coordinate.
rotationAngle of rotation of text. Expressed in radians, +ve anti-clockwise from the +ve X axis.
Returns
NULL on error.

◆ create() [2/2]

TSLText * TSLText::create ( TSLFeatureID featureID,
TSLTMC x,
TSLTMC y,
const wchar_t * value,
TSLTMC height = 100,
TSLHorizontalAlignment xalign = TSLHorizontalAlignmentCentre,
TSLVerticalAlignment yalign = TSLVerticalAlignmentMiddle,
double rotation = 0 )
static

Creates a text object with the specified parameters.

This call should only be used for temporary entities. For example, this call may be used to create entities that are used in the spatial tests.

Parameters
featureIDID of the feature code to assign to the entity. This is used when rendering map features if no specific attribute set has been created for the entity.
xX coordinate of text position.
yY coordinate of text position.
valueText string to be displayed.
heightSize of symbol in TMC units.
xalignX alignment of text. This position of the text string is placed at the x coordinate.
yalignY alignment of text. This position of the text string is placed at the y coordinate.
rotationAngle of rotation of text. Expressed in radians, +ve anti-clockwise from the +ve X axis.
Returns
NULL on error.

◆ height() [1/2]

TSLTMC TSLText::height ( ) const

Query the size of the text.

◆ height() [2/2]

void TSLText::height ( TSLTMC newValue)

Set the size of the text.

Parameters
newValueNew size of text, in TMC units.

◆ horizontalAlignment() [1/2]

TSLHorizontalAlignment TSLText::horizontalAlignment ( ) const

Query the horizontal alignment of the text.

◆ horizontalAlignment() [2/2]

void TSLText::horizontalAlignment ( TSLHorizontalAlignment align)

Set the horizontal alignment of the text.

Parameters
alignNew alignment for the text.

◆ isText() [1/2]

const TSLText * TSLText::isText ( const TSLEntity * entity)
static

Query whether the entity is text.

If this entity is text, returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ isText() [2/2]

TSLText * TSLText::isText ( TSLEntity * entity)
static

Query whether the entity is text.

If this entity is text, returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ operator=()

TSLText & TSLText::operator= ( const TSLText & text)
protected

Assignment operator.

Sets the text to be equal to that specified.

Parameters
textSource for new text.
Returns
reference to updated value.

◆ position() [1/2]

const TSLCoord & TSLText::position ( ) const

Query the position of the text.

Returns a reference to the text position.

◆ position() [2/2]

void TSLText::position ( const TSLCoord & newPosition)

Set the position of the text.

Parameters
newPositionNew position for the text.

◆ value() [1/3]

const char * TSLText::value ( ) const

Query the value of the text.

◆ value() [2/3]

void TSLText::value ( const char * newValue)

Set the value of the text string.

Parameters
newValueNew string to be displayed.

◆ value() [3/3]

void TSLText::value ( const wchar_t * newValue)

Set the value of the text string.

Parameters
newValueNew string to be displayed.

◆ verticalAlignment() [1/2]

TSLVerticalAlignment TSLText::verticalAlignment ( ) const

Query the vertical alignment of the text.

◆ verticalAlignment() [2/2]

void TSLText::verticalAlignment ( TSLVerticalAlignment align)

Set the vertical alignment of the text.

Parameters
alignNew alignment for the text.