From: nds Date: Thu, 22 May 2014 12:01:47 +0000 (+0400) Subject: Merge branch 'MessagesGroups' of newgeom:newgeom into MessagesGroups X-Git-Tag: V_0.2~26^2~1^2^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8f51ebb87a4e7063c64bd8c4bc4525555aaa4bc4;p=modules%2Fshaper.git Merge branch 'MessagesGroups' of newgeom:newgeom into MessagesGroups Conflicts: src/SketchSolver/SketchSolver_ConstraintManager.cpp --- 8f51ebb87a4e7063c64bd8c4bc4525555aaa4bc4 diff --cc src/SketchSolver/SketchSolver_ConstraintManager.cpp index ab6786fa7,dba0d550c..7e9292037 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@@ -72,31 -75,44 +75,44 @@@ SketchSolver_ConstraintManager::~Sketch void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessage) { if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_CREATED) || - theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED)) + theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED) || - theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURES_MOVED)) ++ theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED)) { - const Model_FeatureUpdatedMessage* aUpdateMsg = dynamic_cast(theMessage); + const Model_FeatureUpdatedMessage* anUpdateMsg = dynamic_cast(theMessage); + std::set< boost::shared_ptr > aFeatures = anUpdateMsg->features(); - // Only sketches and constraints can be added by Create event - const std::string& aFeatureKind = aUpdateMsg->feature()->getKind(); - if (aFeatureKind.compare("Sketch") == 0) - bool isModifiedEvt = theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURES_MOVED); ++ bool isModifiedEvt = theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED); + if (!isModifiedEvt) { - boost::shared_ptr aSketch = - boost::dynamic_pointer_cast(aUpdateMsg->feature()); - changeWorkplane(aSketch); - return ; - } - boost::shared_ptr aConstraint = - boost::dynamic_pointer_cast(aUpdateMsg->feature()); - if (aConstraint) - changeConstraint(aConstraint); - else - { - // Sketch plugin features can be only updated - boost::shared_ptr aFeature = - boost::dynamic_pointer_cast(aUpdateMsg->feature()); - if (aFeature) - updateEntity(aFeature); + std::set< boost::shared_ptr >::iterator aFeatIter; + for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) + { + // Only sketches and constraints can be added by Create event + const std::string& aFeatureKind = (*aFeatIter)->getKind(); + if (aFeatureKind.compare("Sketch") == 0) + { + boost::shared_ptr aSketch = + boost::dynamic_pointer_cast(*aFeatIter); + changeWorkplane(aSketch); + return ; + } + boost::shared_ptr aConstraint = + boost::dynamic_pointer_cast(*aFeatIter); + if (aConstraint) + changeConstraint(aConstraint); + else + { + // Sketch plugin features can be only updated + boost::shared_ptr aFeature = + boost::dynamic_pointer_cast(*aFeatIter); + if (aFeature) + updateEntity(aFeature); + } + } } + + // Solve the set of constraints + resolveConstraints(isModifiedEvt); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_DELETED)) {