Skip to content

Commit

Permalink
Gui: include non view provider coin for scene bbox calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed May 19, 2020
1 parent ab87746 commit 087f3fb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Gui/View3DInventorViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3536,10 +3536,21 @@ bool View3DInventorViewer::getSceneBoundBox(Base::BoundBox3d &box) const {
}

if(guiDocument && ViewParams::instance()->getUseTightBoundingBox()) {
SoGetBoundingBoxAction action(this->getSoRenderManager()->getViewportRegion());
for(int i=0;i<pcViewProviderRoot->getNumChildren();++i) {
auto node = pcViewProviderRoot->getChild(i);
auto vp = guiDocument->getViewProvider(node);
if(!vp || !vp->isVisible())
if(!vp) {
action.apply(node);
auto bbox = action.getBoundingBox();
if(!bbox.isEmpty()) {
float minx,miny,minz,maxx,maxy,maxz;
bbox.getBounds(minx,miny,minz,maxx,maxy,maxz);
box.Add(Base::BoundBox3d(minx,miny,minz,maxx,maxy,maxz));
}
continue;
}
if(!vp->isVisible())
continue;
auto sbox = vp->getBoundingBox(0,0,true,this);
if(sbox.IsValid())
Expand Down

0 comments on commit 087f3fb

Please sign in to comment.