Salome HOME
SketchEntity object for the Sketch features
[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).
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   MODELAPI_EXPORT virtual void setValues(const int theRed,
27                                          const int theGreen,
28                                          const int theBlue) = 0;
29
30   /// Fills the attribute values by a random color
31   MODELAPI_EXPORT virtual void setValuesRandom() = 0;
32
33   /// Returns the color value
34   MODELAPI_EXPORT virtual void values(int& theRed, int& theGreen, int& theBlue) = 0;
35
36   /// Returns the type of this class of attributes
37   MODELAPI_EXPORT static std::string type()
38   {
39     return "Color";
40   }
41
42   /// Returns the type of this class of attributes, not static method
43   MODELAPI_EXPORT virtual std::string attributeType();
44
45   /// To virtually destroy the fields of successors
46   MODELAPI_EXPORT virtual ~ModelAPI_AttributeColor();
47
48  protected:
49   /// Objects are created for features automatically
50   MODELAPI_EXPORT ModelAPI_AttributeColor();
51 };
52
53 //! Pointer on double attribute
54 typedef std::shared_ptr<ModelAPI_AttributeColor> AttributeColorPtr;
55
56 #endif