Tulip  5.2.1
Large graphs analysis and drawing
WorkspacePanel.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef WORKSPACEPANEL_H
22 #define WORKSPACEPANEL_H
23 
24 #include <QFrame>
25 #include <QAction>
26 
27 #include <tulip/tulipconf.h>
28 
29 class QDragEnterEvent;
30 class QGraphicsObject;
31 class QPropertyAnimation;
32 class QGraphicsProxyWidget;
33 class QGraphicsRectItem;
34 class QMimeData;
35 
36 namespace Ui {
37 class WorkspacePanel;
38 }
39 
40 namespace tlp {
41 class Graph;
42 class View;
43 class Interactor;
44 class GraphHierarchiesModel;
45 
46 class TLP_QT_SCOPE WorkspacePanel : public QFrame {
47  Q_OBJECT
48 
49  Ui::WorkspacePanel *_ui;
50  tlp::View *_view;
51  QString _viewName;
52  QMap<QAction *, QWidget *> _actionTriggers;
53  QGraphicsRectItem *_overlayRect;
54 
55  QGraphicsProxyWidget *_viewConfigurationWidgets;
56  bool _viewConfigurationExpanded;
57  QGraphicsProxyWidget *_currentInteractorConfigurationItem;
58 
59  QPointF configurationTabPosition(bool expanded) const;
60  void setConfigurationTabExpanded(bool expanded, bool animate = true);
61 
62 public:
63  explicit WorkspacePanel(tlp::View *view, QWidget *parent = nullptr);
64  ~WorkspacePanel() override;
65 
66  bool eventFilter(QObject *, QEvent *) override;
67 
68  tlp::View *view() const;
69  QString viewName() const;
70 
71 public slots:
72  void setView(tlp::View *view);
73  void setCurrentInteractor(tlp::Interactor *);
74  void setGraphsModel(tlp::GraphHierarchiesModel *);
75  void viewGraphSet(tlp::Graph *);
76  void setOverlayMode(bool);
77  void setHighlightMode(bool);
78  bool isGraphSynchronized() const;
79 
80 signals:
81  void drawNeeded();
82  void swapWithPanels(WorkspacePanel *panel);
83  void changeGraphSynchronization(bool);
84 
85 protected slots:
86  void hideConfigurationTab();
87  void interactorActionTriggered();
88  void viewDestroyed();
89  void graphComboIndexChanged();
90  void setCurrentInteractorConfigurationVisible(bool);
91  void actionChanged();
92 
93  void scrollInteractorsRight();
94  void scrollInteractorsLeft();
95  void resetInteractorsScrollButtonsVisibility();
96  void refreshInteractorsToolbar();
97  void toggleSynchronization(bool);
98 
99 protected:
100  void resizeEvent(QResizeEvent *) override;
101 
102  void dragEnterEvent(QDragEnterEvent *) override;
103  void dropEvent(QDropEvent *) override;
104  void dragLeaveEvent(QDragLeaveEvent *) override;
105 
106  bool handleDragEnterEvent(QEvent *e, const QMimeData *mimedata);
107  bool handleDropEvent(const QMimeData *mimedata);
108 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
109  void showEvent(QShowEvent *event) override;
110 #endif
111  void closeEvent(QCloseEvent *event) override;
112 };
113 } // namespace tlp
114 
115 #endif // WORKSPACEPANEL_H
116 ///@endcond
Interactor provides a way to handle user inputs over a view. Basically, The interactor class is an ov...
Definition: Interactor.h:61
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
Definition: View.h:90