Salome HOME
Constriction type for all sketch entities
[modules/shaper.git] / src / Model / Model_AttributeColor.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_AttributeColor.h
4 // Created:     6 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef MODEL_ATTRIBUTECOLOR_H_
8 #define MODEL_ATTRIBUTECOLOR_H_
9
10 #include <Model.h>
11 #include <ModelAPI_AttributeColor.h>
12
13 #include <TDF_Label.hxx>
14 #include <TDataStd_Integer.hxx>
15
16 #include <string>
17
18 /**\class Model_AttributeColor
19  * \ingroup DataModel
20  * \brief Attribute that contains three integer values which define the color.
21  */
22
23 class Model_AttributeColor : public ModelAPI_AttributeColor
24 {
25   Handle_TDataStd_Integer myRed;
26   Handle_TDataStd_Integer myGreen;
27   Handle_TDataStd_Integer myBlue;
28  public:
29   /// Defines the color value
30   /// \param theRed the red part of the color
31   /// \param theRed the green part of the color
32   /// \param theRed the blue part of the color
33   MODELAPI_EXPORT virtual void setValues(const int theRed,
34                                          const int theGreen,
35                                          const int theBlue);
36
37   /// Fills the attribute values by a random color
38   MODELAPI_EXPORT virtual void setValuesRandom();
39
40   /// Returns the color value
41   MODELAPI_EXPORT virtual void values(int& theRed, int& theGreen, int& theBlue);
42
43  protected:
44   /// Initializes attibutes
45   Model_AttributeColor(TDF_Label& theLabel);
46
47   friend class Model_Data;
48 };
49
50 #endif