]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug of tests
authorisn <isn@opencascade.com>
Thu, 30 Nov 2017 10:46:59 +0000 (13:46 +0300)
committerisn <isn@opencascade.com>
Thu, 30 Nov 2017 10:46:59 +0000 (13:46 +0300)
12 files changed:
src/HYDROGUI/HYDROGUI_Overview.cxx
src/HYDRO_tests/reference_data/win32/Channel.png
src/HYDRO_tests/reference_data/win32/overview_drag.png
src/HYDRO_tests/reference_data/win32/overview_empty.png
src/HYDRO_tests/reference_data/win32/overview_panned_1.png
src/HYDRO_tests/reference_data/win32/overview_prs.png
src/HYDRO_tests/reference_data/win32/overview_rotated_1.png
src/HYDRO_tests/reference_data/win32/overview_selection.png
src/HYDRO_tests/reference_data/win32/overview_selection_a.png
src/HYDRO_tests/reference_data/win32/overview_zoomed_1.png
src/HYDRO_tests/reference_data/win32/overview_zoomed_2.png
src/HYDRO_tests/test_Overview.cxx

index bc809703f433f68c82e3be656123c6c455761bbd..e3cb8a6c42b55213fccb9306d12557e3eda69c67 100644 (file)
@@ -278,12 +278,25 @@ QImage HYDROGUI_Overview::dump() const
   int aHeight = myViewPort->height();
 
   Image_PixMap aPix;
-  view->ToPixMap( aPix,aWidth, aHeight,Graphic3d_BT_RGBA );
 
+#if OCC_VERSION_LARGE >= 0x07020000
+  view->ToPixMap( aPix,aWidth, aHeight,Graphic3d_BT_RGBA );
   QImage anImage( aPix.Data(), aWidth, aHeight, QImage::Format_ARGB32 );
   anImage = anImage.mirrored();
   anImage = anImage.rgbSwapped();
-
+#else
+  view->ToPixMap(aPix, aWidth, aHeight, Graphic3d_BT_RGB);
+  QImage anImage( aWidth, aHeight, QImage::Format_ARGB32 );
+  for ( int i = 0; i < aWidth; i++ ) {
+    for ( int j = 0; j < aHeight; j++ ) {
+      Quantity_Color pixel = aPix.PixelColor( i, j ).GetRGB();
+      QColor color = QColor::fromRgbF( pixel.Red(), pixel.Green(), pixel.Blue() );
+      anImage.setPixelColor( i, j, color );
+    }
+  }
+  if ( aPix.IsTopDown() )
+    anImage = anImage.mirrored();
+#endif
   if( myBand && myBand->isVisible() )
   {
     QPixmap aPixmap = QPixmap::fromImage( anImage );
@@ -291,7 +304,6 @@ QImage HYDROGUI_Overview::dump() const
     myBand->render( &aPixmap, p );
     anImage = aPixmap.toImage();
   }
-
   return anImage;
 }
 
index ee59e11629ea96742cfd31657a9e01689ec0abbd..76c911af48ec8670433557b61c631272e9cdba88 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/Channel.png and b/src/HYDRO_tests/reference_data/win32/Channel.png differ
index 51bb7321c4159251efb8231514fea267a49e5037..4d87541e75ad196e1a54864c05cc4b8f46732f6b 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_drag.png and b/src/HYDRO_tests/reference_data/win32/overview_drag.png differ
index cbe55edf4951cbe064d6fac09f474a20c0f1bd22..5a0693fa8fb8ae4ca88886e76b9de1b8cf12e8bf 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_empty.png and b/src/HYDRO_tests/reference_data/win32/overview_empty.png differ
index 4b79d38997af39bf1bf9e74d8c2535ad9b130c92..12eabb8cb7ea2ade1af32f65b9f63f532045c003 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_panned_1.png and b/src/HYDRO_tests/reference_data/win32/overview_panned_1.png differ
index 59d60f9d73e6797004cd198873f4274c9d8034a7..be48a17cb942179c2c67ea64bdd02dcd1546d3c1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_prs.png and b/src/HYDRO_tests/reference_data/win32/overview_prs.png differ
index 7846098a83afeefb8f968bd3231c2500fa5760cb..80121bdd9fa49042c7ff1354fc35bfda1a033574 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_rotated_1.png and b/src/HYDRO_tests/reference_data/win32/overview_rotated_1.png differ
index 536c7b9cf955b99e010c8e1b7b637b263d1f0608..fc6faf79655716c1ef4177c4cdc0f64ef48a49be 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_selection.png and b/src/HYDRO_tests/reference_data/win32/overview_selection.png differ
index 7bf88ecc11dd118ba9e378efb7e37275f477d301..65aa4a93a18400a9f10b080e975ab8e36c774cce 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_selection_a.png and b/src/HYDRO_tests/reference_data/win32/overview_selection_a.png differ
index eb0013aa4d153d05f1a7068f26b4e9a3056eec6f..651650ac747731050652366ea3481a98833ac260 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_zoomed_1.png and b/src/HYDRO_tests/reference_data/win32/overview_zoomed_1.png differ
index 86fe552ee957e31474c6a4030f32e16aec0a44ba..a40ed2f78192a084c6bb9f68c889830e17bd4610 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/win32/overview_zoomed_2.png and b/src/HYDRO_tests/reference_data/win32/overview_zoomed_2.png differ
index a83af23d8a4045591e875a1d865393d489a9e1bb..9bf5e7f4dea782c5708da5c6d200dfa17e6994d9 100644 (file)
@@ -58,7 +58,8 @@ QImage test_Overview::dumpViews()
   QImage aMain = TestViewer::viewWindow()->getView(OCCViewer_ViewFrame::MAIN_VIEW)->dumpView();
   QImage anOverview = myOverview->dump();
 
-  aMain = aMain.rgbSwapped();              //PATCH for image came from OCCT dump
+  if (SWAP_RGB)
+    aMain = aMain.rgbSwapped();              //PATCH for image came from OCCT dump
   //anOverview = anOverview.rgbSwapped();  //overview dump already normalizes the image, the line is not necessary!!!
 
   int w1 = aMain.width();
@@ -74,9 +75,6 @@ QImage test_Overview::dumpViews()
   QPainter painter( &pix );
   painter.setPen( PSOLID );
 
-  painter.drawRect( WIDTH, WIDTH, w2, h2 );
-  painter.drawRect( w2+WIDTH, WIDTH, w1, h1 );
-
   //static int q = 0;
   //q++;
   //anOverview.save( QString( "/tmp/hydro/overview_" ) + QString::number( q ) + ".png" );
@@ -85,6 +83,9 @@ QImage test_Overview::dumpViews()
   painter.drawImage( WIDTH, WIDTH, anOverview );
   painter.drawImage( w2+WIDTH, WIDTH, aMain );
 
+  painter.drawRect( WIDTH, WIDTH, w2, h2 );
+  painter.drawRect( w2+WIDTH, WIDTH, w1, h1 );
+
   QImage res = pix.toImage();
   //res.save( QString( "/tmp/hydro/result_" ) + QString::number( q ) + ".png" );