From: szy Date: Fri, 20 Dec 2013 12:05:29 +0000 (+0000) Subject: 20.12.2013.Update to fix case with one input shape: no split. X-Git-Tag: BR_hydro_v_0_6~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3cc94e64c49b12365576d4f0dd4d5b29cf6ff2b3;p=modules%2Fhydro.git 20.12.2013.Update to fix case with one input shape: no split. --- diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index 6f20f0d6..f7cd068a 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -60,7 +60,7 @@ HYDROData_SplitToZonesTool::SplitDataList const Handle(HYDROData_PolylineXY)& thePolyline ) { SplitDataList anOutputSplitDataList; - + if(theObjectList.IsEmpty()) return anOutputSplitDataList; // Preparation. // Collect the object shapes to split. InputDataList will contain elements which will hold shape & name_of_shape. SplitDataList anInputSplitDataList; @@ -121,15 +121,15 @@ HYDROData_SplitToZonesTool::SplitDataList } } } - - // If is only one shape is given we do not process the intersection - // algorithm but just return the unpacked input data - if ( theObjectList.Length() == 1 ) - { - anOutputSplitDataList << anInputSplitDataList << anInputGroupList; + // If only one shape is given we don't split it + // algorithm just returns the unpacked input data + if(theObjectList.Size() == 1) { + anOutputSplitDataList.append(anInputSplitDataList); + if(!theGroupsList.IsEmpty() ) + anOutputSplitDataList.append(anInputGroupList); return anOutputSplitDataList; } - + HYDROData_DataMapOfShapeListOfString aDM3; if(!anInputGroupList.isEmpty()) {// Old edge ==> List_Of_Names QStringList aListOfNames; @@ -197,35 +197,35 @@ HYDROData_SplitToZonesTool::SplitDataList aList.Append(it.Value()); // Bug in History: partition should give only modified entities! => temporary solution is used const TopTools_ListOfShape& aListOfGen = aBuilder->Generated(anIt.Value()); - it.Initialize(aListOfGen); - for(;it.More();it.Next()) - aList.Append(it.Value()); + it.Initialize(aListOfGen); + for(;it.More();it.Next()) + aList.Append(it.Value()); - aDM1.Bind(anIt.Value(), aList); - //TCollection_AsciiString aName; - if(!anInputGroupList.isEmpty()) { /* 1 */ + aDM1.Bind(anIt.Value(), aList); + //TCollection_AsciiString aName; + if(!anInputGroupList.isEmpty() ) { aList.Clear(); - TopExp_Explorer exp (anIt.Value(), TopAbs_EDGE); - for (int j =1;exp.More();exp.Next(),j++) { - const TopTools_ListOfShape& aListM = aBuilder->Modified(exp.Current()); - //cout << "NB_EDGE_M = " << aListM.Extent() <Generated(exp.Current()); - it.Initialize(aListG); - for(int k=1;it.More();it.Next(),k++) { - aList.Append(it.Value()); - //aName = aNamG + i + j +k +".brep"; - //BRepTools::Write(it.Value(),aName.ToCString()); - } - //cout << "NB_EDGE = " << aList.Extent() <Modified(exp.Current()); + //cout << "NB_EDGE_M = " << aListM.Extent() <Generated(exp.Current()); + it.Initialize(aListG); + for(int k=1;it.More();it.Next(),k++) { + aList.Append(it.Value()); + //aName = aNamG + i + j +k +".brep"; + //BRepTools::Write(it.Value(),aName.ToCString()); + } + //cout << "NB_EDGE = " << aList.Extent() < ListOfOldShapes @@ -261,92 +261,21 @@ HYDROData_SplitToZonesTool::SplitDataList QStringList aListOfNames; // names processing const TopTools_ListOfShape& aListOfOld = aMIt.Value(); TopTools_ListIteratorOfListOfShape it(aListOfOld); - for(;it.More();it.Next()) { - const TopoDS_Shape& aSh = it.Value(); //old - if(aDM3.IsBound(aSh)) { - const QStringList& ObjectNames = aDM3.Find(aSh); - aListOfNames.append(ObjectNames); - } - } -/* - if(aKey.ShapeType() == TopAbs_EDGE) { - QString aStr("EDGE_Of_Face_"); - aStr = aStr.append(TCollection_AsciiString(i).ToCString()); - const QStringList& ObjectNames = QStringList( aStr); - cout << "EDGE ==> " << ObjectNames.size() <<" " << aStr.toStdString()<