VTK  9.7.1
vtkDemandDrivenPipeline.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkDemandDrivenPipeline_h
19 #define vtkDemandDrivenPipeline_h
20 
21 #include "vtkCommonExecutionModelModule.h" // For export macro
22 #include "vtkExecutive.h"
23 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkAbstractArray;
27 class vtkDataArray;
29 class vtkDemandDrivenPipelineInternals;
30 class vtkFieldData;
31 class vtkInformation;
36 
66 class VTKCOMMONEXECUTIONMODEL_EXPORT VTK_MARSHALAUTO vtkDemandDrivenPipeline : public vtkExecutive
67 {
68 public:
69  static vtkDemandDrivenPipeline* New();
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
78  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
79 
84  vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
85 
87 
91  vtkTypeBool Update() override;
92  vtkTypeBool Update(int port) override;
94 
96 
99  vtkGetMacro(PipelineMTime, vtkMTimeType);
101 
106  virtual int SetReleaseDataFlag(int port, vtkTypeBool n);
107 
111  virtual vtkTypeBool GetReleaseDataFlag(int port);
112 
116  virtual int UpdatePipelineMTime();
117 
123  int UpdateDataObject() override;
124 
128  int UpdateInformation() override;
129 
135  virtual int UpdateData(int outputPort);
136 
141  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
142 
147  static vtkInformationRequestKey* REQUEST_INFORMATION();
148 
153  static vtkInformationRequestKey* REQUEST_DATA();
154 
160  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
161 
167  static vtkInformationIntegerKey* RELEASE_DATA();
168 
175  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
176 
182  static vtkDataObject* NewDataObject(const char* type);
183 
184 protected:
186  ~vtkDemandDrivenPipeline() override;
187 
188  // Helper methods to send requests to the algorithm.
189  virtual int ExecuteDataObject(
190  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
191  virtual int ExecuteInformation(
192  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
193  virtual int ExecuteData(
194  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
195 
196  // Reset the pipeline update values in the given output information object.
197  void ResetPipelineInformation(int, vtkInformation*) override;
198 
199  // Check whether the data object in the pipeline information for an
200  // output port exists and has a valid type.
201  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
202 
203  // Input connection validity checkers.
204  int InputCountIsValid(vtkInformationVector**);
205  int InputCountIsValid(int port, vtkInformationVector**);
206  int InputTypeIsValid(vtkInformationVector**);
207  int InputTypeIsValid(int port, vtkInformationVector**);
208  virtual int InputTypeIsValid(int port, int index, vtkInformationVector**);
209  int InputFieldsAreValid(vtkInformationVector**);
210  int InputFieldsAreValid(int port, vtkInformationVector**);
211  virtual int InputFieldsAreValid(int port, int index, vtkInformationVector**);
212 
213  // Field existence checkers.
214  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
215  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
216  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
217 
218  // Input port information checkers.
219  int InputIsOptional(int port);
220  int InputIsRepeatable(int port);
221 
222  // Decide whether the output data need to be generated.
223  virtual int NeedToExecuteData(
224  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
225 
226  // Handle before/after operations for ExecuteData method.
227  virtual void ExecuteDataStart(
228  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
229  virtual void ExecuteDataEnd(
230  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
231  virtual void MarkOutputsGenerated(
232  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
233 
234  // Largest MTime of any algorithm on this executive or preceding
235  // executives.
237 
238  // Time when information or data were last generated.
242 
244 
248 
249 private:
251  void operator=(const vtkDemandDrivenPipeline&) = delete;
252 };
253 
254 VTK_ABI_NAMESPACE_END
255 #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.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
Abstract superclass for all arrays.
virtual int UpdateDataObject()=0
record modification and/or execution time
Definition: vtkTimeStamp.h:24
virtual int UpdateInformation()
Bring the output information up to date.
Definition: vtkExecutive.h:75
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Generalized interface for asking the executive to fulfill pipeline requests.
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
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:44
represent and manipulate attribute data in a dataset
Key for vector-of-keys values.
Executive supporting composite datasets.
virtual vtkTypeBool Update()
Bring the algorithm's outputs up-to-date.
virtual void ResetPipelineInformation(int port, vtkInformation *)=0
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
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:55
Represents and manipulates a collection of data arrays.
Definition: vtkFieldData.h:51