00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProgrammableAttributeDataFilter.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 =========================================================================*/ 00079 #ifndef __vtkProgrammableAttributeDataFilter_h 00080 #define __vtkProgrammableAttributeDataFilter_h 00081 00082 #include "vtkDataSetAlgorithm.h" 00083 00084 class vtkDataSetCollection; 00085 00086 class VTK_GRAPHICS_EXPORT vtkProgrammableAttributeDataFilter : public vtkDataSetAlgorithm 00087 { 00088 public: 00089 static vtkProgrammableAttributeDataFilter *New(); 00090 vtkTypeMacro(vtkProgrammableAttributeDataFilter,vtkDataSetAlgorithm); 00091 void PrintSelf(ostream& os, vtkIndent indent); 00092 00094 void AddInput(vtkDataSet *in); 00095 00097 void RemoveInput(vtkDataSet *in); 00098 00100 vtkDataSetCollection *GetInputList() {return this->InputList;}; 00101 00109 typedef void (*ProgrammableMethodCallbackType)(void *arg); 00110 00113 void SetExecuteMethod(void (*f)(void *), void *arg); 00114 00116 void SetExecuteMethodArgDelete(void (*f)(void *)); 00117 00118 protected: 00119 vtkProgrammableAttributeDataFilter(); 00120 ~vtkProgrammableAttributeDataFilter(); 00121 00122 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00123 vtkDataSetCollection *InputList; //list of datasets to process 00124 ProgrammableMethodCallbackType ExecuteMethod; //function to invoke 00125 ProgrammableMethodCallbackType ExecuteMethodArgDelete; 00126 void *ExecuteMethodArg; 00127 00128 virtual void ReportReferences(vtkGarbageCollector*); 00129 00130 private: 00131 // hide the superclass' AddInput() from the user and the compiler 00132 void AddInput(vtkDataObject *) 00133 { vtkErrorMacro( << "AddInput() must be called with a vtkDataSet not a vtkDataObject."); }; 00134 00135 private: 00136 vtkProgrammableAttributeDataFilter(const vtkProgrammableAttributeDataFilter&); // Not implemented. 00137 void operator=(const vtkProgrammableAttributeDataFilter&); // Not implemented. 00138 }; 00139 00140 #endif 00141 00142