X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintManager.cpp;h=71f062c392a6a3de9537a2c31ed20066c6a36929;hb=51889d235a27d0ee4b3c3237d21d1ea621063580;hp=a69eb95bcae4cf6f924d4cb1e7cb545ba45a1a93;hpb=3d680157a89ccd3b3e28bfd9a4404b1ef1b9c3ac;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index a69eb95bc..71f062c39 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: SketchSolver_ConstraintManager.cpp // Created: 08 May 2014 // Author: Artem ZHIDKOV @@ -112,7 +114,7 @@ void SketchSolver_ConstraintManager::processEvent( } // Solve the set of constraints - resolveConstraints(); + resolveConstraints(isMovedEvt); // send update for movement in any case } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) { std::shared_ptr aDeleteMsg = std::dynamic_pointer_cast(theMessage); @@ -370,7 +372,7 @@ std::shared_ptr SketchSolver_ConstraintManager // Class: SketchSolver_Session // Purpose: change entities according to available constraints // ============================================================================ -void SketchSolver_ConstraintManager::resolveConstraints() +void SketchSolver_ConstraintManager::resolveConstraints(const bool theForceUpdate) { myIsComputed = true; bool needToUpdate = false; @@ -386,12 +388,15 @@ void SketchSolver_ConstraintManager::resolveConstraints() if ((*aGroupIter)->resolveConstraints()) needToUpdate = true; - // Features may be updated => now send events, btu for all changed at once + // Features may be updated => now send events, but for all changed at once if (isUpdateFlushed) { Events_Loop::loop()->setFlushed(anUpdateEvent, true); } - if (needToUpdate) - Events_Loop::loop()->flush(anUpdateEvent); + // Must be before flush because on "Updated" flush the results may be produced + // and the creation event is appeared with many new objects. If myIsComputed these + // events are missed in processEvents and some elements are not added. myIsComputed = false; + if (needToUpdate || theForceUpdate) + Events_Loop::loop()->flush(anUpdateEvent); }