Unravel Engine C++ Reference
Loading...
Searching...
No Matches
parametric_path.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_PARAMETRICPATH_HPP
2#define GENERATOR_PARAMETRICPATH_HPP
3
4#include <functional>
5
6#include "edge.hpp"
7#include "path_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_path_t& path);
25
26 const parametric_path_t* path_;
27
28 int i_;
29
30 friend class parametric_path_t;
31 };
32
34 {
35 public:
36 path_vertex_t generate() const;
37 bool done() const noexcept;
38 void next();
39
40 private:
41 explicit vertices_t(const parametric_path_t& path);
42
43 const parametric_path_t* path_;
44
45 int i_;
46
47 friend class parametric_path_t;
48 };
49
53 explicit parametric_path_t(const std::function<path_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<path_vertex_t(double)> eval_;
61
62 int segments_;
63
64 double delta_;
65};
66} // namespace generator
67
68#endif
Path generated by evaluating callback functions at even intervals.
edges_t edges() const noexcept
vertices_t vertices() const noexcept
parametric_path_t(const std::function< path_vertex_t(double)> &eval, int segments=16) noexcept
const segment_list * segments