Salome HOME
refs #1326: debug of the selection on bathymetry
[modules/hydro.git] / src / HYDRO_tests / TestViewer.cxx
index 5ef6d2d9529afa0b6042d491bb0535c1eebb8232..f3c3215206266131e7968b0b3731cfbbc05344cb 100644 (file)
@@ -134,12 +134,14 @@ void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject,
     eraseAll( false );
   }
   
-  context()->Display( theObject, theMode, theSelectionMode );
   if( theSelectionMode > 0 )
   {
     context()->OpenLocalContext();
+    context()->Display( theObject, theMode, theSelectionMode );
     context()->Activate( theObject, theSelectionMode, Standard_True );
   }
+  else
+    context()->Display( theObject, theMode, theSelectionMode );
 
   if( isFitAll )
   {
@@ -274,6 +276,14 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons
   else
     anActualImage = viewWindow()->dumpView();
 
+  const bool SWAP_RGB_ORDER = true;
+  if( SWAP_RGB_ORDER )
+  {
+    // A temporary patch for bug in SALOME/OCC dump; the result image contains swapped RGB colors
+    anActualImage = anActualImage.rgbSwapped();
+  }
+
+
   if( theCase )
     myKey = theCase;
 
@@ -414,3 +424,8 @@ bool TestViewer::areScriptsEqual( const QString& theBaseName,
 
   return isEqual;
 }
+
+void TestViewer::setKey( const QString& theKey )
+{
+  myKey = theKey;
+}