From: isn Date: Tue, 6 Dec 2016 14:20:06 +0000 (+0300) Subject: debug of tests X-Git-Tag: v1.6~5^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c76dd3570d37ca87ff6ca8b7d717c5e220933b6d;p=modules%2Fhydro.git debug of tests --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 64155ea6..f48beeac 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -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; diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index f3dea715..fd470bbd 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -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); diff --git a/src/HYDRO_tests/reference_data/StreamDlg.png b/src/HYDRO_tests/reference_data/StreamDlg.png index 8371a7bc..69df6a0a 100644 Binary files a/src/HYDRO_tests/reference_data/StreamDlg.png and b/src/HYDRO_tests/reference_data/StreamDlg.png differ diff --git a/src/HYDRO_tests/reference_data/cc_int_w_3.png b/src/HYDRO_tests/reference_data/cc_int_w_3.png index cdeffb4a..53d94fec 100644 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 diff --git a/src/HYDRO_tests/reference_data/stream_dtm_2d.png b/src/HYDRO_tests/reference_data/stream_dtm_2d.png index 83044a05..f42860b1 100644 Binary files a/src/HYDRO_tests/reference_data/stream_dtm_2d.png and b/src/HYDRO_tests/reference_data/stream_dtm_2d.png differ diff --git a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx index 7e3c9b72..f0b327fb 100644 --- a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx +++ b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx @@ -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 } diff --git a/src/HYDRO_tests/test_HYDROData_Stream.cxx b/src/HYDRO_tests/test_HYDROData_Stream.cxx index 6bf3c37d..dff2c9bb 100644 --- a/src/HYDRO_tests/test_HYDROData_Stream.cxx +++ b/src/HYDRO_tests/test_HYDROData_Stream.cxx @@ -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 );