Tulip  4.2.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 <QtGui/QMouseEvent>
25 #include <QtGui/QWidget>
26 #include <QtGui/QTableView>
27 #include <QtGui/QGraphicsProxyWidget>
28 #include <tulip/ViewWidget.h>
29 #include <tulip/GlScene.h>
30 
31 #include <tulip/InteractorComposite.h>
32 
33 namespace tlp {
34 
35 class View;
36 /**
37  * We define a specific interactor to show element graph infos in eltProperties
38  */
39 class TLP_QT_SCOPE MouseShowElementInfos : public InteractorComponent {
40 public:
41  MouseShowElementInfos();
42  virtual bool eventFilter(QObject* widget, QEvent* e);
43 
44  void viewChanged(View *);
45 
46  void clear();
47 
48  virtual bool pick(int x, int y, SelectedEntity &selectedEntity);
49 
50 protected:
51 
52  ViewWidget *_view;
53  QWidget *_informationsWidget;
54  QGraphicsProxyWidget *_informationsWidgetItem;
55 
56  QTableView* tableView() const;
57 
58  /**
59  * @brief buildModel create and returns the model to visualize edit elements parameters.
60  * @param elementType the type of the element can be NODE or EDGE
61  * @param elementId elementId the id of the element
62  * @param parent the parent for the model creation.
63  * @return
64  */
65  virtual QAbstractItemModel* buildModel(ElementType elementType, unsigned int elementId, QObject *parent)const;
66  /**
67  * @brief elementName returns the title of the element.
68  * @param elementType the type of the element can be NODE or EDGE
69  * @param elementId the id of the element
70  * @return
71  */
72  virtual QString elementName(ElementType elementType, unsigned int elementId)const;
73 };
74 
75 }
76 
77 
78 
79 #endif
80 ///@endcond