MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLMUGeometry Class Referenceabstract
Inheritance diagram for TSLMUGeometry:

Detailed Description

The base class for map unit based geometry.

These geometry classes are designed to store vector data in a particular coordinate system. The units of this data may be degrees, metres, or any other unit considered a 'Map-Unit'.

Public Types

enum  GeometryType {
  GeometryTypeNone , GeometryTypeSet , GeometryTypePoint , GeometryTypePolyline ,
  GeometryTypePolygon
}
 This enum represents the type of a given TSLMUGeometry instance. More...
 

Public Member Functions

void destroy ()
 Destructor.
 
TSLMUGeometry::GeometryType type () const
 
virtual TSLMUGeometryclone ()=0
 
TSLFeatureID featureID () const
 
void featureID (TSLFeatureID id)
 
const char * featureName () const
 
void featureName (const char *name)
 
unsigned int numAttributes () const
 
bool getAttribute (unsigned int index, TSLSimpleString *attributeName, TSLSimpleString *attributeValue)
 
const char * getAttribute (const char *attributeName) const
 
void setAttribute (const char *attributeName, const char *attributeValue)
 
void clearAttribute (const char *attributeName)
 
void clearAttributes ()
 Clear all attributes.
 
void rotation (double rot)
 
double rotation () const
 
virtual bool calculateExtent (TSLMUExtent &extent) const =0
 

Protected Member Functions

 TSLMUGeometry (TSLMUGeometry::GeometryType type, TSLFeatureID featureID=TSLFeatureID_Default, const char *featureName=NULL)
 
 TSLMUGeometry (const TSLMUGeometry &other)
 
virtual ~TSLMUGeometry ()
 

Member Enumeration Documentation

◆ GeometryType

This enum represents the type of a given TSLMUGeometry instance.

Enumerator
GeometryTypeNone 

Undefined/no type.

GeometryTypeSet 

A set of geometry.

GeometryTypePoint 

A point. Represents either a MapLink symbol or a textual entity.

GeometryTypePolyline 

A polyline.

GeometryTypePolygon 

A polygon.

Constructor & Destructor Documentation

◆ TSLMUGeometry() [1/2]

TSLMUGeometry::TSLMUGeometry ( TSLMUGeometry::GeometryType type,
TSLFeatureID featureID = TSLFeatureID_Default,
const char * featureName = NULL )
protected

◆ TSLMUGeometry() [2/2]

TSLMUGeometry::TSLMUGeometry ( const TSLMUGeometry & other)
protected

◆ ~TSLMUGeometry()

virtual TSLMUGeometry::~TSLMUGeometry ( )
protectedvirtual

Member Function Documentation

◆ calculateExtent()

virtual bool TSLMUGeometry::calculateExtent ( TSLMUExtent & extent) const
pure virtual

Calculate the extent of this geometry

Parameters
extentWill be set to this geometries extent.
Returns
true if the extent was calculated, false otherwise.

Implemented in TSLMUGeometrySet, TSLMUPoint, TSLMUPolygon, and TSLMUPolyline.

◆ clearAttribute()

void TSLMUGeometry::clearAttribute ( const char * attributeName)

Clear an attribute

Parameters
attributeNameName of the attribute to clear.

◆ clearAttributes()

void TSLMUGeometry::clearAttributes ( )

Clear all attributes.

◆ clone()

virtual TSLMUGeometry * TSLMUGeometry::clone ( )
pure virtual

Create a clone of this geometry

Returns
A clone of this geometry. This object is owned by the caller.

Implemented in TSLMUGeometrySet, TSLMUPoint, TSLMUPolygon, and TSLMUPolyline.

◆ destroy()

void TSLMUGeometry::destroy ( )

Destructor.

◆ featureID() [1/2]

TSLFeatureID TSLMUGeometry::featureID ( ) const

Query the feature ID

Returns
The feature ID.

◆ featureID() [2/2]

void TSLMUGeometry::featureID ( TSLFeatureID id)

Set the feature ID

Parameters
idThe feature ID.

◆ featureName() [1/2]

const char * TSLMUGeometry::featureName ( ) const

Query the feature Name

Returns
The feature name or NULL if not set.

◆ featureName() [2/2]

void TSLMUGeometry::featureName ( const char * name)

Set the feature name

Parameters
nameThe feature name or NULL to clear.

◆ getAttribute() [1/2]

const char * TSLMUGeometry::getAttribute ( const char * attributeName) const

Query the value of an attribute

Parameters
attributeNameName of the attribute to query
Returns
The value of the attribute or NULL if the attribute isn't set.

◆ getAttribute() [2/2]

bool TSLMUGeometry::getAttribute ( unsigned int index,
TSLSimpleString * attributeName,
TSLSimpleString * attributeValue )

Query an attribute by index

Parameters
indexThe index of the attribute to query
attributeNameWill be set to the name of the attribute
attributeValueWill be set to the value of the attribute
Returns
true if the attributeName and attributeValue were set, false otherwise

◆ numAttributes()

unsigned int TSLMUGeometry::numAttributes ( ) const

Query the number of attributes

Returns
The number of attributes assigned to this geometry

◆ rotation() [1/2]

double TSLMUGeometry::rotation ( ) const

Query the rotation of this geometry

Rotation is specific in radians. A positive rotation is anticlockwise

Returns
The rotation of this geometry

◆ rotation() [2/2]

void TSLMUGeometry::rotation ( double rot)

Set the rotation of this geometry

Rotation is specified in radians. A positive rotation is anticlockwise.

Parameters
rotThe rotation to set, in radians, positive anticlockwise

◆ setAttribute()

void TSLMUGeometry::setAttribute ( const char * attributeName,
const char * attributeValue )

Set the value of an attribute

If this attribute exists it will be overwritten.

Parameters
attributeNameName of the attribute to set
attributeValueValue of the attribute

◆ type()

TSLMUGeometry::GeometryType TSLMUGeometry::type ( ) const

Query the geometry type

Returns
The geometry type of this object