From: vsv Date: Thu, 25 Sep 2014 11:10:30 +0000 (+0400) Subject: Use pre-selection for shape selector X-Git-Tag: V_0.4.4~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c70c6a7ce45784d6a1dc9cd972a940a79fdb692e;p=modules%2Fshaper.git Use pre-selection for shape selector --- diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index d4294aa2b..c4832dd8f 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -167,6 +167,15 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged() bool ModuleBase_WidgetShapeSelector::isAccepted(const ObjectPtr theResult) const { ResultPtr aResult = boost::dynamic_pointer_cast(theResult); + if (myFeature) { + // We can not select a result of our feature + const std::list>& aRes = myFeature->results(); + std::list >::const_iterator aIt; + for (aIt = aRes.cbegin(); aIt != aRes.cend(); ++aIt) { + if ((*aIt) == aResult) + return false; + } + } boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (!aShapePtr) return false; @@ -227,6 +236,9 @@ void ModuleBase_WidgetShapeSelector::activateSelection(bool toActivate) connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); else disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); + + if (myWorkshop->selectedObjects().size() > 0) + onSelectionChanged(); } //********************************************************************