-
Notifications
You must be signed in to change notification settings - Fork 1
/
AllConfigs.hpp
52 lines (41 loc) · 1.42 KB
/
AllConfigs.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
45
46
47
48
49
50
51
52
/**
* 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/Cube.hpp"
#include "marching-cubes/Triangle.hpp"
#include "utils/TinyVector.hpp"
namespace marchingcubes {
constexpr const std::size_t CONFIGS_COUNT = 256;
/*!
* \class TriangleOnCubeEdges
* \brief The alias TriangleOnCubeEdges represents the edges that contain
* the vertices of a triangle used to approximate the isosurface within a cube.
*/
using TriangleOnCubeEdges =
utils::TinyArray<cube::Edge, cube::ONE_EDGE_SIZE, triangle::POINT_COUNT>;
constexpr auto OneTriangleOnCubeEdgesSize =
cube::ONE_EDGE_SIZE * triangle::POINT_COUNT;
/*!
* \class TrianglesOnCubeEdges
* \brief The alias TrianglesOnCubeEdges represents the triangles
* that approximate the isosurface within a cube.
*/
using TrianglesOnCubeEdges =
utils::TinyVector<TriangleOnCubeEdges, OneTriangleOnCubeEdgesSize>;
/*!
* \class AllConfigs
* \brief The class AllConfigs contains all 256 cube configurations and the
* triangles approximating the isosurface within the corresponding cube.
*/
class AllConfigs {
public:
AllConfigs(const std::array<TrianglesOnCubeEdges, CONFIGS_COUNT> &triangles);
public:
const std::array<TrianglesOnCubeEdges, CONFIGS_COUNT> triangles;
};
} // namespace marchingcubes