Salome HOME
refs #1330: basic implementation of the not zoomable polyline arrows
[modules/hydro.git] / src / HYDROData / HYDROData_SplitToZonesTool.cxx
index 182c61781ffcc8601989763b74f99d91b5bedbcf..07a515ff296c6723f1a6d9c14a4da6bc5785204b 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
@@ -52,7 +53,7 @@
 static TCollection_AsciiString fileNameBefore("BeforeTranslation");
 #endif
 
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
 #include "HYDRO_trace.hxx"
 
 TopoDS_Face HYDROData_SplitToZonesTool::SplitData::Face() const
@@ -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