Tulip  5.3.0
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 #include <QDialog>
27 
28 #include <tulip/tulipconf.h>
29 
30 class QDragEnterEvent;
31 class QGraphicsObject;
32 class QPropertyAnimation;
33 class QGraphicsProxyWidget;
34 class QGraphicsRectItem;
35 class QMimeData;
36 class QVBoxLayout;
37 
38 namespace Ui {
39 class WorkspacePanel;
40 }
41 
42 namespace tlp {
43 class Graph;
44 class View;
45 class Interactor;
46 class GraphHierarchiesModel;
47 class InteractorConfigWidget;
48 
49 class TLP_QT_SCOPE WorkspacePanel : public QFrame {
50  Q_OBJECT
51 
52  Ui::WorkspacePanel *_ui;
53  InteractorConfigWidget *_interactorConfigWidget;
54  tlp::View *_view;
55  QMap<QAction *, QWidget *> _actionTriggers;
56  QGraphicsRectItem *_overlayRect;
57 
58  QGraphicsProxyWidget *_viewConfigurationWidgets;
59  bool _viewConfigurationExpanded;
60 
61  QPointF configurationTabPosition(bool expanded) const;
62  void setConfigurationTabExpanded(bool expanded, bool animate = true);
63 
64 public:
65  explicit WorkspacePanel(tlp::View *view, QWidget *parent = nullptr);
66  ~WorkspacePanel() override;
67 
68  bool eventFilter(QObject *, QEvent *) override;
69 
70  tlp::View *view() const;
71  QString viewName() const;
72 
73 public slots:
74  void setView(tlp::View *view);
75  void setCurrentInteractor(tlp::Interactor *);
76  void setGraphsModel(tlp::GraphHierarchiesModel *);
77  void viewGraphSet(tlp::Graph *);
78  void setOverlayMode(bool);
79  void setHighlightMode(bool);
80  bool isGraphSynchronized() const;
81 
82 signals:
83  void drawNeeded();
84  void swapWithPanels(WorkspacePanel *panel);
85  void changeGraphSynchronization(bool);
86 
87 protected slots:
88  void hideConfigurationTab();
89  void interactorActionTriggered();
90  void viewDestroyed();
91  void graphComboIndexChanged();
92  void setCurrentInteractorConfigurationVisible(bool);
93  void actionChanged();
94 
95  void scrollInteractorsRight();
96  void scrollInteractorsLeft();
97  void resetInteractorsScrollButtonsVisibility();
98  void refreshInteractorsToolbar();
99  void toggleSynchronization(bool);
100 
101 protected:
102  void resizeEvent(QResizeEvent *) override;
103 
104  void dragEnterEvent(QDragEnterEvent *) override;
105  void dropEvent(QDropEvent *) override;
106  void dragLeaveEvent(QDragLeaveEvent *) override;
107 
108  bool handleDragEnterEvent(QEvent *e, const QMimeData *mimedata);
109  bool handleDropEvent(const QMimeData *mimedata);
110  void showEvent(QShowEvent *event) override;
111  void closeEvent(QCloseEvent *event) override;
112 };
113 
114 } // namespace tlp
115 
116 #endif // WORKSPACEPANEL_H
117 ///@endcond
Interactor provides a way to handle user inputs over a view. Basically, The interactor class is an ov...
Definition: Interactor.h:62
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
Definition: View.h:92