VTK  9.3.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 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkAbstractArray;
26 class vtkDataArray;
28 class vtkDemandDrivenPipelineInternals;
29 class vtkFieldData;
30 class vtkInformation;
35 
42 
43 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkDemandDrivenPipeline : public vtkExecutive
44 {
45 public:
46  static vtkDemandDrivenPipeline* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
55  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
56 
61  vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
62 
64 
68  vtkTypeBool Update() override;
69  vtkTypeBool Update(int port) override;
71 
73 
76  vtkGetMacro(PipelineMTime, vtkMTimeType);
78 
83  virtual int SetReleaseDataFlag(int port, vtkTypeBool n);
84 
88  virtual vtkTypeBool GetReleaseDataFlag(int port);
89 
93  virtual int UpdatePipelineMTime();
94 
100  int UpdateDataObject() override;
101 
105  int UpdateInformation() override;
106 
112  virtual int UpdateData(int outputPort);
113 
118  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
119 
124  static vtkInformationRequestKey* REQUEST_INFORMATION();
125 
130  static vtkInformationRequestKey* REQUEST_DATA();
131 
137  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
138 
144  static vtkInformationIntegerKey* RELEASE_DATA();
145 
152  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
153 
159  static vtkDataObject* NewDataObject(const char* type);
160 
161 protected:
163  ~vtkDemandDrivenPipeline() override;
164 
165  // Helper methods to send requests to the algorithm.
166  virtual int ExecuteDataObject(
167  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
168  virtual int ExecuteInformation(
169  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
170  virtual int ExecuteData(
171  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
172 
173  // Reset the pipeline update values in the given output information object.
174  void ResetPipelineInformation(int, vtkInformation*) override;
175 
176  // Check whether the data object in the pipeline information for an
177  // output port exists and has a valid type.
178  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
179 
180  // Input connection validity checkers.
181  int InputCountIsValid(vtkInformationVector**);
182  int InputCountIsValid(int port, vtkInformationVector**);
183  int InputTypeIsValid(vtkInformationVector**);
184  int InputTypeIsValid(int port, vtkInformationVector**);
185  virtual int InputTypeIsValid(int port, int index, vtkInformationVector**);
186  int InputFieldsAreValid(vtkInformationVector**);
187  int InputFieldsAreValid(int port, vtkInformationVector**);
188  virtual int InputFieldsAreValid(int port, int index, vtkInformationVector**);
189 
190  // Field existence checkers.
191  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
192  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
193  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
194 
195  // Input port information checkers.
196  int InputIsOptional(int port);
197  int InputIsRepeatable(int port);
198 
199  // Decide whether the output data need to be generated.
200  virtual int NeedToExecuteData(
201  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
202 
203  // Handle before/after operations for ExecuteData method.
204  virtual void ExecuteDataStart(
205  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
206  virtual void ExecuteDataEnd(
207  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
208  virtual void MarkOutputsGenerated(
209  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
210 
211  // Largest MTime of any algorithm on this executive or preceding
212  // executives.
214 
215  // Time when information or data were last generated.
219 
221 
225 
226 private:
228  void operator=(const vtkDemandDrivenPipeline&) = delete;
229 };
230 
231 VTK_ABI_NAMESPACE_END
232 #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:270
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:74
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:38
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.
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:54
represent and manipulate fields of data
Definition: vtkFieldData.h:51