]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug of tests
authorisn <isn@opencascade.com>
Tue, 6 Dec 2016 14:20:06 +0000 (17:20 +0300)
committerisn <isn@opencascade.com>
Wed, 7 Dec 2016 14:25:48 +0000 (17:25 +0300)
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/reference_data/StreamDlg.png
src/HYDRO_tests/reference_data/cc_int_w_3.png
src/HYDRO_tests/reference_data/stream_dtm_2d.png
src/HYDRO_tests/test_HYDROData_CalcCase.cxx
src/HYDRO_tests/test_HYDROData_Stream.cxx

index 64155ea69743222e7e0838adb6bdb85f728a3beb..f48beeac744da81d17d52c15ab3f1d1152567966 100644 (file)
@@ -44,6 +44,7 @@
 #include <QHash>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
+#include <Prs3d_IsoAspect.hxx>
 
 #include <GEOMUtils.hxx>
 #include <TopTools_ListOfShape.hxx>
@@ -148,11 +149,20 @@ void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject,
   }
 }
 
-void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor )
+void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor,
+  int theUIANb, int theVIANb)
 {
   Handle(AIS_Shape) aShape = new AIS_Shape( theShape );
   if( theShape.ShapeType()==TopAbs_VERTEX )
     aShape->Attributes()->PointAspect()->SetTypeOfMarker( Aspect_TOM_X );
+  if (theShape.ShapeType()==TopAbs_FACE)
+  {
+    context()->DefaultDrawer()->UIsoAspect()->SetNumber(theUIANb);
+    context()->DefaultDrawer()->VIsoAspect()->SetNumber(theVIANb);
+    Handle_Prs3d_Drawer aDrawer = aShape->Attributes();
+    aDrawer->UIsoAspect()->SetNumber(theUIANb);
+    aDrawer->VIsoAspect()->SetNumber(theVIANb);
+  }
   aShape->SetMaterial( Graphic3d_NOM_PLASTIC );
   aShape->SetColor( HYDROData_Tool::toOccColor( theColor ) );
   context()->Display( aShape, theMode, 0, Standard_False );
@@ -163,8 +173,8 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll,
     viewWindow()->onFitAll();
   }
 }
-
-void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey )
+void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey,
+                       int theUIANb, int theVIANb)
 {
   QString aNewKey = theKey;
   if( !aNewKey.isEmpty() )
@@ -185,7 +195,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll,
   GEOMUtils::SortShapes(aListOfFaces);
   TopTools_ListIteratorOfListOfShape aLF(aListOfFaces);
   for( ; aLF.More(); aLF.Next(), i++)
-    show( aLF.Value(), theMode, false, GetColor(i) );
+    show( aLF.Value(), theMode, false, GetColor(i), theUIANb, theVIANb );
 
   //show all independent wires
   TopTools_ListOfShape aListOfWires;
@@ -378,7 +388,7 @@ bool TestViewer::areScriptsEqual( const QString& theBaseName,
                                   int theLinesToOmit,
                                   QString& theMsg )
 {
-  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test";
   anExpectedRefFilePath += "/" + theBaseName;
   
   QString anActualFilePath = QDir::tempPath() + "/" + theBaseName;
index f3dea715d359b86b6de675aae5c6958809acbb46..fd470bbd78976b2b1fa3bf90e5bae2bc8e8979e9 100644 (file)
@@ -40,8 +40,10 @@ public:
   static void eraseAll( bool isUpdate );
   static void show( const Handle_AIS_InteractiveObject& theObject,
                     int theMode, int theSelectionMode, bool isFitAll, const char* theKey );
-  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor );
-  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey );
+  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor,
+                    int theUIANb = 10, int theVIANb = 10);
+  static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey,
+                    int theUIANb = 10, int theVIANb = 10);
   static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0 );
   static QColor GetColor(int i);
 
index 8371a7bc21f7ed42bcac03d6d18a7983d4fad71a..69df6a0aec371d5cdcb78180fc3c4b6d5c00e13a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/StreamDlg.png and b/src/HYDRO_tests/reference_data/StreamDlg.png differ
index cdeffb4a98fa91beaa5c00accb4024af3aacce70..53d94fec358b7dfed87a04d8cb7ef12a7b4ed089 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cc_int_w_3.png and b/src/HYDRO_tests/reference_data/cc_int_w_3.png differ
index 83044a05066838511c5d82ad996e7eb8fb51b2c7..f42860b178d50f9b26419d29b617f72f77868628 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/stream_dtm_2d.png and b/src/HYDRO_tests/reference_data/stream_dtm_2d.png differ
index 7e3c9b7226aafa33ebd9f9b0ceebce12d6a3990b..f0b327fb413e804e6f2ad0c52fc7cae95268d026 100644 (file)
@@ -98,7 +98,7 @@ void test_HYDROData_CalcCase::test_add_int_wires()
     TopTools_IndexedDataMapOfShapeShape ls;
     HYDROData_SplitToZonesTool::CutByEdges(InF, Wires, OutSh, &ls, NULL);
     CPPUNIT_ASSERT_EQUAL(1, OutSh.Extent());
-    TestViewer::show( OutSh.First(), AIS_WireFrame, true, "cc_int_w_3" );
+    TestViewer::show( OutSh.First(), AIS_WireFrame, true, "cc_int_w_3", 1, 1 );
     CPPUNIT_ASSERT_IMAGES
   }
 
index 6bf3c37d404a47aacebfbaeec1f83b7f3322a604..dff2c9bb9e0ae0b9c3b661b5e5d393eb4084ef1a 100644 (file)
@@ -261,7 +261,7 @@ void test_HYDROData_Stream::test_presentation()
   TopoDS_Shape aPrs3d = aStream->GetShape3D();
   TopoDS_Shape aPrs2d = aStream->GetTopShape();
 
-  TestViewer::show( aPrs2d, 0, true, "stream_dtm_2d" );
+  TestViewer::show( aPrs2d, 0, true, "stream_dtm_2d", 1, 1 );
   CPPUNIT_ASSERT_IMAGES;
 
   TestViewer::eraseAll( true );