X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Storage.cpp;h=d1f6c4f17bbe88a2619731e5bb59c8c854be1183;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=91b36b77cce7671c53841deb1e18d51664de39cb;hpb=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index 91b36b77c..d1f6c4f17 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -18,6 +18,7 @@ #include #include #include +#include /// \brief Verify two vectors of constraints are equal. @@ -160,20 +161,14 @@ static bool isCopyInMulti(std::shared_ptr theFeature, return false; bool aResult = theFeature->isCopy(); if (aResult) { - std::map >::const_iterator - anIt = theConstraints.begin(); - for (; anIt != theConstraints.end() && aResult; ++anIt) { - if (anIt->first->getKind() != SketchPlugin_ConstraintMirror::ID()) - continue; - AttributeRefListPtr aRefList = std::dynamic_pointer_cast( - anIt->first->attribute(SketchPlugin_Constraint::ENTITY_C())); - std::list aMirroredList = aRefList->list(); - std::list::const_iterator aMIt = aMirroredList.begin(); - for (; aMIt != aMirroredList.end() && aResult; ++aMIt) { - FeaturePtr aFeat = ModelAPI_Feature::feature(*aMIt); - if (aFeat == theFeature) - aResult = false; - } + const std::set& aRefs = theFeature->data()->refsToMe(); + for (std::set::const_iterator aRefIt = aRefs.begin(); + aRefIt != aRefs.end() && aResult; ++aRefIt) { + FeaturePtr anOwner = ModelAPI_Feature::feature((*aRefIt)->owner()); + if ((anOwner->getKind() == SketchPlugin_ConstraintMirror::ID() && + (*aRefIt)->id() == SketchPlugin_Constraint::ENTITY_C()) || + (anOwner->getKind() == SketchPlugin_Projection::ID())) + aResult = false; } } return aResult;