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

Method getLinkedObject

src/App/DocumentObject.cpp:1332–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330}
1331
1332DocumentObject* DocumentObject::getLinkedObject(bool recursive,
1333 Base::Matrix4D* mat,
1334 bool transform,
1335 int depth) const
1336{
1337 DocumentObject* ret = nullptr;
1338 auto exts = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
1339 for (auto ext : exts) {
1340 if (ext->extensionGetLinkedObject(ret, recursive, mat, transform, depth)) {
1341 return ret;
1342 }
1343 }
1344 if (transform && mat) {
1345 auto pla = freecad_cast<PropertyPlacement*>(getPropertyByName("Placement"));
1346 if (pla) {
1347 *mat *= pla->getValue().toMatrix();
1348 }
1349 }
1350 return const_cast<DocumentObject*>(this);
1351}
1352
1353void DocumentObject::Save(Base::Writer& writer) const
1354{

Callers 1

getSubObjectListFlattenFunction · 0.45

Calls 4

getPropertyByNameFunction · 0.85
toMatrixMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected