diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index af8128478f..33a07fc1ad 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -2967,6 +2967,14 @@ void View3DInventorViewer::boxZoom(const SbBox2s& box) navigation->boxZoom(box); } +SbBox3f View3DInventorViewer::getBoundingBox() const +{ + SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion(); + SoGetBoundingBoxAction action(vp); + action.apply(this->getSoRenderManager()->getSceneGraph()); + return action.getBoundingBox(); +} + void View3DInventorViewer::viewAll() { SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion(); diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index 571dd5755e..a32ccc59d4 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -357,6 +357,11 @@ public: /// Breaks out a VR window for a Rift void viewVR(void); + /** + * Returns the bounding box of the scene graph. + */ + SbBox3f getBoundingBox() const; + /** * Reposition the current camera so we can see all selected objects * of the scene. Therefore we search for all SOFCSelection nodes, if