X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Manager.cpp;h=a9d47533e95b12fb5cb18ad2dc632add3e8c13a5;hb=4b5708fbc546999d5d08899879dd7fb32e87ba3e;hp=6f000ec6c8d91a46d443836ae7d4a8a231172ee9;hpb=d58960c09c19b06dd80eb2c5c4bd87fdc52dfdd8;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Manager.cpp b/src/SketchSolver/SketchSolver_Manager.cpp index 6f000ec6c..a9d47533e 100644 --- a/src/SketchSolver/SketchSolver_Manager.cpp +++ b/src/SketchSolver/SketchSolver_Manager.cpp @@ -231,8 +231,8 @@ void SketchSolver_Manager::processEvent( if (aObjects.size() == 1) { std::set::const_iterator aIt; for (aIt = aObjects.cbegin(); aIt != aObjects.cend(); aIt++) { - std::shared_ptr aFeature = - std::dynamic_pointer_cast(*aIt); + CompositeFeaturePtr aFeature = + std::dynamic_pointer_cast(*aIt); if (aFeature) { SketchGroupPtr aGroup = findGroup(aFeature); @@ -245,7 +245,7 @@ void SketchSolver_Manager::processEvent( aFeatures.push_back(*aIt); } - // TODO: send features to GUI + // send features to GUI static const Events_ID anEvent = Events_Loop::eventByName(EVENT_DOF_OBJECTS); ModelAPI_EventCreator::get()->sendUpdated(aFeatures, anEvent); Events_Loop::loop()->flush(anEvent); @@ -382,7 +382,7 @@ bool SketchSolver_Manager::moveAttribute( // Purpose: search groups of entities interacting with given feature // ============================================================================ SketchGroupPtr SketchSolver_Manager::findGroup( - std::shared_ptr theFeature) + std::shared_ptr theFeature) { if (!isFeatureValid(theFeature)) return SketchGroupPtr(); // do not process wrong features @@ -398,17 +398,21 @@ SketchGroupPtr SketchSolver_Manager::findGroup( break; } } + return findGroup(aSketch); +} - if (!aSketch) +SketchGroupPtr SketchSolver_Manager::findGroup(CompositeFeaturePtr theSketch) +{ + if (!theSketch) return SketchGroupPtr(); // not a sketch's feature std::list::const_iterator aGroupIt; for (aGroupIt = myGroups.begin(); aGroupIt != myGroups.end(); ++aGroupIt) - if ((*aGroupIt)->getWorkplane() == aSketch) + if ((*aGroupIt)->getWorkplane() == theSketch) return *aGroupIt; // group for the sketch does not created yet - SketchGroupPtr aNewGroup = SketchGroupPtr(new SketchSolver_Group(aSketch)); + SketchGroupPtr aNewGroup = SketchGroupPtr(new SketchSolver_Group(theSketch)); myGroups.push_back(aNewGroup); return aNewGroup; }