Salome HOME
6dbee367efcd52c34d6bd7c510e412e7054cf612
[modules/shaper.git] / src / XGUI / XGUI_ColorDialog.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        XGUI_ColorDialog.hxx
4 // Created:     27 Apr 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef XGUI_ColorDialog_H
8 #define XGUI_ColorDialog_H
9
10 #include "XGUI.h"
11
12 #include <QDialog>
13
14 class QButtonGroup;
15 class QtxColorButton;
16
17 /**
18 * \ingroup GUI
19 * A class of dialog to chose a color. The color can be set in two ways: use a random value or
20 * a certain color. There is a radio button to provide this choice. The color button is 
21 * visualized to select a certain color.
22 */ 
23 class XGUI_ColorDialog : public QDialog
24 {
25   Q_OBJECT
26 public:
27   /// Constructor
28   /// \param theParent a parent widget for the dialog
29   XGUI_EXPORT XGUI_ColorDialog(QWidget* theParent);
30
31   XGUI_EXPORT virtual ~XGUI_ColorDialog() {};
32
33   /// Returns whether the random state of color is chosen
34   /// \return a boolean value
35   bool isRandomColor() const;
36
37   /// Initializes the dialog with the given value. Set choice on certain value and fill it by.
38   /// \param theValue an RGB components value
39   void setColor(const std::vector<int>& theValue);
40
41   /// Returns a container with the current color value. 
42   /// These are tree int values for RGB definition.
43   /// These value is depend on the random choice and eighter 
44   /// a next random color or a certain color.
45   /// \return a vector of values
46   std::vector<int> getColor() const;
47
48   /// Returns a container with the current color value. 
49   /// These are tree int values for RGB definition.
50   /// It returns the next random color.
51   /// \return a vector of values
52   std::vector<int> getRandomColor() const;
53
54 private:
55   QButtonGroup* myButtonGroup; /// a group, contained random and certain color radio button choice
56   QtxColorButton* myColorButton; /// a control to select a color
57 };
58
59 #endif