PeriDyno 1.0.0
Loading...
Searching...
No Matches
QtNodeFlowScene.h
Go to the documentation of this file.
1#pragma once
2
3#include "nodes/QFlowScene"
4
5#include "SceneGraph.h"
6#include "FBase.h"
7
8namespace Qt
9{
10
11using dyno::SceneGraph;
12
15 : public QtFlowScene
16{
17 Q_OBJECT
18public:
19
20 QtNodeFlowScene(std::shared_ptr<QtDataModelRegistry> registry,
21 QObject * parent = Q_NULLPTR);
22
23 QtNodeFlowScene(QObject * parent = Q_NULLPTR);
24
26
27 void addNodeByString(std::string NodeName);
28
29 void enableEditing();
30 void disableEditing();
31
32 void setDx(float dx) { mDx = dx; }
33 void setDy(float dy) { mDy = dy; }
34
35 float dx() { return mDx; }
36 float dy() { return mDy; }
37
38public Q_SLOTS:
43
48
49 void fieldUpdated(dyno::FBase* field, int status);
50
51 void addNode(QtNode& n);
52
53 void deleteNode(QtNode& n);
54
55 void moveNode(QtNode& n, const QPointF& newLocation);
56
57 void createQtNode(std::shared_ptr<dyno::Node> node);
58
59 void enableRendering(QtNode& n, bool checked);
60
61 void enablePhysics(QtNode& n, bool checked);
62
63 void showContextMenu(QtNode& n, const QPointF& pos);
64
65 void showHelper(QtNode& n);
66
70 void reorderAllNodes();
71
72private:
73 void showThisNodeOnly(QtNode& n);
74 void showAllNodes();
75
76 void activateThisNodeOnly(QtNode& n);
77 void activateAllNodes();
78
79 void autoSyncAllNodes(bool autoSync);
80
81 void autoSyncAllDescendants(QtNode& n, bool autoSync);
82
83 SceneGraph* m_scene = nullptr;
84
85 bool mEditingEnabled = true;
86
87 float mDx = 100.0f;
88 float mDy = 50.0f;
89};
90
91}
void deleteNode(QtNode &n)
void showHelper(QtNode &n)
void enableRendering(QtNode &n, bool checked)
void createQtNode(std::shared_ptr< dyno::Node > node)
void enablePhysics(QtNode &n, bool checked)
void setDy(float dy)
void autoSyncAllNodes(bool autoSync)
void updateNodeGraphView()
Update the view only for the active scene graph, the data model will not be changed.
void showThisNodeOnly(QtNode &n)
void moveNode(QtNode &n, const QPointF &newLocation)
void addNodeByString(std::string NodeName)
void createNodeGraphView()
create a QT-based view for the active scene graph.
void addNode(QtNode &n)
void setDx(float dx)
void autoSyncAllDescendants(QtNode &n, bool autoSync)
void showContextMenu(QtNode &n, const QPointF &pos)
void activateThisNodeOnly(QtNode &n)
void fieldUpdated(dyno::FBase *field, int status)
QtNodeFlowScene(std::shared_ptr< QtDataModelRegistry > registry, QObject *parent=Q_NULLPTR)