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

Detailed Description

3D polygon specific access methods.

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

Interpolated polygon drawing has a number of design limitations:

  • The alignment with the underlying grid is not perfect as the two grids are constructed in different coordinate systems. However it appears to work very well for convex shapes. The World grid is based on latitude/longitude. The grid is essentially an x/y grid placed upon the polygon projected using a 'Stereographic' projection with the centre being the centre of the object, the increment in this case is based on the x distance at the centre.
  • As the shapes get bigger the alignment towards the edges is further away from the ideal.
  • The maximum size of a polygon is approximately 40 degrees across. The limit is imposed by the use of the Stereographic projection.
  • If you want very high resolution terrain or imagery the sub-divisions required for the polygon become very small and have a very high impact on the performance when the polygons are on the surface of the Earth. The maximum terrain Level Of Detail supported by the draped polygon/line is 8.
  • Draped polygons/lines which are very close to the Earth's surface may still intersect with the surface.
  • Viewing a draped polygon/line looking straight down close to the Earth the polygon/line may still intersect with the surface. This is partly an issue with the Z-buffer accuracy and a trade off with performance.
  • Complex/holed polygons are tessellated using the OpenGL tessellator. This causes more OpenGL primitives to be generated then would be expected and reduces the effectiveness of the draping algorithm.
  • Avoid creating draped polygons/lines which straddling the +-80 degree latitude boundary as the depth of subdivision is constrained towards the poles to limit the number of tiles to a reasonable amount.
  • The Extruded Polygons initial face is the face that is draped. The extruded face is translated to the extruded height. If the bottom is not required draw the polygon at the required altitude and extrude downwards turning off the top.
  • If a polygon has a hole then the holes are created using the OpenGL contour rules. This makes the polygons overly complex and sometimes the polygon has smaller triangle holes or the one edge is drawn straight.
  • TSL3DPolygons whose points are specified with different altitude types may not be drawn as expected. The additional points added across the polygon to enable the draping will take the altitude type from the start point so this means that the result is undefined as the start point is not defined. The altitude type should all be the same for all points specified for a polygon.
  • TSL3DPolygons whose points are specified with different heights may not be drawn as expected the effect should be very similar to MapLink 5.4, however the technique used in 5.4 and previous versions resulted in very poor drawing performance and in a number of cases poor visualisation. The new technique used for draping is done assuming that a polygon is contained in a single plane and produces significantly less drawing primitives.
  • A lot of memory is required for complex of holed draped polygons.

If a polygon is not draped correctly or appears to have holes when it should not have please send the TMF file to Envitia support (suppo.nosp@m.rt@e.nosp@m.nviti.nosp@m.a.co.nosp@m.m).

Deprecated
Deprecated as of MapLink 11.1. Advised to use MapLink Earth SDK instead.

Public Member Functions

bool addInner (TSL3DCoordSet *newPoints, bool keepCoordSet=false)
 
bool addInner (const TSL3DCoordSet &newPoints)
 
double area () const
 
const TSL3DCoordSetinner (int index) const
 
bool inner (int index, TSL3DCoordSet *newPoints, bool keepCoordSet=false)
 
bool inner (int index, const TSL3DCoordSet &newPoints)
 
TSL3DInterpolation interpolation () const
 
void interpolation (const TSL3DInterpolation val)
 
int numInners () const
 
const TSL3DCoordSetouter () const
 
bool outer (TSL3DCoordSet *newPoints, bool keepCoordSet=false)
 
bool outer (const TSL3DCoordSet &newPoints)
 
bool perimeter (double *outerPerimeter, double *innerPerimeter) const
 
bool removeInner (int index)
 
- Public Member Functions inherited from TSL3DEntity
TSL3DBoundingBox boundingBox (int surfaceID=-1) const
 
void boundingBox (TSL3DCoord &bottomLeft, TSL3DCoord &topRight, int surfaceID=-1) const
 
TSL3DCoord centroid () const
 
TSL3DEntityclone () const
 
double distance (const TSL3DCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
 
bool equals (const TSL3DEntity *other) const
 
void move (const TSL3DCoord &location, const TSL3DCoord &reference)
 
TSL3DEntitySetparent ()
 
const TSL3DEntitySetparent () const
 
void scale (double scaleParam, const TSL3DCoord *origin=0)
 
void scale (double scaleX, double scaleY, double scaleZ, const TSL3DCoord *origin=0)
 
double squareDistance (const TSL3DCoord &point, bool useRenderedExtent=true, int drawingSurfaceID=-1) const
 
void translate (double latitudeOffset, double longitudeOffset, double altitudeOffset)
 
- 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 TSL3DPolygoncreate (TSLFeatureID featureID, TSL3DCoordSet *coords, bool keepCoordSet=false)
 
static TSL3DPolygoncreate (TSLFeatureID featureID, const TSL3DCoordSet &coords)
 
static TSL3DPolygoncreate (TSLFeatureID featureID, const TSL3DCoordSet &coordSet, TSL3DInterpolation interpolation)
 
static const TSL3DPolygonis3DPolygon (const TSL3DEntity *entity)
 
static TSL3DPolygonis3DPolygon (TSL3DEntity *entity)
 

Additional Inherited Members

- Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()
 

Member Function Documentation

◆ addInner() [1/2]

bool TSL3DPolygon::addInner ( const TSL3DCoordSet & newPoints)

Adds an inner boundary to the 3D polygon.

A 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

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

◆ addInner() [2/2]

bool TSL3DPolygon::addInner ( TSL3DCoordSet * newPoints,
bool keepCoordSet = false )

Adds an inner boundary to the 3D polygon.

A 3D 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

Parameters
newPointsPoints for new inner boundary.
keepCoordSetFlag to indicate whether the polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the 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 polygon would be made invalid, then false. Otherwise returns true.

◆ area()

double TSL3DPolygon::area ( ) const

Query the area of the 3D polygon.

Calculates and returns the area of the 3D polygon, in TMC units. The area will be the area of the outer, minus the combined area of the inners.

Note that this method can only be called on planar polygons and that values returned from non planar polygons will not be correct.

◆ create() [1/3]

static TSL3DPolygon * TSL3DPolygon::create ( TSLFeatureID featureID,
const TSL3DCoordSet & coords )
static

Creates a 3D polygon with the specified parameters.

A 3D polygon is a closed, filled, planar 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

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 polygon.
Returns
NULL on error.

◆ create() [2/3]

static TSL3DPolygon * TSL3DPolygon::create ( TSLFeatureID featureID,
const TSL3DCoordSet & coordSet,
TSL3DInterpolation interpolation )
static

Creates a 3D interpolated Polygon with the specified parameters.

A 3D polygon is a closed, filled, planar 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

The resultant polygon may be interpolated across the surface of the Earth.

Argument description list:

featureID: ID 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.

coords: Coordinate set describing the polygon.

interpolation : Type of interpolation to undertake. Defaults to None. TSL3DInterpolationNone : no interpolation TSL3DInterpolationGrid: Creates points where the polygon intersects with a Grid. The number of subdivisions in a grid is based on the height of the polygon from the Earth's surface.

Returns NULL on error.

◆ create() [3/3]

static TSL3DPolygon * TSL3DPolygon::create ( TSLFeatureID featureID,
TSL3DCoordSet * coords,
bool keepCoordSet = false )
static

Creates a 3D polygon with the specified parameters.

A 3D polygon is a closed, filled, planar 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

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 polygon.
keepCoordSetFlag to indicate whether the polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the 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 TSL3DCoordSet * TSL3DPolygon::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 TSL3DPolygon::inner ( int index,
const TSL3DCoordSet & newPoints )

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

A 3D 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

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

◆ inner() [3/3]

bool TSL3DPolygon::inner ( int index,
TSL3DCoordSet * newPoints,
bool keepCoordSet = false )

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

A 3D 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

Parameters
indexIndex of inner boundary to change.
newPointsNew points for inner boundary.
keepCoordSetFlag to indicate whether the polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the 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 polygon would be made invalid, then false. Also returns false if there is no such inner. Otherwise returns true.

◆ interpolation() [1/2]

TSL3DInterpolation TSL3DPolygon::interpolation ( ) const

Returns the current TSL3DInterpolation setting.

◆ interpolation() [2/2]

void TSL3DPolygon::interpolation ( const TSL3DInterpolation val)

Sets the type of interpolation to use for this entity.

If the setting does not change then returns immediately with out doing anything.

Invalidates any interpolated points.

Clears the postDistance and numberOfPoints settings.

◆ is3DPolygon() [1/2]

static const TSL3DPolygon * TSL3DPolygon::is3DPolygon ( const TSL3DEntity * entity)
static

Query whether the entity is a 3d polygon.

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

Parameters
entitythe entity to query.

◆ is3DPolygon() [2/2]

static TSL3DPolygon * TSL3DPolygon::is3DPolygon ( TSL3DEntity * entity)
static

Query whether the entity is a 3d polygon.

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

Parameters
entitythe entity to query.

◆ numInners()

int TSL3DPolygon::numInners ( ) const

Query the number of inner boundaries of the 3D polygon.

◆ outer() [1/3]

const TSL3DCoordSet & TSL3DPolygon::outer ( ) const

Query the coordinates of the outer boundary of the 3D polygon.

◆ outer() [2/3]

bool TSL3DPolygon::outer ( const TSL3DCoordSet & newPoints)

Sets the coordinates of the outer boundary of the 3D polygon.

A 3D 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

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

◆ outer() [3/3]

bool TSL3DPolygon::outer ( TSL3DCoordSet * newPoints,
bool keepCoordSet = false )

Sets the coordinates of the outer boundary of the 3D polygon.

A 3D 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.

All points for inners and outer of a 3D polygon must lie in the same plane.

Parameters
newPointsNew points for the outer boundary.
keepCoordSetFlag to indicate whether the polygon should keep the specified coordinate set, or clone it. Note that if this flag is set, the 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 polygon would be made invalid, then false. Otherwise returns true.

◆ perimeter()

bool TSL3DPolygon::perimeter ( double * outerPerimeter,
double * innerPerimeter ) const

Query the perimeter of the 3D polygon.

Calculates and returns the perimeter of the 3D polygon, in TMC units. Both inner and outer perimeters may be returned by reference. If only the outer perimeter is required, then the inner perimeter parameter may be NULL.

Returns true if successful, false otherwise.

◆ removeInner()

bool TSL3DPolygon::removeInner ( int index)

Removes the inner boundary from the 3D polygon.

A 3D 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 polygon would be made invalid, then false. Also returns false if there is no such inner. Otherwise returns true.