Salome HOME
refs #1327: implementation of the scaling operations
[modules/hydro.git] / src / HYDRO_tests / test_HYDROGUI_BathymetryPrs.cxx
index 39b7b9c9bbff892787b687f9805cc34de215e825..47f4cec2cd5ae06bf9ce9b46f54a024eb99f3fc7 100644 (file)
@@ -42,6 +42,7 @@ void test_HYDROGUI_BathymetryPrs::createBathPrs()
 {
   myBathPrs = new HYDROGUI_ShapeBathymetry( 0, TestViewer::context(), myBath );
   myBathPrs->Build();
+  myBathPrs->getAISObject()->SetAutoHilight( Standard_False );
 
   double min, max;
   myBathPrs->GetRange( min, max );
@@ -93,6 +94,7 @@ void select( int x1, int y1, int x2, int y2 )
 
 void test_HYDROGUI_BathymetryPrs::test_selection()
 {
+  TestViewer::eraseAll( true );
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   importTestBath( aDoc );
@@ -111,6 +113,10 @@ void test_HYDROGUI_BathymetryPrs::test_selection()
   TestViewer::setKey( "bathy_selection" );
   CPPUNIT_ASSERT_IMAGES
 
+  select( 5, 5, 6, 6 );
+  TestViewer::setKey( "bathy_prs" );
+  CPPUNIT_ASSERT_IMAGES
+
   //QTest::qWait( 50000 );
 
   aDoc->Close();
@@ -119,6 +125,7 @@ void test_HYDROGUI_BathymetryPrs::test_selection()
 
 void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection()
 {
+  TestViewer::eraseAll( true );
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   importTestBath( aDoc );
@@ -138,6 +145,8 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection()
   myBathPrs->RescaleBySelection();
   updateColors(); // In HYDRO GUI it should be done by displayer
 
+  //QTest::qWait( 50000 );
+
   double min, max;
   myBathPrs->GetRange( min, max );
   CPPUNIT_ASSERT_DOUBLES_EQUAL( 177.78, min, EPS );
@@ -175,6 +184,7 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection()
 
 void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible()
 {
+  TestViewer::eraseAll( true );
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   importTestBath( aDoc );
@@ -215,10 +225,13 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible()
   CPPUNIT_ASSERT_IMAGES;
 
   //QTest::qWait( 50000 );
+  aDoc->Close();
+  TestViewer::eraseAll( true );
 }
 
 void test_HYDROGUI_BathymetryPrs::test_text_presentation()
 {
+  TestViewer::eraseAll( true );
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   importTestBath( aDoc );
@@ -245,6 +258,22 @@ void test_HYDROGUI_BathymetryPrs::test_text_presentation()
   TestViewer::setKey( "bathy_text_labels" );
   CPPUNIT_ASSERT_IMAGES;
 
+  // Disable text labels
+  myBathPrs->TextLabels( false );
+  vp->fitAll();
+  qApp->processEvents();
+  TestViewer::setKey( "bathy_prs" );
+  CPPUNIT_ASSERT_IMAGES;
+
+  // Special case: flag=false + non-empty selection
+  select( x1, y1, x2, y2 );
+  myBathPrs->TextLabels( false );
+  vp->fitAll();
+  qApp->processEvents();
+  TestViewer::setKey( "bathy_prs" );
+  CPPUNIT_ASSERT_IMAGES;
+
+
   //QTest::qWait( 50000 );
 
   aDoc->Close();
@@ -253,6 +282,7 @@ void test_HYDROGUI_BathymetryPrs::test_text_presentation()
 
 void test_HYDROGUI_BathymetryPrs::test_rescale_default()
 {
+  TestViewer::eraseAll( true );
   Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
 
   importTestBath( aDoc );