]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1070
authorisn <isn@opencascade.com>
Wed, 7 Dec 2016 11:12:34 +0000 (14:12 +0300)
committerisn <isn@opencascade.com>
Wed, 7 Dec 2016 11:12:34 +0000 (14:12 +0300)
src/HYDROData/HYDROData_SplitToZonesTool.cxx

index 182c61781ffcc8601989763b74f99d91b5bedbcf..8784a1e5f31f9a008241221c5e86ac2e7e652b30 100644 (file)
@@ -44,6 +44,7 @@
 #include <BOPAlgo_BOP.hxx>
 #include <BOPAlgo_Builder.hxx>
 #include <TopExp.hxx>
+#include <assert.h>
 
 //#define DEB_SPLIT_TO_ZONES 1
 //#define DEB_SPLIT_TO_ZONES_CHECK_PARTITION 1
@@ -246,6 +247,24 @@ HYDROData_SplitToZonesTool::SplitDataList
         anOutputSplitDataList.append(SDI);
       }
 
+#ifndef NDEBUG
+      //check CutFaceByEdges method: ensure that SD.Face() edges fully covered by
+      //history map (OutOrSh2M)
+      if (!OutOrSh2M.IsEmpty())
+      {
+        TopTools_IndexedMapOfShape EE;
+        TopExp::MapShapes(SD.Face(), TopAbs_EDGE, EE);
+        int noncontNb = 0;      
+        for (int i = 1; i <= EE.Extent(); i++)
+        {
+          const TopoDS_Shape& E = EE(i);
+          noncontNb += !OutOrSh2M.Contains(E);
+        }
+        //noncontNb > 0 => some problem with edge history
+        assert(noncontNb == 0);
+      }
+#endif
+
       if(!theGroupsList.IsEmpty() ) 
       {
         SplitDataList ModifInpGroupList;
@@ -256,7 +275,16 @@ HYDROData_SplitToZonesTool::SplitDataList
           if (SData.Type != SplitData::Data_Edge)
             ModifInpGroupList.append(SData); //add as is
           const TopoDS_Shape& SData_sh = SData.Shape;
-          const TopTools_ListOfShape& modif_ls = OutOrSh2M.FindFromKey(SData_sh);
+          TopTools_ListOfShape modif_ls;
+          if (!InterPolys.IsEmpty())
+            if (OutOrSh2M.Contains(SData_sh))
+              modif_ls = OutOrSh2M.FindFromKey(SData_sh);
+            //else TODO -  show message that one of the object should be updated
+
+#ifndef NDEBUG
+          if (!InterPolys.IsEmpty() && OutOrSh2M.IsEmpty())
+            assert (true);
+#endif
           if (modif_ls.IsEmpty())
             ModifInpGroupList.append(SData); //non modified
           else