VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDataObjectAlgorithm.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 =========================================================================*/ 00032 #ifndef vtkDataObjectAlgorithm_h 00033 #define vtkDataObjectAlgorithm_h 00034 00035 #include "vtkCommonExecutionModelModule.h" // For export macro 00036 #include "vtkAlgorithm.h" 00037 #include "vtkDataObject.h" // makes things a bit easier 00038 00039 class vtkDataSet; 00040 class vtkDataObject; 00041 00042 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkDataObjectAlgorithm : public vtkAlgorithm 00043 { 00044 public: 00045 static vtkDataObjectAlgorithm *New(); 00046 vtkTypeMacro(vtkDataObjectAlgorithm,vtkAlgorithm); 00047 void PrintSelf(ostream& os, vtkIndent indent); 00048 00050 00051 vtkDataObject* GetOutput(); 00052 vtkDataObject* GetOutput(int); 00053 virtual void SetOutput(vtkDataObject* d); 00055 00057 00058 virtual int ProcessRequest(vtkInformation*, 00059 vtkInformationVector**, 00060 vtkInformationVector*); 00062 00063 // this method is not recommended for use, but lots of old style filters 00064 // use it 00065 vtkDataObject* GetInput(); 00066 vtkDataObject *GetInput(int port); 00067 00069 00072 void SetInputData(vtkDataObject *); 00073 void SetInputData(int, vtkDataObject*); 00075 00077 00080 void AddInputData(vtkDataObject *); 00081 void AddInputData(int, vtkDataObject*); 00083 00084 protected: 00085 vtkDataObjectAlgorithm(); 00086 ~vtkDataObjectAlgorithm(); 00087 00088 // convenience method 00089 virtual int RequestInformation(vtkInformation* request, 00090 vtkInformationVector** inputVector, 00091 vtkInformationVector* outputVector); 00092 00094 00096 virtual int RequestDataObject(vtkInformation*, 00097 vtkInformationVector**, 00098 vtkInformationVector*) 00099 { 00100 return 1; 00101 } 00103 00105 00107 virtual int RequestUpdateExtent(vtkInformation*, 00108 vtkInformationVector**, 00109 vtkInformationVector*) 00110 { 00111 return 1; 00112 } 00114 00115 virtual int RequestData(vtkInformation*, 00116 vtkInformationVector**, 00117 vtkInformationVector*) 00118 { 00119 return 1; 00120 } 00121 00122 // see algorithm for more info 00123 virtual int FillOutputPortInformation(int port, vtkInformation* info); 00124 virtual int FillInputPortInformation(int port, vtkInformation* info); 00125 00126 private: 00127 vtkDataObjectAlgorithm(const vtkDataObjectAlgorithm&); // Not implemented. 00128 void operator=(const vtkDataObjectAlgorithm&); // Not implemented. 00129 }; 00130 00131 #endif