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

Detailed Description

Bordered Polygon specific access methods.

This class represents the access methods that are specific to a bordered 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 TSLBorderedPolygon:

  • TSLRenderingAttributeBorderColour
  • TSLRenderingAttributeBorderWidth
  • TSLRenderingAttributeExteriorEdgeColour
  • TSLRenderingAttributeExteriorEdgeStyle
  • TSLRenderingAttributeExteriorEdgeThickness
  • TSLRenderingAttributeExteriorEdgeThicknessUnits
  • TSLRenderingAttributeFillColour
  • TSLRenderingAttributeFillStyle

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

Public Member Functions

TSLStyleID colour () const
 
bool colour (TSLStyleID newColour)
 
bool flip (const TSLCoord &to, TSLTMC aperture)
 
bool flipAll ()
 
TSLBorderInfoinnerBorderInfo (int position) const
 
bool innerBorderInfo (int position, const TSLBorderInfo &info)
 
TSLBorderInfoouterBorderInfo () const
 
bool outerBorderInfo (const TSLBorderInfo &info)
 
TSLTMC width () const
 
bool width (TSLTMC newWidth)
 
- Public Member Functions inherited from TSLPolygon
bool addInner (TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool addInner (const TSLCoordSet &newPoints)
 
double area () const
 
const TSLCoordSetinner (int index) const
 
bool inner (int index, TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool inner (int index, const TSLCoordSet &newPoints)
 
int numInners () const
 
const TSLCoordSetouter () const
 
bool outer (TSLCoordSet *newPoints, bool keepCoordSet=false)
 
bool outer (const TSLCoordSet &newPoints)
 
bool perimeter (double *outerPerimeter, double *innerPerimeter) const
 
bool removeInner (int index)
 
TSLEntitySetxOr (TSLPolygon const *const *otherPolygons, int numOtherPolygons) const
 
- 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 TSLBorderedPolygoncreate (TSLFeatureID featureID, TSLCoordSet *coords, TSLTMC width, bool keepCoordSet=false)
 
static TSLBorderedPolygoncreate (TSLFeatureID featureID, const TSLCoordSet &coords, TSLTMC width)
 
static const TSLBorderedPolygonisBorderedPolygon (const TSLEntity *entity)
 
static TSLBorderedPolygonisBorderedPolygon (TSLEntity *entity)
 
static TSLBorderedPolygoncreate (TSLFeatureID featureID, TSLCoordSet *coords, TSLTMC width, bool keepCoordSet, bool reserved1, bool reserved2)
 
static TSLBorderedPolygoncreate (TSLFeatureID featureID, const TSLCoordSet &coords, TSLTMC width, bool reserved1, bool reserved2)
 
- Static Public Member Functions inherited from TSLPolygon
static TSLPolygoncreate (TSLFeatureID featureID, TSLCoordSet *coords, bool keepCoordSet=false)
 
static TSLPolygoncreate (TSLFeatureID featureID, const TSLCoordSet &coords)
 
static const TSLPolygonisPolygon (const TSLEntity *entity)
 
static TSLPolygonisPolygon (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)
 

Protected Member Functions

 TSLBorderedPolygon ()
 
 ~TSLBorderedPolygon ()
 
- Protected Member Functions inherited from TSLPolygon
 TSLPolygon ()
 
 ~TSLPolygon ()
 
 TSLPolygon (const TSLPolygon &)
 
TSLPolygonoperator= (const TSLPolygon &)
 
- Protected Member Functions inherited from TSLEntity
 ~TSLEntity ()
 
- Protected Member Functions inherited from TSLEntityBase
 ~TSLEntityBase ()
 

Constructor & Destructor Documentation

◆ TSLBorderedPolygon()

TSLBorderedPolygon::TSLBorderedPolygon ( )
protected

Protected constructor and destructor to prevent user creation

◆ ~TSLBorderedPolygon()

TSLBorderedPolygon::~TSLBorderedPolygon ( )
protected

Member Function Documentation

◆ colour() [1/2]

TSLStyleID TSLBorderedPolygon::colour ( ) const

This method returns the current border colour as an index into the colours file.

A value of 0 indicates that the border segments will be drawn in the polygons edge colour and that they will be drawn instead of the edge. A positive value indicates that the fill, border segments and edge will be drawn - in that order.

◆ colour() [2/2]

bool TSLBorderedPolygon::colour ( TSLStyleID newColour)

This method changes the current border colour.

A value of 0 indicates that the border segments will be drawn in the polygons edge colour and that they will be drawn instead of the edge. A positive value indicates that the fill, border segments and edge will be drawn - in that order.

Arguments list details :

newColour (Long) : The new border colour.

It returns True if the operation is successful, False otherwise.

◆ create() [1/4]

static TSLBorderedPolygon * TSLBorderedPolygon::create ( TSLFeatureID featureID,
const TSLCoordSet & coords,
TSLTMC width )
static

Creates a bordered polygon with the specified parameters.

A bordered polygon is a closed, filled feature. The outline of the polygon may optionally have extra thick edges of a specified width, Each edge may be individually be flipped inside or outside of the polygon. 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 polygon.
widthThickness of edges in TMC units. 0 width is rendered as a normal polygon. All edges are initially inside the polygon.
Returns
NULL on error.

◆ create() [2/4]

static TSLBorderedPolygon * TSLBorderedPolygon::create ( TSLFeatureID featureID,
const TSLCoordSet & coords,
TSLTMC width,
bool reserved1,
bool reserved2 )
static

◆ create() [3/4]

static TSLBorderedPolygon * TSLBorderedPolygon::create ( TSLFeatureID featureID,
TSLCoordSet * coords,
TSLTMC width,
bool keepCoordSet,
bool reserved1,
bool reserved2 )
static

◆ create() [4/4]

static TSLBorderedPolygon * TSLBorderedPolygon::create ( TSLFeatureID featureID,
TSLCoordSet * coords,
TSLTMC width,
bool keepCoordSet = false )
static

Creates a bordered polygon with the specified parameters.

A bordered polygon is a closed, filled feature. The outline of the polygon may optionally have extra thick edges of a specified width, Each edge may be individually be flipped inside or outside of the polygon. 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 polygon.
widthThickness of edges in TMC units. 0 width is rendered as a normal polygon. All edges are initially inside 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.

◆ flip()

bool TSLBorderedPolygon::flip ( const TSLCoord & to,
TSLTMC aperture )

This method flips the border segment nearest to the specified coordinate.

Arguments list details :

to : The specified co-ordinate.

aperture : Specifies the distance to search for the nearest border, in TMC units.

It returns true if the operation is successful, false otherwise.

◆ flipAll()

bool TSLBorderedPolygon::flipAll ( )

This method flips all existing border segments.

Returns true on success, otherwise false.

◆ innerBorderInfo() [1/2]

TSLBorderInfo * TSLBorderedPolygon::innerBorderInfo ( int position) const

Queries the border orientation data associated with the position'th inner.

Modifying the bordered polygon's outer or inners invalidates all associated TSLBorderInfo objects.

Parameters
positionWhich inner. Uses same indices as inner().
Returns
a copy of the border orientation data associated with the position'th inner, or NULL if no borders are present or if the position is out of range. The returned object needs to be destroyed by the user, and should not be passed to outerBorderInfo(), or be used to modify a different inner.

◆ innerBorderInfo() [2/2]

bool TSLBorderedPolygon::innerBorderInfo ( int position,
const TSLBorderInfo & info )

Set the border orientation data associated with the position'th inner.

Parameters
positionWhich inner. Uses same indices as inner().
infoNew border orientation data.
Returns
true success, false on error.

◆ isBorderedPolygon() [1/2]

static const TSLBorderedPolygon * TSLBorderedPolygon::isBorderedPolygon ( const TSLEntity * entity)
static

Query whether the entity is a bordered polygon.

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

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ isBorderedPolygon() [2/2]

static TSLBorderedPolygon * TSLBorderedPolygon::isBorderedPolygon ( TSLEntity * entity)
static

Query whether the entity is a bordered polygon.

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

When querying Optimised maps this query may return NULL.

Parameters
entitythe entity to query

◆ outerBorderInfo() [1/2]

TSLBorderInfo * TSLBorderedPolygon::outerBorderInfo ( ) const

Queries the border orientation data associated with the outer.

Modifying the bordered polygon's outer or inners invalidates all associated TSLBorderInfo objects.

Returns
a copy of the border orientation data associated with the outer, or NULL if no borders are present. The returned object needs to be destroyed by the user, and should not be passed to innerBorderInfo().

◆ outerBorderInfo() [2/2]

bool TSLBorderedPolygon::outerBorderInfo ( const TSLBorderInfo & info)

Set the border orientation data associated with the outer.

Parameters
infoNew border orientation data.
Returns
true success, false on error.

◆ width() [1/2]

TSLTMC TSLBorderedPolygon::width ( ) const

This method returns the current border width in TMC units.

◆ width() [2/2]

bool TSLBorderedPolygon::width ( TSLTMC newWidth)

This method changes the current border width.

If the polygon does not have a current width, then border segments are generated, defaulting to inside the polygon. If segments already exist, then their width is changed.

Arguments list details :

newWidth (Long) : The new border width in TMC units.

It returns True if the operation is successful, False otherwise.