00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00064 #ifndef __vtkTesting_h
00065 #define __vtkTesting_h
00066
00067 #include "vtkObject.h"
00068 #include <vtkstd/vector>
00069 #include <vtkstd/string>
00070
00071 class vtkRenderWindow;
00072 class vtkImageData;
00073
00074 class VTK_RENDERING_EXPORT vtkTesting : public vtkObject
00075 {
00076 public:
00077 static vtkTesting *New();
00078 vtkTypeRevisionMacro(vtkTesting,vtkObject);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00081
00082 enum ReturnValue {
00083 FAILED = 0,
00084 PASSED = 1,
00085 NOT_RUN = 2,
00086 DO_INTERACTOR = 3
00087 };
00088
00089 static int Test(int argc, char *argv[], vtkRenderWindow *rw, double thresh);
00090
00091
00093
00094 vtkSetClampMacro(FrontBuffer, int, 0, 1);
00095 vtkBooleanMacro(FrontBuffer, int);
00096 vtkGetMacro(FrontBuffer, int);
00098
00100
00102 virtual int RegressionTest(double thresh);
00103 virtual int RegressionTest(double thresh,ostream &os);
00105
00107
00108 virtual int RegressionTest(vtkImageData* image, double thresh);
00109 virtual int RegressionTest(vtkImageData* image, double thresh, ostream& os);
00111
00113
00115 virtual void SetRenderWindow(vtkRenderWindow* rw);
00116 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
00118
00120
00121 vtkSetStringMacro(ValidImageFileName);
00122 const char *GetValidImageFileName();
00124
00126
00127 vtkGetMacro(ImageDifference, double);
00129
00135 void AddArgument(const char *argv);
00136
00139 void CleanArguments();
00140
00142
00143 const char *GetDataRoot();
00144 vtkSetStringMacro(DataRoot);
00146
00148
00149 const char *GetTempDirectory();
00150 vtkSetStringMacro(TempDirectory);
00152
00154 int IsValidImageSpecified();
00155
00157 int IsInteractiveModeSpecified();
00158
00160
00162 vtkSetMacro(BorderOffset, int);
00163 vtkGetMacro(BorderOffset, int);
00165
00166 protected:
00167 vtkTesting();
00168 ~vtkTesting();
00169
00170 static char* IncrementFileName(const char* fname, int count);
00171 static int LookForFile(const char* newFileName);
00172
00173 int FrontBuffer;
00174 vtkRenderWindow* RenderWindow;
00175 char* ValidImageFileName;
00176 double ImageDifference;
00177 char *TempDirectory;
00178 int BorderOffset;
00179
00180
00181 vtkstd::vector<vtkstd::string> Args;
00182
00183 char *DataRoot;
00184 double StartWallTime;
00185 double StartCPUTime;
00186
00187 private:
00188 vtkTesting(const vtkTesting&);
00189 void operator=(const vtkTesting&);
00190 };
00191
00192 #endif
00193
00194