VTK  9.0.1
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 
60  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
61 
66  vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
67 
69 
73  vtkTypeBool Update() override;
74  vtkTypeBool Update(int port) override;
76 
78 
81  vtkGetMacro(PipelineMTime, vtkMTimeType);
83 
88  virtual int SetReleaseDataFlag(int port, int n);
89 
93  virtual int GetReleaseDataFlag(int port);
94 
98  virtual int UpdatePipelineMTime();
99 
105  int UpdateDataObject() override;
106 
110  int UpdateInformation() override;
111 
117  virtual int UpdateData(int outputPort);
118 
123  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
124 
129  static vtkInformationRequestKey* REQUEST_INFORMATION();
130 
135  static vtkInformationRequestKey* REQUEST_DATA();
136 
142  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
143 
149  static vtkInformationIntegerKey* RELEASE_DATA();
150 
157  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
158 
164  static vtkDataObject* NewDataObject(const char* type);
165 
166 protected:
168  ~vtkDemandDrivenPipeline() override;
169 
170  // Helper methods to send requests to the algorithm.
171  virtual int ExecuteDataObject(
172  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
173  virtual int ExecuteInformation(
174  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
175  virtual int ExecuteData(
176  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
177 
178  // Reset the pipeline update values in the given output information object.
179  void ResetPipelineInformation(int, vtkInformation*) override;
180 
181  // Check whether the data object in the pipeline information for an
182  // output port exists and has a valid type.
183  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
184 
185  // Input connection validity checkers.
186  int InputCountIsValid(vtkInformationVector**);
187  int InputCountIsValid(int port, vtkInformationVector**);
188  int InputTypeIsValid(vtkInformationVector**);
189  int InputTypeIsValid(int port, vtkInformationVector**);
190  virtual int InputTypeIsValid(int port, int index, vtkInformationVector**);
191  int InputFieldsAreValid(vtkInformationVector**);
192  int InputFieldsAreValid(int port, vtkInformationVector**);
193  virtual int InputFieldsAreValid(int port, int index, vtkInformationVector**);
194 
195  // Field existence checkers.
196  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
197  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
198  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
199 
200  // Input port information checkers.
201  int InputIsOptional(int port);
202  int InputIsRepeatable(int port);
203 
204  // Decide whether the output data need to be generated.
205  virtual int NeedToExecuteData(
206  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
207 
208  // Handle before/after operations for ExecuteData method.
209  virtual void ExecuteDataStart(
210  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
211  virtual void ExecuteDataEnd(
212  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
213  virtual void MarkOutputsGenerated(
214  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
215 
216  // Largest MTime of any algorithm on this executive or preceding
217  // executives.
219 
220  // Time when information or data were last generated.
224 
226 
230 
231 private:
233  void operator=(const vtkDemandDrivenPipeline&) = delete;
234 };
235 
236 #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:293
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:82
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:46
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
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:49
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:59
represent and manipulate fields of data
Definition: vtkFieldData.h:53