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

Method stackBottom

src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp:452–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void ViewProviderDrawingView::stackBottom()
453{
454 QGIView* qView = getQView();
455 if (!qView || !getViewProviderPage()) {
456 //no view, nothing to stack
457 return;
458 }
459 int minZ = std::numeric_limits<int>::max();
460 auto parent = qView->parentItem();
461 if (parent) {
462 //if we have a parentItem, we have to stack within the parentItem, not within the page
463 auto siblings = parent->childItems();
464 for (auto& child : siblings) {
465 if (child->zValue() < minZ) {
466 minZ = child->zValue();
467 }
468 }
469 } else {
470 //TODO: need to special case DPGI or any other member of a collection
471 //if we have no parentItem, we are a top level QGIView and we need to stack
472 //with respect to the other top level views on this page
473 std::vector<App::DocumentObject*> peerObjects = getViewProviderPage()->claimChildren();
474 Gui::Document* gDoc = getDocument();
475 for (auto& peer: peerObjects) {
476 auto vpPeer = gDoc->getViewProvider(peer);
477 ViewProviderDrawingView* vpdv = static_cast<ViewProviderDrawingView*>(vpPeer);
478 int z = vpdv->StackOrder.getValue();
479 if (z < minZ) {
480 minZ = z;
481 }
482 }
483 }
484 StackOrder.setValue(minZ - 1);
485 qView->setStack(minZ - 1);
486}
487
488const char* ViewProviderDrawingView::whoAmI() const
489{

Callers 1

execStackBottomFunction · 0.80

Calls 8

getViewProviderPageFunction · 0.85
maxFunction · 0.85
setStackMethod · 0.80
getDocumentFunction · 0.50
claimChildrenMethod · 0.45
getViewProviderMethod · 0.45
getValueMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected