BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
NodeEditor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/NodeEditor.h
6 //! @brief Defines class NodeEditor
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_NODEEDITOR_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_NODEEDITOR_H
17 
18 /*
19  * Node editor: original code is taken from
20  * http://algoholic.eu/qnodeseditor-qt-nodesports-based-data-processing-flow-editor/
21  * Copyright (c) 2012, STANISLAW ADASZEWSKI
22  */
23 
24 #include <QObject>
25 
26 class QGraphicsScene;
28 class QGraphicsItem;
29 class QPointF;
30 class QGraphicsSceneMouseEvent;
31 
32 //! The NodeEditor class implement for QGraphicsScene an editable schematic
33 //! of the dependency graph, displaying nodes and the connections between their
34 //! attributes
35 class NodeEditor : public QObject {
36  Q_OBJECT
37 
38 public:
39  explicit NodeEditor(QObject* parent = 0);
40 
41  void install(QGraphicsScene* scene);
42 
43  bool eventFilter(QObject* object, QEvent* event);
44 
45 signals:
48 
49 private:
50  QGraphicsItem* itemAt(const QPointF&);
51 
52 private:
53  bool processMousePress(QGraphicsSceneMouseEvent* event);
54  bool processMouseMove(QGraphicsSceneMouseEvent* event);
55  bool processMouseRelease(QGraphicsSceneMouseEvent* event);
56 
57  QGraphicsScene* m_scene;
59 };
60 
61 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_NODEEDITOR_H
The NodeEditor class implement for QGraphicsScene an editable schematic of the dependency graph,...
Definition: NodeEditor.h:35
QGraphicsItem * itemAt(const QPointF &)
Definition: NodeEditor.cpp:31
bool processMousePress(QGraphicsSceneMouseEvent *event)
Definition: NodeEditor.cpp:60
bool eventFilter(QObject *object, QEvent *event)
Definition: NodeEditor.cpp:42
void connectionIsEstablished(NodeEditorConnection *)
NodeEditorConnection * m_conn
Definition: NodeEditor.h:58
NodeEditor(QObject *parent=0)
Definition: NodeEditor.cpp:23
bool processMouseRelease(QGraphicsSceneMouseEvent *event)
Definition: NodeEditor.cpp:92
void install(QGraphicsScene *scene)
Definition: NodeEditor.cpp:25
QGraphicsScene * m_scene
Definition: NodeEditor.h:57
bool processMouseMove(QGraphicsSceneMouseEvent *event)
Definition: NodeEditor.cpp:80
void selectionModeChangeRequest(int)