MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / canonicalPath

Method canonicalPath

src/App/PropertyExpressionEngine.cpp:475–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475ObjectIdentifier PropertyExpressionEngine::canonicalPath(const ObjectIdentifier& oid) const
476{
477 DocumentObject* docObj = freecad_cast<DocumentObject*>(getContainer());
478
479 // Am I owned by a DocumentObject?
480 if (!docObj) {
481 throw Base::RuntimeError("PropertyExpressionEngine must be owned by a DocumentObject.");
482 }
483
484 int ptype;
485 Property* prop = oid.getProperty(&ptype);
486
487 // oid pointing to a property...?
488 if (!prop) {
489 throw Base::RuntimeError(oid.resolveErrorString().c_str());
490 }
491
492 if (ptype || prop->getContainer() != getContainer()) {
493 return oid;
494 }
495
496 // In case someone calls this with p pointing to a PropertyExpressionEngine for some reason
497 if (prop->isDerivedFrom(PropertyExpressionEngine::classTypeId)) {
498 return oid;
499 }
500
501 // Dispatch call to actual canonicalPath implementation
502 return oid.canonicalPath();
503}
504
505size_t PropertyExpressionEngine::numExpressions() const
506{

Callers 1

buildGraphStructuresMethod · 0.45

Calls 6

getContainerFunction · 0.85
resolveErrorStringMethod · 0.80
getPropertyMethod · 0.45
c_strMethod · 0.45
getContainerMethod · 0.45
isDerivedFromMethod · 0.45

Tested by

no test coverage detected