From: isn Date: Mon, 28 Nov 2016 11:42:21 +0000 (+0300) Subject: debug of tests [colorScale] X-Git-Tag: v1.6~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13ea5e42d4982dc1525a568ef25edcb99bf9cb2b;p=modules%2Fhydro.git debug of tests [colorScale] --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index fce3baad..64155ea6 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -346,6 +346,14 @@ void TestViewer::showColorScale( bool isShow ) } } +bool TestViewer::ColorScaleIsDisplayed() +{ + Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); + if( aView.IsNull() ) + return false; + return aView->ColorScaleIsDisplayed(); +} + void TestViewer::select( int theViewX, int theViewY ) { Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index 7173bb2f..f3dea715 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -47,6 +47,7 @@ public: static Handle_Aspect_ColorScale colorScale(); static void showColorScale( bool ); + static bool ColorScaleIsDisplayed(); static void select( int theViewX, int theViewY ); diff --git a/src/HYDRO_tests/test_HYDROData_DTM.cxx b/src/HYDRO_tests/test_HYDROData_DTM.cxx index 3a84e0bc..b3fd50f7 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.cxx +++ b/src/HYDRO_tests/test_HYDROData_DTM.cxx @@ -590,8 +590,6 @@ void test_HYDROData_DTM::test_garonne() CPPUNIT_ASSERT_EQUAL( 11, (int)profiles.Size() ); - - Handle(HYDROData_DTM) DTM = Handle(HYDROData_DTM)::DownCast( aDoc->CreateObject( KIND_DTM ) ); DTM->SetProfiles( profiles ); DTM->SetDDZ( 0.1 ); @@ -601,10 +599,12 @@ void test_HYDROData_DTM::test_garonne() DTM->Update(); CPPUNIT_ASSERT_EQUAL( 282338, (int)DTM->GetAltitudePoints().size() ); - + Handle_AIS_InteractiveContext aContext = TestViewer::context(); HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM ); aBathPrs->update( true, false ); + + bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed(); TestViewer::showColorScale( true ); Handle_Aspect_ColorScale aCS = TestViewer::colorScale(); @@ -615,7 +615,8 @@ void test_HYDROData_DTM::test_garonne() QImage aDTMPrs = draw_DTM( aBathPrs, 0.5, 600, 600 ); CPPUNIT_ASSERT_IMAGES2( &aDTMPrs, "DTM_2" ); + TestViewer::showColorScale( ColorScaleIsDisp ); delete aBathPrs; - aDoc->Close(); + }