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 =========================================================================*/
24 #ifndef vtkDemandDrivenPipeline_h
25 #define vtkDemandDrivenPipeline_h
26 
27 #include "vtkCommonExecutionModelModule.h" // For export macro
28 #include "vtkExecutive.h"
29 
30 class vtkAbstractArray;
31 class vtkDataArray;
33 class vtkDemandDrivenPipelineInternals;
34 class vtkFieldData;
35 class vtkInformation;
40 
47 
48 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkDemandDrivenPipeline : public vtkExecutive
49 {
50 public:
51  static vtkDemandDrivenPipeline* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
59  int ProcessRequest(vtkInformation* request,
60  vtkInformationVector** inInfo,
61  vtkInformationVector* outInfo) override;
62 
66  int
68  vtkInformationVector** inInfoVec,
69  vtkInformationVector* outInfoVec,
70  int requestFromOutputPort,
71  vtkMTimeType* mtime) override;
72 
74 
78  int Update() override;
79  int Update(int port) override;
81 
83 
86  vtkGetMacro(PipelineMTime, vtkMTimeType);
88 
93  virtual int SetReleaseDataFlag(int port, int n);
94 
98  virtual int GetReleaseDataFlag(int port);
99 
103  virtual int UpdatePipelineMTime();
104 
110  int UpdateDataObject() override;
111 
115  int UpdateInformation() override;
116 
122  virtual int UpdateData(int outputPort);
123 
128  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
129 
134  static vtkInformationRequestKey* REQUEST_INFORMATION();
135 
140  static vtkInformationRequestKey* REQUEST_DATA();
141 
147  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
148 
154  static vtkInformationIntegerKey* RELEASE_DATA();
155 
162  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
163 
169  static vtkDataObject* NewDataObject(const char* type);
170 
171 protected:
173  ~vtkDemandDrivenPipeline() override;
174 
175  // Helper methods to send requests to the algorithm.
176  virtual int ExecuteDataObject(vtkInformation* request,
177  vtkInformationVector** inInfo,
178  vtkInformationVector* outInfo);
179  virtual int ExecuteInformation(vtkInformation* request,
180  vtkInformationVector** inInfo,
181  vtkInformationVector* outInfo);
182  virtual int ExecuteData(vtkInformation* request,
183  vtkInformationVector** inInfo,
184  vtkInformationVector* outInfo);
185 
186 
187  // Reset the pipeline update values in the given output information object.
188  void ResetPipelineInformation(int, vtkInformation*) override;
189 
190  // Check whether the data object in the pipeline information for an
191  // output port exists and has a valid type.
192  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
193 
194 
195  // Input connection validity checkers.
196  int InputCountIsValid(vtkInformationVector **);
197  int InputCountIsValid(int port,vtkInformationVector **);
198  int InputTypeIsValid(vtkInformationVector **);
199  int InputTypeIsValid(int port,vtkInformationVector **);
200  virtual int InputTypeIsValid(int port, int index,vtkInformationVector **);
201  int InputFieldsAreValid(vtkInformationVector **);
202  int InputFieldsAreValid(int port,vtkInformationVector **);
203  virtual int InputFieldsAreValid(int port, int index,vtkInformationVector **);
204 
205  // Field existence checkers.
206  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
207  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
208  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
209 
210  // Input port information checkers.
211  int InputIsOptional(int port);
212  int InputIsRepeatable(int port);
213 
214  // Decide whether the output data need to be generated.
215  virtual int NeedToExecuteData(int outputPort,
216  vtkInformationVector** inInfoVec,
217  vtkInformationVector* outInfoVec);
218 
219  // Handle before/after operations for ExecuteData method.
220  virtual void ExecuteDataStart(vtkInformation* request,
221  vtkInformationVector** inInfoVec,
222  vtkInformationVector* outInfoVec);
223  virtual void ExecuteDataEnd(vtkInformation* request,
224  vtkInformationVector** inInfoVec,
225  vtkInformationVector* outInfoVec);
226  virtual void MarkOutputsGenerated(vtkInformation* request,
227  vtkInformationVector** inInfoVec,
228  vtkInformationVector* outInfoVec);
229 
230  // Largest MTime of any algorithm on this executive or preceding
231  // executives.
233 
234  // Time when information or data were last generated.
238 
240 
244 
245 private:
247  void operator=(const vtkDemandDrivenPipeline&) = delete;
248 };
249 
250 #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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
Abstract superclass for all arrays.
virtual int UpdateDataObject()=0
record modification and/or execution time
Definition: vtkTimeStamp.h:32
virtual int UpdateInformation()
Bring the output information up to date.
Definition: vtkExecutive.h:87
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:46
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
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:48
represent and manipulate attribute data in a dataset
Key for vector-of-keys values.
Executive supporting composite datasets.
virtual void ResetPipelineInformation(int port, vtkInformation *)=0
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:58
represent and manipulate fields of data
Definition: vtkFieldData.h:53
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Generalized interface for asking the executive to fulfill pipeline requests.