PartDesign: change view sizing on new sketch

This commit is contained in:
DeepSOIC
2019-09-07 19:52:12 +03:00
committed by wmayer
parent ba8e964171
commit 588fc8df77
3 changed files with 7 additions and 19 deletions

View File

@@ -720,24 +720,6 @@ void CmdPartDesignNewSketch::activated(int iMsg)
Base::Console().Error("Failed to create a Body object");
return;
}
// The method 'SoCamera::viewBoundingBox' is still declared as protected in Coin3d versions
// older than 4.0.
#if COIN_MAJOR_VERSION >= 4
// if no part feature was there then auto-adjust the camera
Gui::Document* guidoc = Gui::Application::Instance->getDocument(doc);
Gui::View3DInventor* view = guidoc ? qobject_cast<Gui::View3DInventor*>(guidoc->getActiveView()) : nullptr;
if (view) {
SoCamera* camera = view->getViewer()->getCamera();
SbViewportRegion vpregion = view->getViewer()->getViewportRegion();
float aspectratio = vpregion.getViewportAspectRatio();
float size = Gui::ViewProviderOrigin::defaultSize();
SbBox3f bbox;
bbox.setBounds(-size,-size,-size,size,size,size);
camera->viewBoundingBox(bbox, aspectratio, 1.0f);
}
#endif
}
// At this point, we have pcActiveBody