Tulip  5.2.1
Large graphs analysis and drawing
ViewToolTipAndUrlManager.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 VIEW_TOOLTIP_AND_URL_MANAGER_H
22 #define VIEW_TOOLTIP_AND_URL_MANAGER_H
23 
24 #include <QMenu>
25 
26 #include <tulip/View.h>
27 #include <tulip/DataSet.h>
28 #include <tulip/GlMainWidget.h>
29 
30 namespace tlp {
31 
32 class TLP_QT_SCOPE ViewToolTipAndUrlManager : public QObject {
33  Q_OBJECT
34 
35  View *_view;
36  GlMainWidget *_glMainWidget;
37  bool _tooltips;
38  std::string _urlPropName;
39  std::string _url, _contextMenuUrl;
40 
41 public:
42  ViewToolTipAndUrlManager(tlp::View *view, tlp::GlMainWidget *widget);
43 
44  // the functions below must be called by the associated view
45  // when overloading the View class corresponding methods
46  void setState(const tlp::DataSet &);
47  void state(tlp::DataSet &) const;
48  void fillContextMenu(QMenu *menu);
49  void fillContextMenu(QMenu *menu, node n);
50  void fillContextMenu(QMenu *menu, edge e);
51 
52 protected slots:
53  void displayToolTips(bool display);
54  void setUrlProp(QAction *);
55  void openUrl();
56 
57 protected:
58  bool eventFilter(QObject *, QEvent *e) override;
59 };
60 } // namespace tlp
61 
62 #endif /* VIEW_TOOLTIP_AND_URL_MANAGER_H */
63 
64 ///@endcond
A container that can store data from any type.
Definition: DataSet.h:189
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph...
Definition: View.h:90
This widget provide a simple system to visualize data/graph with OpenGL 3D engine.
Definition: GlMainWidget.h:66