From c7b8ff16b72c0141e8fe6467bc4bf24fde77730f Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 6 Oct 2020 15:32:35 +0200 Subject: [PATCH] PartDesign: [skip ci] remove automatic adjustment of view frustum when creating a body In v0.17 this was needed to fix bug 2503 and was done with commit d4ff570bf9. Now a more sensible view frustum is already set on document creation. The automatic adjustment is even annoying now if the document is not empty and nothing is selected because the view frustum can become too big and thus the objects appear quite small. --- src/Mod/PartDesign/Gui/CommandBody.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/Mod/PartDesign/Gui/CommandBody.cpp b/src/Mod/PartDesign/Gui/CommandBody.cpp index 1125b9d76e..d6d753bccb 100644 --- a/src/Mod/PartDesign/Gui/CommandBody.cpp +++ b/src/Mod/PartDesign/Gui/CommandBody.cpp @@ -27,7 +27,6 @@ # include # include # include -# include # include #endif @@ -40,9 +39,7 @@ #include #include #include -#include #include -#include #include #include @@ -110,7 +107,6 @@ void CmdPartDesignBody::activated(int iMsg) std::vector features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId()); App::DocumentObject* baseFeature = nullptr; - bool viewAll = features.empty(); bool addtogroup = false; @@ -297,28 +293,6 @@ void CmdPartDesignBody::activated(int iMsg) } } - // 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 - if (viewAll) { - Gui::Document* doc = Gui::Application::Instance->getDocument(getDocument()); - Gui::View3DInventor* view = doc ? qobject_cast(doc->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); - } - } -#else - Q_UNUSED(viewAll) -#endif - updateActive(); }