Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
MouseShowElementInfos.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 1 and Inria Bordeaux - Sud Ouest
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_MOUSESHOWELEMENTINFOS_H
22 #define _Tulip_MOUSESHOWELEMENTINFOS_H
23 
24 #include <tulip/InteractorComposite.h>
25 #include <tulip/Graph.h>
26 
27 namespace Ui {
28 class ElementInformationsWidget;
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 struct SelectedEntity;
42 
43 /**
44  * We define a specific interactor to show element graph infos in eltProperties
45  */
46 class TLP_QT_SCOPE MouseShowElementInfos : public InteractorComponent {
47 
48  Ui::ElementInformationsWidget* _ui;
49 public:
50  MouseShowElementInfos();
51  ~MouseShowElementInfos();
52  virtual bool eventFilter(QObject* widget, QEvent* e);
53 
54  void viewChanged(View *);
55 
56  void clear();
57 
58  virtual bool pick(int x, int y, SelectedEntity &selectedEntity);
59 
60 protected:
61 
62  ViewWidget *_view;
63  QWidget *_informationsWidget;
64  QGraphicsProxyWidget *_informationsWidgetItem;
65 
66  QTableView* tableView() const;
67 
68  /**
69  * @brief buildModel create and returns the model to visualize edit elements parameters.
70  * @param elementType the type of the element can be NODE or EDGE
71  * @param elementId elementId the id of the element
72  * @param parent the parent for the model creation.
73  * @return
74  */
75  virtual QAbstractItemModel* buildModel(ElementType elementType, unsigned int elementId, QObject *parent)const;
76  /**
77  * @brief elementName returns the title of the element.
78  * @param elementType the type of the element can be NODE or EDGE
79  * @param elementId the id of the element
80  * @return
81  */
82  virtual QString elementName(ElementType elementType, unsigned int elementId)const;
83 };
84 
85 }
86 
87 
88 
89 #endif
90 ///@endcond