00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkProgrammableSource.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00062 #ifndef __vtkProgrammableSource_h 00063 #define __vtkProgrammableSource_h 00064 00065 #include "vtkSource.h" 00066 00067 class vtkPolyData; 00068 class vtkStructuredPoints; 00069 class vtkStructuredGrid; 00070 class vtkUnstructuredGrid; 00071 class vtkRectilinearGrid; 00072 00073 class VTK_GRAPHICS_EXPORT vtkProgrammableSource : public vtkSource 00074 { 00075 public: 00076 static vtkProgrammableSource *New(); 00077 vtkTypeRevisionMacro(vtkProgrammableSource,vtkSource); 00078 00081 void SetExecuteMethod(void (*f)(void *), void *arg); 00082 00084 void SetExecuteMethodArgDelete(void (*f)(void *)); 00085 00090 vtkPolyData *GetPolyDataOutput(); 00091 00093 vtkStructuredPoints *GetStructuredPointsOutput(); 00094 00096 vtkStructuredGrid *GetStructuredGridOutput(); 00097 00099 vtkUnstructuredGrid *GetUnstructuredGridOutput(); 00100 00102 vtkRectilinearGrid *GetRectilinearGridOutput(); 00103 00104 void UpdateInformation(); 00105 void UpdateData(vtkDataObject *output); 00106 00107 protected: 00108 vtkProgrammableSource(); 00109 ~vtkProgrammableSource(); 00110 00111 void Execute(); 00112 00113 void (*ExecuteMethod)(void *); //function to invoke 00114 void (*ExecuteMethodArgDelete)(void *); 00115 void *ExecuteMethodArg; 00116 00117 vtkTimeStamp ExecuteTime; 00118 private: 00119 vtkProgrammableSource(const vtkProgrammableSource&); // Not implemented. 00120 void operator=(const vtkProgrammableSource&); // Not implemented. 00121 }; 00122 00123 #endif 00124