20 #ifndef Model_Expression_H_
21 #define Model_Expression_H_
24 #include "ModelAPI_Expression.h"
26 #include <TDataStd_Comment.hxx>
27 #include <TDataStd_ExtStringList.hxx>
28 #include <TDataStd_Integer.hxx>
29 #include <TDataStd_Name.hxx>
30 #include <TDataStd_Real.hxx>
32 #include <TDF_Label.hxx>
42 MODEL_EXPORT
virtual void setText(
const std::wstring& theText);
45 MODEL_EXPORT
virtual std::wstring
text()
const;
48 MODEL_EXPORT
virtual void setError(
const std::string& theError);
51 MODEL_EXPORT
virtual std::string
error();
54 MODEL_EXPORT
virtual void setUsedParameters(
const std::set<std::wstring>& theUsedParameters);
57 MODEL_EXPORT
virtual std::set<std::wstring>
usedParameters()
const;
80 MODEL_EXPORT
virtual void setText(
const std::wstring& theText) {
85 MODEL_EXPORT
virtual std::wstring
text()
const {
90 MODEL_EXPORT
virtual void setError(
const std::string& theError) {
95 MODEL_EXPORT
virtual std::string
error() {
110 MODEL_EXPORT
virtual void setValue(
const double theValue);
113 MODEL_EXPORT
virtual double value();
116 MODEL_EXPORT
virtual void setInvalid(
const bool theFlag);
131 Handle_TDataStd_Real myReal;
145 MODEL_EXPORT
virtual void setText(
const std::wstring& theText) {
150 MODEL_EXPORT
virtual std::wstring
text()
const {
155 MODEL_EXPORT
virtual void setError(
const std::string& theError) {
160 MODEL_EXPORT
virtual std::string
error() {
175 MODEL_EXPORT
virtual void setValue(
const int theValue);
178 MODEL_EXPORT
virtual int value();
181 MODEL_EXPORT
virtual void setInvalid(
const bool theFlag);
195 Handle_TDataStd_Integer myInteger;
Expression for calculated double values.
Definition: ModelAPI_Expression.h:101
Expression for calculated integer values.
Definition: ModelAPI_Expression.h:122
Expression for calculated values.
Definition: ModelAPI_Expression.h:34
Attribute that contains real value with double precision.
Definition: Model_AttributeDouble.h:36
Attribute that contains integer.
Definition: Model_AttributeInteger.h:36
General object of the application that allows to get/set attributes from the document and compute res...
Definition: Model_Data.h:61
Implementation of ModelAPI_ExpressionDouble.
Definition: Model_Expression.h:77
virtual void reinit()
Reinitializes the internal state of the attribute (may be needed on undo/redo, abort,...
Definition: Model_Expression.cpp:101
virtual std::wstring text() const
Returns the text of this Expression.
Definition: Model_Expression.h:85
virtual void setError(const std::string &theError)
Allows to set expression (text) error (by the parameters listener)
Definition: Model_Expression.h:90
virtual bool isInvalid()
Returns true if text is invalid.
Definition: Model_Expression.cpp:136
Model_ExpressionDouble(TDF_Label &theLabel)
Initializes attributes.
Definition: Model_Expression.cpp:94
virtual double value()
Returns the double value.
Definition: Model_Expression.cpp:120
virtual std::string error()
Returns an expression error.
Definition: Model_Expression.h:95
virtual std::set< std::wstring > usedParameters() const
Returns the used parameters.
Definition: Model_Expression.h:105
virtual void setText(const std::wstring &theText)
Sets the text of this Expression.
Definition: Model_Expression.h:80
virtual void setValue(const double theValue)
Defines the double value.
Definition: Model_Expression.cpp:110
virtual void setUsedParameters(const std::set< std::wstring > &theUsedParameters)
Defines the used parameters (by the parameters listener)
Definition: Model_Expression.h:100
virtual void setInvalid(const bool theFlag)
Allows to set expression (text) as invalid (by the parameters listener)
Definition: Model_Expression.cpp:127
Implementation of ModelAPI_ExpressionInteger.
Definition: Model_Expression.h:142
virtual void reinit()
Reinitializes the internal state of the attribute (may be needed on undo/redo, abort,...
Definition: Model_Expression.cpp:149
virtual bool isInvalid()
Returns true if text is invalid.
Definition: Model_Expression.cpp:184
virtual std::set< std::wstring > usedParameters() const
Returns the used parameters.
Definition: Model_Expression.h:170
virtual std::string error()
Returns an expression error.
Definition: Model_Expression.h:160
virtual void setValue(const int theValue)
Defines the integer value.
Definition: Model_Expression.cpp:158
virtual void setError(const std::string &theError)
Allows to set expression (text) error (by the parameters listener)
Definition: Model_Expression.h:155
Model_ExpressionInteger(TDF_Label &theLabel)
Initializes attributes.
Definition: Model_Expression.cpp:142
virtual std::wstring text() const
Returns the text of this Expression.
Definition: Model_Expression.h:150
virtual void setText(const std::wstring &theText)
Sets the text of this Expression.
Definition: Model_Expression.h:145
virtual void setUsedParameters(const std::set< std::wstring > &theUsedParameters)
Defines the used parameters (by the parameters listener)
Definition: Model_Expression.h:165
virtual int value()
Returns the integer value.
Definition: Model_Expression.cpp:168
virtual void setInvalid(const bool theFlag)
Allows to set expression (text) as invalid (by the parameters listener)
Definition: Model_Expression.cpp:175
Implementation of ModelAPI_Expression.
Definition: Model_Expression.h:39
Handle_TDataStd_Name myText
Text representation of the attribute (may differ for parameters)
Definition: Model_Expression.h:63
virtual void setError(const std::string &theError)
Allows to set expression (text) error (by the parameters listener)
Definition: Model_Expression.cpp:65
virtual std::wstring text() const
Returns the text of this Expression.
Definition: Model_Expression.cpp:60
Handle_TDataStd_ExtStringList myUsedParameters
Parameters used in expression.
Definition: Model_Expression.h:65
Model_Expression(TDF_Label &theLabel)
Initializes attributes.
Definition: Model_Expression.cpp:37
TDF_Label myLab
if attribute is not initialized, store label here
Definition: Model_Expression.h:66
Handle_TDataStd_Comment myError
Error of expression of the text attribute.
Definition: Model_Expression.h:64
virtual std::set< std::wstring > usedParameters() const
Returns the used parameters.
Definition: Model_Expression.cpp:84
virtual void setText(const std::wstring &theText)
Sets the text of this Expression.
Definition: Model_Expression.cpp:50
virtual void setUsedParameters(const std::set< std::wstring > &theUsedParameters)
Defines the used parameters (by the parameters listener)
Definition: Model_Expression.cpp:76
virtual std::string error()
Returns an expression error.
Definition: Model_Expression.cpp:71