From 265b227f2875175e40fc5a66caa5bc3a23d42294 Mon Sep 17 00:00:00 2001 From: szy Date: Fri, 31 Jan 2014 06:35:38 +0000 Subject: [PATCH] 31.01.2014. Clearning code. --- src/HYDROData/HYDROData_SplitToZonesTool.cxx | 111 +++++++++---------- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index f251cc75..95c514de 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -117,7 +117,9 @@ 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_"); +#ifdef DEB_SPLIT_TO_ZONES + TCollection_AsciiString aNam("Faces_"); +#endif for( int anIndex = 1, aLength = theObjectList.Length(); anIndex <= aLength; anIndex++ ) { Handle(HYDROData_Object) aGeomObj = @@ -128,9 +130,10 @@ HYDROData_SplitToZonesTool::SplitDataList TopoDS_Shape aShape = aGeomObj->GetTopShape(); if ( aShape.IsNull() ) continue; - //TCollection_AsciiString aName = aNam + anIndex + ".brep"; - //BRepTools::Write(aShape, aName.ToCString()); - +#ifdef DEB_SPLIT_TO_ZONES + TCollection_AsciiString aName = aNam + anIndex + ".brep"; + BRepTools::Write(aShape, aName.ToCString()); +#endif if ( aShape.ShapeType() == TopAbs_COMPOUND ) { // Create split data for each face contained in the compound TopExp_Explorer anExp( aShape, TopAbs_FACE ); @@ -201,6 +204,7 @@ HYDROData_SplitToZonesTool::SplitDataList aDM3.Bind(aSh, anInputGroupList.at(i).ObjectNames); } } + // Step 1. Prepare Partition structures. TopoDS_Shape aResult; BOPCol_ListOfShape aLS; @@ -247,8 +251,10 @@ HYDROData_SplitToZonesTool::SplitDataList // Step 3. Collect history //HYDROData_DataMapOfShapeListOfShape aDM1; BOPCol_ListIteratorOfListOfShape anIt(aLS); +#ifdef DEB_SPLIT_TO_ZONES TCollection_AsciiString aNamM ("EdgM_"); TCollection_AsciiString aNamG ("EdgG_"); +#endif for (int i =1;anIt.More();anIt.Next(),i++) { Standard_Boolean foundF(Standard_False); const TopTools_ListOfShape& aListOfNew = splitTool.Modified(anIt.Value()); @@ -257,16 +263,7 @@ HYDROData_SplitToZonesTool::SplitDataList 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 = splitTool.Generated(anIt.Value()); - if(!aListOfGen.IsEmpty()) { - foundF = Standard_True; - it.Initialize(aListOfGen); - for(;it.More();it.Next()) - aList.Append(it.Value()); - }*/ + aList.Append(it.Value()); if(!foundF) // face is not modified aList.Append (anIt.Value()); aDM1.Bind(anIt.Value(), aList); @@ -284,19 +281,11 @@ HYDROData_SplitToZonesTool::SplitDataList it.Initialize(aListM); for(int k=1;it.More();it.Next(),k++) { aList.Append(it.Value()); +#ifdef DEB_SPLIT_TO_ZONES //aName = aNamM + i + j +k +".brep"; //BRepTools::Write(it.Value(),aName.ToCString()); +#endif } - /* const TopTools_ListOfShape& aListG = splitTool.Generated(exp.Current()); - if(!aListG.IsEmpty()) { - foundE = Standard_True; - 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() <