libatomprobe
Library for Atom Probe Tomography (APT) computation
isoSurface.h
Go to the documentation of this file.
1 /*
2  * isoSurface.h - Marching cubes implementation
3  * Copyright (C) 2018, D Haley
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 
20 #ifndef ATOMPROBE_ISOSURFACE_H
21 #define ATOMPROBE_ISOSURFACE_H
22 
24 
25 namespace AtomProbe
26 {
28 {
29  public:
30  Point3D p[3];
32 
34  inline Point3D getPoint(unsigned int pos) const { return p[pos];}
35  void getCentroid(Point3D &p) const;
36  void computeACWNormal(Point3D &p) const;
37  void safeComputeACWNormal(Point3D &p) const;
38  float computeArea() const;
39  bool isDegenerate() const;
40 };
41 
43 {
44  size_t p[3];
45 };
46 
47 
48 //Perform marching cube algorithm
49 void marchingCubes(const Voxels<float> &v,float isoValue,
50  std::vector<TriangleWithVertexNorm> &tVec);
51 
52 #ifdef DEBUG
53 bool testIsoSurface();
54 #endif
55 }
56 
57 #endif
void safeComputeACWNormal(Point3D &p) const
Definition: isoSurface.cpp:100
void computeACWNormal(Point3D &p) const
Definition: isoSurface.cpp:89
Template class that stores 3D voxel data.
Definition: voxels.h:106
Point3D getPoint(unsigned int pos) const
Convenience function for python.
Definition: isoSurface.h:34
A 3D point data class storage.
Definition: point3D.h:39
void getCentroid(Point3D &p) const
Definition: isoSurface.cpp:135
void marchingCubes(const Voxels< float > &v, float isoValue, std::vector< TriangleWithVertexNorm > &tVec)
Definition: isoSurface.cpp:494