From a0e93f487500aca7d440c6e527867289c486fa32 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 27 Jun 2014 11:38:05 +0400 Subject: [PATCH] Bugs fixing on constraints with preselected objects --- .../ModuleBase_WidgetFeatureOrAttribute.cpp | 37 ++++++++++--------- src/PartSet/PartSet_Module.cpp | 2 - 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp index 9a47f9231..4ff9ab84b 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp @@ -48,25 +48,26 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa if (aFeatureValue) { boost::shared_ptr aValuePoint = aFeatureValue->point(); FeaturePtr aValueFeature = aFeatureValue->feature(); - - 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 (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 (aFPoint) - isDone = setAttribute(aFPoint); } } } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 206bbaa5b..65172c482 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -391,8 +391,6 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this, SLOT(onMultiSelectionEnabled(bool))); - connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), - this, SLOT(onMultiSelectionEnabled(bool))); connect(aPreviewOp, SIGNAL(stopSelection(const QFeatureList&, const bool)), this, SLOT(onStopSelection(const QFeatureList&, const bool))); connect(aPreviewOp, SIGNAL(setSelection(const QFeatureList&)), -- 2.39.2