Salome HOME
Merge remote-tracking branch 'origin/pre/IMPS_2016' into BR_HYDRO_IMPS_2016
[modules/hydro.git] / src / HYDRO_tests / TestViewer.cxx
index 196df1f00f03fccce966f71e650f982229db214b..64155ea69743222e7e0838adb6bdb85f728a3beb 100644 (file)
@@ -257,11 +257,18 @@ bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double th
   return true;
 }
 
-bool TestViewer::AssertImages( QString& theMessage )
+bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, const char* theCase )
 {
-  QImage anActualImage = viewWindow()->dumpView();
+  QImage anActualImage;
+  if( theImage )
+    anActualImage = *theImage;
+  else
+    anActualImage = viewWindow()->dumpView();
 
-  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+  if( theCase )
+    myKey = theCase;
+
+  QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test";
   anExpectedRefFilePath += "/" + myKey + ".png";
   QImage anExpectedRefImage; 
   anExpectedRefImage.load( anExpectedRefFilePath );
@@ -286,6 +293,8 @@ bool TestViewer::AssertImages( QString& theMessage )
   QString aDiffFilePath = QDir::tempPath() + "/" + myKey + "_diff.png";
   aDiff.save( aDiffFilePath );
 
+  anExpectedRefImage.save( QDir::tempPath() + "/" + myKey + "_1.png");
+
   return false;
 }
 
@@ -337,6 +346,14 @@ void TestViewer::showColorScale( bool isShow )
   }
 }
 
+bool TestViewer::ColorScaleIsDisplayed()
+{
+  Handle(V3d_View) aView = myViewWindow->getViewPort()->getView();
+  if( aView.IsNull() )
+    return false;
+  return aView->ColorScaleIsDisplayed();
+}
+
 void TestViewer::select( int theViewX, int theViewY )
 {
   Handle(V3d_View) aView = myViewWindow->getViewPort()->getView();