X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Module.cpp;h=c1348168e8dd5be66e7c0312af78dbb61aa8bc44;hb=f6a26acb1d58b1ccd50c938b785dc39df1877374;hp=94c577a55272a5a9b85722926c92af717655dfad;hpb=a07cdcdf600fc224bc862686439dfbe01d72524a;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 94c577a55..c1348168e 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -228,35 +228,35 @@ void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation) void PartSet_Module::onSelectionChanged() { ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); + if (!aOperation) + return; + bool isSketcherOp = false; // An edit operation is enable only if the current opeation is the sketch operation - if (aOperation && mySketchMgr->activeSketch()) { + if (mySketchMgr->activeSketch()) { if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch())) isSketcherOp = (aOperation->id().toStdString() == SketchPlugin_Sketch::ID()); } - if (!isSketcherOp) - return; - - // Editing of constraints can be done on selection - ModuleBase_ISelection* aSelect = myWorkshop->selection(); - QList aSelected = aSelect->getSelected(); - if (aSelected.size() == 1) { - ModuleBase_ViewerPrs aPrs = aSelected.first(); - ObjectPtr aObject = aPrs.object(); - FeaturePtr aFeature = ModelAPI_Feature::feature(aObject); - if (aFeature) { - std::string aId = aFeature->getKind(); - if ((aId == SketchPlugin_ConstraintRadius::ID()) || - (aId == SketchPlugin_ConstraintLength::ID()) || - (aId == SketchPlugin_ConstraintDistance::ID())) { - editFeature(aFeature); + if (isSketcherOp) { + // Editing of constraints can be done on selection + ModuleBase_ISelection* aSelect = myWorkshop->selection(); + QList aSelected = aSelect->getSelected(); + if (aSelected.size() == 1) { + ModuleBase_ViewerPrs aPrs = aSelected.first(); + ObjectPtr aObject = aPrs.object(); + FeaturePtr aFeature = ModelAPI_Feature::feature(aObject); + if (aFeature) { + std::string aId = aFeature->getKind(); + if ((aId == SketchPlugin_ConstraintRadius::ID()) || + (aId == SketchPlugin_ConstraintLength::ID()) || + (aId == SketchPlugin_ConstraintDistance::ID())) { + editFeature(aFeature); + } } } - } + } } - // after movement the solver will call the update event: optimization - void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent) { XGUI_ModuleConnector* aConnector = dynamic_cast(workshop());