PeriDyno 1.2.1
Loading...
Searching...
No Matches
WtNodeFlowScene.h
Go to the documentation of this file.
1#pragma once
2
3#include "WtFlowScene.h"
4#include "WtNodeData.hpp"
5#include "WtNodeWidget.h"
6
7#include "SceneGraphFactory.h"
8#include "SceneGraph.h"
9#include "FBase.h"
10#include "Action.h"
12#include "AutoLayoutDAG.h"
13
15
17{
18public:
19 WtNodeFlowScene(std::shared_ptr<WtDataModelRegistry> registry, Wt::WPainter* painter);
20 WtNodeFlowScene(Wt::WPainter* painter, std::shared_ptr<dyno::SceneGraph> scene, int selectType, int selectNum);
22
23 void addNode(WtNode& n);
24
25 void addNodeByString(std::string NodeName);
26
27 void enableEditing();
28 void disableEditing();
29
30 void setDx(float dx) { mDx = dx; }
31 void setDy(float dy) { mDy = dy; }
32
33 float dx() { return mDx; }
34 float dy() { return mDy; }
35
36
37public:
42
47
48 void fieldUpdated(dyno::FBase* field, int status);
49
50 void createWtNode(std::shared_ptr<dyno::Node> node);
51
52 void enableRendering(WtNode& n, bool checked);
53
54 void enablePhysics(WtNode& n, bool checked);
55
56 void showContextMenu(WtNode& n, const Wt::WPointF& pos);
57
58 void showHelper(WtNode& n);
59
63 void reorderAllNodes();
64
65 //std::map<dyno::ObjectId, WtNode*> getNodeMap();
66
67private:
68 void showThisNodeOnly(WtNode& n);
69 void showAllNodes();
70
72 void activateAllNodes();
73
74 void autoSyncAllNodes(bool autoSync);
75
76 void autoSyncAllDescendants(WtNode& n, bool autoSync);
77private:
78 SceneGraph* m_scene = nullptr;
79
80 bool mEditingEnabled = true;
81
82 Wt::WPainter* _painter;
83
84 float mDx = 100.0f;
85 float mDy = 50.0f;
86
87 std::shared_ptr<dyno::SceneGraph> mScene = nullptr;
88
89 //std::map<dyno::ObjectId, WtNode*> OutNodeMap;
90
93
95 Wt::WPointF _mousePoint = Wt::WPointF(0, 0);
96};
WtDataModelRegistry & registry() const
void enableRendering(WtNode &n, bool checked)
Wt::WPainter * _painter
void fieldUpdated(dyno::FBase *field, int status)
void addNode(WtNode &n)
void showContextMenu(WtNode &n, const Wt::WPointF &pos)
void autoSyncAllDescendants(WtNode &n, bool autoSync)
void enablePhysics(WtNode &n, bool checked)
std::shared_ptr< dyno::SceneGraph > mScene
void addNodeByString(std::string NodeName)
void updateNodeGraphView()
Update the view only for the active scene graph, the data model will not be changed.
void autoSyncAllNodes(bool autoSync)
Wt::WPointF _mousePoint
void createNodeGraphView()
create a QT-based view for the active scene graph.
void showThisNodeOnly(WtNode &n)
void createWtNode(std::shared_ptr< dyno::Node > node)
void activateThisNodeOnly(WtNode &n)
SceneGraph * m_scene
void setDx(float dx)
void showHelper(WtNode &n)
WtNodeFlowScene(std::shared_ptr< WtDataModelRegistry > registry, Wt::WPainter *painter)
void setDy(float dy)