PeriDyno 1.2.1
Loading...
Searching...
No Matches
QtModuleFlowScene.h
Go to the documentation of this file.
1#pragma once
2
3#include "nodes/QFlowScene"
4
5#include "Node.h"
6#include "QtNodeWidget.h"
7
8using dyno::Node;
9using dyno::Module;
10using dyno::Pipeline;
11
12namespace Qt
13{
16 : public QtFlowScene
17 {
18 Q_OBJECT
19 public:
20
21 QtModuleFlowScene(std::shared_ptr<QtDataModelRegistry> registry,
22 QObject* parent = Q_NULLPTR);
23
24 QtModuleFlowScene(QObject* parent = Q_NULLPTR, QtNodeWidget* widget = nullptr);
25
26
28
29 public:
30 void enableEditing();
31 void disableEditing();
32
33 Q_SIGNALS:
35
36 public Q_SLOTS:
37 void showModuleFlow(Node* node);
38
40
41 void reorderAllModules();
42
43 void addModule(QtNode& n);
44
45 void deleteModule(QtNode& n);
46
47 void moveModule(QtNode& n, const QPointF& newLocation);
48
49 void showResetPipeline();
50
52
54
56
60 void promoteOutput(QtNode& n, const PortIndex index, const QPointF& pos);
61
62 private:
63 std::shared_ptr<dyno::Node> mNode;
64 std::shared_ptr<dyno::Pipeline> mActivePipeline;
65
66 //A virtual module to store all state variables
67 std::shared_ptr<dyno::Module> mStates = nullptr;
68 std::shared_ptr<dyno::Module> mOutputs = nullptr;
69
70 float mDx = 100.0f;
71 float mDy = 50.0f;
72
75
76 bool mEditingEnabled = true;
77 };
78}
int PortIndex
std::shared_ptr< dyno::Module > mStates
std::shared_ptr< dyno::Pipeline > mActivePipeline
QtModuleFlowScene(std::shared_ptr< QtDataModelRegistry > registry, QObject *parent=Q_NULLPTR)
std::shared_ptr< dyno::Node > mNode
std::shared_ptr< dyno::Module > mOutputs
void moveModule(QtNode &n, const QPointF &newLocation)
void showModuleFlow(Node *node)
void promoteOutput(QtNode &n, const PortIndex index, const QPointF &pos)
The model dictates the number of inputs and outputs for the Node.