libatomprobe
Library for Atom Probe Tomography (APT) computation
convexHull.h
Go to the documentation of this file.
1 /* convexHull.cpp: Wrapper for convex hull calculations
2  * Copyright (C) 2020 Daniel Haley
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef ATOMPROBE_CONVEX_HULL_H
18 #define ATOMPROBE_CONVEX_HULL_H
19 
20 #include <vector>
21 
23 
24 namespace AtomProbe{
25 //Error codes
26 enum
27 {
31 };
32 
33 
35 /*Returns 0 on success, nonzero on error, with error codes in above enum
36 
37  FIXME: Currently the algorithm is over-agressive and reduces by more
38  than neccesary, some times a lot. It should be replaced with a more
39  correct version
40 */
41 unsigned int GetReducedHullPts(const std::vector<IonHit> &points, float reductionDim,
42  unsigned int *progress, bool (*callback)(bool), std::vector<IonHit> &pointResult);
43 
45 
51 unsigned int computeConvexHull(const std::vector<IonHit> &data, unsigned int *progress,
52  bool (*callback)(bool),std::vector<Point3D> &curHull, bool freeHull);
53 
54 
55 #ifdef DEBUG
56 bool testConvexHull();
57 #endif
58 
59 }
60 
61 #endif
bool callback()
Definition: kd-example.cpp:37
unsigned int GetReducedHullPts(const std::vector< IonHit > &points, float reductionDim, unsigned int *progress, bool(*callback)(bool), std::vector< IonHit > &pointResult)
Obtain a set of points that are a subset of points the convex hull that are at least "reductionDim" a...
Definition: convexHull.cpp:289
unsigned int progress
Definition: kd-example.cpp:26
unsigned int computeConvexHull(const std::vector< IonHit > &data, unsigned int *progress, bool(*callback)(bool), std::vector< Point3D > &curHull, bool freeHull)
Obtain the convex hull of a set of ions.
Definition: convexHull.cpp:149