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

Method checkLinkDepth

src/App/Application.cpp:1451–1475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449}
1450
1451int Application::checkLinkDepth(int depth, MessageOption option)
1452{
1453 if (_objCount < 0) {
1454 _objCount = 0;
1455 for (const auto &v : DocMap) {
1456 _objCount += v.second->countObjects();
1457 }
1458 }
1459
1460 if (depth > _objCount + 2) {
1461 const auto msg = "Link recursion limit reached. "
1462 "Please check for cyclic reference.";
1463 switch (option) {
1464 case MessageOption::Quiet:
1465 return 0;
1466 case MessageOption::Error:
1467 FC_ERR(msg);
1468 return 0;
1469 case MessageOption::Throw:
1470 throw Base::RuntimeError(msg);
1471 }
1472 }
1473
1474 return _objCount + 2;
1475}
1476
1477std::set<DocumentObject *> Application::getLinksTo(
1478 const DocumentObject *obj, int options, int maxCount) const

Callers 7

getOutListRecursiveMethod · 0.80
getParentsMethod · 0.80
getLinkMethod · 0.80
getLinksToMethod · 0.80
sCheckLinkDepthMethod · 0.80
expandSubObjectNamesFunction · 0.80
getSubObjectMethod · 0.80

Calls 1

countObjectsMethod · 0.80

Tested by

no test coverage detected