X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintMovement.cpp;h=916b8d5515d988d4eeca5cd5fc8d713ae96b74af;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=85542cb42c7cad8c36e86a18530dc18c8479da23;hpb=37c59d59b17e4a7e304588fb647488457a0c7283;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp index 85542cb42..916b8d551 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + #include #include #include @@ -49,7 +51,9 @@ 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) + // check only the points to be moved (because arcs in PlaneGCS have scalar subs too) + if ((*anOldIt)->type() == ENTITY_POINT && + (aMovedSubs.size() != 1 || aMovedSubs.front() != *anOldIt)) isFullyMoved = false; aMoved.insert(aMoved.end(), aMovedSubs.begin(), aMovedSubs.end()); } @@ -96,3 +100,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; +}