From 9ab2083403bd0837a7690f4923419be51f249b71 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 14 Jul 2015 15:52:37 +0300 Subject: [PATCH] Update of actions in the tool bar by click in the viewer when the sketch is active and the selection in the object browser is not empty. --- src/PartSet/PartSet_Validators.cpp | 10 +++++----- src/XGUI/XGUI_ActionsMgr.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 36606361e..29afcf8d0 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -36,7 +36,7 @@ int shapesNbPoints(const ModuleBase_ISelection* theSelection) { - QList aList = theSelection->getSelected(); + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); int aCount = 0; foreach (ModuleBase_ViewerPrs aPrs, aList) { const TopoDS_Shape& aShape = aPrs.shape(); @@ -50,7 +50,7 @@ int shapesNbPoints(const ModuleBase_ISelection* theSelection) int shapesNbLines(const ModuleBase_ISelection* theSelection) { - QList aList = theSelection->getSelected(); + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); int aCount = 0; foreach(ModuleBase_ViewerPrs aPrs, aList) { const TopoDS_Shape& aShape = aPrs.shape(); @@ -94,7 +94,7 @@ bool PartSet_ParallelSelection::isValid(const ModuleBase_ISelection* theSelectio bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection) const { - QList aList = theSelection->getSelected(); + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); ModuleBase_ViewerPrs aPrs; int aCount = 0; foreach (ModuleBase_ViewerPrs aPrs, aList) { @@ -115,7 +115,7 @@ bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection) bool PartSet_RigidSelection::isValid(const ModuleBase_ISelection* theSelection) const { - QList aList = theSelection->getSelected(); + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); return (aList.count() == 1); } @@ -140,7 +140,7 @@ bool PartSet_FilletSelection::isValid(const ModuleBase_ISelection* theSelection) bool PartSet_TangentSelection::isValid(const ModuleBase_ISelection* theSelection) const { - QList aList = theSelection->getSelected(); + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); if ((aList.size() == 0) || (aList.size() > 2)) return false; diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index beb901ee0..83d3e09b0 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -140,7 +140,8 @@ void XGUI_ActionsMgr::updateOnViewSelection() //QString aFeatureId = QString::fromStdString(anActiveFeature->getKind()); XGUI_Selection* aSelection = myWorkshop->selector()->selection(); - if (aSelection->getSelected().size() == 0) { + // only viewer selection is processed + if (aSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) { // it seems that this code is not nesessary anymore. It leads to incorrect case: // sketch operation start, click in any place in the viewer. The result is all nested // entities are enabled(but the sketch plane is not selected yet). Any sketch operation -- 2.39.2