TSLEntity is an interface to a generic 2D entity.
TSLEntity and its derived classes are not instantiable classes. They may only be created by other calls to the API.
|
TSLCoord | centroid () const |
|
TSLEntity * | clone () const |
|
bool | contains (const TSLEntity *other) const |
|
bool | crosses (const TSLEntity *other) const |
|
void | alwaysMergeDifferences (bool _alwaysMergeDifferences) |
|
TSLEntity * | difference (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 |
|
TSLEntity * | intersection (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 |
|
TSLEntitySet * | parent () |
|
const TSLEntitySet * | parent () 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) |
|
TSLEntity * | unionWith (const TSLEntity *other) const |
|
bool | within (const TSLEntity *other) const |
|
TSLCoord | adjustedWeightedCentroid () |
| reserved for future use
|
|
TSLCoord | centreOfGravity () |
| reserved for future use
|
|
bool | addDataSet () |
|
bool | addDataSet (TSLDataHandler *toUseDataHandler) |
|
bool | clearRenderingAttributes () |
|
TSLDataSet * | dataSet () |
|
const TSLDataSet * | dataSet () 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 |
|
TSL3DEntity * | is3DEntity () |
|
const TSL3DEntity * | is3DEntity () const |
|
TSLEntity * | isEntity () |
|
const TSLEntity * | isEntity () 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 TSLEntity * TSLEntity::createFromWKB |
( |
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 |
Convert from well known binary to MapLink geometry.
The following WKB types will be converted:
The coordinate system of the data will not be modified, but the coordinates of each geometry will be scaled according to the TMCPerMU value.
Any invalid geometry will be ignored, and will not be present in the output entity.
- Parameters
-
wkb | A pointer to the well known binary data |
wkbLength | The length, in bytes, of the data |
TMCPerMU | The TMC per Map Unit conversion value to use when converting the geometry. |
mapOffsetX | The x coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system. |
mapOffsetY | The y coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system. |
multiAsEntitySet | If true, all multi geometry types will be converted to entity sets. If false the TSLMultiXXX types will be used. |
maxCurveAngle | The largest step in degrees along an arc when drawing curved geometry (From MapLink Pro 8.2 onwards) |
static TSLEntity * TSLEntity::createFromWKT |
( |
const char * | wkt, |
|
|
double | TMCPerMU, |
|
|
double | mapOffsetX = 0.0, |
|
|
double | mapOffsetY = 0.0, |
|
|
bool | multiAsEntitySet = false, |
|
|
double | maxCurveAngle = 0.0 ) |
|
static |
Convert from well known text to MapLink geometry.
The following WKT types will be converted:
The coordinate system of the data will not be modified, but the coordinates of each geometry will be scaled according to the TMCPerMU value.
Any invalid geometry will be ignored, and will not be present in the output entity.
- Parameters
-
wkt | The well known text string to convert |
TMCPerMU | The TMC per Map Unit conversion value to use when converting the geometry. |
mapOffsetX | The x coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system. |
mapOffsetY | The y coordinate of the MapLink TMC coordinate space for the projected coordinate system, in map units. This can be queried from the TSLCoordinateSystem::getMapOffsets method when creating geometry compatible with a MapLink coordinate system. |
multiAsEntitySet | If true, all multi geometry types will be converted to entity sets. If false the TSLMultiXXX types will be used. |
maxCurveAngle | The largest step in degrees along an arc when drawing curved geometry (From MapLink Pro 8.2 onwards) |
bool TSLEntity::rotate |
( |
double | angle, |
|
|
const TSLCoord * | origin = NULL ) |
Rotates the entity.
Rotates the TSLEntity anti-clockwise by angle, about specified origin. Uses centroid as the reference of the rotation if origin is NULL.
Angle is given in radians.
For entities that have an internal rotation, such as text or symbols, this adds to the rotation angle, and possibly changes the position of the entity.
For entities that contain a CoordSet, the coordinates are changed.
- Parameters
-
angle | Angle to rotate by, in radians, anti-clockwise +ve. |
origin | Point to rotate about. NULL origin uses centroid. |
- Returns
- true if the rotate occurred, false if the rotate could not be applied. If the rotate can not be applied then the entity is not changed. The only reason for the rotate not being applied is if an attempt is made to rotate the entity fully or partially outside TMC space.
- Note
- TSLEntitySet rotate is done on each entity and as such is applied to all entities in turn. If one entity can not be rotated then the rotation is removed on the ones that succeeded. False will be returned in this situation.