PropertyExpressionEngine: convert to link type property

PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
This commit is contained in:
Zheng, Lei
2019-06-29 17:30:51 +08:00
committed by wmayer
parent e85bf9cd0e
commit 93e60caa35
25 changed files with 3895 additions and 1645 deletions

View File

@@ -351,14 +351,12 @@ public:
/* Expression support */
virtual void setExpression(const ObjectIdentifier & path, boost::shared_ptr<App::Expression> expr, const char *comment = 0);
virtual void setExpression(const ObjectIdentifier & path, boost::shared_ptr<App::Expression> expr);
virtual const PropertyExpressionEngine::ExpressionInfo getExpression(const ObjectIdentifier &path) const;
virtual void renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> & paths);
virtual void connectRelabelSignals();
const std::string & getOldLabel() const { return oldLabel; }
const char *getViewProviderNameStored() const {
@@ -531,11 +529,6 @@ protected: // attributes
/// pointer to the document this object belongs to
App::Document* _pDoc;
// Connections to track relabeling of document and document objects
boost::signals2::scoped_connection onRelabledDocumentConnection;
boost::signals2::scoped_connection onRelabledObjectConnection;
boost::signals2::scoped_connection onDeletedObjectConnection;
/// Old label; used for renaming expressions
std::string oldLabel;