Salome HOME
empty AIS presentation should not be visualized in the viewer. It is caused by OCCT...
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeInteger.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_AttributeInteger.h
4 // Created:     2 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef MODELAPI_ATTRIBUTEINTEGER_H_
8 #define MODELAPI_ATTRIBUTEINTEGER_H_
9
10 #include <ModelAPI_Attribute.h>
11
12 #include <set>
13 #include <string>
14
15 /**\class ModelAPI_AttributeInteger
16  * \ingroup DataModel
17  * \brief API for the attribute that contains integer (int).
18  */
19
20 class ModelAPI_AttributeInteger : public ModelAPI_Attribute
21 {
22  public:
23   /// Defines the integer value
24   MODELAPI_EXPORT virtual void setValue(const int theValue) = 0;
25
26   /// Returns the integer value
27   MODELAPI_EXPORT virtual int value() = 0;
28
29   /// Defines the calculated value
30   MODELAPI_EXPORT virtual void setCalculatedValue(const int theValue) = 0;
31
32   /// Defines the text value
33   MODELAPI_EXPORT virtual void setText(const std::string& theText) = 0;
34
35   /// Returns the text value
36   MODELAPI_EXPORT virtual std::string text() = 0;
37
38   /// Allows to set expression (text) as invalid (by the parameters listener)
39   MODELAPI_EXPORT virtual void setExpressionInvalid(const bool theFlag) = 0;
40
41   /// Returns true if text is invalid
42   MODELAPI_EXPORT virtual bool expressionInvalid() = 0;
43
44   /// Allows to set expression (text) error (by the parameters listener)
45   MODELAPI_EXPORT virtual void setExpressionError(const std::string& theError) = 0;
46
47   /// Returns an expression error
48   MODELAPI_EXPORT virtual std::string expressionError() = 0;
49
50   /// Defines the used parameters
51   MODELAPI_EXPORT virtual void setUsedParameters(const std::set<std::string>& theUsedParameters) = 0;
52
53   /// Returns the used parameters
54   MODELAPI_EXPORT virtual std::set<std::string> usedParameters() const = 0;
55
56   /// Returns the type of this class of attributes
57   MODELAPI_EXPORT static std::string typeId()
58   {
59     return "Integer";
60   }
61
62   /// Returns the type of this class of attributes, not static method
63   MODELAPI_EXPORT virtual std::string attributeType();
64
65   /// To virtually destroy the fields of successors
66   MODELAPI_EXPORT virtual ~ModelAPI_AttributeInteger();
67
68  protected:
69   /// Objects are created for features automatically
70   MODELAPI_EXPORT ModelAPI_AttributeInteger();
71 };
72
73 //! Pointer on double attribute
74 typedef std::shared_ptr<ModelAPI_AttributeInteger> AttributeIntegerPtr;
75
76 #endif