Loading...
Searching...
No Matches
PCLToGeometry.hpp
1#pragma once
2
3#include <ossia/detail/pod_vector.hpp>
4
5#include <boost/container/vector.hpp>
6
7#include <Threedim/TinyObj.hpp>
8#include <halp/buffer.hpp>
9#include <halp/controls.hpp>
10#include <halp/geometry.hpp>
11#include <halp/meta.hpp>
12
13namespace halp
14{
15
17{
18 struct buffers
19 {
20 struct
21 {
22 enum
23 {
24 dynamic,
25 vertex
26 };
27 void* handle{};
28 int size{};
29 bool dirty{};
30 } main_buffer;
31 } buffers;
32
33 struct bindings
34 {
35 struct
36 {
37 enum
38 {
39 per_vertex
40 };
41 int stride = 3 * sizeof(float);
42 int step_rate = 1;
43 } position_binding;
44 };
45
47 {
48 struct
49 {
50 enum
51 {
52 position
53 };
54 using datatype = float[3];
55 int32_t offset = 0;
56 int32_t binding = 0;
57 } position;
58 };
59
60 struct
61 {
62 struct
63 {
64 static constexpr auto buffer() { return &buffers::main_buffer; }
65 int offset = 0;
66 } input0;
67 } input;
68
69 int vertices = 0;
70 enum
71 {
72 triangles,
73 counter_clockwise,
74 cull_back
75 };
76};
77
78}
79namespace Threedim
80{
81
83{
84public:
85 halp_meta(name, "Pointcloud to mesh")
86 halp_meta(category, "Visuals/3D")
87 halp_meta(c_name, "pointcloud_to_mesh")
88 halp_meta(manual_url, "https://ossia.io/score-docs/processes/pointcloud-to-mesh.html")
89 halp_meta(uuid, "2450ffbf-04ed-4b42-8848-69f200d2742a")
90
91 struct ins
92 {
93 halp::cpu_buffer_input<"Buffer"> in;
94 PositionControl position;
95 RotationControl rotation;
96 ScaleControl scale;
97 } inputs;
98
99 struct
100 {
101 struct
102 {
103 halp_meta(name, "Geometry");
104 halp::position_color_packed_geometry mesh;
105 float transform[16]{};
106 bool dirty_mesh = false;
107 bool dirty_transform = false;
108 } geometry;
109 } outputs;
110
111 PCLToMesh();
112 void create_mesh(std::span<float> v);
113 void operator()();
114
115 std::vector<float> complete;
116};
117
118
120{
121public:
122 halp_meta(name, "Pointcloud to mesh")
123 halp_meta(category, "Visuals/3D")
124 halp_meta(c_name, "pointcloud_to_mesh")
125 halp_meta(manual_url, "https://ossia.io/score-docs/processes/pointcloud-to-mesh.html")
126 halp_meta(uuid, "2450ffbf-04ed-4b42-8848-69f200d2742a")
127
128 enum BufferType
129 {
130 XYZ,
131 XYZ_RGB,
132 XYZW,
133 XYZW_RGBA
134 };
135 struct ins
136 {
137 halp::gpu_buffer_input<"Buffer"> in;
138 PositionControl position;
139 RotationControl rotation;
140 ScaleControl scale;
141 halp::enum_t<BufferType, "Buffer type"> type;
142 } inputs;
143
144 struct
145 {
146 struct
147 {
148 // Use Noiuse::dynamic_geometry
149 halp_meta(name, "Geometry");
150 halp::dynamic_gpu_geometry mesh;
151 float transform[16]{};
152 bool dirty_mesh = false;
153 bool dirty_transform = false;
154 } geometry;
155 } outputs;
156
157 PCLToMesh2();
158 void operator()();
159};
160}
Definition PCLToGeometry.hpp:120
Definition PCLToGeometry.hpp:83
Definition PCLToGeometry.hpp:136
Definition PCLToGeometry.hpp:92
Definition TinyObj.hpp:64
Definition TinyObj.hpp:69
Definition TinyObj.hpp:73
Definition TinyObj.hpp:19
Definition PCLToGeometry.hpp:47
Definition PCLToGeometry.hpp:34
Definition PCLToGeometry.hpp:19
Definition PCLToGeometry.hpp:17