VTK
vtkDemandDrivenPipeline.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDemandDrivenPipeline.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkDemandDrivenPipeline_h
28 #define vtkDemandDrivenPipeline_h
29 
30 #include "vtkCommonExecutionModelModule.h" // For export macro
31 #include "vtkExecutive.h"
32 
33 class vtkAbstractArray;
34 class vtkDataArray;
36 class vtkDemandDrivenPipelineInternals;
37 class vtkFieldData;
38 class vtkInformation;
43 
50 
51 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkDemandDrivenPipeline : public vtkExecutive
52 {
53 public:
54  static vtkDemandDrivenPipeline* New();
56  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
57 
62  int ProcessRequest(vtkInformation* request,
63  vtkInformationVector** inInfo,
64  vtkInformationVector* outInfo) VTK_OVERRIDE;
65 
69  int
71  vtkInformationVector** inInfoVec,
72  vtkInformationVector* outInfoVec,
73  int requestFromOutputPort,
74  vtkMTimeType* mtime) VTK_OVERRIDE;
75 
77 
81  int Update() VTK_OVERRIDE;
82  int Update(int port) VTK_OVERRIDE;
84 
86 
89  vtkGetMacro(PipelineMTime, vtkMTimeType);
91 
96  virtual int SetReleaseDataFlag(int port, int n);
97 
101  virtual int GetReleaseDataFlag(int port);
102 
106  virtual int UpdatePipelineMTime();
107 
113  int UpdateDataObject() VTK_OVERRIDE;
114 
118  int UpdateInformation() VTK_OVERRIDE;
119 
125  virtual int UpdateData(int outputPort);
126 
131  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
132 
137  static vtkInformationRequestKey* REQUEST_INFORMATION();
138 
143  static vtkInformationRequestKey* REQUEST_DATA();
144 
150  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
151 
157  static vtkInformationIntegerKey* RELEASE_DATA();
158 
165  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
166 
172  static vtkDataObject* NewDataObject(const char* type);
173 
174 protected:
176  ~vtkDemandDrivenPipeline() VTK_OVERRIDE;
177 
178  // Helper methods to send requests to the algorithm.
179  virtual int ExecuteDataObject(vtkInformation* request,
180  vtkInformationVector** inInfo,
181  vtkInformationVector* outInfo);
182  virtual int ExecuteInformation(vtkInformation* request,
183  vtkInformationVector** inInfo,
184  vtkInformationVector* outInfo);
185  virtual int ExecuteData(vtkInformation* request,
186  vtkInformationVector** inInfo,
187  vtkInformationVector* outInfo);
188 
189 
190  // Reset the pipeline update values in the given output information object.
191  void ResetPipelineInformation(int, vtkInformation*) VTK_OVERRIDE;
192 
193  // Check whether the data object in the pipeline information for an
194  // output port exists and has a valid type.
195  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
196 
197 
198  // Input connection validity checkers.
199  int InputCountIsValid(vtkInformationVector **);
200  int InputCountIsValid(int port,vtkInformationVector **);
201  int InputTypeIsValid(vtkInformationVector **);
202  int InputTypeIsValid(int port,vtkInformationVector **);
203  virtual int InputTypeIsValid(int port, int index,vtkInformationVector **);
204  int InputFieldsAreValid(vtkInformationVector **);
205  int InputFieldsAreValid(int port,vtkInformationVector **);
206  virtual int InputFieldsAreValid(int port, int index,vtkInformationVector **);
207 
208  // Field existence checkers.
209  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
210  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
211  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
212 
213  // Input port information checkers.
214  int InputIsOptional(int port);
215  int InputIsRepeatable(int port);
216 
217  // Decide whether the output data need to be generated.
218  virtual int NeedToExecuteData(int outputPort,
219  vtkInformationVector** inInfoVec,
220  vtkInformationVector* outInfoVec);
221 
222  // Handle before/after operations for ExecuteData method.
223  virtual void ExecuteDataStart(vtkInformation* request,
224  vtkInformationVector** inInfoVec,
225  vtkInformationVector* outInfoVec);
226  virtual void ExecuteDataEnd(vtkInformation* request,
227  vtkInformationVector** inInfoVec,
228  vtkInformationVector* outInfoVec);
229  virtual void MarkOutputsGenerated(vtkInformation* request,
230  vtkInformationVector** inInfoVec,
231  vtkInformationVector* outInfoVec);
232 
233  // Largest MTime of any algorithm on this executive or preceding
234  // executives.
235  vtkMTimeType PipelineMTime;
236 
237  // Time when information or data were last generated.
238  vtkTimeStamp DataObjectTime;
239  vtkTimeStamp InformationTime;
240  vtkTimeStamp DataTime;
241 
243 
244  vtkInformation *InfoRequest;
245  vtkInformation *DataObjectRequest;
246  vtkInformation *DataRequest;
247 
248 private:
249  vtkDemandDrivenPipeline(const vtkDemandDrivenPipeline&) VTK_DELETE_FUNCTION;
250  void operator=(const vtkDemandDrivenPipeline&) VTK_DELETE_FUNCTION;
251 };
252 
253 #endif
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, vtkMTimeType *mtime)
A special version of ProcessRequest meant specifically for the pipeline modified time request...
Key for unsigned long values in vtkInformation.
virtual int Update()
Bring the algorithm's outputs up-to-date.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
virtual void Update()
Updates the extensions string.
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a simple class to control print indentation
Definition: vtkIndent.h:39
Key for pointer to pointer.
Key for integer values in vtkInformation.
Executive supporting on-demand execution.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
represent and manipulate attribute data in a dataset
Key for vector-of-keys values.
Executive supporting composite datasets.
Store zero or more vtkInformation instances.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:64
represent and manipulate fields of data
Definition: vtkFieldData.h:56
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Generalized interface for asking the executive to fulfill pipeline requests.