From: isn Date: Thu, 30 Nov 2017 10:46:59 +0000 (+0300) Subject: debug of tests X-Git-Tag: v2.1.1__salome84~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2d7c0059c85e0be651b8351b925f8ac6ea49e629;p=modules%2Fhydro.git debug of tests --- diff --git a/src/HYDROGUI/HYDROGUI_Overview.cxx b/src/HYDROGUI/HYDROGUI_Overview.cxx index bc809703..e3cb8a6c 100644 --- a/src/HYDROGUI/HYDROGUI_Overview.cxx +++ b/src/HYDROGUI/HYDROGUI_Overview.cxx @@ -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; } diff --git a/src/HYDRO_tests/reference_data/win32/Channel.png b/src/HYDRO_tests/reference_data/win32/Channel.png index ee59e116..76c911af 100644 Binary files a/src/HYDRO_tests/reference_data/win32/Channel.png and b/src/HYDRO_tests/reference_data/win32/Channel.png differ diff --git a/src/HYDRO_tests/reference_data/win32/overview_drag.png b/src/HYDRO_tests/reference_data/win32/overview_drag.png index 51bb7321..4d87541e 100644 Binary files a/src/HYDRO_tests/reference_data/win32/overview_drag.png and b/src/HYDRO_tests/reference_data/win32/overview_drag.png differ diff --git a/src/HYDRO_tests/reference_data/win32/overview_empty.png b/src/HYDRO_tests/reference_data/win32/overview_empty.png index cbe55edf..5a0693fa 100644 Binary files a/src/HYDRO_tests/reference_data/win32/overview_empty.png and b/src/HYDRO_tests/reference_data/win32/overview_empty.png differ diff --git a/src/HYDRO_tests/reference_data/win32/overview_panned_1.png b/src/HYDRO_tests/reference_data/win32/overview_panned_1.png index 4b79d389..12eabb8c 100644 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 diff --git a/src/HYDRO_tests/reference_data/win32/overview_prs.png b/src/HYDRO_tests/reference_data/win32/overview_prs.png index 59d60f9d..be48a17c 100644 Binary files a/src/HYDRO_tests/reference_data/win32/overview_prs.png and b/src/HYDRO_tests/reference_data/win32/overview_prs.png differ diff --git a/src/HYDRO_tests/reference_data/win32/overview_rotated_1.png b/src/HYDRO_tests/reference_data/win32/overview_rotated_1.png index 7846098a..80121bdd 100644 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 diff --git a/src/HYDRO_tests/reference_data/win32/overview_selection.png b/src/HYDRO_tests/reference_data/win32/overview_selection.png index 536c7b9c..fc6faf79 100644 Binary files a/src/HYDRO_tests/reference_data/win32/overview_selection.png and b/src/HYDRO_tests/reference_data/win32/overview_selection.png differ diff --git a/src/HYDRO_tests/reference_data/win32/overview_selection_a.png b/src/HYDRO_tests/reference_data/win32/overview_selection_a.png index 7bf88ecc..65aa4a93 100644 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 diff --git a/src/HYDRO_tests/reference_data/win32/overview_zoomed_1.png b/src/HYDRO_tests/reference_data/win32/overview_zoomed_1.png index eb0013aa..651650ac 100644 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 diff --git a/src/HYDRO_tests/reference_data/win32/overview_zoomed_2.png b/src/HYDRO_tests/reference_data/win32/overview_zoomed_2.png index 86fe552e..a40ed2f7 100644 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 diff --git a/src/HYDRO_tests/test_Overview.cxx b/src/HYDRO_tests/test_Overview.cxx index a83af23d..9bf5e7f4 100644 --- a/src/HYDRO_tests/test_Overview.cxx +++ b/src/HYDRO_tests/test_Overview.cxx @@ -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" );