From: mpv Date: Tue, 11 Nov 2014 08:23:07 +0000 (+0300) Subject: Issue #258: make selection information of the attribute label, not on the data label... X-Git-Tag: V_0.5~6^2~1^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=542a170fd9283cf24db5f0fc4fb9d1c4f26c15ff;p=modules%2Fshaper.git Issue #258: make selection information of the attribute label, not on the data label (for selection list it is really bad case) --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index c284b49eb..05888b5d7 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -114,9 +114,7 @@ bool Model_AttributeSelection::update() boost::dynamic_pointer_cast( boost::dynamic_pointer_cast(aContext)->shape()); if (aWirePtr && aWirePtr->hasPlane()) { - boost::shared_ptr aData = - boost::dynamic_pointer_cast(owner()->data()); - TDF_Label aLab = aData->label(); + TDF_Label aLab = myRef.myRef->Label(); // getting a type of selected shape Handle(TDataStd_Integer) aTypeAttr; if (!aLab.FindAttribute(TDataStd_Integer::GetID(), aTypeAttr)) { @@ -305,7 +303,7 @@ void Model_AttributeSelection::selectConstruction( return; // saving of context is enough: result construction contains exactly the needed shape } boost::shared_ptr aData = boost::dynamic_pointer_cast(owner()->data()); - TDF_Label aLab = aData->label(); + TDF_Label aLab = myRef.myRef->Label(); // identify the reuslts of sub-object of the composite by edges const TopoDS_Shape& aSubShape = theSubShape->impl(); // save type of the selected shape in integer attribute @@ -325,6 +323,7 @@ void Model_AttributeSelection::selectConstruction( } // iterate and store the result ids of sub-elements Handle(TDataStd_IntPackedMap) aRefs = TDataStd_IntPackedMap::Set(aLab); + aRefs->Clear(); const int aSubNum = aComposite->numberOfSubs(); for(int a = 0; a < aSubNum; a++) { FeaturePtr aSub = aComposite->subFeature(a); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 7e2d215ee..7b77ac066 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -254,7 +254,7 @@ bool Model_Document::compactNested() myIsEmptyTr[myTransactionsAfterSave] = allWasEmpty; myTransactionsAfterSave++; if (allWasEmpty) { - // if everything is empty, it is a problem for OCCT to work with it, + // Issue 151: if everything is empty, it is a problem for OCCT to work with it, // just commit the empty that returns nothing myDoc->CommitCommand(); } else {