Gui: add convenience function View3DInventorViewer::getBoundingBox()

This commit is contained in:
wmayer
2022-04-12 13:43:58 +02:00
parent 54efa2afcd
commit 0082a80148
2 changed files with 13 additions and 0 deletions

View File

@@ -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();

View File

@@ -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