Tulip  4.8.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
WorkspacePanel.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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=NULL);
64  virtual ~WorkspacePanel();
65 
66  bool eventFilter(QObject *, QEvent *);
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 
101  void resizeEvent(QResizeEvent *);
102 
103  void dragEnterEvent(QDragEnterEvent *);
104  void dropEvent(QDropEvent *);
105  void dragLeaveEvent(QDragLeaveEvent *);
106 
107  bool handleDragEnterEvent(QEvent* e, const QMimeData* mimedata);
108  bool handleDropEvent(const QMimeData* mimedata);
109 
110  void showEvent(QShowEvent *event);
111 
112 };
113 
114 }
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:53
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
Definition: View.h:73