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

Detailed Description

Extruded 2D polygon specific access methods.

An extruded 2D polygon is a 2D polygon placed at a specified altitude and extruded by a specified distance vertically. The altitude may be absolute or relative. The resultant visualisation is a 3D solid.

This class represents the access methods that are specific to an extruded 2D 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

double altitude (TSL3DAltitudeType *alt=NULL) const
 
void altitude (double altitude, TSL3DAltitudeType type=TSL3DAltitudeTypeMeanSeaLevel)
 
double extrudedHeight () const
 
void extrudedHeight (double newHeight)
 
TSL3DInterpolation interpolation () const
 
void interpolation (TSL3DInterpolation inter)
 
const TSLPolygonpolygon () const
 
TSLPolygonpolygon ()
 
bool polygon (TSLPolygon *newPolygon, bool assumeOwnsership=true)
 
void showBottom (bool show)
 
bool showBottom () const
 
void showSides (bool show)
 
bool showSides () const
 
void showTop (bool show)
 
bool showTop () const
 
- 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 TSLExtruded2DPolygoncreate (TSLFeatureID featureID, TSLPolygon *polygon, bool ownsPolygon=true)
 
static TSLExtruded2DPolygoncreate (TSLFeatureID featureID, TSLPolygon *polygon, TSL3DInterpolation interpolation, bool ownsPolygon=true)
 
static const TSLExtruded2DPolygonisExtruded2DPolygon (const TSL3DEntity *entity)
 
static TSLExtruded2DPolygonisExtruded2DPolygon (TSL3DEntity *entity)
 

Additional Inherited Members

- Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()
 

Member Function Documentation

◆ altitude() [1/2]

void TSLExtruded2DPolygon::altitude ( double altitude,
TSL3DAltitudeType type = TSL3DAltitudeTypeMeanSeaLevel )

Set the altitude of the extruded entity in metres.

Argument description list:

altitude: The altitude at which the vertices of the entity should be set.

type: The type of altitude - defaults to TSL3DAltitudeTypeMeanSeaLevel

◆ altitude() [2/2]

double TSLExtruded2DPolygon::altitude ( TSL3DAltitudeType * alt = NULL) const

Return the altitude of the entity.

Parameters
typethe returned altitude type value

◆ create() [1/2]

static TSLExtruded2DPolygon * TSLExtruded2DPolygon::create ( TSLFeatureID featureID,
TSLPolygon * polygon,
bool ownsPolygon = true )
static

Creates an extruded 2D polygon 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.
polygonBase 2D polygon to use.
ownsPolygonIf true, the extruded 2D polygon will assume ownership of the base 2D polygon. Otherwise a copy of the polygon is made. The default is true.
Returns
NULL on error.

◆ create() [2/2]

static TSLExtruded2DPolygon * TSLExtruded2DPolygon::create ( TSLFeatureID featureID,
TSLPolygon * polygon,
TSL3DInterpolation interpolation,
bool ownsPolygon = true )
static

Creates an extruded 2D polyline 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.

Returns NULL on error.

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.
polygonBase 2D Polygon to use.
interpolationType of interpolation to undertake. Defaults to None.
TSL3DInterpolationNoneno interpolation
TSL3DInterpolationGridCreates 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.
ownsPolygonIf true, the extruded 2D polygon will assume ownership of the base 2D polygon. Otherwise a copy of the polygon is made. The default is true.
Returns
NULL if an error occurred.

◆ extrudedHeight() [1/2]

double TSLExtruded2DPolygon::extrudedHeight ( ) const

Returns the extruded height of the entity, in metres.

◆ extrudedHeight() [2/2]

void TSLExtruded2DPolygon::extrudedHeight ( double newHeight)

Set the extruded height of the base 2D polyline, in metres.

Parameters
newHeightthe new extruded height in metres

◆ interpolation() [1/2]

TSL3DInterpolation TSLExtruded2DPolygon::interpolation ( ) const

Returns the current interpolation option being used to render this primitive.

◆ interpolation() [2/2]

void TSLExtruded2DPolygon::interpolation ( TSL3DInterpolation inter)

Sets the type of interpolation used to render this primitive:

Parameters
interpolationType of interpolation to undertake.
TSL3DInterpolationNoneno interpolation
TSL3DInterpolationCreationinterpolate at creation time. Requires maxNum Points or postDistance to be set.
TSL3DInterpolationDisplayinterpolation at display time. maxNumPoints is taken as a max' number of Points and postDistance is ignored.

◆ isExtruded2DPolygon() [1/2]

static const TSLExtruded2DPolygon * TSLExtruded2DPolygon::isExtruded2DPolygon ( const TSL3DEntity * entity)
static

Query whether the entity is an extruded 2d polygon.

If this entity is an extruded 2d polygon, returns an accessor, otherwise returns NULL.

Parameters
entitythe entity to query.

◆ isExtruded2DPolygon() [2/2]

static TSLExtruded2DPolygon * TSLExtruded2DPolygon::isExtruded2DPolygon ( TSL3DEntity * entity)
static

Query whether the entity is an extruded 2d polygon.

If this entity is an extruded 2d polygon, returns an accessor, otherwise returns NULL.

Parameters
entitythe entity to query.

◆ polygon() [1/3]

TSLPolygon * TSLExtruded2DPolygon::polygon ( )

Query method for the base 2D polygon being extruded

The returned polygon geometry may be modified. If so, then the 'update' method should be called so that the extruded 2D polygon can update its internal information.

Returns pointer to base 2D polygon

◆ polygon() [2/3]

const TSLPolygon * TSLExtruded2DPolygon::polygon ( ) const

Query method for read-only access to the base 2D polygon being extruded

Returns read-only pointer to base 2D polygon

◆ polygon() [3/3]

bool TSLExtruded2DPolygon::polygon ( TSLPolygon * newPolygon,
bool assumeOwnsership = true )

Sets polygon to be extruded.

Parameters
newPolygonPolygon to be used.
assumeOwnershipIf true, the extruded 2D polygon will assume ownership of newPolygon. The default is true.
Returns
true on success, false otherwise.

◆ showBottom() [1/2]

bool TSLExtruded2DPolygon::showBottom ( ) const

Returns whether the bottom of the extruded polygon will be drawn. By default the bottom is drawn.

◆ showBottom() [2/2]

void TSLExtruded2DPolygon::showBottom ( bool show)

Sets whether the bottom of the extruded polygon will be drawn. By default the bottom is drawn.

Parameters
showWhether to show the bottom of the extruded polygon.

◆ showSides() [1/2]

bool TSLExtruded2DPolygon::showSides ( ) const

Returns whether the sides of the extruded polygon will be drawn. By default the sides are drawn.

◆ showSides() [2/2]

void TSLExtruded2DPolygon::showSides ( bool show)

Sets whether the sides of the extruded polygon will be drawn. By default the sides are drawn.

Parameters
showWhether to show the sides of the extruded polygon.

◆ showTop() [1/2]

bool TSLExtruded2DPolygon::showTop ( ) const

Returns whether the top of the extruded polygon will be drawn. By default the top is drawn.

◆ showTop() [2/2]

void TSLExtruded2DPolygon::showTop ( bool show)

Sets whether the top of the extruded polygon will be drawn. By default the top is drawn.

Parameters
showWhether to show the top of the extruded polygon.