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 =========================================================================*/ 00050 #ifndef __vtkProgrammableSource_h 00051 #define __vtkProgrammableSource_h 00052 00053 #include "vtkSource.h" 00054 00055 class vtkPolyData; 00056 class vtkStructuredPoints; 00057 class vtkStructuredGrid; 00058 class vtkUnstructuredGrid; 00059 class vtkRectilinearGrid; 00060 00061 class VTK_GRAPHICS_EXPORT vtkProgrammableSource : public vtkSource 00062 { 00063 public: 00064 static vtkProgrammableSource *New(); 00065 vtkTypeRevisionMacro(vtkProgrammableSource,vtkSource); 00066 00069 void SetExecuteMethod(void (*f)(void *), void *arg); 00070 00072 void SetExecuteMethodArgDelete(void (*f)(void *)); 00073 00078 vtkPolyData *GetPolyDataOutput(); 00079 00081 vtkStructuredPoints *GetStructuredPointsOutput(); 00082 00084 vtkStructuredGrid *GetStructuredGridOutput(); 00085 00087 vtkUnstructuredGrid *GetUnstructuredGridOutput(); 00088 00090 vtkRectilinearGrid *GetRectilinearGridOutput(); 00091 00092 void UpdateInformation(); 00093 void UpdateData(vtkDataObject *output); 00094 00095 protected: 00096 vtkProgrammableSource(); 00097 ~vtkProgrammableSource(); 00098 00099 void Execute(); 00100 00101 void (*ExecuteMethod)(void *); //function to invoke 00102 void (*ExecuteMethodArgDelete)(void *); 00103 void *ExecuteMethodArg; 00104 00105 vtkTimeStamp ExecuteTime; 00106 private: 00107 vtkProgrammableSource(const vtkProgrammableSource&); // Not implemented. 00108 void operator=(const vtkProgrammableSource&); // Not implemented. 00109 }; 00110 00111 #endif 00112