-
Notifications
You must be signed in to change notification settings - Fork 1
/
ConfigsGenerator.hpp
52 lines (39 loc) · 1.2 KB
/
ConfigsGenerator.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/AllConfigs.hpp"
namespace marchingcubes {
/*!
* \class BaseConfigs
* \brief The class BaseConfigs contains the 15 base cube configurations
* that are used to calculate all 256 cube configurations.
*/
class BaseConfigs {
public:
BaseConfigs();
public:
const std::array<cube::Configuration, 15> configs;
const std::array<TrianglesOnCubeEdges, 15> triangles;
const std::array<std::size_t, 6> startIndicesByTrueValueCount;
};
/*!
* \class ConfigsGenerator
* \brief The class ConfigsGenerator can generate AllConfigs objects that
* contains all 256 cube configurations from the 15 base cube configurations.
*/
class ConfigsGenerator {
public:
ConfigsGenerator(const BaseConfigs baseConfigs);
AllConfigs generateConfigs() const;
cube::Permutation findSimilarConfiguration(cube::Configuration config) const;
public:
const BaseConfigs baseConfigs;
private:
const std::array<cube::Permutation, 48> allowedPermutations;
};
} // namespace marchingcubes