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

Method exportObjects

src/Mod/Import/App/ExportOCAF2.cpp:345–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void ExportOCAF2::exportObjects(std::vector<App::DocumentObject*>& objs, const char* name)
346{
347 if (objs.empty()) {
348 return;
349 }
350 myObjects.clear();
351 myNames.clear();
352 mySetups.clear();
353 if (objs.size() == 1) {
354 exportObject(objs.front(), nullptr, TDF_Label());
355 }
356 else {
357 auto label = aShapeTool->NewShape();
358 App::Document* doc = nullptr;
359 bool sameDoc = true;
360 for (auto obj : objs) {
361 if (doc) {
362 sameDoc = sameDoc && doc == obj->getDocument();
363 }
364 else {
365 doc = obj->getDocument();
366 }
367 exportObject(obj, nullptr, label);
368 }
369
370 if (!name && doc && sameDoc) {
371 name = doc->getName();
372 }
373 setName(label, nullptr, name);
374 }
375
376 if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) {
377 Tools::dumpLabels(pDoc->Main(), aShapeTool, aColorTool);
378 }
379
380 // Update is not performed automatically anymore:
381 // https://tracker.dev.opencascade.org/view.php?id=28055
382 aShapeTool->UpdateAssemblies();
383}
384
385TDF_Label ExportOCAF2::exportObject(
386 App::DocumentObject* parentObj,

Callers

nothing calls this directly

Calls 9

TDF_LabelClass · 0.70
setNameFunction · 0.50
emptyMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
frontMethod · 0.45
getDocumentMethod · 0.45
getNameMethod · 0.45
isEnabledMethod · 0.45

Tested by

no test coverage detected