00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSource.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 =========================================================================*/ 00047 #ifndef __vtkSource_h 00048 #define __vtkSource_h 00049 00050 #include "vtkProcessObject.h" 00051 00052 class vtkDataObject; 00053 class vtkDataObjectToSourceFriendship; 00054 00055 class VTK_FILTERING_EXPORT vtkSource : public vtkProcessObject 00056 { 00057 public: 00058 vtkTypeMacro(vtkSource,vtkProcessObject); 00059 void PrintSelf(ostream& os, vtkIndent indent); 00060 00064 virtual void Update(); 00065 00068 virtual void UpdateWholeExtent(); 00069 00072 virtual void UpdateInformation(); 00073 00078 virtual void PropagateUpdateExtent(vtkDataObject *output); 00079 00085 virtual void TriggerAsynchronousUpdate(); 00086 00093 virtual void UpdateData(vtkDataObject *output); 00094 00098 virtual void ComputeInputUpdateExtents( vtkDataObject *output ); 00099 00101 00103 virtual void SetReleaseDataFlag(int); 00104 virtual int GetReleaseDataFlag(); 00105 vtkBooleanMacro(ReleaseDataFlag,int); 00107 00109 00111 vtkDataObject **GetOutputs(); 00112 vtkGetMacro(NumberOfOutputs,int); 00114 00118 void UnRegisterAllOutputs(void); 00119 00122 int GetOutputIndex(vtkDataObject *out); 00123 00127 virtual void SetExecutive(vtkExecutive* executive); 00128 00130 00134 virtual int ProcessRequest(vtkInformation*, 00135 vtkInformationVector**, 00136 vtkInformationVector*); 00138 00139 protected: 00140 vtkSource(); 00141 ~vtkSource(); 00142 00146 virtual void ExecuteData(vtkDataObject *output); 00147 00149 virtual void Execute(); 00150 00151 // By default, UpdateInformation calls this method to copy information 00152 // unmodified from the input to the output. 00153 virtual void ExecuteInformation(); 00154 00155 // Called after ExecuteData to call DataHasBeenGenerated on the 00156 // outputs. It can be overridden by subclasses to call 00157 // DataHasBeenGenerated on only a subset of the outputs. The 00158 // argument is the pointer to the output data object that was passed 00159 // to ExecuteData. 00160 virtual void MarkGeneratedOutputs(vtkDataObject*); 00161 00162 // Called to allocate the input array. Copies old inputs. 00163 void SetNumberOfOutputs(int num); 00164 00165 // method used internally for getting an output. 00166 vtkDataObject *GetOutput(int idx); 00167 00168 // protected methods for setting inputs. 00169 virtual void SetNthOutput(int num, vtkDataObject *output); 00170 virtual void AddOutput(vtkDataObject *output); 00171 virtual void RemoveOutput(vtkDataObject *output); 00172 00173 vtkDataObject **Outputs; // An Array of the outputs to the filter 00174 int NumberOfOutputs; 00175 int Updating; 00176 // Time when ExecuteInformation was last called. 00177 vtkTimeStamp InformationTime; 00178 00179 virtual void ReportReferences(vtkGarbageCollector*); 00180 00181 // Output port information must match the current outputs. 00182 int FillOutputPortInformation(int, vtkInformation*); 00183 00184 // Reimplemented from vtkAlgorithm to maintain backward 00185 // compatibility for vtkProcessObject. 00186 virtual void SetNumberOfOutputPorts(int n); 00187 00188 //BTX 00189 friend class vtkDataObjectToSourceFriendship; 00190 //ETX 00191 00192 private: 00193 vtkSource(const vtkSource&); // Not implemented. 00194 void operator=(const vtkSource&); // Not implemented. 00195 }; 00196 00197 #endif 00198 00199 00200