DM::GeometricAlgorithms Namespace Reference

provides a set of geometric algorithms (Douglas-Peucker algorithm, densification of lines) More...

Functions

DM_API DM::PolylineHandle thinOut (const DM::PolylineHandle &line, double maxOrthoDist)
 Use the Douglas-Peucker algorithm to create a polyline with a subset of vertices of the provided line object. More...
 
DM_API DM::PolylineHandle densify (const DM::PolylineHandle &line, double maxSpacing)
 densify a polyline by inserting new points along the line segments
More...
 
DM_API bool isSelfIntersecting (const DM::PolylineHandle &line)
 test if a polyline is self intersecting
 
DM_API void analyseDistance (const PolylineHandle &base, const PolylineHandle &other, IAnalyseDistance &callback, double maxDist=-1, bool d3=true)
 For analysing 2d/3d distances between vertices of the base polyline to the other provided polyline (optional a max distance threshold is considered) More...
 

Detailed Description

provides a set of geometric algorithms (Douglas-Peucker algorithm, densification of lines)

Function Documentation

◆ analyseDistance()

DM_API void DM::GeometricAlgorithms::analyseDistance ( const PolylineHandle base,
const PolylineHandle other,
IAnalyseDistance callback,
double  maxDist = -1,
bool  d3 = true 
)

For analysing 2d/3d distances between vertices of the base polyline to the other provided polyline (optional a max distance threshold is considered)

The function computes the shortest 2d/3d distances of all vertices of the base polyline to the 'other' polyline. With the results of each base vertex distance computation the corresponding function of the provided callback object is called. If an maximum distance threshold is provided (maxDist>0), the algorithms only considers distances up to the given threshold (see IAnalyseDistance). The implemented algorithm uses the maxDist threshold during spatial search and therfore, is more efficient than only handling the distance threshold within the callback oject.

Parameters
[in]basethe vertex of the base polyline is used for distance analysis
[in]otherpolyline to which the distances are computed
[in]callbackcallback object for analysing the computed distance results
[in]maxDistoptional maximum distance threshold (-1: no distance threshold is applied)
[in]d3flag if 3d or 2d computation (true: 3d / false: 2d)

◆ densify()

DM_API DM::PolylineHandle DM::GeometricAlgorithms::densify ( const DM::PolylineHandle line,
double  maxSpacing 
)

densify a polyline by inserting new points along the line segments

insert as few points as possible to reach the criterion:
(distances between neighbours) <= d_maxSpacing
distribute the new points equally along each line segment
preserve original points together with their additional infos

Parameters
[in]linepolyline that should be densified
[in]maxSpacingmaximum spacing between neighboring vertices
Returns
resulting object

◆ thinOut()

DM_API DM::PolylineHandle DM::GeometricAlgorithms::thinOut ( const DM::PolylineHandle line,
double  maxOrthoDist 
)

Use the Douglas-Peucker algorithm to create a polyline with a subset of vertices of the provided line object.

Each polyline part is treated as a separate object

Parameters
[in]linepolyline that should be thinned out
[in]maxOrthoDistDiscarded vertices feature an orthogonal distance to the returned polyline <= d_maxOrthoDist
Returns
resulting object