TexturePort.hpp
1 #pragma once
2 #include <Process/Dataflow/Port.hpp>
3 
4 #include <Dataflow/PortItem.hpp>
5 
6 #include <score_plugin_gfx_export.h>
7 
8 namespace Gfx
9 {
10 class TextureInlet;
11 class TextureOutlet;
12 }
13 UUID_METADATA(, Process::Port, Gfx::TextureInlet, "5ac86198-2d03-4830-9e41-a6d529922d29")
14 UUID_METADATA(
15  , Process::Port, Gfx::TextureOutlet, "f1c71046-b754-49a5-8e66-d01374773dfc")
16 namespace Gfx
17 {
18 
19 class SCORE_PLUGIN_GFX_EXPORT TextureInlet : public Process::Inlet
20 {
21  W_OBJECT(TextureInlet)
22 
23  SCORE_SERIALIZE_FRIENDS
24 public:
25  MODEL_METADATA_IMPL_HPP(TextureInlet)
26  TextureInlet() = delete;
27  ~TextureInlet() override;
28  TextureInlet(const TextureInlet&) = delete;
29  TextureInlet(Id<Process::Port> c, QObject* parent);
30 
31  TextureInlet(DataStream::Deserializer& vis, QObject* parent);
32  TextureInlet(JSONObject::Deserializer& vis, QObject* parent);
33  TextureInlet(DataStream::Deserializer&& vis, QObject* parent);
34  TextureInlet(JSONObject::Deserializer&& vis, QObject* parent);
35 
36  VIRTUAL_CONSTEXPR Process::PortType type() const noexcept override
37  {
38  return Process::PortType::Texture;
39  }
40 };
41 
42 class SCORE_PLUGIN_GFX_EXPORT TextureOutlet : public Process::Outlet
43 {
44  W_OBJECT(TextureOutlet)
45 
46  SCORE_SERIALIZE_FRIENDS
47 public:
48  MODEL_METADATA_IMPL_HPP(TextureOutlet)
49  TextureOutlet() = delete;
50  ~TextureOutlet() override;
51  TextureOutlet(const TextureOutlet&) = delete;
52  TextureOutlet(Id<Process::Port> c, QObject* parent);
53 
54  TextureOutlet(DataStream::Deserializer& vis, QObject* parent);
55  TextureOutlet(JSONObject::Deserializer& vis, QObject* parent);
56  TextureOutlet(DataStream::Deserializer&& vis, QObject* parent);
57  TextureOutlet(JSONObject::Deserializer&& vis, QObject* parent);
58 
59  VIRTUAL_CONSTEXPR Process::PortType type() const noexcept override
60  {
61  return Process::PortType::Texture;
62  }
63 
64  int nodeId{-1};
65 };
66 
67 struct TextureInletFactory final : public Dataflow::AutomatablePortFactory
68 {
69  using Model_T = TextureInlet;
70  UuidKey<Process::Port> concreteKey() const noexcept override
71  {
73  }
74 
75  Model_T* load(const VisitorVariant& vis, QObject* parent) override
76  {
77  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
78  return new Model_T{deserializer, parent};
79  });
80  }
81 
82  void setupInletInspector(
83  const Process::Inlet& port, const score::DocumentContext& ctx, QWidget* parent,
84  Inspector::Layout& lay, QObject* context) override;
85 };
86 
87 struct TextureOutletFactory final : public Dataflow::AutomatablePortFactory
88 {
89  using Model_T = TextureOutlet;
90  UuidKey<Process::Port> concreteKey() const noexcept override
91  {
93  }
94 
95  Model_T* load(const VisitorVariant& vis, QObject* parent) override
96  {
97  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
98  return new Model_T{deserializer, parent};
99  });
100  }
101 
102  void setupOutletInspector(
103  const Process::Outlet& port, const score::DocumentContext& ctx, QWidget* parent,
104  Inspector::Layout& lay, QObject* context) override;
105 };
106 }
107 
108 namespace Gfx
109 {
110 class GeometryInlet;
111 class GeometryOutlet;
112 }
113 UUID_METADATA(
114  , Process::Port, Gfx::GeometryInlet, "f2ab26ea-415d-45a2-bfbc-2968c7c92a33")
115 UUID_METADATA(
116  , Process::Port, Gfx::GeometryOutlet, "848061c5-e8a0-4a13-9985-e8df30ce6d4f")
117 namespace Gfx
118 {
119 
120 class SCORE_PLUGIN_GFX_EXPORT GeometryInlet : public Process::Inlet
121 {
122  W_OBJECT(GeometryInlet)
123 
124  SCORE_SERIALIZE_FRIENDS
125 public:
126  MODEL_METADATA_IMPL_HPP(GeometryInlet)
127  GeometryInlet() = delete;
128  ~GeometryInlet() override;
129  GeometryInlet(const GeometryInlet&) = delete;
130  GeometryInlet(Id<Process::Port> c, QObject* parent);
131 
132  GeometryInlet(DataStream::Deserializer& vis, QObject* parent);
133  GeometryInlet(JSONObject::Deserializer& vis, QObject* parent);
134  GeometryInlet(DataStream::Deserializer&& vis, QObject* parent);
135  GeometryInlet(JSONObject::Deserializer&& vis, QObject* parent);
136 
137  VIRTUAL_CONSTEXPR Process::PortType type() const noexcept override
138  {
139  return Process::PortType::Geometry;
140  }
141 };
142 
143 class SCORE_PLUGIN_GFX_EXPORT GeometryOutlet : public Process::Outlet
144 {
145  W_OBJECT(GeometryOutlet)
146 
147  SCORE_SERIALIZE_FRIENDS
148 public:
149  MODEL_METADATA_IMPL_HPP(GeometryOutlet)
150  GeometryOutlet() = delete;
151  ~GeometryOutlet() override;
152  GeometryOutlet(const GeometryOutlet&) = delete;
153  GeometryOutlet(Id<Process::Port> c, QObject* parent);
154 
155  GeometryOutlet(DataStream::Deserializer& vis, QObject* parent);
156  GeometryOutlet(JSONObject::Deserializer& vis, QObject* parent);
157  GeometryOutlet(DataStream::Deserializer&& vis, QObject* parent);
158  GeometryOutlet(JSONObject::Deserializer&& vis, QObject* parent);
159 
160  VIRTUAL_CONSTEXPR Process::PortType type() const noexcept override
161  {
162  return Process::PortType::Geometry;
163  }
164 };
165 
167 {
168  using Model_T = GeometryInlet;
169  UuidKey<Process::Port> concreteKey() const noexcept override
170  {
172  }
173 
174  Model_T* load(const VisitorVariant& vis, QObject* parent) override
175  {
176  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
177  return new Model_T{deserializer, parent};
178  });
179  }
180 };
181 
183 {
184  using Model_T = GeometryOutlet;
185  UuidKey<Process::Port> concreteKey() const noexcept override
186  {
188  }
189 
190  Model_T* load(const VisitorVariant& vis, QObject* parent) override
191  {
192  return score::deserialize_dyn(vis, [&](auto&& deserializer) {
193  return new Model_T{deserializer, parent};
194  });
195  }
196 };
197 }
Definition: DataStreamVisitor.hpp:202
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:38
Definition: TexturePort.hpp:121
Definition: TexturePort.hpp:144
Definition: lib/score/widgets/Layout.hpp:29
Definition: JSONVisitor.hpp:423
Definition: score-lib-process/Process/Dataflow/Port.hpp:176
Definition: score-lib-process/Process/Dataflow/Port.hpp:264
Definition: score-lib-process/Process/Dataflow/Port.hpp:102
Definition: UuidKey.hpp:343
The id_base_t class.
Definition: Identifier.hpp:57
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: TexturePort.hpp:167
Definition: TexturePort.hpp:183
Static metadata implementation.
Definition: lib/score/tools/Metadata.hpp:36
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: DocumentContext.hpp:18