]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Place mirrored entities to correct group
authorazv <azv@opencascade.com>
Wed, 1 Jun 2016 07:01:58 +0000 (10:01 +0300)
committerazv <azv@opencascade.com>
Wed, 1 Jun 2016 07:02:20 +0000 (10:02 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp
src/SketchSolver/SketchSolver_ConstraintMirror.cpp

index 1dbc5ed4983a932f358cc6b5b8bbf3a2616aeb91..3ad5b78a855ee6a334df466b08b9a9ae1b694385 100644 (file)
@@ -342,10 +342,10 @@ std::list<ConstraintWrapperPtr> PlaneGCSSolver_Builder::createMirror(
         std::dynamic_pointer_cast<GCS::Line>(aMirrorLine->entity());
 
     std::list<GCSConstraintPtr> aConstrList;
-    aConstrList.push_back(GCSConstraintPtr(new GCS::ConstraintPerpendicular(
-        *(aPoint1->point()), *(aPoint2->point()), aLine->p1, aLine->p2)));
     aConstrList.push_back(GCSConstraintPtr(new GCS::ConstraintMidpointOnLine(
         *(aPoint1->point()), *(aPoint2->point()), aLine->p1, aLine->p2)));
+    aConstrList.push_back(GCSConstraintPtr(new GCS::ConstraintPerpendicular(
+        *(aPoint1->point()), *(aPoint2->point()), aLine->p1, aLine->p2)));
 
     ConstraintWrapperPtr aSubResult(new PlaneGCSSolver_ConstraintWrapper(
         theConstraint, aConstrList, CONSTRAINT_SYMMETRIC));
index 0bccf4f0495ae3547c4d0c4d7dac714ec3d7d940..254c16853aa839e087821ce876ade33d3f4032b5 100644 (file)
@@ -50,6 +50,12 @@ void SketchSolver_ConstraintMirror::getAttributes(
     }
   }
 
+  // Mirrored entities are placed out-of-group by default, due to they are copies.
+  // Place them into current group manually.
+  std::vector<EntityWrapperPtr>::iterator aMirIt = theMirrorEntities.begin();
+  for (; aMirIt != theMirrorEntities.end(); ++aMirIt)
+    (*aMirIt)->setGroup(myGroupID);
+
   if (theBaseEntities.size() > theMirrorEntities.size())
     myErrorMsg = SketchSolver_Error::NOT_INITIALIZED();
 }
@@ -105,10 +111,10 @@ void SketchSolver_ConstraintMirror::process()
     aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
   }
 
-  myStorage->addConstraint(myBaseConstraint, aMirConstrList);
   // update mirrored features to be in the current group
   for (aMIt = aMirrorList.begin(); aMIt != aMirrorList.end(); ++aMIt)
     myStorage->update((*aMIt)->baseFeature(), myGroupID);
+  myStorage->addConstraint(myBaseConstraint, aMirConstrList);
 }