Commit 4e00a63b authored by Julien Finet's avatar Julien Finet
Browse files

Charts: Disable transfer function tests for old OpenGL drivers

Transfer function charts don't support versions of OpenGL < 2.0

Change-Id: I5654b15739f92b02b6c738b8c837cbe9ef7643dd
parent cb180cbc
......@@ -17,6 +17,8 @@
#include "vtkColorTransferControlPointsItem.h"
#include "vtkColorTransferFunction.h"
#include "vtkColorTransferFunctionItem.h"
#include "vtkContext2D.h"
#include "vtkContextDevice2D.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
#include "vtkRenderWindow.h"
......@@ -55,10 +57,17 @@ int TestColorTransferFunction(int , char * [])
controlPointsItem->SetUserBounds(0., 255., 0., 1.);
chart->AddPlot(controlPointsItem);
//Finally render the scene and compare the image to a reference image
// view->GetRenderWindow()->SetMultiSamples(1);
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
// Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(1);
if (view->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
{
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
}
else
{
cout << "GL version 2 or higher is required." << endl;
}
return EXIT_SUCCESS;
}
......@@ -17,6 +17,8 @@
#include "vtkColorTransferFunction.h"
#include "vtkCompositeControlPointsItem.h"
#include "vtkCompositeTransferFunctionItem.h"
#include "vtkContext2D.h"
#include "vtkContextDevice2D.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
#include "vtkLookupTable.h"
......@@ -71,10 +73,17 @@ int TestScalarsToColors(int , char * [])
item5->SetColorTransferFunction(colorTransferFunction);
chart->AddPlot(item5);
//Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0);
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
// Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(1);
if (view->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
{
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
}
else
{
cout << "GL version 2 or higher is required." << endl;
}
return EXIT_SUCCESS;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment