-
Notifications
You must be signed in to change notification settings - Fork 1
/
MarchingCubes.hpp
44 lines (34 loc) · 1013 Bytes
/
MarchingCubes.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright Marc-Olivier Andrez 2018.
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*/
#pragma once
#include "marching-cubes/Geometry3D.hpp"
#include "marching-cubes/Triangle.hpp"
#include <memory>
#include <vector>
namespace marchingcubes {
class Grid3D;
class Tensor3D;
using Triangle3D = triangle::Type<Point3D>;
/*!
* \class MarchingCubes
* \brief The MarchingCubes class calculates isosurfaces as triangles for a
* given 3D tensor applied on a given 3D grid domain.
*
* Note that this class hides some dependencies by using the private
* implementation idiom.
*/
class MarchingCubes {
public:
MarchingCubes();
~MarchingCubes();
std::vector<Triangle3D> isoSurface(const Grid3D &grid, const Tensor3D &tensor,
double isoValue) const;
private:
const std::unique_ptr<class MarchingCubesImpl> pImpl;
};
} // namespace marchingcubes