1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeInteger.h
4 // Created: 03 sep 2014
7 #ifndef MODEL_ATTRIBUTEINTEGER_H_
8 #define MODEL_ATTRIBUTEINTEGER_H_
11 #include <ModelAPI_AttributeInteger.h>
13 #include <TDF_Label.hxx>
15 class ModelAPI_ExpressionInteger;
17 /**\class Model_AttributeInteger
19 * \brief Attribute that contains integer.
22 class Model_AttributeInteger : public ModelAPI_AttributeInteger
25 /// Defines the integer value
26 MODEL_EXPORT virtual void setValue(const int theValue);
28 /// Returns the integer value
29 MODEL_EXPORT virtual int value();
31 /// Defines the calculated value
32 MODEL_EXPORT virtual void setCalculatedValue(const int theValue);
34 /// Defines the text value
35 MODEL_EXPORT virtual void setText(const std::string& theText);
37 /// Returns the text value
38 MODEL_EXPORT virtual std::string text();
40 /// Allows to set expression (text) as invalid (by the parameters listener)
41 MODEL_EXPORT virtual void setExpressionInvalid(const bool theFlag);
43 /// Returns true if text is invalid
44 MODEL_EXPORT virtual bool expressionInvalid();
46 /// Allows to set expression (text) error (by the parameters listener)
47 MODEL_EXPORT virtual void setExpressionError(const std::string& theError);
49 /// Returns an expression error
50 MODEL_EXPORT virtual std::string expressionError();
52 /// Defines the used parameters
53 MODEL_EXPORT virtual void setUsedParameters(const std::set<std::string>& theUsedParameters);
55 /// Returns the used parameters
56 MODEL_EXPORT virtual std::set<std::string> usedParameters() const;
59 /// Initializes attributes
60 Model_AttributeInteger();
62 friend class Model_Data;
65 std::shared_ptr<ModelAPI_ExpressionInteger> myExpression;