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

Detailed Description

Geodetic Polygon specific access methods.

This class represents the access methods that are specific to a geodetic polygon. They also allow setting of rendering attributes.

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 TSLGeodeticPolygon:

  • TSLRenderingAttributeExteriorEdgeColour
  • TSLRenderingAttributeExteriorEdgeStyle
  • TSLRenderingAttributeExteriorEdgeThickness
  • TSLRenderingAttributeExteriorEdgeThicknessUnits
  • TSLRenderingAttributeFillColour
  • TSLRenderingAttributeFillStyle

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

Known Limitations:

  • If points or lines pass through or near the poles, the entity may be drawn incorrectly or even disappear.
  • If a map has curved edges (e.g. it uses the Eckert IV projection), interpolated entities split over the edges may not draw correctly.
  • We have only tested interpolated entities whose consecutive points are within 60 degrees of latitude/longitude of each other. 180 degrees is the absolute maximum separation for consecutive points.
  • If the coordinate system changes (e.g. a new map is loaded), geodetic entities will move themselves on the next draw to preserve lat/lon positions. However, if any TMC data of a geodetic entity are altered before a redraw but after a coord system change, the lat/lon data will be lost. The TMC data can be altered by move(), scale(), rotate() and translate(), and by any control point manipulation or insertion/removal of inners.
  • Several parts of the system will treat interpolated entities as though they were not interpolated (e.g. checking whether a point is inside the entity or not).
  • Interpolated entities do not fully "exist" until they are drawn, which means that their extents are not known until they are drawn. This can cause issues e.g. if a drawing surface has an undrawn geodetic entity, then its reset() method will zoom out a long way. This can also cause visual artefacts when manipulating interpolated entities; the entire drawing surface should always be redrawn when using them.
  • Geodetic entities can modify themselves when they are drawn (e.g. moving themselves, updating their envelopes, etc).
  • Layers containing Geodetic entities should not be shared between Drawing Surfaces.
  • The default interpolation post distance is 50km, which can be changed by calling interpolationDistance().
  • An interpolated geodetic polygon may declare itself invalid if the non-interpolated one would have due to it self-intersecting.
  • The inners of a geodetic polygon are not interpolated with respect to the outer.
  • If a geodetic polygon is split over the dateline, inners may disappear.

Public Member Functions

bool addInner (TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool addInner (const TSLCoordSet &newPoints)
 
const TSLCoordSetinner (int index) const
 
bool inner (int index, TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool inner (int index, const TSLCoordSet &newPoints)
 
bool interpolation () const
 
void interpolation (bool newValue)
 
void interpolationDistance (double newValue)
 
double interpolationDistance () const
 
TSLGeodeticInterpolationOptionsEnum interpolationOptions () const
 
void interpolationOptions (TSLGeodeticInterpolationOptionsEnum newValue)
 
int numInners () const
 
const TSLCoordSetouter () const
 
bool outer (TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool outer (const TSLCoordSet &newPoints)
 
bool removeInner (int index)
 
- 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 TSLGeodeticPolygoncreate (TSLFeatureID featureID, TSLCoordSet *coords, bool keepCoordSet=false)
 
static TSLGeodeticPolygoncreate (TSLFeatureID featureID, const TSLCoordSet &coords)
 
static const TSLGeodeticPolygonisGeodeticPolygon (const TSLEntity *entity)
 
static TSLGeodeticPolygonisGeodeticPolygon (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)
 

Additional Inherited Members

- Protected Member Functions inherited from TSLEntity
 ~TSLEntity ()
 
- Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()
 

Member Function Documentation

◆ addInner() [1/2]

bool TSLGeodeticPolygon::addInner ( const TSLCoordSet & newPoints)

Adds an inner boundary to the geodetic polygon.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
newPointsPoints for new inner boundary.
Returns
If the geodetic polygon would be made invalid, then false. Otherwise returns true.

◆ addInner() [2/2]

bool TSLGeodeticPolygon::addInner ( TSLCoordSet * newPoints,
bool keepCoordSet = false )

Adds an inner boundary to the geodetic polygon.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
newPointsPoints for new inner boundary.
keepCoordSetFlag to indicate whether the geodetic polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the geodetic polygon assumes control of the coordinate set and invalidates it. The user should not attempt to make further use of the coordinate set.
Returns
If the geodetic polygon would be made invalid, then false. Otherwise returns true.

◆ create() [1/2]

static TSLGeodeticPolygon * TSLGeodeticPolygon::create ( TSLFeatureID featureID,
const TSLCoordSet & coords )
static

Creates a geodetic polygon with the specified parameters.

A geodetic polygon is a closed, filled feature. It must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

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.
coordsCoordinate set describing the geodetic polygon.
Returns
NULL on error.

◆ create() [2/2]

static TSLGeodeticPolygon * TSLGeodeticPolygon::create ( TSLFeatureID featureID,
TSLCoordSet * coords,
bool keepCoordSet = false )
static

Creates a geodetic polygon with the specified parameters.

A geodetic polygon is a closed, filled feature. It must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

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.
coordsCoordinate set describing the geodetic polygon.
keepCoordSetFlag to indicate whether the geodetic polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the geodetic polygon assumes control of the coordinate set and invalidates it. The user should not attempt to make further use of the coordinate set.
Returns
NULL on error.

◆ inner() [1/3]

const TSLCoordSet * TSLGeodeticPolygon::inner ( int index) const

Query the coordinates of the inner boundary at the specified index.

Parameters
indexIndex of inner boundary to query.
Returns
NULL if no such inner exists.

◆ inner() [2/3]

bool TSLGeodeticPolygon::inner ( int index,
const TSLCoordSet & newPoints )

Sets the coordinates of the inner boundary at the specified index.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
indexIndex of inner boundary to change.
newPointsNew points for inner boundary.
Returns
If the geodetic polygon would be made invalid, then false. Also returns false if there is no such inner. Otherwise returns true.

◆ inner() [3/3]

bool TSLGeodeticPolygon::inner ( int index,
TSLCoordSet * newPoints,
bool keepCoordSet = false )

Sets the coordinates of the inner boundary at the specified index.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
indexIndex of inner boundary to change.
newPointsNew points for inner boundary.
keepCoordSetFlag to indicate whether the geodetic polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the geodetic polygon assumes control of the coordinate set and invalidates it. The user should not attempt to make further use of the coordinate set.
Returns
If the geodetic polygon would be made invalid, then false. Also returns false if there is no such inner. Otherwise returns true.

◆ interpolation() [1/2]

bool TSLGeodeticPolygon::interpolation ( ) const

Returns whether the geodetic entity interpolates between control points at all.

◆ interpolation() [2/2]

void TSLGeodeticPolygon::interpolation ( bool newValue)

Sets whether the geodetic entity interpolates between control points at all.

If true, the lines drawn between each pair of control points will be curved to follow the shortest geodesic path between them. If false, the lines will be drawn straight.

Parameters
newValueNew value for interpolation flag.

◆ interpolationDistance() [1/2]

double TSLGeodeticPolygon::interpolationDistance ( ) const

Returns the post distance used for interpolation, in km.

◆ interpolationDistance() [2/2]

void TSLGeodeticPolygon::interpolationDistance ( double newValue)

Sets the post distance for interpolation, in km. Will be used only if interpolation is on.

Parameters
newValueNew value for the post distance, in km.

◆ interpolationOptions() [1/2]

TSLGeodeticInterpolationOptionsEnum TSLGeodeticPolygon::interpolationOptions ( ) const

Returns the flags which control interpolation between control points of this geodetic entity.

◆ interpolationOptions() [2/2]

void TSLGeodeticPolygon::interpolationOptions ( TSLGeodeticInterpolationOptionsEnum newValue)

Sets the flags which control interpolation between control points of this geodetic entity.

Parameters
newValueNew value for the flags.

◆ isGeodeticPolygon() [1/2]

static const TSLGeodeticPolygon * TSLGeodeticPolygon::isGeodeticPolygon ( const TSLEntity * entity)
static

Query whether the entity is a geodetic polygon.

If this entity is a geodetic polygon, returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ isGeodeticPolygon() [2/2]

static TSLGeodeticPolygon * TSLGeodeticPolygon::isGeodeticPolygon ( TSLEntity * entity)
static

Query whether the entity is a geodetic polygon.

If this entity is a geodetic polygon, returns an accessor, otherwise returns NULL.

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ numInners()

int TSLGeodeticPolygon::numInners ( ) const

Query the number of inner boundaries of the geodetic polygon.

◆ outer() [1/3]

const TSLCoordSet & TSLGeodeticPolygon::outer ( ) const

Query the coordinates of the outer boundary of the geodetic polygon.

◆ outer() [2/3]

bool TSLGeodeticPolygon::outer ( const TSLCoordSet & newPoints)

Sets the coordinates of the outer boundary of the geodetic polygon.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
newPointsNew points for the outer boundary.
Returns
If the geodetic polygon would be made invalid, then false. Otherwise returns true.

◆ outer() [3/3]

bool TSLGeodeticPolygon::outer ( TSLCoordSet * newPoints,
bool keepCoordSet = false )

Sets the coordinates of the outer boundary of the geodetic polygon.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
newPointsNew points for the outer boundary.
keepCoordSetFlag to indicate whether the geodetic polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the geodetic polygon assumes control of the coordinate set and invalidates it. The user should not attempt to make further use of the coordinate set.
Returns
If the geodetic polygon would be made invalid, then false. Otherwise returns true.

◆ removeInner()

bool TSLGeodeticPolygon::removeInner ( int index)

Removes the inner boundary from the geodetic polygon.

A geodetic polygon must be non-complex, ie. edges must not cross, although they may touch. In addition, any holes may not touch or cross the outer, nor touch or cross any other hole.

Parameters
indexIndex of inner boundary to remove.
Returns
If the geodetic polygon would be made invalid, then false. Also returns false if there is no such inner. Otherwise returns true.