From: azv Date: Wed, 1 Jun 2016 07:01:58 +0000 (+0300) Subject: Place mirrored entities to correct group X-Git-Tag: V_2.3.1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bb69e72a1c20016c1a6d8aa46ff286b2ebda5dce;p=modules%2Fshaper.git Place mirrored entities to correct group --- 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); }