]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
24.01.2014. Fix for bug of limiting bounding wire name..
authorszy <szy@opencascade.com>
Fri, 24 Jan 2014 14:37:30 +0000 (14:37 +0000)
committerszy <szy@opencascade.com>
Fri, 24 Jan 2014 14:37:30 +0000 (14:37 +0000)
src/HYDROData/HYDROData_SplitToZonesTool.cxx

index e4015d4a7aa54afbd97d260effea48ba50eb6a3a..d076706fadf98920b6266bf9f770ddc7d9932e80 100644 (file)
@@ -311,6 +311,8 @@ HYDROData_SplitToZonesTool::SplitDataList
   // make limiting face
   HYDROData_DataMapOfShapeListOfShape aDM4;
   Standard_Boolean hasLimits(Standard_False);
+  QString aBndName;
+  HYDROData_MapOfShape aBndView;
   if (! thePolyline.IsNull()) {    
     const TopoDS_Wire aBndWire = TopoDS::Wire(thePolyline->GetShape());
     if(!aBndWire.IsNull()) {
@@ -325,10 +327,16 @@ HYDROData_SplitToZonesTool::SplitDataList
 #ifdef DEB_SPLIT_TO_ZONES
                    BRepTools::Write(aComResult,"CommonV.brep");
 #endif 
-
+                       aBndName = thePolyline->GetName();
                    hasLimits = Standard_True; // DM2 should be filled here
+                       TopExp_Explorer exp (limFace, TopAbs_EDGE);
+                       for (int i =1;exp.More();exp.Next(),i++) {
+              const TopoDS_Shape& anEdge = exp.Current();
+                         if(anEdge.IsNull()) continue;
+                         aBndView.Add(anEdge);
+                       }
                    HYDROData_MapOfShape aView;
-                   TopExp_Explorer exp (aResult, TopAbs_FACE);
+                       exp.Init (aResult, TopAbs_FACE);
                        for (int i =1;exp.More();exp.Next(),i++) {
               const TopoDS_Shape& aFace = exp.Current();
                      if(!aFace.IsNull()) {
@@ -502,13 +510,20 @@ HYDROData_SplitToZonesTool::SplitDataList
        for(int j =1;it.More();it.Next(),j++) { 
          const TopoDS_Shape& aSh = it.Value(); //old
          if(aDM3.IsBound(aSh)) {
-           const QStringList& ObjectNames = aDM3.Find(aSh);
+           const QStringList& ObjectNames = aDM3.Find(aSh);    
                aListOfNames.append(ObjectNames);
 #ifdef DEB_SPLIT_TO_ZONES
                TCollection_AsciiString aName = aNam4 + i +"_" + j + ".brep";
            BRepTools::Write(aSh ,aName.ToCString());           
 #endif 
-         }      
+         }     else {
+                 if(aBndView.Contains(aSh) && hasLimits) {                     
+                       aListOfNames.append(aBndName);
+#ifdef DEB_SPLIT_TO_ZONES
+                       cout << " BndName = "<<aBndName.toStdString() <<endl; 
+#endif
+                 }
+         }
        }
 
        aDestSplitData.ObjectNames = aListOfNames;