From b24a4ca4f151ac9839d8b36b94c8e0f200839159 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 2 Dec 2014 19:50:25 +0300 Subject: [PATCH] This is an improvement to use one AND filter in the viewer context. It serves to combine the document and the plane filters inside. The code improvement. --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 10 +++++----- src/PartSet/PartSet_WidgetSketchLabel.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 3f7b53b25..46f641e00 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -102,7 +102,7 @@ void PartSet_WidgetSketchLabel::onPlaneSelected() // Clear selection mode and define sketching mode XGUI_Displayer* aDisp = myWorkshop->displayer(); - aDisp->removeSelectionFilter(myPlaneFilter); + aDisp->removeSelectionFilter(myFaceFilter); aDisp->closeLocalContexts(); emit planeSelected(plane()); setSketchingMode(); @@ -134,9 +134,9 @@ void PartSet_WidgetSketchLabel::activate() XGUI_Displayer* aDisp = myWorkshop->displayer(); aDisp->openLocalContext(); aDisp->activateObjects(QIntList()); - if (myPlaneFilter.IsNull()) - myPlaneFilter = new StdSelect_FaceFilter(StdSelect_Plane); - aDisp->addSelectionFilter(myPlaneFilter); + if (myFaceFilter.IsNull()) + myFaceFilter = new StdSelect_FaceFilter(StdSelect_Plane); + aDisp->addSelectionFilter(myFaceFilter); QIntList aModes; aModes << TopAbs_FACE; aDisp->activateObjects(aModes); @@ -153,7 +153,7 @@ void PartSet_WidgetSketchLabel::deactivate() { XGUI_Displayer* aDisp = myWorkshop->displayer(); - aDisp->removeSelectionFilter(myPlaneFilter); + aDisp->removeSelectionFilter(myFaceFilter); //aDisp->removeSelectionFilter(mySketchFilter); aDisp->closeLocalContexts(); erasePreviewPlanes(); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 906e96295..5d4ad6f52 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -90,7 +90,7 @@ signals: AISObjectPtr myXYPlane; bool myPreviewDisplayed; - Handle(StdSelect_FaceFilter) myPlaneFilter; + Handle(StdSelect_FaceFilter) myFaceFilter; //Handle(ModuleBase_ShapeInPlaneFilter) mySketchFilter; }; -- 2.39.2