From: mpv Date: Tue, 21 Mar 2017 13:47:11 +0000 (+0300) Subject: Fix the problem of color overwriting X-Git-Tag: V_2.7.0~205 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=ca72bdeeb3bd0540c61897f34fbdf91172684f2a;hp=0d86fc6820bb4e2185a4ef443693441193678e63;p=modules%2Fshaper.git Fix the problem of color overwriting --- diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 4826c9e09..a9781e1f4 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -253,16 +252,10 @@ int Model_ResultConstruction::select(const std::shared_ptr& theSu // empty NS TNaming_Builder aBuilder(aLab); // store all sub-faces naming since faces may be used for extrusion, where all edges are needed + Handle(TDataStd_IntPackedMap) anIndices = TDataStd_IntPackedMap::Set(aLab); std::list aFacesIndexes; for(int a = 0; a < facesNum(); a++) { - aFacesIndexes.push_back(select(face(a), theExtDoc, -1)); - } - if (aFacesIndexes.size()) { - Handle(TDataStd_IntegerArray) anArray = - TDataStd_IntegerArray::Set(aLab, 0, int(aFacesIndexes.size() - 1)); - std::list::iterator anIter = aFacesIndexes.begin(); - for(int anArrayIndex = 0; anIter != aFacesIndexes.end(); anArrayIndex++, anIter++) - anArray->SetValue(anArrayIndex, *anIter); + anIndices->Add(select(face(a), theExtDoc, -1)); } return anIndex - 1; } @@ -457,10 +450,11 @@ bool Model_ResultConstruction::update(const int theIndex, if (!isInfinite()) { // update all faces named by the whole result bool aRes = true; - Handle(TDataStd_IntegerArray) anArray; - if (aLab.FindAttribute(TDataStd_IntegerArray::GetID(), anArray)) { - for(int anIndex = 0; anIndex <= anArray->Upper(); anIndex++) { - if (!update(anArray->Value(anIndex), theExtDoc, theModified)) + Handle(TDataStd_IntPackedMap) anIndices; + if (aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), anIndices)) { + TColStd_MapIteratorOfPackedMapOfInteger anIndexIter(anIndices->GetMap()); + for(; anIndexIter.More(); anIndexIter.Next()) { + if (!update(anIndexIter.Key(), theExtDoc, theModified)) aRes = false; } }