From: asl Date: Tue, 3 Oct 2017 08:08:06 +0000 (+0300) Subject: refs #1325: fit on selected points of bathymetry X-Git-Tag: v2.1~66^2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_1327;p=modules%2Fhydro.git refs #1325: fit on selected points of bathymetry --- diff --git a/src/HYDRO_tests/reference_data/CMakeLists.txt b/src/HYDRO_tests/reference_data/CMakeLists.txt index 41ab7d79..663b7227 100644 --- a/src/HYDRO_tests/reference_data/CMakeLists.txt +++ b/src/HYDRO_tests/reference_data/CMakeLists.txt @@ -131,6 +131,7 @@ SET(REFERENCE_DATA bathy_rescaled_user.png bathy_rescaled_visible.png bathy_text_labels.png + bathy_prs_fit_selected.png ) # Application tests diff --git a/src/HYDRO_tests/reference_data/bathy_prs_fit_selected.png b/src/HYDRO_tests/reference_data/bathy_prs_fit_selected.png new file mode 100644 index 00000000..370cbf71 Binary files /dev/null and b/src/HYDRO_tests/reference_data/bathy_prs_fit_selected.png differ diff --git a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx index 47f4cec2..9523ab4c 100644 --- a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx @@ -336,3 +336,33 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_default() aDoc->Close(); TestViewer::eraseAll( true ); } + +void test_HYDROGUI_BathymetryPrs::test_fit_on_selected() +{ + TestViewer::eraseAll( true ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + importTestBath( aDoc ); + TestViewer::showColorScale( false ); + + createBathPrs(); + updateColors(); + + Handle(AIS_InteractiveObject) bprs = myBathPrs->getAISObject(); + CPPUNIT_ASSERT( !bprs.IsNull() ); + + TestViewer::show( bprs, 0, 1, true, "bathy_prs" ); + CPPUNIT_ASSERT_IMAGES; + + // Fit selected points on bathymetry + int x1 = 100, y1 = 50, x2 = 250, y2 = 200; + select( x1, y1, x2, y2 ); + TestViewer::viewWindow()->onFitSelection(); + TestViewer::setKey( "bathy_prs_fit_selected" ); + CPPUNIT_ASSERT_IMAGES; + + //QTest::qWait( 50000 ); + + aDoc->Close(); + TestViewer::eraseAll( true ); +} diff --git a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.h b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.h index c60ca185..3d2831f6 100644 --- a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.h +++ b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.h @@ -31,6 +31,7 @@ class test_HYDROGUI_BathymetryPrs : public CppUnit::TestFixture CPPUNIT_TEST( test_rescale_by_visible ); CPPUNIT_TEST( test_text_presentation ); CPPUNIT_TEST( test_rescale_default ); + CPPUNIT_TEST( test_fit_on_selected ); CPPUNIT_TEST_SUITE_END(); private: @@ -44,6 +45,7 @@ private: void test_rescale_by_visible(); void test_text_presentation(); void test_rescale_default(); + void test_fit_on_selected(); private: Handle(HYDROData_Bathymetry) myBath;