Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.84
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 
18 #pragma once
19 
20 #include "common.h"
21 #if GEOM_PSEUDO3D==GEOM_TRUE
22 
23 #include "Point2.h"
24 
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(std::vector<Point2>& vPoints);
114  void add(size_t numPoints,double * aCoordinates);
115 
116  // REDUCE
134  void uniformSimplifyGrid(double gridLength,SumStrategy sms,ConvexHullStrategy chs);
155  void uniformSimplifyNum(int approxNumPoints,SumStrategy sms,ConvexHullStrategy chs);
174  void adaptiveSimplify(double maxDiffZ,SumStrategy sms,ConvexHullStrategy chs);
175 
176  // BOUNDS
178  double getRangeX();
180  double getRangeY();
182  double getRangeZ();
185  void getBounds(double& minX,double& minY,double& minZ,double& maxX,double& maxY,double& maxZ);
186 
187  // Convex Hull
196  bool computeConvexHull(bool bAllPoints,std::vector<Point2>& vConvexHull);
197 
198  // Points
203  size_t getNumPoints() const;
215  void getPoints(std::vector<Point2>& vPointsOut) const;
217  void clear();
218 protected:
219 
220 private:
222  CloudPrepareImpl* pImpl;
223 private:
224  CloudPrepare(const CloudPrepare&);
225 };
226 
227 } // NAMESPACE
228 
229 // up to here: if GEOM_PSEUDO3D==GEOM_TRUE
230 #elif GEOM_PSEUDO3D==GEOM_FALSE
231  namespace GEOM_FADE2D {
232 #else
233  #error GEOM_PSEUDO3D is not defined
234 #endif
ConvexHullStrategy
ConvexHullStrategy for CloudPrepare.
Definition: CloudPrepare.h:40
Assign the minimum height.
Definition: CloudPrepare.h:33
No special treatment for convex hull points.
Definition: CloudPrepare.h:42
CloudPrepare simplifies overdense point clouds and helps to avoid memory-usage-peaks during data tran...
Definition: CloudPrepare.h:86
Use only convex points of the convex hull (no collinear ones)
Definition: CloudPrepare.h:44
Assign the average height.
Definition: CloudPrepare.h:36
SumStrategy
SumStrategy for CloudPrepare.
Definition: CloudPrepare.h:31
Assign the median height.
Definition: CloudPrepare.h:35
Use all points from the convex hull.
Definition: CloudPrepare.h:43
Definition: Bbox2.h:23
Assign the maximum height.
Definition: CloudPrepare.h:34