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 =========================================================================*/
29 #ifndef vtkDemandDrivenPipeline_h
30 #define vtkDemandDrivenPipeline_h
31 
32 #include "vtkCommonExecutionModelModule.h" // For export macro
33 #include "vtkExecutive.h"
34 
35 class vtkAbstractArray;
36 class vtkDataArray;
38 class vtkDemandDrivenPipelineInternals;
39 class vtkFieldData;
40 class vtkInformation;
45 
52 
54 {
55 public:
56  static vtkDemandDrivenPipeline* New();
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
63  virtual int ProcessRequest(vtkInformation* request,
64  vtkInformationVector** inInfo,
65  vtkInformationVector* outInfo);
67 
69 
70  virtual int
72  vtkInformationVector** inInfoVec,
73  vtkInformationVector* outInfoVec,
74  int requestFromOutputPort,
75  unsigned long* mtime);
77 
79 
81  virtual int Update();
82  virtual int Update(int port);
84 
86 
87  vtkGetMacro(PipelineMTime, unsigned long);
89 
92  virtual int SetReleaseDataFlag(int port, int n);
93 
95  virtual int GetReleaseDataFlag(int port);
96 
98  virtual int UpdatePipelineMTime();
99 
103  virtual int UpdateDataObject();
104 
106  virtual int UpdateInformation();
107 
111  virtual int UpdateData(int outputPort);
112 
115  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
116 
119  static vtkInformationRequestKey* REQUEST_INFORMATION();
120 
123  static vtkInformationRequestKey* REQUEST_DATA();
124 
127  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
128 
131  static vtkInformationIntegerKey* RELEASE_DATA();
132 
136  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
137 
141  static vtkDataObject* NewDataObject(const char* type);
142 
143 protected:
146 
147  // Helper methods to send requests to the algorithm.
148  virtual int ExecuteDataObject(vtkInformation* request,
149  vtkInformationVector** inInfo,
150  vtkInformationVector* outInfo);
151  virtual int ExecuteInformation(vtkInformation* request,
152  vtkInformationVector** inInfo,
153  vtkInformationVector* outInfo);
154  virtual int ExecuteData(vtkInformation* request,
155  vtkInformationVector** inInfo,
156  vtkInformationVector* outInfo);
157 
158 
159  // Reset the pipeline update values in the given output information object.
160  virtual void ResetPipelineInformation(int, vtkInformation*);
161 
162  // Check whether the data object in the pipeline information for an
163  // output port exists and has a valid type.
164  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
165 
166 
167  // Input connection validity checkers.
168  int InputCountIsValid(vtkInformationVector **);
169  int InputCountIsValid(int port,vtkInformationVector **);
170  int InputTypeIsValid(vtkInformationVector **);
171  int InputTypeIsValid(int port,vtkInformationVector **);
172  virtual int InputTypeIsValid(int port, int index,vtkInformationVector **);
173  int InputFieldsAreValid(vtkInformationVector **);
174  int InputFieldsAreValid(int port,vtkInformationVector **);
175  virtual int InputFieldsAreValid(int port, int index,vtkInformationVector **);
176 
177  // Field existence checkers.
178  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
179  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
180  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
181 
182  // Input port information checkers.
183  int InputIsOptional(int port);
184  int InputIsRepeatable(int port);
185 
186  // Decide whether the output data need to be generated.
187  virtual int NeedToExecuteData(int outputPort,
188  vtkInformationVector** inInfoVec,
189  vtkInformationVector* outInfoVec);
190 
191  // Handle before/after operations for ExecuteData method.
192  virtual void ExecuteDataStart(vtkInformation* request,
193  vtkInformationVector** inInfoVec,
194  vtkInformationVector* outInfoVec);
195  virtual void ExecuteDataEnd(vtkInformation* request,
196  vtkInformationVector** inInfoVec,
197  vtkInformationVector* outInfoVec);
198  virtual void MarkOutputsGenerated(vtkInformation* request,
199  vtkInformationVector** inInfoVec,
200  vtkInformationVector* outInfoVec);
201 
202  // Largest MTime of any algorithm on this executive or preceding
203  // executives.
204  unsigned long PipelineMTime;
205 
206  // Time when information or data were last generated.
210 
211 //BTX
213 //ETX
214 
215 
219 
220 private:
221  vtkDemandDrivenPipeline(const vtkDemandDrivenPipeline&); // Not implemented.
222  void operator=(const vtkDemandDrivenPipeline&); // Not implemented.
223 };
224 
225 #endif
#define VTKCOMMONEXECUTIONMODEL_EXPORT
Key for unsigned long values in vtkInformation.
virtual int Update()
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
virtual int UpdateDataObject()=0
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual int UpdateInformation()
Definition: vtkExecutive.h:84
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:48
void PrintSelf(ostream &os, vtkIndent indent)
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
a simple class to control print indentation
Definition: vtkIndent.h:38
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:54
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()
general representation of visualization data
Definition: vtkDataObject.h:64
represent and manipulate fields of data
Definition: vtkFieldData.h:55
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)