SHAPER  9.12.0
Model_Expression Class Referenceabstract

Implementation of ModelAPI_Expression. More...

Inheritance diagram for Model_Expression:
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 bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
virtual void setInitialized ()
 Makes attribute initialized. More...
 
virtual void setInvalid (const bool theFlag)=0
 Allows to set expression (text) as invalid (by the parameters listener) More...
 
virtual bool isInvalid ()=0
 Returns true if text is invalid. 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_Expression (TDF_Label &theLabel)
 Initializes attributes. More...
 
virtual void reinit ()=0
 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...
 

Detailed Description

Implementation of ModelAPI_Expression.

Constructor & Destructor Documentation

◆ Model_Expression()

Model_Expression::Model_Expression ( TDF_Label &  theLabel)
protected

Initializes attributes.

Member Function Documentation

◆ setText()

void Model_Expression::setText ( const std::wstring &  theText)
virtual

Sets the text of this Expression.

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ text()

std::wstring Model_Expression::text ( ) const
virtual

Returns the text of this Expression.

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ setError()

void Model_Expression::setError ( const std::string &  theError)
virtual

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

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ error()

std::string Model_Expression::error ( )
virtual

Returns an expression error.

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ setUsedParameters()

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

Defines the used parameters (by the parameters listener)

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ usedParameters()

std::set< std::wstring > Model_Expression::usedParameters ( ) const
virtual

Returns the used parameters.

Implements ModelAPI_Expression.

Reimplemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ isInitialized()

bool ModelAPI_Expression::isInitialized ( )
virtualinherited

Returns true if attribute was initialized by some value.

◆ setInitialized()

void ModelAPI_Expression::setInitialized ( )
virtualinherited

Makes attribute initialized.

◆ setInvalid()

virtual void ModelAPI_Expression::setInvalid ( const bool  theFlag)
pure virtualinherited

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

Implemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ isInvalid()

virtual bool ModelAPI_Expression::isInvalid ( )
pure virtualinherited

Returns true if text is invalid.

Implemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ 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.

◆ reinit()

virtual void ModelAPI_Expression::reinit ( )
protectedpure virtualinherited

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

Implemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ reset()

virtual void ModelAPI_Expression::reset ( )
inlineprotectedvirtualinherited

Resets attribute to deafult state.

Field Documentation

◆ myText

Handle_TDataStd_Name Model_Expression::myText
protected

Text representation of the attribute (may differ for parameters)

◆ myError

Handle_TDataStd_Comment Model_Expression::myError
protected

Error of expression of the text attribute.

◆ myUsedParameters

Handle_TDataStd_ExtStringList Model_Expression::myUsedParameters
protected

Parameters used in expression.

◆ myLab

TDF_Label Model_Expression::myLab
protected

if attribute is not initialized, store label here

◆ myIsInitialized

bool ModelAPI_Expression::myIsInitialized
protectedinherited

is some value assigned to this attribute