Tulip  5.7.4
Large graphs analysis and drawing
WorkspacePanel.h
1 /*
2  *
3  * This file is part of Tulip (https://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  void showConfigurationTab(QString tabName);
82 
83 signals:
84  void drawNeeded();
85  void swapWithPanels(WorkspacePanel *panel);
86  void changeGraphSynchronization(bool);
87 
88 protected slots:
89  void hideConfigurationTab();
90  void interactorActionTriggered();
91  void viewDestroyed();
92  void graphComboIndexChanged();
93  void setCurrentInteractorConfigurationVisible(bool);
94  void actionChanged();
95 
96  void scrollInteractorsRight();
97  void scrollInteractorsLeft();
98  void resetInteractorsScrollButtonsVisibility();
99  void refreshInteractorsToolbar();
100  void toggleSynchronization(bool);
101 
102 protected:
103  void resizeEvent(QResizeEvent *) override;
104 
105  void dragEnterEvent(QDragEnterEvent *) override;
106  void dropEvent(QDropEvent *) override;
107  void dragLeaveEvent(QDragLeaveEvent *) override;
108 
109  bool handleDragEnterEvent(QEvent *e, const QMimeData *mimedata);
110  bool handleDropEvent(const QMimeData *mimedata);
111  void showEvent(QShowEvent *event) override;
112  void closeEvent(QCloseEvent *event) override;
113 };
114 
115 } // namespace tlp
116 
117 #endif // WORKSPACEPANEL_H
118 ///@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:95