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

Detailed Description

This class provides low-level access to the underlying bound, lasso and auto-title functionality.

Before using this class, you should set up the (static) snap-tolerance in the TSLBoundaryVertex class.

Public Member Functions

 TSLBoundaryHelper (TSLFeatureID *buildingFeatureCodes=0, int numBuildingFeatureCodes=0, TSLFeatureID *extensionFeatureCodes=0, int numExtensionFeatureCodes=0)
 
 TSLBoundaryHelper (TSLBoundaryHelper &src, TSLEnvelope &extent, bool includeMarked, bool extensionOnly)
 
 TSLBoundaryHelper (TSLDrawingSurface *surface)
 
 ~TSLBoundaryHelper ()
 
void addEdge (TSLTMC end1_x, TSLTMC end1_y, TSLTMC end2_x, TSLTMC end2_y)
 
void clear ()
 
void decompose (const TSLEntitySet *entity, bool(*valid)(const TSLEntity *entity)=0, const TSLEntity *clipEntity=0)
 
void decompose (const TSLPolyline *entity, const TSLEntity *clipEntity=0, bool mark=false, bool clearMarkIfExists=false)
 
void decompose (const TSLPolygon *entity, const TSLEntity *clipEntity=0, bool mark=false, bool clearMarkIfExists=false)
 
TSLCoordSetdynamicBound (const TSLCoord *coord, const TSLEnvelope *boundary=0)
 
void extendMarkedCorners (double minCornerAngleChange, TSLTMC maxExtensionLength)
 
void extendOrphans (double angleTolerance, double scaleFactor)
 
TSLBoundaryEdgeListgetEdges () const
 
TSLBoundaryEdgeListgetEdgesWithVerticesNear (const TSLCoord &point, TSLTMC tolerance) const
 
TSLBoundaryVertexgetNearestPoint (const TSLCoord &pt, TSLTMC maxTMCDistance)
 
TSLBoundaryVertexgetNearestVertex (const TSLCoord &pt, bool existingOnly, TSLTMC maxTMCDistance)
 
void insertGapFillets (TSLTMC maximumDistance)
 
TSLCoordSetlargestContained (TSLBoundaryEdgeList **constituentEdges)
 
void removeOrphans (double angleTolerance=360.0, TSLTMC maximumLength=0)
 
void removeMarkedEdges ()
 
const TSLCoordSetseeds () const
 
TSLCoordSetsmallestEnclosure (const TSLCoord &coord, TSLBoundaryEdgeList **constituentEdges)
 
void splitEdges ()
 
void unmarkContinuationEdges (Double angleTolerance)
 
void * getHandle () const
 

Constructor & Destructor Documentation

◆ TSLBoundaryHelper() [1/3]

TSLBoundaryHelper::TSLBoundaryHelper ( TSLFeatureID * buildingFeatureCodes = 0,
int numBuildingFeatureCodes = 0,
TSLFeatureID * extensionFeatureCodes = 0,
int numExtensionFeatureCodes = 0 )

This method is the basic constructor for TSLBoundaryHelper.

Parameters
buildingFeatureCodesFeature codes to identify building outlines and seed points.
numBuildingFeatureCodesNumber of feature codes specified in 'building FeatureCodes'.
extensionFeatureCodesFeature codes for features used during 'extendMarked Corners'.
numExtensionFeatureCodesNumber of feature codes specified in 'extension FeatureCodes'.

◆ TSLBoundaryHelper() [2/3]

TSLBoundaryHelper::TSLBoundaryHelper ( TSLBoundaryHelper & src,
TSLEnvelope & extent,
bool includeMarked,
bool extensionOnly )

This is a copy constructor for the TSLBoundaryHelper class.

This takes an existing TSLBoundaryHelper and copies across all edges that intersect the specified extent. Optionally, marked edges can be ignored.

Parameters
srcSource TSLBoundaryHelper to copy from
extentExtent of edges to copy. Note that all edges that intersect the extent will be copied without being clipped.
includeMarkedThis flag indicates whether marked edges should be copied as well.
extensionOnlyThis flag indicates whether only extension features shuld be copied.

◆ TSLBoundaryHelper() [3/3]

TSLBoundaryHelper::TSLBoundaryHelper ( TSLDrawingSurface * surface)

◆ ~TSLBoundaryHelper()

TSLBoundaryHelper::~TSLBoundaryHelper ( )

Destructor for boundary helper

Member Function Documentation

◆ addEdge()

void TSLBoundaryHelper::addEdge ( TSLTMC end1_x,
TSLTMC end1_y,
TSLTMC end2_x,
TSLTMC end2_y )

Add an edge line to the map data.

When all required edges have been added, call splitEdges to make sure vertices are created where edges cross.

Parameters
end1_x,end1_ycoordinates of one end of the edge
end2_x,end2_ycoordinates of the other end of the edge

◆ clear()

void TSLBoundaryHelper::clear ( )

This clears the all vertex and edge lists held within the boundary helper.

◆ decompose() [1/3]

void TSLBoundaryHelper::decompose ( const TSLEntitySet * entity,
bool(* valid )(const TSLEntity *entity) = 0,
const TSLEntity * clipEntity = 0 )

This method decomposes the specified entity into its component edges. For entities that contain other entities, this function recursively calls itself.

The (optional) validate function is called for all entities. If the validate function returns true, then that entity's edges are added. If no validate function is specified, then all entities edges are added

An optional clipping entity may be specified. The edges will be clipped to the boundary of this entity prior to addition.

Arguments list details :

entity : A pointer to the entity to be decomposed.

valid : Optional pointer to the validate function.

clipEntity : A pointer to the optional clip region.

◆ decompose() [2/3]

void TSLBoundaryHelper::decompose ( const TSLPolygon * entity,
const TSLEntity * clipEntity = 0,
bool mark = false,
bool clearMarkIfExists = false )

This method decomposes the specified polygon into its component edges.

An optional clipping entity may be specified. The edges will be clipped to the boundary of this entity prior to addition.

Arguments list details :

entity : A pointer to the entity to be decomposed.

clipEntity: Optional pointer to the clip boundary

mark : Flag to indicate whether the edges of the polygon should be marked.

clearMarkIfExists: Flag to indicate whether the edges of the polyline should have their mark cleared if they are already in the network.

◆ decompose() [3/3]

void TSLBoundaryHelper::decompose ( const TSLPolyline * entity,
const TSLEntity * clipEntity = 0,
bool mark = false,
bool clearMarkIfExists = false )

This method decomposes the specified polyline into its component edges.

An optional clipping entity may be specified. The edges will be clipped to the boundary of this entity prior to addition.

Arguments list details :

entity : A pointer to the entity to be decomposed.

clipEntity: Optional pointer to the clip boundary

mark : Flag to indicate whether the edges of the polyline should be marked.

clearMarkIfExists: Flag to indicate whether the edges of the polyline should have their mark cleared if they are already in the network.

◆ dynamicBound()

TSLCoordSet * TSLBoundaryHelper::dynamicBound ( const TSLCoord * coord,
const TSLEnvelope * boundary = 0 )

Use this method to find the smallest possible polygon at a given point on a drawing surface. To use this method you must use the constructor that takes a drawing surface.

Parameters
coordThe point at which the search should start.
boundaryA bounding polygon which specifies the extent to the search. If this is not declared, then a 'smart' search will take place.
Returns
a TSLCoordSet representing the smallest enclosure if it succeeds or a null pointer otherwise.

◆ extendMarkedCorners()

void TSLBoundaryHelper::extendMarkedCorners ( double minCornerAngleChange,
TSLTMC maxExtensionLength )

This method extends corners including marked edges be extended to a nearby non marked edge.

Parameters
minCornerAngleChangeMinimum angle change, in degrees, that must occur to indicate a corner.
maxExtensionLengthMaximum length, in TMC units, that a corner may be extended by,

◆ extendOrphans()

void TSLBoundaryHelper::extendOrphans ( double angleTolerance,
double scaleFactor )

This method extends any orphan chains by the maximum specified amount.

An orphan chain is a chain of edges, starting with a vertex that is only used by a single edge (the end vertex). The angle between each edge in the chain may vary by no more than the specified tolerance, typically a few degrees. The chain will also be terminated by a vertex that is used by three or more edges (eg. a T junction). Once the chain edges have been determined, the length of the chain is calculated. A ray is cast, extending out from the end vertex. If the ray intersects with another edge, then the distance from the end vertex to the intersection is calculated. If this distance is less than the chain length multiplied by the scaleFactor, then an edge is added between the end vertex and the intersection.

Parameters
angleToleranceThis is the angle that determines whether the chain is to be continued. The angle is in degrees.
scaleFactorMultiplication factor to determine the maximum length of edge that may be added.

◆ getEdges()

TSLBoundaryEdgeList * TSLBoundaryHelper::getEdges ( ) const

Returns a new list of the edges found by the operation. Note that though the list is new (and should be destroyed after use), the list contains references to edges actually owned by the TSLBoundaryHelper. Therefore the helper must stay in existence while the list or its edges are in use.

No arguments.

◆ getEdgesWithVerticesNear()

TSLBoundaryEdgeList * TSLBoundaryHelper::getEdgesWithVerticesNear ( const TSLCoord & point,
TSLTMC tolerance ) const

Returns a list of edges that have at least one vertex close to the given point. Note that though the list is new (and should be destroyed after use), the list contains references to edges actually owned by the TSLBoundary Helper. Therefore the helper must stay in existence while the list or its edges are in use.

Parameters
pointPoint to test.
toleranceMaximum distance that the vertex may be from the edge to return true. If the point must be exacly on the edge, pass zero.

◆ getHandle()

void * TSLBoundaryHelper::getHandle ( ) const

◆ getNearestPoint()

TSLBoundaryVertex * TSLBoundaryHelper::getNearestPoint ( const TSLCoord & pt,
TSLTMC maxTMCDistance )

Returns the nearest vertex within the specified distance to the specified point. If no such vertex currently exists within the vertex list, but the point is within maxTMCDistance of an existing edge, then a new vertex is created at the closest point along the edge and returned. The edge is split into two by the new vertex.

Argument descripton: pt : The point to check against maxTMCDistance: Tolerance value to decide whether the vertex and point are the same

Returns nearest Vertex within tolerance or nearest vertex along an edge, NULL if none found

◆ getNearestVertex()

TSLBoundaryVertex * TSLBoundaryHelper::getNearestVertex ( const TSLCoord & pt,
bool existingOnly,
TSLTMC maxTMCDistance )

Returns the nearest vertex within the specified distance to the specified point. If no such point currently exists within the vertex list and the 'existingOnly' flag is false, then all edges are checked to see if they are within the tolerance value if the point. If so, then the nearest vertex of that edge is returned. No new vertex is created. Under the latter circumstances, the returned vertex may be outside the tolerance value.

Argument descripton: pt : The point to check against existingOnly : If true, only looks for an existing vertex. If false, also checks for edges within tolerance and returns nearest vertex of any edge within the tolerance value. maxTMCDistance: Tolerance value to decide whether the vertex and point are the same

Returns nearest Vertex within tolerance, NULL if none found and existingOnly is true.

◆ insertGapFillets()

void TSLBoundaryHelper::insertGapFillets ( TSLTMC maximumDistance)

Inserts additional edges between end vertices.

An end vertex is a vertex that is only used by a single edge. This method inserts an edge between end vertices that are within the specified distance of each other.

Parameters
maximumDistanceMaximum distance between end vertices to be filled.

◆ largestContained()

TSLCoordSet * TSLBoundaryHelper::largestContained ( TSLBoundaryEdgeList ** constituentEdges)

This method determines the largest polygon that can be constructed within the edges. If necessary, the edges that make up the polygon can be returned by reference.

Both the coordinate set and any constituentEdges returned must be destroyed by the caller.

Parameters
constituentEdgesStorage for list of edges that make up the returned polygon.
Returns
smallest enclosing polygon by value, constituent edges by reference.

◆ removeMarkedEdges()

void TSLBoundaryHelper::removeMarkedEdges ( )

This method removes all marked edges from list of edges.

◆ removeOrphans()

void TSLBoundaryHelper::removeOrphans ( double angleTolerance = 360.0,
TSLTMC maximumLength = 0 )

This method removes any orphan chains

An orphan chain is a chain of edges, starting with a vertex that is only used by a single edge (the end vertex). The angle between each edge in the chain may vary by no more than the specified tolerance, typically a few degrees.

Parameters
angleToleranceThis is the angle that determines whether the chain is to be continued. The angle is in degrees. The default (360.0) will ignore angle changes when determining the chain. The chain will then be terminated by a vertex that is used by three or more edges (eg. a T junction).
maximumLengthMaximum length of orphan chain to be removed, in TMC units. The default (0.0) will ignore the length and remove all orphan chains.

◆ seeds()

const TSLCoordSet * TSLBoundaryHelper::seeds ( ) const

This method queries for any seed points found during the decomposition of entity sets.

Returns coord set containing seed points found.

◆ smallestEnclosure()

TSLCoordSet * TSLBoundaryHelper::smallestEnclosure ( const TSLCoord & coord,
TSLBoundaryEdgeList ** constituentEdges )

This method determines the smallest polygon that can be constructed around the specified point. If necessary, the edges that make up the polygon can be returned by reference.

Both the coordinate set and any constituentEdges returned must be destroyed by the caller.

Parameters
coordCoordinate to construct polygon around.
constituentEdgesStorage for list of edges that make up the returned polygon.
Returns
smallest enclosing polygon by value, constituent edges by reference.

◆ splitEdges()

void TSLBoundaryHelper::splitEdges ( )

This splits up existing edges where vertices touch. eg. T junctions and + junctions

Arguments list details :

No parameters.

◆ unmarkContinuationEdges()

void TSLBoundaryHelper::unmarkContinuationEdges ( Double angleTolerance)

This method removes the 'marked' flag from edges which run in a straight line from unmarked edges.

A tolerance angle may be specified to determine how straight the line should be.

Parameters
toleranceAngleThis is the angle that determines whether the line is straight. The angle is in degrees.