| 1330 | } |
| 1331 | |
| 1332 | DocumentObject* 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 | |
| 1353 | void DocumentObject::Save(Base::Writer& writer) const |
| 1354 | { |
no test coverage detected