Remove hack around geometry visibility in active sketch.

Revert #14386 and #16378
This commit is contained in:
Max Wilfinger
2025-02-24 19:07:06 +01:00
committed by Chris Hennes
parent fb53f2eebd
commit 28aa531a02
3 changed files with 0 additions and 64 deletions

View File

@@ -107,7 +107,6 @@ void SketcherSettings::saveSettings()
ui->checkBoxAdvancedSolverTaskBox->onSave();
ui->checkBoxRecalculateInitialSolutionWhileDragging->onSave();
ui->checkBoxEnableEscape->onSave();
ui->checkBoxDisableShading->onSave();
ui->checkBoxNotifyConstraintSubstitutions->onSave();
ui->checkBoxAutoRemoveRedundants->onSave();
ui->checkBoxUnifiedCoincident->onSave();
@@ -180,7 +179,6 @@ void SketcherSettings::loadSettings()
ui->checkBoxAdvancedSolverTaskBox->onRestore();
ui->checkBoxRecalculateInitialSolutionWhileDragging->onRestore();
ui->checkBoxEnableEscape->onRestore();
ui->checkBoxDisableShading->onRestore();
ui->checkBoxNotifyConstraintSubstitutions->onRestore();
ui->checkBoxAutoRemoveRedundants->onRestore();
ui->checkBoxUnifiedCoincident->onRestore();

View File

@@ -140,25 +140,6 @@ Requires to re-enter edit mode to take effect.</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxDisableShading">
<property name="toolTip">
<string>Disables the shaded view when entering the sketch edit mode.</string>
</property>
<property name="text">
<string>Disable shading in edit mode</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="1">
<cstring>DisableShadedView</cstring>
</property>
<property name="prefPath" stdset="1">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxNotifyConstraintSubstitutions">
<property name="toolTip">

View File

@@ -3294,31 +3294,6 @@ void ViewProviderSketch::unsetEdit(int ModNum)
if (sketchHandler)
deactivateHandler();
Gui::MDIView* mdi = getInventorView();
// handle the override draw style mode only if there's a 3D view, otherwise SIGSEGV may
// occur as described in https://github.com/FreeCAD/FreeCAD/issues/15918
if (mdi) {
// Resets the override draw style mode when leaving the sketch edit mode.
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher/General");
auto disableShadedView = hGrp->GetBool("DisableShadedView", false);
if (disableShadedView) {
Gui::View3DInventorViewer* viewer =
static_cast<Gui::View3DInventor*>(mdi)->getViewer();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher/General");
auto OverrideMode = hGrp->GetASCII("OverrideMode", "As Is");
if (viewer) {
viewer->updateOverrideMode(OverrideMode);
viewer->setOverrideMode(OverrideMode);
}
}
}
editCoinManager = nullptr;
snapManager = nullptr;
preselection.reset();
@@ -3397,24 +3372,6 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo
}
}
// Sets the view mode to no shading to prevent visibility issues against parallel surfaces with shininess when entering the sketch mode.
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher/General");
auto disableShadedView = hGrp->GetBool("DisableShadedView", false);
hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher/General");
hGrp->SetASCII("OverrideMode", viewer->getOverrideMode());
if (disableShadedView) {
viewer->updateOverrideMode("No Shading");
viewer->setOverrideMode("No Shading");
}
auto editDoc = Gui::Application::Instance->editDocument();
editDocName.clear();
if (editDoc) {