DefaultEffectItem.hpp
1 #pragma once
2 #include <score/graphics/RectItem.hpp>
3 #include <score/model/Identifier.hpp>
4 
5 #include <score_lib_process_export.h>
6 
7 #include <vector>
8 namespace score
9 {
10 class GraphicsLayout;
11 }
12 namespace Dataflow
13 {
14 class PortItem;
15 }
16 namespace Process
17 {
18 class ProcessModel;
19 class PortFactoryList;
20 struct Context;
21 class ControlInlet;
22 class ControlOutlet;
23 class Port;
24 
25 class SCORE_LIB_PROCESS_EXPORT DefaultEffectItem final : public score::EmptyRectItem
26 {
27 public:
29  const Process::ProcessModel& effect, const Process::Context& doc,
30  QGraphicsItem* root);
32 
33  void
34  setupInlet(Process::ControlInlet& inlet, const Process::PortFactoryList& portFactory);
35  void setupOutlet(
36  Process::ControlOutlet& inlet, const Process::PortFactoryList& portFactory);
37 
38 private:
39  template <typename T>
40  void setupPort(T& port, const Process::PortFactoryList& portFactory);
41 
42  void reset();
43  void recreate();
44  void updateRect();
45 
46  score::GraphicsLayout* m_layout{};
47  const Process::ProcessModel& m_effect;
48  const Process::Context& m_ctx;
49 
50  bool m_needRecreate{};
51 };
52 }
Definition: QmlObjects.hpp:114
Definition: Port.hpp:203
Definition: Port.hpp:425
Definition: DefaultEffectItem.hpp:26
Definition: PortFactory.hpp:74
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: RectItem.hpp:64
Definition: GraphicsLayout.hpp:8
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: ProcessContext.hpp:12