00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProgrammableFilter.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 =========================================================================*/ 00045 #ifndef __vtkProgrammableFilter_h 00046 #define __vtkProgrammableFilter_h 00047 00048 #include "vtkPassInputTypeAlgorithm.h" 00049 00050 class vtkGraph; 00051 class vtkTable; 00052 00053 class VTK_GRAPHICS_EXPORT vtkProgrammableFilter : public vtkPassInputTypeAlgorithm 00054 { 00055 public: 00056 static vtkProgrammableFilter *New(); 00057 vtkTypeMacro(vtkProgrammableFilter,vtkPassInputTypeAlgorithm); 00058 void PrintSelf(ostream& os, vtkIndent indent); 00059 00067 typedef void (*ProgrammableMethodCallbackType)(void *arg); 00068 00071 void SetExecuteMethod(void (*f)(void *), void *arg); 00072 00074 void SetExecuteMethodArgDelete(void (*f)(void *)); 00075 00080 vtkPolyData *GetPolyDataInput(); 00081 00083 vtkStructuredPoints *GetStructuredPointsInput(); 00084 00086 vtkStructuredGrid *GetStructuredGridInput(); 00087 00089 vtkUnstructuredGrid *GetUnstructuredGridInput(); 00090 00092 vtkRectilinearGrid *GetRectilinearGridInput(); 00093 00095 vtkGraph *GetGraphInput(); 00096 00097 00099 vtkTable *GetTableInput(); 00100 00102 00104 vtkSetMacro(CopyArrays, bool); 00105 vtkGetMacro(CopyArrays, bool); 00106 vtkBooleanMacro(CopyArrays, bool); 00108 00109 protected: 00110 vtkProgrammableFilter(); 00111 ~vtkProgrammableFilter(); 00112 00113 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00114 virtual int FillInputPortInformation(int port, vtkInformation* info); 00115 00116 ProgrammableMethodCallbackType ExecuteMethod; //function to invoke 00117 ProgrammableMethodCallbackType ExecuteMethodArgDelete; 00118 void *ExecuteMethodArg; 00119 00120 bool CopyArrays; 00121 00122 private: 00123 vtkProgrammableFilter(const vtkProgrammableFilter&); // Not implemented. 00124 void operator=(const vtkProgrammableFilter&); // Not implemented. 00125 }; 00126 00127 #endif 00128