From 5c59c4364e02d3e14c9fcfdfe1ffbfbdb7361b15 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 22 May 2014 17:44:41 +0400 Subject: [PATCH] Implementation of mechanism of grouping of messages Debug corrections for line edition. Modification line by property panel. Move some lines --- src/Events/Events_Loop.cpp | 2 +- src/PartSet/PartSet_OperationEditLine.cpp | 2 +- src/SketchSolver/SketchSolver_ConstraintManager.cpp | 7 +++---- src/SketchSolver/SketchSolver_ConstraintManager.h | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index 5a5a94426..40917a64f 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -103,8 +103,8 @@ void Events_Loop::flush(const Events_ID& theID) myGroups.find(theID.eventText()); if (aMyGroup != myGroups.end()) { // really sends Events_MessageGroup* aGroup = aMyGroup->second; - send(*aGroup, false); myGroups.erase(aMyGroup); + send(*aGroup, false); delete aGroup; } } diff --git a/src/PartSet/PartSet_OperationEditLine.cpp b/src/PartSet/PartSet_OperationEditLine.cpp index 18d3bbc4d..4cfbc3e9a 100644 --- a/src/PartSet/PartSet_OperationEditLine.cpp +++ b/src/PartSet/PartSet_OperationEditLine.cpp @@ -179,7 +179,7 @@ void PartSet_OperationEditLine::sendFeatures() std::list::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end(); for (; anIt != aLast; anIt++) { boost::shared_ptr aFeature = (*anIt).feature(); - if (!aFeature || aFeature == feature()) + if (!aFeature) continue; Model_FeatureUpdatedMessage aMessage(aFeature, anEvent); diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index 7e9292037..d8ae5bcd2 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -112,7 +112,7 @@ void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessa } // Solve the set of constraints - resolveConstraints(isModifiedEvt); + resolveConstraints(); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_DELETED)) { @@ -278,15 +278,14 @@ boost::shared_ptr SketchSolver_ConstraintManager::findWork return boost::shared_ptr(); } -void SketchSolver_ConstraintManager::resolveConstraints(const bool needEvent) +void SketchSolver_ConstraintManager::resolveConstraints() { std::vector::iterator aGroupIter; for (aGroupIter = myGroups.begin(); aGroupIter != myGroups.end(); aGroupIter++) (*aGroupIter)->resolveConstraints(); // Features may be updated => send events - if (needEvent) - Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED)); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED)); } diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.h b/src/SketchSolver/SketchSolver_ConstraintManager.h index b833f54dc..9cbb23bab 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.h +++ b/src/SketchSolver/SketchSolver_ConstraintManager.h @@ -84,9 +84,8 @@ protected: void updateEntity(boost::shared_ptr theFeature); /** \brief Goes through the list of groups and solve the constraints - * \param[in] needEvent shows that some features are probably updated and Update event should be thrown */ - void resolveConstraints(const bool needEvent); + void resolveConstraints(); private: class SketchSolver_ConstraintGroup; -- 2.39.2