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