Salome HOME
Issue #718 - Translation with parameters - wrong coordinates
[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 #include <TDataStd_Real.hxx>
13 #include <TDF_Label.hxx>
14
15 #include <TDataStd_Name.hxx>
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   Handle_TDataStd_Real myReal;  ///< double is Real attribute
25   Handle_TDataStd_Name myText;  ///< Text representation of the attribute (may differ for parametres)
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  protected:
49   /// Initializes attibutes
50   Model_AttributeDouble(TDF_Label& theLabel);
51
52   friend class Model_Data;
53 };
54
55 #endif