Gui: add convenience function View3DInventorViewer::getBoundingBox()
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user