Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
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
30class QDragEnterEvent;
31class QGraphicsObject;
32class QPropertyAnimation;
33class QGraphicsProxyWidget;
34class QGraphicsRectItem;
35class QMimeData;
36class QVBoxLayout;
37
38namespace Ui {
39class WorkspacePanel;
40}
41
42namespace tlp {
43class Graph;
44class View;
45class Interactor;
46class GraphHierarchiesModel;
47class InteractorConfigWidget;
48
49class 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
64public:
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
73public 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
83signals:
84 void drawNeeded();
85 void swapWithPanels(WorkspacePanel *panel);
86 void changeGraphSynchronization(bool);
87
88protected 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
102protected:
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