Tulip  5.0.0
Large graphs analysis and drawing
MouseShowElementInfo.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 _Tulip_MOUSESHOWELEMENTINFO_H
22 #define _Tulip_MOUSESHOWELEMENTINFO_H
23 
24 #include <tulip/InteractorComposite.h>
25 #include <tulip/Graph.h>
26 
27 namespace Ui {
28 class ElementInformationWidget;
29 }
30 
31 class QWidget;
32 class QGraphicsProxyWidget;
33 class QTableView;
34 class QAbstractItemModel;
35 class QObject;
36 
37 namespace tlp {
38 
39 class View;
40 class ViewWidget;
41 class GlMainWidget;
42 struct SelectedEntity;
43 
44 /**
45  * We define a specific interactor to show element graph information in eltProperties
46  */
47 class TLP_QT_SCOPE MouseShowElementInfo : public InteractorComponent {
48 
49  Ui::ElementInformationWidget* _ui;
50 public:
51  MouseShowElementInfo();
52  ~MouseShowElementInfo();
53  virtual bool eventFilter(QObject* widget, QEvent* e);
54 
55  void viewChanged(View *);
56 
57  void clear();
58 
59  virtual bool pick(int x, int y, SelectedEntity &selectedEntity);
60 
61 protected:
62 
63  ViewWidget *_view;
64  QWidget *_informationWidget;
65  QGraphicsProxyWidget *_informationWidgetItem;
66  GlMainWidget* glMainWidget;
67 
68  QTableView* tableView() const;
69 
70  /**
71  * @brief buildModel creates and returns the model to visualize edit element parameters.
72  * @param elementType the type of the element can be NODE or EDGE
73  * @param elementId elementId the id of the element
74  * @param parent the parent for the model creation.
75  * @return
76  */
77  virtual QAbstractItemModel* buildModel(ElementType elementType, unsigned int elementId, QObject *parent)const;
78  /**
79  * @brief elementName returns the title of the element.
80  * @param elementType the type of the element can be NODE or EDGE
81  * @param elementId the id of the element
82  * @return
83  */
84  virtual QString elementName(ElementType elementType, unsigned int elementId)const;
85 };
86 
87 }
88 
89 
90 
91 #endif
92 ///@endcond