bool PlaneGCSSolver_Storage::remove(EntityWrapperPtr theEntity)
{
bool isFullyRemoved = SketchSolver_Storage::remove(theEntity);
- if (theEntity->type() == ENTITY_ARC) {
- // remove arc additional constraints
- std::map<EntityWrapperPtr, std::vector<GCSConstraintPtr> >::iterator
- aFound = myArcConstraintMap.find(theEntity);
- if (aFound != myArcConstraintMap.end()) {
- myRemovedConstraints.insert(myRemovedConstraints.end(),
- aFound->second.begin(), aFound->second.end());
- myArcConstraintMap.erase(aFound);
+ if (isFullyRemoved) {
+ if (theEntity->type() == ENTITY_ARC) {
+ // remove arc additional constraints
+ std::map<EntityWrapperPtr, std::vector<GCSConstraintPtr> >::iterator
+ aFound = myArcConstraintMap.find(theEntity);
+ if (aFound != myArcConstraintMap.end()) {
+ myRemovedConstraints.insert(myRemovedConstraints.end(),
+ aFound->second.begin(), aFound->second.end());
+ myArcConstraintMap.erase(aFound);
+ }
}
+ if (theEntity->id() == myEntityLastID)
+ --myEntityLastID;
}
- if (isFullyRemoved && theEntity->id() == myEntityLastID)
- --myEntityLastID;
return isFullyRemoved;
}
updateMultiConstraints(myConstraints);
if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) {
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue("");
+ std::set<ObjectPtr> aConflicting = myConflictingConstraints;
myConflictingConstraints.clear();
myPrevResult = STATUS_OK;
// the error message should be changed before sending the message
- sendMessage(EVENT_SOLVER_REPAIRED, myConflictingConstraints);
+ sendMessage(EVENT_SOLVER_REPAIRED, aConflicting);
}
} else {
mySketchSolver->undo();