Unravel Engine C++ Reference
Loading...
Searching...
No Matches
teapot_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_TEAPOTMESH_HPP
2#define GENERATOR_TEAPOTMESH_HPP
3
4#include <array>
5#include <memory>
6
7#include "bezier_mesh.hpp"
8#include "mesh_vertex.hpp"
9#include "triangle.hpp"
10#include "utils.hpp"
11
12namespace generator
13{
14
19{
20public:
22 {
23 public:
24 bool done() const noexcept;
25 triangle_t generate() const;
26 void next();
27
28 private:
29 const teapot_mesh_t* mesh_t;
30
31 int index_;
32
33 std::shared_ptr<const bezier_mesh_t<4, 4>> patch_mesh_;
34
36
37 explicit triangles_t(const teapot_mesh_t& mesh) noexcept;
38
39 friend class teapot_mesh_t;
40 };
41
43 {
44 public:
45 bool done() const noexcept;
46 mesh_vertex_t generate() const;
47 void next();
48
49 private:
50 const teapot_mesh_t* mesh_;
51
52 int index_;
53
54 // Needs be a shared_ptr in order to make copy/move not to mess up the
55 // internal pointer in triangles_.
56 std::shared_ptr<const bezier_mesh_t<4, 4>> patch_mesh_;
57
59
60 explicit vertices_t(const teapot_mesh_t& mesh) noexcept;
61
62 friend class teapot_mesh_t;
63 };
64
69 explicit teapot_mesh_t(int segments = 8) noexcept;
70
71 triangles_t triangles() const noexcept;
72
73 vertices_t vertices() const noexcept;
74
75private:
76 int segments_;
77
78 int patch_vertex_count_;
79};
80} // namespace generator
81
82#endif
manifold_type type
vertices_t vertices() const noexcept
triangles_t triangles() const noexcept
teapot_mesh_t(int segments=8) noexcept
const segment_list * segments