Active view may not be 3d viewer
When for example the spreadsheet is open and an recompute is issued, the active view is not the 3d viewer which leads to crash if used for scene graph calculations.
This commit is contained in:
@@ -148,7 +148,16 @@ void ViewProviderOriginGroup::updateOriginSize () {
|
||||
return;
|
||||
}
|
||||
|
||||
View3DInventorViewer* viewer = static_cast<View3DInventor*>(this->getActiveView())->getViewer();
|
||||
|
||||
Gui::Document* gdoc = Gui::Application::Instance->getDocument(getObject()->getDocument());
|
||||
if(!gdoc)
|
||||
return;
|
||||
|
||||
Gui::MDIView* view = gdoc->getViewOfViewProvider(this);
|
||||
if(!view)
|
||||
return;
|
||||
|
||||
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
|
||||
SoGetBoundingBoxAction bboxAction(viewer->getSoRenderManager()->getViewportRegion());
|
||||
|
||||
// calculate the bounding box for out content
|
||||
|
||||
Reference in New Issue
Block a user