MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLGeometryUtility Class Reference

Detailed Description

Utility class providing some useful geometrical functions.

Static Public Member Functions

static bool isCoordOnSegment (const TSLCoord &startCoord, const TSLCoord &endCoord, const TSLCoord &thisCoord, double tolerance)
 
static int lineSegmentIntersection (const TSLCoord &seg1Start, const TSLCoord &seg1End, const TSLCoord &seg2Start, const TSLCoord &seg2End, TSLCoord &crossingPt1, TSLCoord &crossingPt2, double tolerance=0.5)
 
static bool ringIsClockwise (const TSLCoordSet &coordSet)
 
static bool ringIsSelfTouching (const TSLCoordSet &coordSet)
 
static TSLCoordSetClassificationEnum classifyCoordSet (const TSLCoordSet &coordSet, bool closed)
 

Member Function Documentation

◆ classifyCoordSet()

static TSLCoordSetClassificationEnum TSLGeometryUtility::classifyCoordSet ( const TSLCoordSet & coordSet,
bool closed )
static

◆ isCoordOnSegment()

static bool TSLGeometryUtility::isCoordOnSegment ( const TSLCoord & startCoord,
const TSLCoord & endCoord,
const TSLCoord & thisCoord,
double tolerance )
static

Checks if the specified coordinate is on the specified line segment.

Parameters
startCoordStart point of the line segment.
endCoordEnd point of the line segment.
thisCoordThe specified coordinate.
toleranceSpecifies the maximum distance (in TMCs) the specified coordinate can be from the line segment to be considered on it.
Returns
true if the specified coordinate is on (i.e. within the tolerance of) the line segment.

◆ lineSegmentIntersection()

static int TSLGeometryUtility::lineSegmentIntersection ( const TSLCoord & seg1Start,
const TSLCoord & seg1End,
const TSLCoord & seg2Start,
const TSLCoord & seg2End,
TSLCoord & crossingPt1,
TSLCoord & crossingPt2,
double tolerance = 0.5 )
static

This computes the intersection of the two specified line segments (including any intersection at their end points).

Parameters
seg1StartStart point of the 1st line segment.
seg1EndEnd point of the 1st line segment.
seg2StartStart point of the 2nd line segment.
seg2EndEnd point of the 2nd line segment.
crossingPt11st crossing point will be returned here, if any. Only valid when return value is 1 or 2.
crossingPt22nd crossing point will be returned here, if any. Only valid when return value is 2.
toleranceSpecifies the maximum distance (in TMCs) the specified line segments can be from each other to still be considered intersecting.
Returns
an integer 0, 1 or 2 for the number of intersections.

◆ ringIsClockwise()

static bool TSLGeometryUtility::ringIsClockwise ( const TSLCoordSet & coordSet)
static

Returns true if the ring defined by the coord set is clockwise orientated.

The function returns a valid value only if the coord set is simple (which is required anyway for a ring).

◆ ringIsSelfTouching()

static bool TSLGeometryUtility::ringIsSelfTouching ( const TSLCoordSet & coordSet)
static

Returns true if the ring defined by the coord set is not simple (i.e. is self-touching, is self-intersecting, or has spikes, punctures, duplicate sides, duplicated points or the same start and end points).