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"
12 #include <TDataStd_Real.hxx>
13 #include <TDF_Label.hxx>
15 #include <TDataStd_Name.hxx>
17 /**\class Model_AttributeDouble
19 * \brief Attribute that contains real value with double precision.
22 class Model_AttributeDouble : public ModelAPI_AttributeDouble
24 Handle_TDataStd_Real myReal; ///< double is Real attribute
25 Handle_TDataStd_Name myText; ///< Text representation of the attribute (may differ for parametres)
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 double value
34 MODEL_EXPORT virtual void setText(const std::string& theText);
36 /// Returns the double value
37 MODEL_EXPORT virtual std::string text();
39 /// Allows to set expression (text) as invalid (by the parameters listener)
40 MODEL_EXPORT virtual void setExpressionInvalid(const bool theFlag);
42 /// Returns true if text is invalid
43 MODEL_EXPORT virtual bool expressionInvalid();
46 /// Initializes attibutes
47 Model_AttributeDouble(TDF_Label& theLabel);
49 friend class Model_Data;