Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
CaptionGraphicsItem.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 CAPTIONGRAPHICSITEM_H
22 #define CAPTIONGRAPHICSITEM_H
23 
24 
25 #include <QtGui/QGraphicsItemGroup>
26 //#include <QtGui/QComboBox>
27 #include <QtGui/QPushButton>
28 #include <QtGui/QGraphicsSceneMouseEvent>
29 #include <QtOpenGL/QGLFramebufferObject>
30 #include <tulip/View.h>
31 #include <tulip/Color.h>
32 #include "tulip/CaptionGraphicsSubItems.h"
33 
34 
35 
36 namespace tlp {
37 
38 class GlMainView;
39 
40 class CaptionGraphicsItem : public QObject {
41 
42  Q_OBJECT
43 
44 public:
45 
46  CaptionGraphicsItem(View *view);
47  ~CaptionGraphicsItem();
48 
49  void setType(unsigned int type);
50 
51  void loadConfiguration();
52 
53  void generateColorCaption(const QGradient &activeGradient, const QGradient &hideGradient, const std::string &propertyName, double minValue, double maxValue);
54 
55  void generateSizeCaption(const std::vector< std::pair <double,float> > &metricToSizeFilteredList,const std::string &propertyName, double minValue, double maxValue);
56 
57  CaptionGraphicsBackgroundItem *getCaptionItem() const {
58  return _rondedRectItem;
59  }
60 
61  std::string usedProperty();
62 
63 signals :
64 
65  void filterChanged(float begin, float end);
66  void selectedPropertyChanged(std::string propertyName);
67 
68 protected slots :
69 
70  void filterChangedSlot(float begin, float end);
71  void selectPropertyButtonClicked();
72  void propertySelectedSlot();
73 // void selectedPropertyChangedSlot(const QString &propertyName);
74 
75 private :
76  QString wrappedPropName(const QString& originalName) const;
77 
78  void constructConfigWidget();
79 
80  View *_view;
81 
82  CaptionGraphicsBackgroundItem *_rondedRectItem;
83 
84  QGraphicsProxyWidget *_confPropertySelectionItem;
85  QGraphicsSimpleTextItem *_nodesEdgesTextItem;
86 // QComboBox *_confPropertySelectionWidget;
87  QPushButton* _confPropertySelectionWidget;
88 };
89 
90 }
91 
92 #endif // CAPTIONGRAPHICSITEM_H
93 ///@endcond