1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef XGUI_ColorDialog_H
22 #define XGUI_ColorDialog_H
33 * A class of dialog to chose a color. The color can be set in two ways: use a random value or
34 * a certain color. There is a radio button to provide this choice. The color button is
35 * visualized to select a certain color.
37 class XGUI_ColorDialog : public QDialog
42 /// \param theParent a parent widget for the dialog
43 XGUI_EXPORT XGUI_ColorDialog(QWidget* theParent);
45 XGUI_EXPORT virtual ~XGUI_ColorDialog() {};
47 /// Returns whether the random state of color is chosen
48 /// \return a boolean value
49 bool isRandomColor() const;
51 /// Initializes the dialog with the given value. Set choice on certain value and fill it by.
52 /// \param theValue an RGB components value
53 void setColor(const std::vector<int>& theValue);
55 /// Returns a container with the current color value.
56 /// These are tree int values for RGB definition.
57 /// These value is depend on the random choice and eighter
58 /// a next random color or a certain color.
59 /// \return a vector of values
60 std::vector<int> getColor() const;
62 /// Returns a container with the current color value.
63 /// These are tree int values for RGB definition.
64 /// It returns the next random color.
65 /// \return a vector of values
66 std::vector<int> getRandomColor() const;
69 QButtonGroup* myButtonGroup; /// a group, contained random and certain color radio button choice
70 QtxColorButton* myColorButton; /// a control to select a color