From: vsv Date: Fri, 27 Jun 2014 07:44:29 +0000 (+0400) Subject: Bug fixing of constraints creation with preselection X-Git-Tag: V_0.4.4~217 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fce89382d725a60f358cd01cdaebcf55ac17f803;p=modules%2Fshaper.git Bug fixing of constraints creation with preselection --- diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp index 4ff9ab84b..0099c993f 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp @@ -48,26 +48,24 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa if (aFeatureValue) { boost::shared_ptr aValuePoint = aFeatureValue->point(); FeaturePtr aValueFeature = aFeatureValue->feature(); - if (aValuePoint && aValueFeature) { - if (aValueFeature) { - isDone = setFeature(aValueFeature); - } - if (!isDone) { - // find the given point in the feature attributes - std::list > anAttiributes = - aValueFeature->data()->attributes(GeomDataAPI_Point2D::type()); - std::list >::const_iterator anIt = anAttiributes.begin(), - aLast = anAttiributes.end(); - boost::shared_ptr aFPoint; - for (;anIt!=aLast && !aFPoint; anIt++) { - boost::shared_ptr aCurPoint = - boost::dynamic_pointer_cast(*anIt); - if (aCurPoint && aCurPoint->pnt()->distance(aValuePoint) < Precision::Confusion()) - aFPoint = aCurPoint; - } - if (aFPoint) - isDone = setAttribute(aFPoint); + if (aValueFeature) { + isDone = setFeature(aValueFeature); + } + if (!isDone && aValuePoint) { + // find the given point in the feature attributes + std::list > anAttiributes = + aValueFeature->data()->attributes(GeomDataAPI_Point2D::type()); + std::list >::const_iterator anIt = anAttiributes.begin(), + aLast = anAttiributes.end(); + boost::shared_ptr aFPoint; + for (;anIt!=aLast && !aFPoint; anIt++) { + boost::shared_ptr aCurPoint = + boost::dynamic_pointer_cast(*anIt); + if (aCurPoint && aCurPoint->pnt()->distance(aValuePoint) < Precision::Confusion()) + aFPoint = aCurPoint; } + if (aFPoint) + isDone = setAttribute(aFPoint); } } }