SHAPER  9.12.0
ModelAPI_Expression Class Referenceabstract

Expression for calculated values. More...

Inheritance diagram for ModelAPI_Expression:
Inheritance graph

Public Member Functions

virtual ~ModelAPI_Expression ()
 To virtually destroy the fields of successors. More...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
virtual void setInitialized ()
 Makes attribute initialized. More...
 
virtual void setText (const std::wstring &theText)=0
 Sets the text of this Expression. More...
 
virtual std::wstring text () const =0
 Returns the text of this Expression. 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...
 
virtual void setError (const std::string &theError)=0
 Allows to set expression (text) error (by the parameters listener) More...
 
virtual std::string error ()=0
 Returns an expression error. More...
 
virtual void setUsedParameters (const std::set< std::wstring > &theUsedParameters)=0
 Defines the used parameters (by the parameters listener) More...
 
virtual std::set< std::wstring > usedParameters () const =0
 Returns the used parameters. 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

 ModelAPI_Expression ()
 Objects are created for features automatically. 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

bool myIsInitialized
 is some value assigned to this attribute More...
 

Friends

class Model_Data
 
class Model_AttributeDouble
 
class Model_AttributeInteger
 
class GeomData_Point
 
class GeomData_Point2D
 

Detailed Description

Expression for calculated values.

Constructor & Destructor Documentation

◆ ~ModelAPI_Expression()

ModelAPI_Expression::~ModelAPI_Expression ( )
virtual

To virtually destroy the fields of successors.

◆ ModelAPI_Expression()

ModelAPI_Expression::ModelAPI_Expression ( )
protected

Objects are created for features automatically.

Member Function Documentation

◆ isInitialized()

bool ModelAPI_Expression::isInitialized ( )
virtual

Returns true if attribute was initialized by some value.

◆ setInitialized()

void ModelAPI_Expression::setInitialized ( )
virtual

Makes attribute initialized.

◆ setText()

virtual void ModelAPI_Expression::setText ( const std::wstring &  theText)
pure virtual

Sets the text of this Expression.

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ text()

virtual std::wstring ModelAPI_Expression::text ( ) const
pure virtual

Returns the text of this Expression.

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ setInvalid()

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

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 virtual

Returns true if text is invalid.

Implemented in Model_ExpressionInteger, and Model_ExpressionDouble.

◆ setError()

virtual void ModelAPI_Expression::setError ( const std::string &  theError)
pure virtual

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

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ error()

virtual std::string ModelAPI_Expression::error ( )
pure virtual

Returns an expression error.

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ setUsedParameters()

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

Defines the used parameters (by the parameters listener)

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ usedParameters()

virtual std::set<std::wstring> ModelAPI_Expression::usedParameters ( ) const
pure virtual

Returns the used parameters.

Implemented in Model_ExpressionInteger, Model_ExpressionDouble, and Model_Expression.

◆ isVariable() [1/2]

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

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)
static

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

◆ reinit()

virtual void ModelAPI_Expression::reinit ( )
protectedpure virtual

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 ( )
inlineprotectedvirtual

Resets attribute to deafult state.

Field Documentation

◆ myIsInitialized

bool ModelAPI_Expression::myIsInitialized
protected

is some value assigned to this attribute