VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProgrammableSource.h 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 =========================================================================*/ 00043 #ifndef __vtkProgrammableSource_h 00044 #define __vtkProgrammableSource_h 00045 00046 #include "vtkDataSetAlgorithm.h" 00047 00048 class vtkPolyData; 00049 class vtkStructuredPoints; 00050 class vtkStructuredGrid; 00051 class vtkUnstructuredGrid; 00052 class vtkRectilinearGrid; 00053 00054 class VTK_GRAPHICS_EXPORT vtkProgrammableSource : public vtkDataSetAlgorithm 00055 { 00056 public: 00057 static vtkProgrammableSource *New(); 00058 vtkTypeMacro(vtkProgrammableSource,vtkDataSetAlgorithm); 00059 00067 typedef void (*ProgrammableMethodCallbackType)(void *arg); 00068 00071 void SetExecuteMethod(void (*f)(void *), void *arg); 00072 00074 void SetExecuteMethodArgDelete(void (*f)(void *)); 00075 00078 void SetRequestInformationMethod(void (*f)(void *)); 00079 00084 vtkPolyData *GetPolyDataOutput(); 00085 00087 vtkStructuredPoints *GetStructuredPointsOutput(); 00088 00090 vtkStructuredGrid *GetStructuredGridOutput(); 00091 00093 vtkUnstructuredGrid *GetUnstructuredGridOutput(); 00094 00096 vtkRectilinearGrid *GetRectilinearGridOutput(); 00097 00098 protected: 00099 vtkProgrammableSource(); 00100 ~vtkProgrammableSource(); 00101 00102 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00103 virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00104 virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00105 00106 ProgrammableMethodCallbackType ExecuteMethod; //function to invoke 00107 ProgrammableMethodCallbackType ExecuteMethodArgDelete; 00108 void *ExecuteMethodArg; 00109 ProgrammableMethodCallbackType RequestInformationMethod; // function to invoke 00110 00111 vtkTimeStamp ExecuteTime; 00112 int RequestedDataType; 00113 00114 private: 00115 vtkProgrammableSource(const vtkProgrammableSource&); // Not implemented. 00116 void operator=(const vtkProgrammableSource&); // Not implemented. 00117 }; 00118 00119 #endif 00120