Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkTesting.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTesting.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00064 #ifndef __vtkTesting_h
00065 #define __vtkTesting_h
00066 
00067 #include "vtkObject.h"
00068 #include <vtkstd/vector> // used for argv
00069 #include <vtkstd/string> // used for argv
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 //BTX
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 //ETX
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 //BTX
00181   vtkstd::vector<vtkstd::string> Args;
00182 //ETX
00183   char *DataRoot;
00184   double StartWallTime;
00185   double StartCPUTime;
00186   
00187 private:
00188   vtkTesting(const vtkTesting&);  // Not implemented.
00189   void operator=(const vtkTesting&);  // Not implemented.
00190 };
00191 
00192 #endif
00193 
00194 

Generated on Mon Jan 21 23:07:36 2008 for VTK by  doxygen 1.4.3-20050530