From e3046be3221a1ee286496f2bc70855beafca5555 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 9 Nov 2019 11:31:51 +0100 Subject: [PATCH] [skip ci] tmp. disable selection when switching to curvature or inspection info modus --- src/Mod/Inspection/Gui/Command.cpp | 1 + src/Mod/Inspection/Gui/ViewProviderInspection.cpp | 5 +++-- src/Mod/Mesh/Gui/Command.cpp | 1 + src/Mod/Mesh/Gui/ViewProviderCurvature.cpp | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Inspection/Gui/Command.cpp b/src/Mod/Inspection/Gui/Command.cpp index cf3ae7cba0..217c4a9b17 100644 --- a/src/Mod/Inspection/Gui/Command.cpp +++ b/src/Mod/Inspection/Gui/Command.cpp @@ -89,6 +89,7 @@ void CmdInspectElement::activated(int) viewer->setEditing(true); viewer->setRedirectToSceneGraphEnabled(true); viewer->setRedirectToSceneGraph(true); + viewer->setSelectionEnabled(false); viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("inspect_pipette",QSize(32,32)),4,29)); viewer->addEventCallback(SoButtonEvent::getClassTypeId(), InspectionGui::ViewProviderInspection::inspectCallback); diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index dcba0f40f3..74f96a8dc4 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -473,6 +473,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n) view->getWidget()->setCursor(QCursor(Qt::ArrowCursor)); view->setRedirectToSceneGraph(false); view->setRedirectToSceneGraphEnabled(false); + view->setSelectionEnabled(true); view->removeEventCallback(SoButtonEvent::getClassTypeId(), inspectCallback, ud); } } @@ -508,8 +509,8 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n) const SoPickedPoint * point = pps[i]; vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath()); if (vp && vp->getTypeId().isDerivedFrom(ViewProviderInspection::getClassTypeId())) { - ViewProviderInspection* that = static_cast(vp); - QString info = that->inspectDistance(point); + ViewProviderInspection* self = static_cast(vp); + QString info = self->inspectDistance(point); Gui::getMainWindow()->setPaneText(1,info); if (addflag) ViewProviderProxyObject::addFlag(view, info, point); diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index eb93c3dec6..74dc26c107 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -694,6 +694,7 @@ void CmdMeshVertexCurvatureInfo::activated(int) Gui::View3DInventorViewer* viewer = view->getViewer(); viewer->setEditing(true); viewer->setRedirectToSceneGraph(true); + viewer->setSelectionEnabled(false); viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("mesh_pipette",QSize(32,32)),4,29)); viewer->addEventCallback(SoEvent::getClassTypeId(), MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback); diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index a897e5e022..fa80b9d218 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -497,6 +497,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback view->setEditing(false); view->getWidget()->setCursor(QCursor(Qt::ArrowCursor)); view->setRedirectToSceneGraph(false); + view->setSelectionEnabled(true); view->removeEventCallback(SoEvent::getClassTypeId(), curvatureInfoCallback, ud); } }