From: szy Date: Mon, 23 Dec 2013 11:08:56 +0000 (+0000) Subject: 23.12.2013. Update Split method (edges history correction). X-Git-Tag: BR_hydro_v_0_7~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d1cf198ac040094d2999a9a1e1f89f8500588bbe;p=modules%2Fhydro.git 23.12.2013. Update Split method (edges history correction). --- diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index f7cd068a..04e212a7 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -64,6 +64,7 @@ HYDROData_SplitToZonesTool::SplitDataList // Preparation. // Collect the object shapes to split. InputDataList will contain elements which will hold shape & name_of_shape. SplitDataList anInputSplitDataList; + //TCollection_AsciiString aNam("Faces_"); for( int anIndex = 1, aLength = theObjectList.Length(); anIndex <= aLength; anIndex++ ) { Handle(HYDROData_Object) aGeomObj = @@ -74,6 +75,8 @@ HYDROData_SplitToZonesTool::SplitDataList TopoDS_Shape aShape = aGeomObj->GetTopShape(); if ( aShape.IsNull() ) continue; +//TCollection_AsciiString aName = aNam + anIndex + ".brep"; +//BRepTools::Write(aShape, aName.ToCString()); if ( aShape.ShapeType() == TopAbs_COMPOUND ) { // Create split data for each face contained in the compound @@ -190,25 +193,33 @@ HYDROData_SplitToZonesTool::SplitDataList //TCollection_AsciiString aNamM ("EdgM_"); //TCollection_AsciiString aNamG ("EdgG_"); for (int i =1;anIt.More();anIt.Next(),i++) { + Standard_Boolean foundF(Standard_False); const TopTools_ListOfShape& aListOfNew = aBuilder->Modified(anIt.Value()); + if(!aListOfNew.IsEmpty()) + foundF = Standard_True; TopTools_ListOfShape aList; TopTools_ListIteratorOfListOfShape it(aListOfNew); for(;it.More();it.Next()) 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()); + if(!aListOfGen.IsEmpty()) + foundF = Standard_True; it.Initialize(aListOfGen); for(;it.More();it.Next()) aList.Append(it.Value()); - + if(!foundF) // face is not modified + aList.Append (anIt.Value()); aDM1.Bind(anIt.Value(), aList); //TCollection_AsciiString aName; - if(!anInputGroupList.isEmpty() ) { + if(!anInputGroupList.isEmpty() ) { // 1 aList.Clear(); TopExp_Explorer exp (anIt.Value(), TopAbs_EDGE); for (int j =1;exp.More();exp.Next(),j++) { + Standard_Boolean foundE(Standard_False); const TopTools_ListOfShape& aListM = aBuilder->Modified(exp.Current()); //cout << "NB_EDGE_M = " << aListM.Extent() <Generated(exp.Current()); + if(aListG.Extent()) foundE = Standard_True; it.Initialize(aListG); for(int k=1;it.More();it.Next(),k++) { aList.Append(it.Value()); @@ -223,6 +235,11 @@ HYDROData_SplitToZonesTool::SplitDataList //BRepTools::Write(it.Value(),aName.ToCString()); } //cout << "NB_EDGE = " << aList.Extent() <