CloudPrepare simplifies overdense point clouds and helps to avoid memoryusagepeaks during data transfer.
More...
#include <CloudPrepare.h>

void  add (double x, double y, double z, int customIndex=1) 
 Add a point to the CloudPrepare object. More...


void  add (std::vector< Point2 > &vPoints) 
 Add points to the CloudPrepare object (vectorversion) More...


void  add (size_t numPoints, double *aCoordinates) 
 Add points to the CloudPrepare object (arrayversion) More...


void  uniformSimplifyGrid (double gridLength, SumStrategy sms, ConvexHullStrategy chs) 
 Simplify the point cloud according to grid resolution. More...


void  uniformSimplifyNum (int approxNumPoints, SumStrategy sms, ConvexHullStrategy chs) 
 Simplify the Point Cloud to a specific target size. More...


void  adaptiveSimplify (double maxDiffZ, SumStrategy sms, ConvexHullStrategy chs) 
 Simplify the Point Cloud according to a tolerance zvalue. More...


double  getRangeX () 

double  getRangeY () 

double  getRangeZ () 

void  getBounds (double &minX, double &minY, double &minZ, double &maxX, double &maxY, double &maxZ) 
 Get the min/max bounds. More...


bool  computeConvexHull (bool bAllPoints, std::vector< Point2 > &vConvexHull) 
 Compute the 2.5D Convex Hull. More...


size_t  getNumPoints () const 
 Get the number of points. More...


void  getPoints (std::vector< Point2 > &vPointsOut) const 
 Get the simplified point cloud. More...


void  clear () 
 Clear all stored data.


CloudPrepare simplifies overdense point clouds and helps to avoid memoryusagepeaks during data transfer.
This class has two applications:
 Simplification of overdense point clouds from areal and photogrammetry surveys. The reduction is either gridbased or zadaptive with a tolerance threshold for the height error. Four strategies can be selected for grouping similar points: MIN, MAX, MEDIAN and AVG. MIN corresponds to simple ground filtering, since it favors ground measurement points over those on vegetation. MEDIAN stabilizes the point cloud because it removes outliers while AVG is well suited to reduce noise in the scan.
 Avoding memory usage peaks when triangulating a large point cloud: Usually you have all vertices in the data structures of your own software and when you then call Fade_2D::insert(), triangles are created immediately and only after that you have the possibility to remove the points from your own data structures. This means for a short time the vertices are duplicated in memory, and this creates an unnecessary memory peak. The solution is to give the points to the CloudPrepare class in advance (onebyone or all at once) and to delete them from your own data structures while not a single triangle exists yet. Only then call Fade_2D::insert(&CloudPrepare).This avoids duplicating memory usage for the vertices.
Have a look at the Examples.
 Note
 This class replaces the EfficientModel class. It is much more memoryefficient and it is extremely fast.
Point Cloud Reduction: Left original, right reduced
◆ adaptiveSimplify()
Simplify the Point Cloud according to a tolerance zvalue.
This method simplifies the point cloud heightadaptively. This means that adjoining points with similar zvalues (within the given tolerance maxDiffZ
) are combined into one.
 Parameters

maxDiffZ  [in] is the maximum height (zcoordinate) difference of points, so that these points are combined to one. 
sms  [in] is the strategy used to summarize similar points into one. Possible values are SMS_MINIMUM, SMS_MAXIMUM, SMS_MEDIAN and SMS_AVERAGE. 
chs  [in] is the ConvexHullStrategy: Use CHS_MAXHULL to keep all points of the convex hull unchanged. If only convex points but not collinear points of the convex hull are to be considered as convex hull points, then use CHS_MINHULL. If convex hull points should be treated like all other points, then use CHS_NOHULL. 
◆ add() [1/3]
void GEOM_FADE25D::CloudPrepare::add 
( 
double 
x, 


double 
y, 


double 
z, 


int 
customIndex = 1 

) 
 
Add a point to the CloudPrepare object.
 Parameters

 x,y,z  [in] are the coordinates 
[in]  customIndex  is an optional index that you can use to relate the point to your own data structures. 
 Note
 If you call Point2::getCustomIndex() on this point at a later time, then exactly this index will be returned.
◆ add() [2/3]
void GEOM_FADE25D::CloudPrepare::add 
( 
std::vector< Point2 > & 
vPoints  ) 

Add points to the CloudPrepare object (vectorversion)
 Parameters

vPoints  [in] are the input points 
◆ add() [3/3]
void GEOM_FADE25D::CloudPrepare::add 
( 
size_t 
numPoints, 


double * 
aCoordinates 

) 
 
Add points to the CloudPrepare object (arrayversion)
 Parameters

numPoints  [in] specifies the number of input points 
aCoordinates  [in] an array that holds 3*numPoints coordinates (x0,y0,z0,x1,y1,z1,...,xn,yn,zn) 
◆ computeConvexHull()
bool GEOM_FADE25D::CloudPrepare::computeConvexHull 
( 
bool 
bAllPoints, 


std::vector< Point2 > & 
vConvexHull 

) 
 
Compute the 2.5D Convex Hull.
 Parameters

bAllPoints  If this parameter is true, then all convex hull points are returned. Otherwise, those points are omitted which lie on the convex hull but whose absence does not shrink the convex hull 
vConvexHull  [out] is used to return the convex hull points 
◆ getBounds()
void GEOM_FADE25D::CloudPrepare::getBounds 
( 
double & 
minX, 


double & 
minY, 


double & 
minZ, 


double & 
maxX, 


double & 
maxY, 


double & 
maxZ 

) 
 
Get the min/max bounds.
 Parameters

minX,minY,minZ,maxX,maxY,maxZ  [out] 
◆ getNumPoints()
size_t GEOM_FADE25D::CloudPrepare::getNumPoints 
( 
 ) 
const 
Get the number of points.
 Returns
 the number of points
◆ getPoints()
void GEOM_FADE25D::CloudPrepare::getPoints 
( 
std::vector< Point2 > & 
vPointsOut  ) 
const 
Get the simplified point cloud.
 Parameters

vPointsOut  [out] is used to return the points 
 Note
 The points of the CloudPrepare object can be inserted directly with Fade_2D::insert(CloudPrepare). This is more memory efficient than getting the points out first only to pass them to insert().
 See also
 Fade_2D::void insert(CloudPrepare* pCloudPrepare,bool bClear=true)
◆ getRangeX()
double GEOM_FADE25D::CloudPrepare::getRangeX 
( 
 ) 

◆ getRangeY()
double GEOM_FADE25D::CloudPrepare::getRangeY 
( 
 ) 

◆ getRangeZ()
double GEOM_FADE25D::CloudPrepare::getRangeZ 
( 
 ) 

◆ uniformSimplifyGrid()
Simplify the point cloud according to grid resolution.
This method uses a thought grid in the xy plane and combines the points of each cell into a single point.
 Parameters

gridLength  [in] determines the horizontal and vertical cell spacing in the grid. 
sms  [in] is the SumStrategy used to combine similar points into one. Possible values are SMS_MINIMUM, SMS_MAXIMUM, SMS_MEDIAN and SMS_AVERAGE. 
chs  [in] is the ConvexHullStrategy: Points of the convex hull can be kept unchanged. Use CHS_MAXHULL for this purpose. If only convex points but not collinear points of the convex hull are to be considered as convex hull points, then use CHS_MINHULL. If convex hull points should be treated like all other points, then use CHS_NOHULL. 
◆ uniformSimplifyNum()
Simplify the Point Cloud to a specific target size.
This method uses a thought grid in the xy plane and combines the points of each cell into a single point. The resolution of the grid is automatically determined such that the point cloud is reduced to approximately the desired number of points.
 Parameters

approxNumPoints  [in] is the desired number of remaining points. The algorithm will reduce the point cloud to approximately that number of points. 
sms  [in] is the SumStrategy used to combine similar points into one. Possible values are SMS_MINIMUM, SMS_MAXIMUM, SMS_MEDIAN and SMS_AVERAGE. 
chs  [in] is the ConvexHullStrategy: Points of the convex hull can be kept unchanged. Use CHS_MAXHULL for this purpose. If only convex points but not collinear points of the convex hull are to be considered as convex hull points, then use CHS_MINHULL. If convex hull points should be treated like all other points, then use CHS_NOHULL. 
The documentation for this class was generated from the following file: