Salome HOME
1. myIsInitialized should have "false" by default. Validators check it to enable...
[modules/shaper.git] / src / Model / Model_AttributeDouble.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_AttributeDouble.h
4 // Created:     2 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef Model_AttributeDouble_H_
8 #define Model_AttributeDouble_H_
9
10 #include "Model.h"
11 #include "ModelAPI_AttributeDouble.h"
12
13 #include <TDF_Label.hxx>
14
15 class ModelAPI_ExpressionDouble;
16
17 /**\class Model_AttributeDouble
18  * \ingroup DataModel
19  * \brief Attribute that contains real value with double precision.
20  */
21
22 class Model_AttributeDouble : public ModelAPI_AttributeDouble
23 {
24   std::shared_ptr<ModelAPI_ExpressionDouble> myExpression;
25
26  public:
27   /// Defines the double value
28   MODEL_EXPORT virtual void setValue(const double theValue);
29
30   /// Returns the double value
31   MODEL_EXPORT virtual double value();
32
33   /// Defines the calculated double value
34   MODEL_EXPORT virtual void setCalculatedValue(const double theValue);
35
36   /// Defines the text value
37   MODEL_EXPORT virtual void setText(const std::string& theText);
38
39   /// Returns the text value
40   MODEL_EXPORT virtual std::string text();
41
42   /// Allows to set expression (text) as invalid (by the parameters listener)
43   MODEL_EXPORT virtual void setExpressionInvalid(const bool theFlag);
44
45   /// Returns true if text is invalid
46   MODEL_EXPORT virtual bool expressionInvalid();
47
48   /// Allows to set expression (text) error (by the parameters listener)
49   MODEL_EXPORT virtual void setExpressionError(const std::string& theError);
50
51   /// Returns an expression error
52   MODEL_EXPORT virtual std::string expressionError();
53
54   /// Defines the used parameters
55   MODEL_EXPORT virtual void setUsedParameters(const std::set<std::string>& theUsedParameters);
56
57   /// Returns the used parameters
58   MODEL_EXPORT virtual std::set<std::string> usedParameters() const;
59
60  protected:
61   /// Initializes attributes
62   Model_AttributeDouble();
63
64   friend class Model_Data;
65 };
66
67 #endif