From: nds Date: Tue, 14 Jul 2015 12:52:37 +0000 (+0300) Subject: Update of actions in the tool bar by click in the viewer when the sketch is active... X-Git-Tag: V_1.3.0~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9ab2083403bd0837a7690f4923419be51f249b71;p=modules%2Fshaper.git 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. --- 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