X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketchSolver%2FSketchSolver_ConstraintMovement.cpp;h=7f4c8d78be74bc356fa3c967a41d612b9bbb1b0f;hb=cf8f82e87c5bec5bef69549ce628bfdb093b92a1;hp=85542cb42c7cad8c36e86a18530dc18c8479da23;hpb=29d446f4dd2969d80087745fe44adb5638d13de7;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp index 85542cb42..7f4c8d78b 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp @@ -49,7 +49,8 @@ static std::list movedEntities( for (; anOldIt != anOldSubs.end() && aNewIt != aNewSubs.end(); ++anOldIt, ++aNewIt) { std::list aMovedSubs = movedEntities( *anOldIt, theOldStorage, *aNewIt, theNewStorage); - if (aMovedSubs.size() != 1 || aMovedSubs.front() != *anOldIt) + if ((*anOldIt)->type() == ENTITY_POINT && // check only the points to be moved (because arcs in PlaneGCS have scalar subs too) + (aMovedSubs.size() != 1 || aMovedSubs.front() != *anOldIt)) isFullyMoved = false; aMoved.insert(aMoved.end(), aMovedSubs.begin(), aMovedSubs.end()); } @@ -96,3 +97,21 @@ void SketchSolver_ConstraintMovement::getAttributes( theAttributes.clear(); theAttributes.insert(theAttributes.begin(), aMoved.begin(), aMoved.end()); } + +bool SketchSolver_ConstraintMovement::remove() +{ + cleanErrorMsg(); + // Move fixed entities back to the current group + std::vector::iterator aMoveIt = myMovedEntities.begin(); + for (; aMoveIt != myMovedEntities.end(); ++aMoveIt) { + if ((*aMoveIt)->baseAttribute()) + myStorage->update((*aMoveIt)->baseAttribute(), myGroupID); + else if ((*aMoveIt)->baseFeature()) + myStorage->update((*aMoveIt)->baseFeature(), myGroupID); + } + + // Remove base feature + if (myBaseFeature) + myStorage->removeEntity(myBaseFeature); + return true; +}