Tulip  4.1.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
ColorScaleWidget.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 
22 #ifndef COLORSCALEWIDGET_H_
23 #define COLORSCALEWIDGET_H_
24 
25 #include <QtGui/QWidget>
26 #include <QtGui/QPainter>
27 
28 #include <tulip/tulipconf.h>
29 
30 namespace tlp {
31 class ColorScale;
32 }
33 /**
34  * @brief Widget used to display and edit color scale.
35  */
36 class TLP_QT_SCOPE ColorScaleWidget : public QWidget {
37 public:
38  ColorScaleWidget(QWidget* parent=NULL);
39  virtual ~ColorScaleWidget();
40 
41  /**
42  * @brief Set the color scale to display.
43  */
44  void setColorScale(tlp::ColorScale *colorScale);
45  tlp::ColorScale* getColorScale()const {
46  return colorScale;
47  }
48 
49  void setOrientation(Qt::Orientation orientation);
50  QSize minimumSizeHint () const;
51  QSize sizeHint () const;
52 protected:
53  void paintEvent ( QPaintEvent * event );
54 
55 private:
56 
57  void paintColorScale(QPainter& painter,const QRect& rect);
58  tlp::ColorScale *colorScale;
59  Qt::Orientation orientation;
60 };
61 
62 #endif /* COLORSCALEWIDGET_H_ */
63 ///@endcond