SHAPER  9.12.0
Model_ExpressionDouble Class Reference

Implementation of ModelAPI_ExpressionDouble. More...

Inheritance diagram for Model_ExpressionDouble:
Inheritance graph

Public Member Functions

virtual void setText (const std::wstring &theText)
 Sets the text of this Expression. More...
 
virtual std::wstring text () const
 Returns the text of this Expression. More...
 
virtual void setError (const std::string &theError)
 Allows to set expression (text) error (by the parameters listener) More...
 
virtual std::string error ()
 Returns an expression error. More...
 
virtual void setUsedParameters (const std::set< std::wstring > &theUsedParameters)
 Defines the used parameters (by the parameters listener) More...
 
virtual std::set< std::wstring > usedParameters () const
 Returns the used parameters. More...
 
virtual void setValue (const double theValue)
 Defines the double value. More...
 
virtual double value ()
 Returns the double value. More...
 
virtual void setInvalid (const bool theFlag)
 Allows to set expression (text) as invalid (by the parameters listener) More...
 
virtual bool isInvalid ()
 Returns true if text is invalid. More...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
virtual void setInitialized ()
 Makes attribute initialized. More...
 

Static Public Member Functions

static bool isVariable (const std::string &theString)
 Returns True if the given string can be defined as a name of an expression variable. More...
 
static bool isVariable (const std::wstring &theString)
 Returns True if the given string can be defined as a name of an expression variable. More...
 

Protected Member Functions

 Model_ExpressionDouble (TDF_Label &theLabel)
 Initializes attributes. More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) More...
 
virtual void reset ()
 Resets attribute to deafult state. More...
 

Protected Attributes

Handle_TDataStd_Name myText
 Text representation of the attribute (may differ for parameters) More...
 
Handle_TDataStd_Comment myError
 Error of expression of the text attribute. More...
 
Handle_TDataStd_ExtStringList myUsedParameters
 Parameters used in expression. More...
 
TDF_Label myLab
 if attribute is not initialized, store label here More...
 
bool myIsInitialized
 is some value assigned to this attribute More...
 

Friends

class Model_AttributeDouble
 
class Model_Data
 

Detailed Description

Implementation of ModelAPI_ExpressionDouble.

Constructor & Destructor Documentation

◆ Model_ExpressionDouble()

Model_ExpressionDouble::Model_ExpressionDouble ( TDF_Label &  theLabel)
protected

Initializes attributes.

Member Function Documentation

◆ setText()

virtual void Model_ExpressionDouble::setText ( const std::wstring &  theText)
inlinevirtual

Sets the text of this Expression.

Reimplemented from Model_Expression.

◆ text()

virtual std::wstring Model_ExpressionDouble::text ( ) const
inlinevirtual

Returns the text of this Expression.

Reimplemented from Model_Expression.

◆ setError()

virtual void Model_ExpressionDouble::setError ( const std::string &  theError)
inlinevirtual

Allows to set expression (text) error (by the parameters listener)

Reimplemented from Model_Expression.

◆ error()

virtual std::string Model_ExpressionDouble::error ( )
inlinevirtual

Returns an expression error.

Reimplemented from Model_Expression.

◆ setUsedParameters()

virtual void Model_ExpressionDouble::setUsedParameters ( const std::set< std::wstring > &  theUsedParameters)
inlinevirtual

Defines the used parameters (by the parameters listener)

Reimplemented from Model_Expression.

◆ usedParameters()

virtual std::set<std::wstring> Model_ExpressionDouble::usedParameters ( ) const
inlinevirtual

Returns the used parameters.

Reimplemented from Model_Expression.

◆ setValue()

void Model_ExpressionDouble::setValue ( const double  theValue)
virtual

Defines the double value.

Implements ModelAPI_ExpressionDouble.

◆ value()

double Model_ExpressionDouble::value ( )
virtual

Returns the double value.

Implements ModelAPI_ExpressionDouble.

◆ setInvalid()

void Model_ExpressionDouble::setInvalid ( const bool  theFlag)
virtual

Allows to set expression (text) as invalid (by the parameters listener)

Implements ModelAPI_Expression.

◆ isInvalid()

bool Model_ExpressionDouble::isInvalid ( )
virtual

Returns true if text is invalid.

Implements ModelAPI_Expression.

◆ reinit()

void Model_ExpressionDouble::reinit ( )
protectedvirtual

Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)

Implements ModelAPI_Expression.

◆ isInitialized()

bool ModelAPI_Expression::isInitialized ( )
virtualinherited

Returns true if attribute was initialized by some value.

◆ setInitialized()

void ModelAPI_Expression::setInitialized ( )
virtualinherited

Makes attribute initialized.

◆ isVariable() [1/2]

bool ModelAPI_Expression::isVariable ( const std::string &  theString)
staticinherited

Returns True if the given string can be defined as a name of an expression variable.

◆ isVariable() [2/2]

bool ModelAPI_Expression::isVariable ( const std::wstring &  theString)
staticinherited

Returns True if the given string can be defined as a name of an expression variable.

◆ reset()

virtual void ModelAPI_Expression::reset ( )
inlineprotectedvirtualinherited

Resets attribute to deafult state.

Field Documentation

◆ myText

Handle_TDataStd_Name Model_Expression::myText
protectedinherited

Text representation of the attribute (may differ for parameters)

◆ myError

Handle_TDataStd_Comment Model_Expression::myError
protectedinherited

Error of expression of the text attribute.

◆ myUsedParameters

Handle_TDataStd_ExtStringList Model_Expression::myUsedParameters
protectedinherited

Parameters used in expression.

◆ myLab

TDF_Label Model_Expression::myLab
protectedinherited

if attribute is not initialized, store label here

◆ myIsInitialized

bool ModelAPI_Expression::myIsInitialized
protectedinherited

is some value assigned to this attribute