From d414fc631114da16d5f9266c5c823633c6f166a0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 6 Apr 2020 14:12:44 +0200 Subject: [PATCH 1/6] Part: [skip ci] set again Two-side rendering as default lighting style --- src/Mod/Part/Gui/DlgSettingsObjectColor.ui | 3 +++ src/Mod/Part/Gui/ViewProviderExt.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/Gui/DlgSettingsObjectColor.ui b/src/Mod/Part/Gui/DlgSettingsObjectColor.ui index 97da9983d8..9de8a266bd 100644 --- a/src/Mod/Part/Gui/DlgSettingsObjectColor.ui +++ b/src/Mod/Part/Gui/DlgSettingsObjectColor.ui @@ -251,6 +251,9 @@ Two-side rendering + + true + TwoSideRendering diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 70230e0af6..709873bc3d 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -246,7 +246,7 @@ ViewProviderPartExt::ViewProviderPartExt() ("User parameter:BaseApp/Preferences/Mod/Part"); NormalsFromUV = hPart->GetBool("NormalsFromUVNodes", NormalsFromUV); - long twoside = hPart->GetBool("TwoSideRendering", false) ? 1 : 0; + long twoside = hPart->GetBool("TwoSideRendering", true) ? 1 : 0; // Let the user define a custom lower limit but a value less than // OCCT's epsilon is not allowed From 7a0606715045a255ef0774e835b0091eef300ac9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 6 Apr 2020 17:07:09 +0200 Subject: [PATCH 2/6] Cloud: fix broken CMake file --- src/Mod/Cloud/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Cloud/CMakeLists.txt b/src/Mod/Cloud/CMakeLists.txt index d359859b64..c2519f4f84 100644 --- a/src/Mod/Cloud/CMakeLists.txt +++ b/src/Mod/Cloud/CMakeLists.txt @@ -29,8 +29,8 @@ elseif(WIN32 AND LIBPACK_FOUND) set(OPENSSL_VERSION ${openssl_version_str}) endif () else() - find_package(OPENSSL REQUIRED) -endif(UNIX AND NOT APPLE) + find_package(OpenSSL REQUIRED) +endif(UNIX AND APPLE) if(OPENSSL_FOUND) message(STATUS "openssl-${OPENSSL_VERSION} has been found\n") else() From 60ac500048dd4e1e68b6ecac1b17c34a8aba015d Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 6 Apr 2020 17:58:08 +0200 Subject: [PATCH 3/6] Cloud: [skip ci] restore old CMake variable to link to OpenSSL to fix build failure on Linux and Windows --- src/Mod/Cloud/App/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Cloud/App/CMakeLists.txt b/src/Mod/Cloud/App/CMakeLists.txt index 3c5a43edba..d51883b4f5 100644 --- a/src/Mod/Cloud/App/CMakeLists.txt +++ b/src/Mod/Cloud/App/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories( set(Cloud_LIBS FreeCADApp - ${OPENSSL_LINK_LIBRARIES} + ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} ${XercesC_LIBRARIES} ${Boost_LIBRARIES} From 359d3a2b4821897e09d71f0d306cbdc0187e0b49 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 6 Apr 2020 19:50:08 +0200 Subject: [PATCH 4/6] Gui: [skip ci] improve whitespaces --- src/Gui/View3DInventorViewer.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 519a904e8d..0458794dea 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1332,22 +1332,27 @@ bool View3DInventorViewer::isEnabledVBO() const void View3DInventorViewer::setRenderCache(int mode) { - if(mode<0) { + if (mode<0) { ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/View"); - int setting = hGrp->GetInt("RenderCache",0); - if(mode==-2) { - if(pcViewProviderRoot && setting!=1) + + int setting = hGrp->GetInt("RenderCache", 0); + if (mode == -2) { + if (pcViewProviderRoot && setting != 1) pcViewProviderRoot->renderCaching = SoSeparator::ON; mode = 2; - }else{ - if(pcViewProviderRoot) + } + else { + if (pcViewProviderRoot) pcViewProviderRoot->renderCaching = SoSeparator::AUTO; mode = setting; } } + SoFCSeparator::setCacheMode( - mode==0?SoSeparator::AUTO:(mode==1?SoSeparator::ON:SoSeparator::OFF)); + mode == 0 ? SoSeparator::AUTO : + (mode == 1 ? SoSeparator::ON : SoSeparator::OFF) + ); } void View3DInventorViewer::setEnabledNaviCube(bool on) From ea8d3bb242f1b85dc07f037370a0a753d0039c99 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 6 Apr 2020 19:50:58 +0200 Subject: [PATCH 5/6] Gui: [skip ci] add options to set one-pass and backface-pass rendering --- src/Gui/DlgSettings3DView.ui | 55 +++++++++++++++++++++++++++----- src/Gui/DlgSettings3DViewImp.cpp | 4 +++ src/Gui/View3DInventor.cpp | 12 +++++++ 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/src/Gui/DlgSettings3DView.ui b/src/Gui/DlgSettings3DView.ui index 07024daf4e..25c45f3814 100644 --- a/src/Gui/DlgSettings3DView.ui +++ b/src/Gui/DlgSettings3DView.ui @@ -214,6 +214,45 @@ but slower response to any scene changes. + + + + + + Transparent objects: + + + + + + + + 120 + 0 + + + + Render types of transparent objects + + + TransparentObjectRenderType + + + View + + + + One pass + + + + + Backface pass + + + + + @@ -223,7 +262,7 @@ but slower response to any scene changes. - + @@ -236,14 +275,14 @@ but slower response to any scene changes. - + Eye to eye distance for stereo modes - + @@ -279,7 +318,7 @@ bounding box size of the 3D object that is currently displayed. - + Backlight is enabled with the defined color @@ -295,7 +334,7 @@ bounding box size of the 3D object that is currently displayed. - + false @@ -318,7 +357,7 @@ bounding box size of the 3D object that is currently displayed. - + Qt::Horizontal @@ -331,7 +370,7 @@ bounding box size of the 3D object that is currently displayed. - + false @@ -347,7 +386,7 @@ bounding box size of the 3D object that is currently displayed. - + false diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index 6365e0e547..90db0ba8ce 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -83,6 +83,8 @@ void DlgSettings3DViewImp::saveSettings() index = ui->renderCache->currentIndex(); hGrp->SetInt("RenderCache", index); + ui->comboTransparentRender->onSave(); + QVariant const &vBoxMarkerSize = ui->boxMarkerSize->itemData(ui->boxMarkerSize->currentIndex()); hGrp->SetInt("MarkerSize", vBoxMarkerSize.toInt()); @@ -124,6 +126,8 @@ void DlgSettings3DViewImp::loadSettings() index = hGrp->GetInt("RenderCache", 0); ui->renderCache->setCurrentIndex(index); + ui->comboTransparentRender->onRestore(); + int const current = hGrp->GetInt("MarkerSize", 9L); ui->boxMarkerSize->addItem(tr("5px"), QVariant(5)); ui->boxMarkerSize->addItem(tr("7px"), QVariant(7)); diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index b0228fe3c1..71c3608b4a 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -189,6 +189,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent, OnChange(*hGrp,"Dimensions3dVisible"); OnChange(*hGrp,"DimensionsDeltaVisible"); OnChange(*hGrp,"PickRadius"); + OnChange(*hGrp,"TransparentObjectRenderType"); stopSpinTimer = new QTimer(this); connect(stopSpinTimer, SIGNAL(timeout()), this, SLOT(stopAnimating())); @@ -414,6 +415,17 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M else if (strcmp(Reason, "PickRadius") == 0) { _viewer->setPickRadius(rGrp.GetFloat("PickRadius", 5.0f)); } + else if (strcmp(Reason, "TransparentObjectRenderType") == 0) { + long renderType = rGrp.GetInt("TransparentObjectRenderType", 0); + if (renderType == 0) { + _viewer->getSoRenderManager()->getGLRenderAction() + ->setTransparentDelayedObjectRenderType(SoGLRenderAction::ONE_PASS); + } + else if (renderType == 1) { + _viewer->getSoRenderManager()->getGLRenderAction() + ->setTransparentDelayedObjectRenderType(SoGLRenderAction::NONSOLID_SEPARATE_BACKFACE_PASS); + } + } else { unsigned long col1 = rGrp.GetUnsigned("BackgroundColor",3940932863UL); unsigned long col2 = rGrp.GetUnsigned("BackgroundColor2",859006463UL); // default color (dark blue) From 65aee430afa285f4ae2caa6dae96fc882c3a1d27 Mon Sep 17 00:00:00 2001 From: Patrick F Date: Mon, 6 Apr 2020 21:11:40 +0200 Subject: [PATCH 6/6] Removed offset check --- src/Mod/Path/PathScripts/PathDeburr.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index e44ab90c71..aa1b1e6d21 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -59,8 +59,7 @@ def toolDepthAndOffset(width, extraDepth, tool): toolOffset = float(tool.FlatRadius) extraOffset = float(tool.Diameter) / 2 - width if 180 == angle else extraDepth / tan offset = toolOffset + extraOffset - if offset < 0.0001: - offset = 0.01 + return (depth, offset)