From bb69e72a1c20016c1a6d8aa46ff286b2ebda5dce Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 1 Jun 2016 10:01:58 +0300 Subject: [PATCH] Place mirrored entities to correct group --- .../PlaneGCSSolver/PlaneGCSSolver_Builder.cpp | 4 ++-- src/SketchSolver/SketchSolver_ConstraintMirror.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index 1dbc5ed49..3ad5b78a8 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -342,10 +342,10 @@ std::list PlaneGCSSolver_Builder::createMirror( std::dynamic_pointer_cast(aMirrorLine->entity()); std::list 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)); diff --git a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp index 0bccf4f04..254c16853 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp @@ -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::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); } -- 2.39.2