VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProcessObject.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 =========================================================================*/ 00044 #ifndef __vtkProcessObject_h 00045 #define __vtkProcessObject_h 00046 00047 #include "vtkAlgorithm.h" 00048 00049 class vtkDataObject; 00050 00051 class VTK_FILTERING_EXPORT vtkProcessObject : public vtkAlgorithm 00052 { 00053 public: 00054 vtkTypeMacro(vtkProcessObject,vtkAlgorithm); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00056 00058 00060 vtkDataObject **GetInputs(); 00061 int GetNumberOfInputs(); 00063 00066 void SqueezeInputArray(); 00067 00069 void RemoveAllInputs(); 00070 00072 00074 virtual void SetInputConnection(vtkAlgorithmOutput* input) { 00075 this->vtkAlgorithm::SetInputConnection(input); } 00076 virtual void SetInputConnection(int port, vtkAlgorithmOutput* input); 00077 virtual void AddInputConnection(int port, vtkAlgorithmOutput* input); 00078 virtual void AddInputConnection(vtkAlgorithmOutput* input) 00079 { 00080 this->AddInputConnection(0, input); 00081 } 00082 virtual void RemoveInputConnection(int port, vtkAlgorithmOutput* input); 00083 virtual void SetNthInputConnection(int port, int index, 00084 vtkAlgorithmOutput* input); 00085 virtual void SetNumberOfInputConnections(int port, int n); 00086 protected: 00087 vtkProcessObject(); 00088 ~vtkProcessObject(); 00090 00091 int NumberOfInputs; 00092 int NumberOfRequiredInputs; 00093 vtkDataObject **Inputs; //An array of the inputs to the filter 00094 00095 // Called to allocate the input array. Copies old inputs. 00096 void SetNumberOfInputs(int num); 00097 00098 // protected methods for setting inputs. 00099 virtual void SetNthInput(int num, vtkDataObject *input); 00100 virtual void AddInput(vtkDataObject *input); 00101 virtual void RemoveInput(vtkDataObject *input); 00102 00103 virtual void ReportReferences(vtkGarbageCollector*); 00104 00105 // Implement methods required by vtkAlgorithm. 00106 virtual int FillInputPortInformation(int, vtkInformation*); 00107 virtual int FillOutputPortInformation(int, vtkInformation*); 00108 00109 // Helper methods for compatibility layer. 00110 void AddInputInternal(vtkDataObject* input); 00111 void RemoveInputInternal(vtkDataObject* input); 00112 void SetupInputs(); 00113 00114 private: 00115 vtkProcessObject(const vtkProcessObject&); // Not implemented. 00116 void operator=(const vtkProcessObject&); // Not implemented. 00117 }; 00118 00119 #endif 00120