Unravel Engine C++ Reference
Loading...
Searching...
No Matches
icosahedron_mesh.hpp
Go to the documentation of this file.
1
#ifndef GENERATOR_ICOSAHEDRONMESH_HPP
2
#define GENERATOR_ICOSAHEDRONMESH_HPP
3
4
#include <array>
5
#include <memory>
6
7
#include "
mesh_vertex.hpp
"
8
#include "
triangle.hpp
"
9
#include "
triangle_mesh.hpp
"
10
#include "
utils.hpp
"
11
12
namespace
generator
13
{
14
17
class
icosahedron_mesh_t
18
{
19
public
:
20
class
triangles_t
21
{
22
public
:
23
bool
done
()
const
noexcept
;
24
triangle_t
generate
()
const
;
25
void
next
();
26
27
private
:
28
const
icosahedron_mesh_t
* mesh_;
29
30
int
i_;
31
32
// Needs be a shared_ptr in order to make copy/move not to mess up the
33
// internal pointer in triangles_.
34
std::shared_ptr<const triangle_mesh_t> triangle_mesh_;
35
36
typename
triangle_generator_type<triangle_mesh_t>::type
triangles_;
37
38
explicit
triangles_t
(
const
icosahedron_mesh_t
& mesh);
39
40
friend
class
icosahedron_mesh_t
;
41
};
42
43
class
vertices_t
44
{
45
public
:
46
bool
done
()
const
noexcept
;
47
mesh_vertex_t
generate
()
const
;
48
void
next
();
49
50
private
:
51
const
icosahedron_mesh_t
* mesh_;
52
53
int
i_;
54
55
// Needs be a shared_ptr in order to make copy/move not to mess up the
56
// internal pointer in triangles_.
57
std::shared_ptr<const triangle_mesh_t> triangle_mesh_;
58
59
typename
vertex_generator_type<triangle_mesh_t>::type
vertices_;
60
61
explicit
vertices_t
(
const
icosahedron_mesh_t
& mesh);
62
63
friend
class
icosahedron_mesh_t
;
64
};
65
66
private
:
67
double
radius_;
68
69
int
segments_;
70
71
int
face_vertex_count_;
72
73
public
:
76
icosahedron_mesh_t
(
double
radius = 1.0,
int
segments
= 1);
77
78
triangles_t
triangles
() const noexcept;
79
80
vertices_t
vertices
() const noexcept;
81
};
82
}
// namespace generator
83
84
#endif
generator::icosahedron_mesh_t::triangles_t
Definition
icosahedron_mesh.hpp:21
generator::icosahedron_mesh_t::triangles_t::next
void next()
Definition
icosahedron_mesh.cpp:73
generator::icosahedron_mesh_t::triangles_t::done
bool done() const noexcept
Definition
icosahedron_mesh.cpp:52
generator::icosahedron_mesh_t::triangles_t::generate
triangle_t generate() const
Definition
icosahedron_mesh.cpp:57
generator::icosahedron_mesh_t::vertices_t
Definition
icosahedron_mesh.hpp:44
generator::icosahedron_mesh_t::vertices_t::generate
mesh_vertex_t generate() const
Definition
icosahedron_mesh.cpp:112
generator::icosahedron_mesh_t::vertices_t::done
bool done() const noexcept
Definition
icosahedron_mesh.cpp:107
generator::icosahedron_mesh_t::vertices_t::next
void next()
Definition
icosahedron_mesh.cpp:124
generator::icosahedron_mesh_t
Definition
icosahedron_mesh.hpp:18
generator::icosahedron_mesh_t::vertices
vertices_t vertices() const noexcept
Definition
icosahedron_mesh.cpp:159
generator::icosahedron_mesh_t::icosahedron_mesh_t
icosahedron_mesh_t(double radius=1.0, int segments=1)
Definition
icosahedron_mesh.cpp:147
generator::icosahedron_mesh_t::triangles
triangles_t triangles() const noexcept
Definition
icosahedron_mesh.cpp:154
generator::mesh_vertex_t
Definition
mesh_vertex.hpp:10
generator::triangle_t
Definition
triangle.hpp:10
mesh_vertex.hpp
generator
Definition
any_generator.hpp:7
segments
const segment_list * segments
Definition
text_component.cpp:442
generator::triangle_generator_type::type
void type
Definition
utils.hpp:44
generator::vertex_generator_type::type
void type
Definition
utils.hpp:59
triangle.hpp
triangle_mesh.hpp
utils.hpp
UnravelEngine
UnravelEngine
engine
engine
rendering
generator
icosahedron_mesh.hpp
Generated by
1.12.0