X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Constraint.cpp;h=bbf00518aa95c1e1f57ec7f12aaa4f7c65e23612;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=fcb2a1fc138371fb94e349c6886f9cd1b60249a1;hpb=6534ec23cbbcf075080dde61be55628c4814a793;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index fcb2a1fc1..bbf00518a 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + #include #include #include @@ -226,6 +228,11 @@ void SketchSolver_Constraint::getAttributes( myStorage->update(*anIter/*, myGroupID*/); EntityWrapperPtr anEntity = myStorage->entity(*anIter); + if (!anEntity) { + // Force creation of an entity + myStorage->update(*anIter, GID_UNKNOWN, true); + anEntity = myStorage->entity(*anIter); + } myAttributes.push_back(anEntity); SketchSolver_EntityType aType = anEntity->type(); @@ -251,7 +258,8 @@ bool SketchSolver_Constraint::isUsed(FeaturePtr theFeature) const if ((*aCIt)->isUsed(theFeature)) return true; - std::list anAttrList = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); + std::list anAttrList = + theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::const_iterator anAttrIt = anAttrList.begin(); for (; anAttrIt != anAttrList.end(); ++ anAttrIt) if (isUsed(*anAttrIt))