Unravel Engine C++ Reference
Loading...
Searching...
No Matches
parametric_shape.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_PARAMETRICSHAPE_HPP
2#define GENERATOR_PARAMETRICSHAPE_HPP
3
4#include <functional>
5
6#include "edge.hpp"
7#include "shape_vertex.hpp"
8
9namespace generator
10{
11
14{
15public:
16 class edges_t
17 {
18 public:
19 edge_t generate() const;
20 bool done() const noexcept;
21 void next();
22
23 private:
24 explicit edges_t(const parametric_shape_t& shape);
25
26 const parametric_shape_t* shape_;
27
28 int i_;
29
30 friend class parametric_shape_t;
31 };
32
34 {
35 public:
37 bool done() const noexcept;
38 void next();
39
40 private:
41 explicit vertices_t(const parametric_shape_t& shape);
42
43 const parametric_shape_t* shape_;
44
45 int i_;
46
47 friend class parametric_shape_t;
48 };
49
53 explicit parametric_shape_t(const std::function<shape_vertex_t(double)>& eval, int segments = 16) noexcept;
54
55 edges_t edges() const noexcept;
56
57 vertices_t vertices() const noexcept;
58
59private:
60 std::function<shape_vertex_t(double)> eval_;
61
62 int segments_;
63
64 double delta_;
65};
66} // namespace generator
67
68#endif
A shape with values evaluated using a callback function.
parametric_shape_t(const std::function< shape_vertex_t(double)> &eval, int segments=16) noexcept
edges_t edges() const noexcept
vertices_t vertices() const noexcept
const segment_list * segments