]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
30.01.2014. Fix for bug with bounding wire.
authorszy <szy@opencascade.com>
Fri, 31 Jan 2014 05:59:28 +0000 (05:59 +0000)
committerszy <szy@opencascade.com>
Fri, 31 Jan 2014 05:59:28 +0000 (05:59 +0000)
src/HYDROData/HYDROData_SplitToZonesTool.cxx

index e496b1f213f98fd27761a2f812c966fe01bc56ba..f251cc758b3defe905b107a8f07a9f53a90ab04e 100644 (file)
@@ -247,8 +247,8 @@ HYDROData_SplitToZonesTool::SplitDataList
   // Step 3. Collect history  
   //HYDROData_DataMapOfShapeListOfShape aDM1;
   BOPCol_ListIteratorOfListOfShape anIt(aLS); 
-  //TCollection_AsciiString aNamM ("EdgM_");
-  //TCollection_AsciiString aNamG ("EdgG_");
+  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 = splitTool.Modified(anIt.Value());
@@ -332,6 +332,7 @@ HYDROData_SplitToZonesTool::SplitDataList
           if(aCheck.IsValid()) {
 #ifdef DEB_SPLIT_TO_ZONES
                    BRepTools::Write(aComResult,"CommonV.brep");
+                       BRepTools::Write(limFace,"limFace.brep");
 #endif 
                        aBndName = thePolyline->GetName();
                    hasLimits = Standard_True; // DM2 should be filled here
@@ -340,6 +341,12 @@ HYDROData_SplitToZonesTool::SplitDataList
               const TopoDS_Shape& anEdge = exp.Current();
                          if(anEdge.IsNull()) continue;
                          aBndView.Add(anEdge);
+                 QStringList aListOfNames;
+                     aListOfNames.append(aBndName);
+                         aDM3.Bind(anEdge, aListOfNames);
+                         TopTools_ListOfShape aList;
+                         aList.Append(anEdge);
+                         aDM1.Bind(anEdge,aList);
                        }
                    HYDROData_MapOfShape aView;
                        exp.Init (aResult, TopAbs_FACE);
@@ -392,14 +399,25 @@ HYDROData_SplitToZonesTool::SplitDataList
                           }
                         }
                        }
-                 } //end DM4 filling (phase 1)
+                       } //end DM4 filling (phase 1)
                    //cout << "DM4 Ext = " <<aDM4.Extent() <<endl;
                 // phase 2 (from tool)
+#ifdef DEB_SPLIT_TO_ZONES
+                TCollection_AsciiString aNam("BEd_");
+#endif
          TopExp_Explorer expt (limFace, TopAbs_EDGE);
-                for(;expt.More();expt.Next()) {
+                for(int i =1;expt.More();expt.Next(),i++) {
                   const TopoDS_Shape& anEdge = expt.Current();
                   if(!anEdge.IsNull()) {
-             const TopTools_ListOfShape& aListOfNewEd = mkCom.Modified(anEdge);                         
+             const TopTools_ListOfShape& aListOfNewEd = mkCom.Modified(anEdge);        
+#ifdef DEB_SPLIT_TO_ZONES
+                        TopTools_ListIteratorOfListOfShape itl(aListOfNewEd);
+                        for(int j=1;itl.More();itl.Next(),j++) {
+                          TCollection_AsciiString aName = aNam + i + "_" + j + ".brep";
+                          BRepTools::Write(itl.Value(), aName.ToCString());
+                          cout <<aName.ToCString()<<" = "<< itl.Value().TShape() <<endl;
+                        }
+#endif
              if(!aListOfNewEd.IsEmpty())
                   aDM4.Bind(anEdge, aListOfNewEd);
                         else {
@@ -449,9 +467,11 @@ HYDROData_SplitToZonesTool::SplitDataList
                         if(!aDM4.IsBound(it.Value())) // bi - is deleted
                continue; // go to the next bi
                         else {
+                               //cout <<"DM4_Key: TShape = " <<it.Value().TShape() <<endl;
                                const TopTools_ListOfShape& aListOfNew4 = aDM4.Find(it.Value());
                            TopTools_ListIteratorOfListOfShape it4(aListOfNew4); // {c1, c2, c3,...}
                 for(;it4.More();it4.Next()) {
+                                 //cout <<"DM4_Value: TShape = " <<it4.Value().TShape() <<endl;
                                  if(!aDM2.IsBound(it4.Value()))
                     aDM2.Bind(it4.Value(), aList);
                              else {
@@ -461,7 +481,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                                }
                         }
                   }
-                }
+                }//###
                 }
                 } else {
                         hasLimits = Standard_False;
@@ -523,6 +543,11 @@ HYDROData_SplitToZonesTool::SplitDataList
            BRepTools::Write(aSh ,aName.ToCString());           
 #endif 
          }     else {
+#ifdef DEB_SPLIT_TO_ZONES
+               TCollection_AsciiString aName = aNam4 +"__" + i +"_" + j + ".brep";
+           BRepTools::Write(aSh ,aName.ToCString());           
+               cout <<aName.ToCString()<<" = "<< aSh.TShape() <<endl;
+#endif
                  if(aBndView.Contains(aSh) && hasLimits) {                     
                        aListOfNames.append(aBndName);
 #ifdef DEB_SPLIT_TO_ZONES