]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Bugs fixing on constraints with preselected objects
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 27 Jun 2014 07:38:05 +0000 (11:38 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 27 Jun 2014 07:38:05 +0000 (11:38 +0400)
src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp
src/PartSet/PartSet_Module.cpp

index 9a47f92319f81213ac7b5163eefcbb7f8d55f52b..4ff9ab84b52227c625efc4620d7baa002dcb4549 100644 (file)
@@ -48,25 +48,26 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa
     if (aFeatureValue) {
       boost::shared_ptr<GeomAPI_Pnt2d> aValuePoint = aFeatureValue->point();
       FeaturePtr aValueFeature = aFeatureValue->feature();
-
-      if (aValueFeature) {
-        isDone = setFeature(aValueFeature);
-      }
-      if (!isDone) {
-        // find the given point in the feature attributes
-        std::list<boost::shared_ptr<ModelAPI_Attribute> > anAttiributes =
-                                      aValueFeature->data()->attributes(GeomDataAPI_Point2D::type());
-        std::list<boost::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt = anAttiributes.begin(),
-                                                                          aLast = anAttiributes.end();
-        boost::shared_ptr<GeomDataAPI_Point2D> aFPoint;
-        for (;anIt!=aLast && !aFPoint; anIt++) {
-          boost::shared_ptr<GeomDataAPI_Point2D> aCurPoint =
-                                              boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(*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<boost::shared_ptr<ModelAPI_Attribute> > anAttiributes =
+                                        aValueFeature->data()->attributes(GeomDataAPI_Point2D::type());
+          std::list<boost::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt = anAttiributes.begin(),
+                                                                            aLast = anAttiributes.end();
+          boost::shared_ptr<GeomDataAPI_Point2D> aFPoint;
+          for (;anIt!=aLast && !aFPoint; anIt++) {
+            boost::shared_ptr<GeomDataAPI_Point2D> aCurPoint =
+                                                boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
+            if (aCurPoint && aCurPoint->pnt()->distance(aValuePoint) < Precision::Confusion())
+              aFPoint = aCurPoint;
+          }
+          if (aFPoint)
+            isDone = setAttribute(aFPoint);
         }
-        if (aFPoint)
-          isDone = setAttribute(aFPoint);
       }
     }
   }
index 206bbaa5baf315cbcc56ceeb352745f6bb5f6a7a..65172c482b5c6b440b6957c9e75f5afab36eb998 100644 (file)
@@ -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&)),