]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
13.01.2014. Added some debugging code.
authorszy <szy@opencascade.com>
Mon, 13 Jan 2014 13:24:50 +0000 (13:24 +0000)
committerszy <szy@opencascade.com>
Mon, 13 Jan 2014 13:24:50 +0000 (13:24 +0000)
src/HYDROData/HYDROData_SplitToZonesTool.cxx
src/HYDROData/HYDROData_Transform.cxx

index 998667b7dbb903c8b1cfe0c4318ad5374f6d57b9..42b8a1b6ade10257481bc805e7afe61e89a69d5b 100644 (file)
 #include <Geom_Plane.hxx>
 #include <BRepBuilderAPI_FindPlane.hxx>
 
-//#define DEB_SPLIT_TO_ZONES 1
-#ifdef DEB_SPLIT_TO_ZONES
+#define DEB_SPLIT_TO_ZONES 1
+#define DEB_SPLIT_TO_ZONES_CHECK_PARTITION 1
+#if (defined (DEB_SPLIT_TO_ZONES) || defined(DEB_SPLIT_TO_ZONES_CHECK_PARTITION))
 #include <BRepTools.hxx>
+static TCollection_AsciiString fileNameBefore("BeforeTranslation");
 #endif
+
 TopoDS_Face HYDROData_SplitToZonesTool::SplitData::Face() const
 {
   TopoDS_Face aResFace;
@@ -187,6 +190,11 @@ HYDROData_SplitToZonesTool::SplitDataList
     //TCollection_AsciiString aName = aNam + i + ".brep";
     //BRepTools::Write(aSh, aName.ToCString());
   }
+#ifdef DEB_SPLIT_TO_ZONES_CHECK_PARTITION
+  TCollection_AsciiString aNameBefore = fileNameBefore + ".brep";
+  BRepTools::Write(aCmp, aNameBefore.ToCString());
+#endif
+
   HYDROData_Transform splitTool; 
   const Standard_Integer anErr = SplitFaces(aCmp, splitTool);    
   if(anErr)
@@ -209,8 +217,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());
@@ -230,7 +238,9 @@ HYDROData_SplitToZonesTool::SplitDataList
     if(!foundF) // face is not modified
          aList.Append (anIt.Value());
        aDM1.Bind(anIt.Value(), aList);
-       //TCollection_AsciiString aName;
+#ifdef DEB_SPLIT_TO_ZONES
+       TCollection_AsciiString aName;
+#endif
        if(!anInputGroupList.isEmpty() ) { // 1
       aList.Clear();
          TopExp_Explorer exp (anIt.Value(), TopAbs_EDGE);
@@ -254,11 +264,14 @@ HYDROData_SplitToZonesTool::SplitDataList
                  //BRepTools::Write(it.Value(),aName.ToCString());
                }
                //cout << "NB_EDGE = " << aList.Extent() <<endl;
-               if(!foundE) //{
+               if(!foundE) {
                  aList.Append (exp.Current());
-               //aName = aNamG + i + j +".brep";
-               //BRepTools::Write(exp.Current(),aName.ToCString());
-               //}
+#ifdef DEB_SPLIT_TO_ZONES
+                 aName = aNamG + i + j +".brep";
+                 //BRepTools::Write(exp.Current(),aName.ToCString());
+                 cout << aName.ToCString()<< " = " << exp.Current().TShape() <<endl;
+#endif
+               }
                aDM1.Bind(exp.Current(), aList);
          }      
        }
@@ -416,8 +429,9 @@ HYDROData_SplitToZonesTool::SplitDataList
        }
   }
   // Step 4. Fill output structure.
-  //TCollection_AsciiString aNam4 ("SC_");
-  
+#ifdef DEB_SPLIT_TO_ZONES
+  TCollection_AsciiString aNam4 ("SC_");
+#endif  
   HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape aMIt(aDM2);
   for(int i =1;aMIt.More();aMIt.Next(),i++) {
     SplitData aDestSplitData;
@@ -425,13 +439,13 @@ HYDROData_SplitToZonesTool::SplitDataList
     aDestSplitData.Shape = aKey;
     if(aKey.ShapeType() == TopAbs_FACE)
       aDestSplitData.Type = SplitData::Data_Zone;
-    else
+       else {
       aDestSplitData.Type = SplitData::Data_Edge;
 #ifdef DEB_SPLIT_TO_ZONES
-         //TCollection_AsciiString aName = aNam4 + i + ".brep";
-         //BRepTools::Write(aKey,aName.ToCString());
+         TCollection_AsciiString aName = aNam4 + i + ".brep";
+         BRepTools::Write(aKey,aName.ToCString());
 #endif 
-
+       }
 
     QStringList aListOfNames; // names processing
     const TopTools_ListOfShape& aListOfOld = aMIt.Value();
@@ -441,6 +455,13 @@ HYDROData_SplitToZonesTool::SplitDataList
          if(aDM3.IsBound(aSh)) {
            const QStringList& ObjectNames = aDM3.Find(aSh);
                aListOfNames.append(ObjectNames);
+#ifdef DEB_SPLIT_TO_ZONES
+
+               for ( int k = 1;k <= ObjectNames.length(); ++k ) {
+                       QString aStr = ObjectNames.last(); 
+                       cout << "Indx = " << i<< " k = " << k << " size = " <<ObjectNames.size() << " Name = "<<aStr.toStdString() <<endl;   
+               }       
+#endif 
          }      
        }
 
index a4a2f12223900461c57f20b64497151a87eb3cb8..b8fe8b15f87bac78f3d071cf859b18953c7e914d 100644 (file)
 #include <BOPAlgo_BuilderShape.hxx>
 #include <BOPAlgo_PaveFiller.hxx>
 
+#define DEB_SPLIT_TO_ZONES_CHECK_PARTITION 1
+#ifdef DEB_SPLIT_TO_ZONES_CHECK_PARTITION
+#include <BRepTools.hxx>
+#include <TCollection_AsciiString.hxx>
+static TCollection_AsciiString fileNameAfter("AfterTranslation");
+#endif
+
+
 //=======================================================================
 //function : HYDROData_Transform
 //purpose  : 
@@ -251,6 +259,10 @@ void HYDROData_Transform::BuildFuse()
   myErrorStatus=0;
   //
   const TopoDS_Shape& aS1=myTransform1->Shape();
+#ifdef DEB_SPLIT_TO_ZONES_CHECK_PARTITION
+  TCollection_AsciiString aNameBefore = fileNameAfter + ".brep";
+  BRepTools::Write(aS1, aNameBefore.ToCString());
+#endif
   //
   aIt.Initialize(aS1);
   for (; aIt.More(); aIt.Next()) {