Skip to content

[For v0.19]Fix ObjectIdentifier ambiguity#1619

Closed
realthunder wants to merge 6 commits intoFreeCAD:masterfrom
realthunder:OIDAmbiguity
Closed

[For v0.19]Fix ObjectIdentifier ambiguity#1619
realthunder wants to merge 6 commits intoFreeCAD:masterfrom
realthunder:OIDAmbiguity

Conversation

@realthunder
Copy link
Contributor

@realthunder realthunder commented Aug 20, 2018

There is an ambiguity problem in ObjectIdentifier. If there are more than one component, then the first component can either be interpreted as an object name, object label, or property name. This file demonstrate the problem. Cube.Height binds to an expression Placement.Base.x+10mm, which is not working because there is an object with label Placement. The named constraint in the sketch cannot be deleted, because SketchObject internally uses ObjectIdentifier for its PropertyConstraintList named Constraints, and the object with the label Placement has an internal name of Constraints.

Commit 6732008 reduces the ambiguity of existing expression (Edit: this commit has been refined by 655d6fe)

Commit d5eeee7 modifies the ObjectIdentifier constructor to make it easy for other code to explicitly set the object name.

Commit 3c4750a modifies all code (that I can find) that uses ObjectIdentifier to use explicit object name.

Commit 47c4a3b add a new syntax to expression to allow explicit object name when the path starts with a dot.

We probably should forbid direct referencing of a property without a leading dot.

All modifications uses ObjectIdentifier to capture the path of its own
property. The new ObjectIdentifier explicitly sets the document object
name as the owner name to avoid runtime resolving ambiguity where there
is an object with same name as the property.
Expression path starting with '.' now means to reference the object's
own property. Without this syntax the expression may fail at runtime if
there is an object with the same name as the property name.
Undo 6732008, because it interfer with
object identifier renaming, where the renamed identifier does not exist
any more.
@wwmayer wwmayer changed the title Fix ObjectIdentifier ambiguity [For v0.19]Fix ObjectIdentifier ambiguity Feb 25, 2019
@wwmayer wwmayer added the ✋ On hold This PR must not be merged before some condition is met label Feb 25, 2019
@yorikvanhavre yorikvanhavre added the Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Feb 26, 2019
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jun 30, 2019
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#1619
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 4, 2019
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#1619
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 5, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 6, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 6, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 10, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 11, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 12, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 13, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 13, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 14, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 14, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 15, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 15, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
realthunder added a commit to realthunder/FreeCAD that referenced this pull request Jul 16, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
wwmayer pushed a commit to wwmayer/FreeCAD that referenced this pull request Aug 8, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
wwmayer pushed a commit to wwmayer/FreeCAD that referenced this pull request Aug 17, 2019
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#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
@realthunder
Copy link
Contributor Author

This is included in the Link merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD ✋ On hold This PR must not be merged before some condition is met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants