Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GraphEditorWindow.hpp
1#pragma once
2#include <Dataflow/RaDataflow.hpp>
3
4// include first for qt/gl include order
5#include <Gui/RaGui.hpp>
6
7#include <QMainWindow>
8#include <QtWidgets>
9
10#include <Dataflow/Core/DataflowGraph.hpp>
11#include <Dataflow/QtGui/GraphEditor/GraphModel.hpp>
12
13namespace Ra {
14namespace Dataflow {
15namespace QtGui {
16namespace GraphEditor {
17
18using namespace Ra::Dataflow::Core;
19
30class RA_DATAFLOW_GUI_API GraphEditorWindow : public QMainWindow
31{
32 Q_OBJECT
33 public:
34 explicit GraphEditorWindow( std::shared_ptr<DataflowGraph> graph = nullptr );
36
37 void loadFile( const QString& fileName );
38 std::shared_ptr<GraphModel> graph_model() { return m_graph_model; }
39
40 signals:
41 void needUpdate();
42
43 protected:
44 void closeEvent( QCloseEvent* event ) override;
45
46 private slots:
47 void newFile();
48 void open();
49 bool save();
50 bool saveAs();
51 void about();
52 void documentWasModified();
53 void add_node( QTreeWidgetItem* item, int column );
54 void node_editor( std::shared_ptr<Node> node );
55 void node_dialog( QtNodes::NodeId node_id );
56
57 private:
58 void createActions();
59 void createStatusBar();
60 void readSettings();
61 void writeSettings();
62 bool maybeSave();
63 bool saveFile( const QString& fileName );
64 void setCurrentFile( const QString& fileName );
65 QString strippedName( const QString& fullFileName );
66
67 std::shared_ptr<DataflowGraph> m_graph { nullptr };
68 std::shared_ptr<GraphModel> m_graph_model { nullptr };
69
70 QtNodes::BasicGraphicsScene* m_scene { nullptr };
71 QtNodes::GraphicsView* m_view { nullptr };
72
73 QString m_curFile { "" };
74
75 QMenu* viewMenu { nullptr };
76};
77
78} // namespace GraphEditor
79} // namespace QtGui
80} // namespace Dataflow
81} // namespace Ra
Window widget to edit a DataflowGraph. This class wraps DataflowGraph, GraphModel,...
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:4