From: nds Date: Tue, 30 Dec 2014 05:06:30 +0000 (+0300) Subject: A modification to move a list of attributes(at the first version only the first one... X-Git-Tag: V_0.7.0_rc1~6^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0ae3d1c1788330238fa4acfc35790e0ee0e0ab0;p=modules%2Fshaper.git A modification to move a list of attributes(at the first version only the first one is moved). --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 2dd071fb5..2b0b5e121 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -271,24 +271,26 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve // 4. the features and attributes modification(move) for (; anIt != aLast; anIt++) { FeaturePtr aFeature = anIt.key(); - AttributePtr anAttr; AttributeList anAttributes = anIt.value(); - if (!anAttributes.empty()) { - anAttr = anAttributes.first(); - } // Process selection by attribute: the priority to the attribute - if (anAttr.get() != NULL) { - std::string aAttrId = anAttr->id(); - DataPtr aData = aFeature->data(); - if (aData.get() != NULL) { - std::shared_ptr aPoint = - std::dynamic_pointer_cast(aData->attribute(aAttrId)); - if (aPoint.get() != NULL) { - bool isImmutable = aPoint->setImmutable(true); - aPoint->move(dX, dY); - ModelAPI_EventCreator::get()->sendUpdated(aFeature, aMoveEvent); - aPoint->setImmutable(isImmutable); + if (!anAttributes.empty()) { + AttributeList::const_iterator anAttIt = anAttributes.begin(), anAttLast = anAttributes.end(); + for (; anAttIt != anAttLast; anAttIt++) { + AttributePtr anAttr = *anAttIt; + if (anAttr.get() == NULL) + continue; + std::string aAttrId = anAttr->id(); + DataPtr aData = aFeature->data(); + if (aData.get() != NULL) { + std::shared_ptr aPoint = + std::dynamic_pointer_cast(aData->attribute(aAttrId)); + if (aPoint.get() != NULL) { + bool isImmutable = aPoint->setImmutable(true); + aPoint->move(dX, dY); + ModelAPI_EventCreator::get()->sendUpdated(aFeature, aMoveEvent); + aPoint->setImmutable(isImmutable); + } } } } else {