1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: XGUI_ColorDialog.hxx
4 // Created: 27 Apr 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef XGUI_ColorDialog_H
8 #define XGUI_ColorDialog_H
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.
23 class XGUI_ColorDialog : public QDialog
28 /// \param theParent a parent widget for the dialog
29 XGUI_EXPORT XGUI_ColorDialog(QWidget* theParent);
31 XGUI_EXPORT virtual ~XGUI_ColorDialog() {};
33 /// Returns whether the random state of color is chosen
34 /// \return a boolean value
35 bool isRandomColor() const;
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);
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;
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;
55 QButtonGroup* myButtonGroup; /// a group, contained random and certain color radio button choice
56 QtxColorButton* myColorButton; /// a control to select a color