Loading...
Searching...
No Matches
StructureSynth.hpp
1#pragma once
2
3#include <Threedim/TinyObj.hpp>
4#include <boost/container/vector.hpp>
5#include <halp/controls.hpp>
6#include <halp/geometry.hpp>
7#include <halp/meta.hpp>
8#include <ossia/detail/mutex.hpp>
9#include <ossia/detail/pod_vector.hpp>
10
11#include <thread>
12
13namespace Threedim
14{
15
17{
18public:
19 halp_meta(name, "Structure Synth")
20 halp_meta(category, "Visuals/3D")
21 halp_meta(c_name, "structure_synth")
22 halp_meta(manual_url, "https://ossia.io/score-docs/processes/structure-synth.html")
23 halp_meta(uuid, "bb8f3d77-4cfd-44ce-9c43-b64c54a748ab")
24
25 struct ins
26 {
27 struct : halp::lineedit<"Program", "">
28 {
29 halp_meta(language, "eisenscript")
30 // Request a computation according to the currently defined program
31 void update(StrucSynth& g) { g.worker.request(this->value); }
32 } program;
33
34 PositionControl position;
35 RotationControl rotation;
36 ScaleControl scale;
37 struct : halp::impulse_button<"Regenerate">
38 {
39 void update(StrucSynth& g) { g.inputs.program.update(g); }
40 } regen;
41 } inputs;
42
43 struct
44 {
45 struct : halp::mesh
46 {
47 halp_meta(name, "Geometry");
48 halp::position_normals_geometry mesh;
49 } geometry;
50 } outputs;
51
52 void operator()();
53
54 struct worker
55 {
56 std::function<void(std::string)> request;
57
58 // Called back in a worker thread
59 // The returned function will be later applied in this object's processing thread
60 static std::function<void(StrucSynth&)> work(std::string_view s);
61 } worker;
62
63 using float_vec = boost::container::vector<float, ossia::pod_allocator<float>>;
64 float_vec m_vertexData;
65};
66
67}
Definition StructureSynth.hpp:17
Definition TinyObj.hpp:63
Definition TinyObj.hpp:68
Definition TinyObj.hpp:72
Definition StructureSynth.hpp:26
Definition StructureSynth.hpp:55
Definition TinyObj.hpp:18