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 =========================================================================*/
30 #ifndef vtkDemandDrivenPipeline_h
31 #define vtkDemandDrivenPipeline_h
32 
33 #include "vtkCommonExecutionModelModule.h" // For export macro
34 #include "vtkExecutive.h"
35 
36 class vtkAbstractArray;
37 class vtkDataArray;
39 class vtkDemandDrivenPipelineInternals;
40 class vtkFieldData;
41 class vtkInformation;
46 
53 
54 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkDemandDrivenPipeline : public vtkExecutive
55 {
56 public:
57  static vtkDemandDrivenPipeline* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
66  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
67 
72  vtkInformationVector* outInfoVec, int requestFromOutputPort, vtkMTimeType* mtime) override;
73 
75 
79  vtkTypeBool Update() override;
80  vtkTypeBool Update(int port) override;
82 
84 
87  vtkGetMacro(PipelineMTime, vtkMTimeType);
89 
94  virtual int SetReleaseDataFlag(int port, int n);
95 
99  virtual int GetReleaseDataFlag(int port);
100 
104  virtual int UpdatePipelineMTime();
105 
111  int UpdateDataObject() override;
112 
116  int UpdateInformation() override;
117 
123  virtual int UpdateData(int outputPort);
124 
129  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
130 
135  static vtkInformationRequestKey* REQUEST_INFORMATION();
136 
141  static vtkInformationRequestKey* REQUEST_DATA();
142 
148  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
149 
155  static vtkInformationIntegerKey* RELEASE_DATA();
156 
163  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
164 
170  static vtkDataObject* NewDataObject(const char* type);
171 
172 protected:
174  ~vtkDemandDrivenPipeline() override;
175 
176  // Helper methods to send requests to the algorithm.
177  virtual int ExecuteDataObject(
178  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
179  virtual int ExecuteInformation(
180  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
181  virtual int ExecuteData(
182  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
183 
184  // Reset the pipeline update values in the given output information object.
185  void ResetPipelineInformation(int, vtkInformation*) override;
186 
187  // Check whether the data object in the pipeline information for an
188  // output port exists and has a valid type.
189  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
190 
191  // Input connection validity checkers.
192  int InputCountIsValid(vtkInformationVector**);
193  int InputCountIsValid(int port, vtkInformationVector**);
194  int InputTypeIsValid(vtkInformationVector**);
195  int InputTypeIsValid(int port, vtkInformationVector**);
196  virtual int InputTypeIsValid(int port, int index, vtkInformationVector**);
197  int InputFieldsAreValid(vtkInformationVector**);
198  int InputFieldsAreValid(int port, vtkInformationVector**);
199  virtual int InputFieldsAreValid(int port, int index, vtkInformationVector**);
200 
201  // Field existence checkers.
202  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
203  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
204  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
205 
206  // Input port information checkers.
207  int InputIsOptional(int port);
208  int InputIsRepeatable(int port);
209 
210  // Decide whether the output data need to be generated.
211  virtual int NeedToExecuteData(
212  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
213 
214  // Handle before/after operations for ExecuteData method.
215  virtual void ExecuteDataStart(
216  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
217  virtual void ExecuteDataEnd(
218  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
219  virtual void MarkOutputsGenerated(
220  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
221 
222  // Largest MTime of any algorithm on this executive or preceding
223  // executives.
225 
226  // Time when information or data were last generated.
230 
232 
236 
237 private:
239  void operator=(const vtkDemandDrivenPipeline&) = delete;
240 };
241 
242 #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