]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1325: fit on selected points of bathymetry BR_1327
authorasl <asl@opencascade.com>
Tue, 3 Oct 2017 08:08:06 +0000 (11:08 +0300)
committerasl <asl@opencascade.com>
Tue, 3 Oct 2017 08:08:06 +0000 (11:08 +0300)
src/HYDRO_tests/reference_data/CMakeLists.txt
src/HYDRO_tests/reference_data/bathy_prs_fit_selected.png [new file with mode: 0644]
src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx
src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.h

index 41ab7d792f5906be0020228e46b56c7a038a02e1..663b7227d8e312909255adc962e73bb90f3f6a9b 100644 (file)
@@ -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 (file)
index 0000000..370cbf7
Binary files /dev/null and b/src/HYDRO_tests/reference_data/bathy_prs_fit_selected.png differ
index 47f4cec2cd5ae06bf9ce9b46f54a024eb99f3fc7..9523ab4c17adaa1ebaca62f4c9d50780fffdf5e2 100644 (file)
@@ -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 );
+}
index c60ca1852d331988a0e4d685fc8e2ec041d0c5d1..3d2831f685a5315b930dcc1cb037ffdfa2c7fd55 100644 (file)
@@ -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;