An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

vtkTestingInteractor.cxx 1.91 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkTestingInteractor.cxx

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkTestingInteractor.h"
16
#include "vtkObjectFactory.h"
17
18
#include "vtkSmartPointer.h"
#include "vtkRenderWindow.h"
19
#include "vtkTesting.h"
20

21
vtkStandardNewMacro(vtkTestingInteractor);
22

23
24
25
26
27
int          vtkTestingInteractor::TestReturnStatus = -1;
double       vtkTestingInteractor::ErrorThreshold = 40.0;
std::string  vtkTestingInteractor::ValidBaseline;
std::string  vtkTestingInteractor::TempDirectory;
std::string  vtkTestingInteractor::DataDirectory;
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

// Start normally starts an event loop. This interator uses vtkTesting
// to grab the render window and compare the results to a baseline image
void vtkTestingInteractor::Start()
{
  vtkSmartPointer<vtkTesting> testing =
    vtkSmartPointer<vtkTesting>::New();
  testing->SetRenderWindow(this->GetRenderWindow());

  // Location of the temp directory for testing
  testing->AddArgument("-T");
  testing->AddArgument(vtkTestingInteractor::TempDirectory.c_str());

  // Location of the Data directory
  testing->AddArgument("-D");
  testing->AddArgument(vtkTestingInteractor::DataDirectory.c_str());

  // The name of the valid baseline image
  testing->AddArgument("-V");
47
  std::string valid = vtkTestingInteractor::ValidBaseline;
48
49
50
  testing->AddArgument(valid.c_str());

  // Regression test the image
51
  vtkTestingInteractor::TestReturnStatus = testing->RegressionTest(vtkTestingInteractor::ErrorThreshold);
52
}