00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkProgrammableSource.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 =========================================================================*/ 00046 #ifndef __vtkProgrammableSource_h 00047 #define __vtkProgrammableSource_h 00048 00049 #include "vtkSource.h" 00050 00051 class vtkPolyData; 00052 class vtkStructuredPoints; 00053 class vtkStructuredGrid; 00054 class vtkUnstructuredGrid; 00055 class vtkRectilinearGrid; 00056 00057 class VTK_GRAPHICS_EXPORT vtkProgrammableSource : public vtkSource 00058 { 00059 public: 00060 static vtkProgrammableSource *New(); 00061 vtkTypeRevisionMacro(vtkProgrammableSource,vtkSource); 00062 00065 void SetExecuteMethod(void (*f)(void *), void *arg); 00066 00068 void SetExecuteMethodArgDelete(void (*f)(void *)); 00069 00074 vtkPolyData *GetPolyDataOutput(); 00075 00077 vtkStructuredPoints *GetStructuredPointsOutput(); 00078 00080 vtkStructuredGrid *GetStructuredGridOutput(); 00081 00083 vtkUnstructuredGrid *GetUnstructuredGridOutput(); 00084 00086 vtkRectilinearGrid *GetRectilinearGridOutput(); 00087 00088 void UpdateInformation(); 00089 void UpdateData(vtkDataObject *output); 00090 00091 protected: 00092 vtkProgrammableSource(); 00093 ~vtkProgrammableSource(); 00094 00095 void Execute(); 00096 00097 void (*ExecuteMethod)(void *); //function to invoke 00098 void (*ExecuteMethodArgDelete)(void *); 00099 void *ExecuteMethodArg; 00100 00101 vtkTimeStamp ExecuteTime; 00102 private: 00103 vtkProgrammableSource(const vtkProgrammableSource&); // Not implemented. 00104 void operator=(const vtkProgrammableSource&); // Not implemented. 00105 }; 00106 00107 #endif 00108