Fade2.5D Documentation pages v2.12
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 
32 {
37 };
38 
41 {
45 };
46 class CloudPrepareImpl; // FWD
47 
48 
49 
50 
51 
86 class CLASS_DECLSPEC CloudPrepare
87 {
88 public:
89  CloudPrepare();
90  ~CloudPrepare();
91 
92  // ADD
102  void add(double x,double y,double z,int customIndex=-1);
107  void add(const std::vector<Point2>& vPoints);
114  void add(size_t numPoints,double * aCoordinates);
115 
116  // REDUCE
139  size_t uniformSimplifyGrid(double gridLength,SumStrategy sms,ConvexHullStrategy chs,bool bDryRun=false);
162  size_t uniformSimplifyNum(int approxNumPoints,SumStrategy sms,ConvexHullStrategy chs);
186  size_t adaptiveSimplify(double maxDiffZ,SumStrategy sms,ConvexHullStrategy chs,bool bDryRun=false);
187 
188  // BOUNDS
190  double getRangeX();
192  double getRangeY();
194  double getRangeZ();
197  void getBounds(double& minX,double& minY,double& minZ,double& maxX,double& maxY,double& maxZ);
198 
199  // Convex Hull
208  bool computeConvexHull(bool bAllPoints,std::vector<Point2>& vConvexHull);
209 
210  // Points
215  size_t getNumPoints() const;
227  void getPoints(std::vector<Point2>& vPointsOut) const;
229  void clear();
230 protected:
231 
232 private:
234  CloudPrepareImpl* pImpl;
235 private:
236  CloudPrepare(const CloudPrepare&);
237  CloudPrepare& operator=(const CloudPrepare&);
238 };
239 
240 } // NAMESPACE
241 
242 // up to here: if GEOM_PSEUDO3D==GEOM_TRUE
243 #elif GEOM_PSEUDO3D==GEOM_FALSE
244  //namespace GEOM_FADE2D {
245 #else
246  #error GEOM_PSEUDO3D is not defined
247 #endif
ConvexHullStrategy
ConvexHullStrategy for CloudPrepare.
Definition: CloudPrepare.h:41
@ CHS_NOHULL
No special treatment for convex hull points.
Definition: CloudPrepare.h:42
@ CHS_MAXHULL
Use all points from the convex hull.
Definition: CloudPrepare.h:43
@ CHS_MINHULL
Use only convex points of the convex hull (no collinear ones)
Definition: CloudPrepare.h:44
SumStrategy
SumStrategy for CloudPrepare.
Definition: CloudPrepare.h:32
@ SMS_MAXIMUM
Assign the maximum height.
Definition: CloudPrepare.h:34
@ SMS_AVERAGE
Assign the average height.
Definition: CloudPrepare.h:36
@ SMS_MINIMUM
Assign the minimum height.
Definition: CloudPrepare.h:33
@ SMS_MEDIAN
Assign the median height.
Definition: CloudPrepare.h:35
CloudPrepare simplifies overdense point clouds and helps to avoid memory-usage-peaks during data tran...
Definition: CloudPrepare.h:87
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 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 to a specific target size.
void clear()
Clear all stored data.
bool computeConvexHull(bool bAllPoints, std::vector< Point2 > &vConvexHull)
Compute the 2.5D Convex Hull.
size_t getNumPoints() const
Get the number of points.
void getPoints(std::vector< Point2 > &vPointsOut) const
Get the simplified point cloud.
void getBounds(double &minX, double &minY, double &minZ, double &maxX, double &maxY, double &maxZ)
Get the min/max bounds.
size_t adaptiveSimplify(double maxDiffZ, SumStrategy sms, ConvexHullStrategy chs, bool bDryRun=false)
Simplify the Point Cloud according to a tolerance z-value.