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