1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeDouble.h
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_AttributeDouble_H_
8 #define Model_AttributeDouble_H_
11 #include "ModelAPI_AttributeDouble.h"
13 #include <TDF_Label.hxx>
15 class ModelAPI_ExpressionDouble;
17 /**\class Model_AttributeDouble
19 * \brief Attribute that contains real value with double precision.
22 class Model_AttributeDouble : public ModelAPI_AttributeDouble
24 std::shared_ptr<ModelAPI_ExpressionDouble> myExpression;
27 /// Defines the double value
28 MODEL_EXPORT virtual void setValue(const double theValue);
30 /// Returns the double value
31 MODEL_EXPORT virtual double value();
33 /// Defines the calculated double value
34 MODEL_EXPORT virtual void setCalculatedValue(const double theValue);
36 /// Defines the text value
37 MODEL_EXPORT virtual void setText(const std::string& theText);
39 /// Returns the text value
40 MODEL_EXPORT virtual std::string text();
42 /// Allows to set expression (text) as invalid (by the parameters listener)
43 MODEL_EXPORT virtual void setExpressionInvalid(const bool theFlag);
45 /// Returns true if text is invalid
46 MODEL_EXPORT virtual bool expressionInvalid();
48 /// Allows to set expression (text) error (by the parameters listener)
49 MODEL_EXPORT virtual void setExpressionError(const std::string& theError);
51 /// Returns an expression error
52 MODEL_EXPORT virtual std::string expressionError();
54 /// Defines the used parameters
55 MODEL_EXPORT virtual void setUsedParameters(const std::set<std::string>& theUsedParameters);
57 /// Returns the used parameters
58 MODEL_EXPORT virtual std::set<std::string> usedParameters() const;
61 /// Initializes attributes
62 Model_AttributeDouble();
64 friend class Model_Data;