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

Method writeObjectDeps

src/App/Document.cpp:1397–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1395constexpr auto fcElementObjectDep {"Dep"};
1396
1397void Document::writeObjectDeps(const std::vector<DocumentObject*>& objs,
1398 Base::Writer& writer) const
1399{
1400 for (auto o : objs) {
1401 // clang-format off
1402 const auto& outList = o->getOutList(DocumentObject::OutListNoHidden |
1403 DocumentObject::OutListNoXLinked);
1404 // clang-format on
1405
1406 auto objName = o->getNameInDocument();
1407 writer.Stream() << writer.ind()
1408 << "<" << fcElementObjectDeps
1409 << " " << fcAttrDepObjName << "=\""
1410 << (objName ? objName : "") << "\" "
1411 << fcAttrDepCount << "=\""
1412 << outList.size();
1413 if (outList.empty()) {
1414 writer.Stream() << "\"/>\n";
1415 continue;
1416 }
1417 int partial = o->canLoadPartial();
1418 if (partial > 0) {
1419 writer.Stream() << "\" " << fcAttrDepAllowPartial << "=\"" << partial;
1420 }
1421 writer.Stream() << "\">\n";
1422 writer.incInd();
1423 for (auto dep : outList) {
1424 auto depName = dep ? dep->getNameInDocument() : "";
1425 writer.Stream() << writer.ind()
1426 << "<" << fcElementObjectDep
1427 << " " << fcAttrDepObjName << "=\""
1428 << (depName ? depName : "") << "\"/>\n";
1429 }
1430 writer.decInd();
1431 writer.Stream() << writer.ind() << "</" << fcElementObjectDeps << ">\n";
1432 }
1433}
1434
1435void Document::writeObjectType(const std::vector<DocumentObject*>& objs,
1436 Base::Writer& writer) const

Callers

nothing calls this directly

Calls 7

incIndMethod · 0.80
decIndMethod · 0.80
getOutListMethod · 0.45
getNameInDocumentMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
canLoadPartialMethod · 0.45

Tested by

no test coverage detected