]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
23.12.2013. Update Split method (edges history correction).
authorszy <szy@opencascade.com>
Mon, 23 Dec 2013 11:08:56 +0000 (11:08 +0000)
committerszy <szy@opencascade.com>
Mon, 23 Dec 2013 11:08:56 +0000 (11:08 +0000)
src/HYDROData/HYDROData_SplitToZonesTool.cxx

index f7cd068ae14aa102af62515a7c0d4776ec032251..04e212a7f2deb0e7ee07a0fd4c676192a6930317 100644 (file)
@@ -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() <<endl;
+               if(aListM.Extent()) foundE = Standard_True;
                it.Initialize(aListM);    
                for(int k=1;it.More();it.Next(),k++) {    
              aList.Append(it.Value());
@@ -216,6 +227,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                  //BRepTools::Write(it.Value(),aName.ToCString());
                }
                const TopTools_ListOfShape& aListG = aBuilder->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() <<endl;
+               if(!foundE) //{
+                 aList.Append (exp.Current());
+               //aName = aNamG + i + j +".brep";
+               //BRepTools::Write(exp.Current(),aName.ToCString());
+               //}
                aDM1.Bind(exp.Current(), aList);
          }      
        }