Salome HOME
Method isStable is defined
[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 #include <set>
13
14 class ModelAPI_Expression;
15
16 /**\class ModelAPI_AttributeDouble
17  * \ingroup DataModel
18  * \brief Attribute that contains real value with double precision.
19  */
20
21 class ModelAPI_AttributeDouble : public ModelAPI_Attribute
22 {
23  public:
24   /// Defines the double value
25   MODELAPI_EXPORT virtual void setValue(const double theValue) = 0;
26
27   /// Returns the double value
28   MODELAPI_EXPORT virtual double value() = 0;
29
30   /// Defines the calculated double value
31   MODELAPI_EXPORT virtual void setCalculatedValue(const double theValue) = 0;
32
33   /// Defines the text value
34   MODELAPI_EXPORT virtual void setText(const std::string& theText) = 0;
35
36   /// Returns the text value
37   MODELAPI_EXPORT virtual std::string text() = 0;
38
39   /// Allows to set expression (text) as invalid (by the parameters listener)
40   MODELAPI_EXPORT virtual void setExpressionInvalid(const bool theFlag) = 0;
41
42   /// Returns true if text is invalid
43   MODELAPI_EXPORT virtual bool expressionInvalid() = 0;
44
45   /// Allows to set expression (text) error (by the parameters listener)
46   MODELAPI_EXPORT virtual void setExpressionError(const std::string& theError) = 0;
47
48   /// Returns an expression error
49   MODELAPI_EXPORT virtual std::string expressionError() = 0;
50
51   /// Defines the used parameters
52   MODELAPI_EXPORT virtual void setUsedParameters(const std::set<std::string>& theUsedParameters) = 0;
53
54   /// Returns the used parameters
55   MODELAPI_EXPORT virtual std::set<std::string> usedParameters() const = 0;
56
57   /// Returns the type of this class of attributes
58   MODELAPI_EXPORT static std::string typeId()
59   {
60     return "Double";
61   }
62
63   /// Returns the type of this class of attributes, not static method
64   MODELAPI_EXPORT virtual std::string attributeType();
65
66   /// To virtually destroy the fields of successors
67   MODELAPI_EXPORT virtual ~ModelAPI_AttributeDouble();
68
69  protected:
70   /// Objects are created for features automatically
71   MODELAPI_EXPORT ModelAPI_AttributeDouble();
72 };
73
74 //! Pointer on double attribute
75 typedef std::shared_ptr<ModelAPI_AttributeDouble> AttributeDoublePtr;
76
77 #endif