Salome HOME
addUniqueNamedCopiedFeature to use unique names for copies features.
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeDouble.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_AttributeDouble.h
4 // Created:     2 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_AttributeDouble_H_
8 #define ModelAPI_AttributeDouble_H_
9
10 #include "ModelAPI_Attribute.h"
11
12 /**\class ModelAPI_AttributeDouble
13  * \ingroup DataModel
14  * \brief Attribute that contains real value with double precision.
15  */
16
17 class ModelAPI_AttributeDouble : public ModelAPI_Attribute
18 {
19  public:
20   /// Defines the double value
21   MODELAPI_EXPORT virtual void setValue(const double theValue) = 0;
22
23   /// Returns the double value
24   MODELAPI_EXPORT virtual double value() = 0;
25
26   /// Defines the double value
27   MODELAPI_EXPORT virtual void setText(const std::string& theText) = 0;
28
29   /// Returns the double value
30   MODELAPI_EXPORT virtual std::string text() = 0;
31
32   /// Allows to set expression (text) as invalid (by the parameters listener)
33   MODELAPI_EXPORT virtual void setExpressionInvalid(const bool theFlag) = 0;
34
35   /// Returns true if text is invalid
36   MODELAPI_EXPORT virtual bool expressionInvalid() = 0;
37
38   /// Returns the type of this class of attributes
39   MODELAPI_EXPORT static std::string typeId()
40   {
41     return "Double";
42   }
43
44   /// Returns the type of this class of attributes, not static method
45   MODELAPI_EXPORT virtual std::string attributeType();
46
47   /// To virtually destroy the fields of successors
48   MODELAPI_EXPORT virtual ~ModelAPI_AttributeDouble();
49
50  protected:
51   /// Objects are created for features automatically
52   MODELAPI_EXPORT ModelAPI_AttributeDouble();
53 };
54
55 //! Pointer on double attribute
56 typedef std::shared_ptr<ModelAPI_AttributeDouble> AttributeDoublePtr;
57
58 #endif