App::ConditionalExpression Class Reference

#include <ExpressionParser.h>

Public Member Functions

 ConditionalExpression (const App::DocumentObject *_owner=nullptr, Expression *_condition=nullptr, Expression *_trueExpr=nullptr, Expression *_falseExpr=nullptr)
 
virtual bool isTouched () const override
 
virtual int priority () const override
 
virtual Expressionsimplify () const override
 
virtual ~ConditionalExpression ()
 
- Public Member Functions inherited from App::Expression
virtual void addComponent (Component *component)
 
bool adjustLinks (const std::set< App::DocumentObject * > &inList)
 
Expressioncopy () const
 
Expressioneval () const
 
 Expression (const App::DocumentObject *_owner)
 
void getDepObjects (std::map< App::DocumentObject *, bool > &, std::vector< std::string > *labels=nullptr) const
 
std::map< App::DocumentObject *, boolgetDepObjects (std::vector< std::string > *labels=nullptr) const
 
void getDeps (ExpressionDeps &deps, int option=DepNormal) const
 
ExpressionDeps getDeps (int option=DepNormal) const
 
std::map< App::ObjectIdentifier, boolgetIdentifiers () const
 
void getIdentifiers (std::map< App::ObjectIdentifier, bool > &) const
 
App::DocumentObjectgetOwner () const
 
Py::Object getPyValue () const
 
boost::any getValueAsAny () const
 
bool hasComponent () const
 
ExpressionPtr importSubNames (const std::map< std::string, std::string > &nameMap) const
 
bool isSame (const Expression &other, bool checkComment=true) const
 
virtual bool isTouched () const
 
virtual int priority () const
 
ExpressionPtr replaceObject (const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const
 
virtual Expressionsimplify () const =0
 
std::string toString (bool persistent=false, bool checkPriority=false, int indent=0) const
 
void toString (std::ostream &os, bool persistent=false, bool checkPriority=false, int indent=0) const
 
ExpressionPtr updateLabelReference (App::DocumentObject *obj, const std::string &ref, const char *newLabel) const
 
void visit (ExpressionVisitor &v)
 
virtual ~Expression ()
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
 BaseClass (const BaseClass &)=default
 
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 
virtual Type getTypeId () const
 
bool isDerivedFrom (const Type type) const
 
BaseClassoperator= (const BaseClass &)=default
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 

Protected Attributes

Expressioncondition
 Condition. More...
 
ExpressionfalseExpr
 Expression if abs(condition) is < 0.5. More...
 
ExpressiontrueExpr
 Expression if abs(condition) is > 0.5. More...
 
- Protected Attributes inherited from App::Expression
ComponentList components
 
App::DocumentObjectowner
 The document object used to access unqualified variables (i.e local scope) More...
 

Additional Inherited Members

- Public Types inherited from App::Expression
typedef std::vector< Component * > ComponentList
 
enum  DepOption { DepNormal , DepHidden , DepAll }
 
- Static Public Member Functions inherited from App::Expression
static ComponentcreateComponent (const std::string &n)
 
static ComponentcreateComponent (Expression *e1, Expression *e2=nullptr, Expression *e3=nullptr, bool isRange=false)
 
static Expressionparse (const App::DocumentObject *owner, const std::string &buffer)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
 
static Type getClassTypeId ()
 
static void init ()
 
- Public Attributes inherited from App::Expression
std::string comment
 
friend ExpressionVisitor
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 

Constructor & Destructor Documentation

◆ ConditionalExpression()

ConditionalExpression::ConditionalExpression ( const App::DocumentObject _owner = nullptr,
Expression _condition = nullptr,
Expression _trueExpr = nullptr,
Expression _falseExpr = nullptr 
)

Referenced by simplify().

◆ ~ConditionalExpression()

ConditionalExpression::~ConditionalExpression ( )
virtual

References condition, falseExpr, and trueExpr.

Member Function Documentation

◆ isTouched()

bool ConditionalExpression::isTouched ( void  ) const
overridevirtual

Reimplemented from App::Expression.

References falseExpr, App::Expression::isTouched(), and trueExpr.

◆ priority()

int ConditionalExpression::priority ( ) const
overridevirtual

Reimplemented from App::Expression.

◆ simplify()

Expression * ConditionalExpression::simplify ( ) const
overridevirtual

Member Data Documentation

◆ condition

Expression* App::ConditionalExpression::condition
protected

Condition.

Referenced by ~ConditionalExpression().

◆ falseExpr

Expression* App::ConditionalExpression::falseExpr
protected

Expression if abs(condition) is < 0.5.

Referenced by isTouched(), simplify(), and ~ConditionalExpression().

◆ trueExpr

Expression* App::ConditionalExpression::trueExpr
protected

Expression if abs(condition) is > 0.5.

Referenced by isTouched(), simplify(), and ~ConditionalExpression().


The documentation for this class was generated from the following files: