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

dox/Rendering/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 =========================================================================*/ 00021 #ifndef __vtkTesting_h 00022 #define __vtkTesting_h 00023 00024 #include "vtkObject.h" 00025 00026 class vtkLine; 00027 class vtkTriangle; 00028 class vtkRenderWindow; 00029 00030 //BTX 00031 struct VTK_RENDERING_EXPORT vtkTestUtilities 00032 { 00036 static char* GetDataRoot(int argc, char* argv[]); 00037 00039 00045 static char* ExpandDataFileName(int argc, char* argv[], 00046 const char* fname, 00047 int slash = 0); 00048 // Description: 00049 // Function returning either a command line argument, an environment 00050 // variable or a default value. 00051 // The returned string has to be deleted (with delete[]) by the user. 00052 static char* GetArgOrEnvOrDefault(const char* arg, 00053 int argc, char* argv[], 00054 const char* env, 00055 const char* def); 00057 00059 00065 static char* ExpandFileNameWithArgOrEnvOrDefault(const char* arg, 00066 int argc, char* argv[], 00067 const char* env, 00068 const char* def, 00069 const char* fname, 00070 int slash = 0); 00072 }; 00073 //ETX 00074 00075 class VTK_RENDERING_EXPORT vtkTesting : public vtkObject 00076 { 00077 public: 00078 static vtkTesting *New(); 00079 vtkTypeRevisionMacro(vtkTesting,vtkObject); 00080 void PrintSelf(ostream& os, vtkIndent indent); 00081 00082 //BTX 00083 enum ReturnValue { 00084 FAILED = 0, 00085 PASSED = 1, 00086 NOT_RUN = 2, 00087 DO_INTERACTOR = 3 00088 }; 00089 00090 static int Test(int argc, char *argv[], vtkRenderWindow *rw, double thresh); 00091 //ETX 00092 00094 00095 vtkSetClampMacro(FrontBuffer, int, 0, 1); 00096 vtkBooleanMacro(FrontBuffer, int); 00097 vtkGetMacro(FrontBuffer, int); 00099 00101 virtual int RegressionTest(double thresh); 00102 00104 00106 virtual void SetRenderWindow(vtkRenderWindow* rw); 00107 vtkGetObjectMacro(RenderWindow, vtkRenderWindow); 00109 00111 */ 00112 vtkSetStringMacro(DataFileName); 00113 vtkGetStringMacro(DataFileName); 00115 00116 protected: 00117 vtkTesting(); 00118 ~vtkTesting(); 00119 00120 static char* IncrementFileName(const char* fname, int count); 00121 static int LookForFile(const char* newFileName); 00122 00123 int FrontBuffer; 00124 vtkRenderWindow* RenderWindow; 00125 char* DataFileName; 00126 00127 private: 00128 vtkTesting(const vtkTesting&); // Not implemented. 00129 void operator=(const vtkTesting&); // Not implemented. 00130 }; 00131 00132 #endif 00133 00134