Fade2.5D Documentation pages v2.16.7
Delaunay Features
CloudPrepare.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 
20 #pragma once
21 
22 #include "common.h"
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24 
25 #include "Point2.h"
26 
27 
28 namespace GEOM_FADE25D {
29 
30 
36 {
41 };
42 
48 {
52 };
53 class CloudPrepareImpl; // FWD
54 
55 
83 class CLASS_DECLSPEC CloudPrepare
84 {
85 public:
86  CloudPrepare();
87  ~CloudPrepare();
88 
89 
102  void add(double x,double y,double z,int customIndex=-1);
103 
111  void add(const std::vector<Point2>& vPoints);
112 
125  void add(size_t numPoints,double * aCoordinates);
126 
127 
154  size_t uniformSimplifyGrid(double gridLength,SumStrategy sms,ConvexHullStrategy chs,bool bDryRun=false);
155 
156 
183  size_t uniformSimplifyNum(int approxNumPoints,SumStrategy sms,ConvexHullStrategy chs);
184 
207  size_t adaptiveSimplify(double maxDiffZ,SumStrategy sms,ConvexHullStrategy chs,bool bDryRun=false);
208 
215  double getRangeX();
216 
223  double getRangeY();
224 
231  double getRangeZ();
232 
240  void getBounds(double& minX,double& minY,double& minZ,double& maxX,double& maxY,double& maxZ);
241 
242 
243 
256  bool computeConvexHull(bool bAllPoints,std::vector<Point2>& vConvexHull);
257 
258  // Points
265  size_t getNumPoints() const;
266 
279  void getPoints(std::vector<Point2>& vPointsOut) const;
281  void clear();
282 protected:
283 
284 private:
286  CloudPrepareImpl* pImpl;
287 private:
288  CloudPrepare(const CloudPrepare&);
289  CloudPrepare& operator=(const CloudPrepare&);
290 };
291 
292 } // NAMESPACE
293 
294 // up to here: if GEOM_PSEUDO3D==GEOM_TRUE
295 #elif GEOM_PSEUDO3D==GEOM_FALSE
296  //namespace GEOM_FADE2D {
297 #else
298  #error GEOM_PSEUDO3D is not defined
299 #endif
ConvexHullStrategy
Enumeration for strategies to treat convex hull points in CloudPrepare.
Definition: CloudPrepare.h:48
@ CHS_NOHULL
No special treatment for convex hull points.
Definition: CloudPrepare.h:49
@ CHS_MAXHULL
Keep all points from the convex hull.
Definition: CloudPrepare.h:50
@ CHS_MINHULL
Keep only non-collinear points of the convex hull.
Definition: CloudPrepare.h:51
SumStrategy
Enumeration for point aggregation strategies used in CloudPrepare.
Definition: CloudPrepare.h:36
@ SMS_MAXIMUM
Assign the maximum height.
Definition: CloudPrepare.h:38
@ SMS_AVERAGE
Assign the average height. Averaging reduces noise in the point cloud.
Definition: CloudPrepare.h:40
@ SMS_MINIMUM
Assign the minimum height. Corresponds to ground filtering by prioritizing the lower ground points ov...
Definition: CloudPrepare.h:37
@ SMS_MEDIAN
Assign the median height. Reduces outliers and stabilizes the cloud by taking the median height of si...
Definition: CloudPrepare.h:39
CloudPrepare simplifies dense point clouds and helps prevent memory usage peaks during data transfer.
Definition: CloudPrepare.h:84
double getRangeY()
Get the range of the y-coordinates.
void add(size_t numPoints, double *aCoordinates)
Add points to the CloudPrepare object (array-version)
size_t uniformSimplifyGrid(double gridLength, SumStrategy sms, ConvexHullStrategy chs, bool bDryRun=false)
Simplify the point cloud according to grid resolution.
void add(const std::vector< Point2 > &vPoints)
Add a set of points to the CloudPrepare object (vector version)
void add(double x, double y, double z, int customIndex=-1)
Add a point to the CloudPrepare object.
size_t uniformSimplifyNum(int approxNumPoints, SumStrategy sms, ConvexHullStrategy chs)
Simplify the point cloud using a grid resolution determined by the desired number of output points.
double getRangeZ()
Get the range of the z-coordinates.
void clear()
Clear all stored data.
bool computeConvexHull(bool bAllPoints, std::vector< Point2 > &vConvexHull)
Compute the Convex Hull.
size_t getNumPoints() const
Get the total number of points in the CloudPrepare object.
double getRangeX()
Get the range of the x-coordinates.
void getPoints(std::vector< Point2 > &vPointsOut) const
Retrieve the point cloud.
void getBounds(double &minX, double &minY, double &minZ, double &maxX, double &maxY, double &maxZ)
Get the minimum and maximum bounds of the point cloud.
size_t adaptiveSimplify(double maxDiffZ, SumStrategy sms, ConvexHullStrategy chs, bool bDryRun=false)
Simplifies the point cloud based on a tolerance threshold for the z-values.