Salome HOME
Constriction type for all sketch entities
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeColor.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_AttributeColor.h
4 // Created:     6 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef ModelAPI_AttributeColor_H_
8 #define ModelAPI_AttributeColor_H_
9
10 #include <ModelAPI.h>
11 #include <ModelAPI_Attribute.h>
12
13 #include <string>
14
15
16 /**\class ModelAPI_AttributeColor
17  * \ingroup DataModel
18  * \brief API for the attribute that contains color (int, int, int). The color is in the range [0, 255]
19  * There is an opportunity to fill the attribute by a random color
20  */
21
22 class ModelAPI_AttributeColor : public ModelAPI_Attribute
23 {
24  public:
25   /// Defines the color value
26   /// \param theRed the red part of the color
27   /// \param theRed the green part of the color
28   /// \param theRed the blue part of the color
29   MODELAPI_EXPORT virtual void setValues(const int theRed,
30                                          const int theGreen,
31                                          const int theBlue) = 0;
32
33   /// Fills the attribute values by a random color
34   MODELAPI_EXPORT virtual void setValuesRandom() = 0;
35
36   /// Returns the color value
37   MODELAPI_EXPORT virtual void values(int& theRed, int& theGreen, int& theBlue) = 0;
38
39   /// Returns the type of this class of attributes
40   MODELAPI_EXPORT static std::string type()
41   {
42     return "Color";
43   }
44
45   /// Returns the type of this class of attributes, not static method
46   MODELAPI_EXPORT virtual std::string attributeType();
47
48   /// To virtually destroy the fields of successors
49   MODELAPI_EXPORT virtual ~ModelAPI_AttributeColor();
50
51  protected:
52   /// Objects are created for features automatically
53   MODELAPI_EXPORT ModelAPI_AttributeColor();
54 };
55
56 //! Pointer on double attribute
57 typedef std::shared_ptr<ModelAPI_AttributeColor> AttributeColorPtr;
58
59 #endif