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 =========================================================================*/
32 #ifndef vtkDemandDrivenPipeline_h
33 #define vtkDemandDrivenPipeline_h
34 
35 #include "vtkCommonExecutionModelModule.h" // For export macro
36 #include "vtkExecutive.h"
37 
38 class vtkAbstractArray;
39 class vtkDataArray;
41 class vtkDemandDrivenPipelineInternals;
42 class vtkFieldData;
43 class vtkInformation;
48 
55 
57 {
58 public:
59  static vtkDemandDrivenPipeline* New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
66  virtual int ProcessRequest(vtkInformation* request,
67  vtkInformationVector** inInfo,
68  vtkInformationVector* outInfo);
70 
72 
73  virtual int
75  vtkInformationVector** inInfoVec,
76  vtkInformationVector* outInfoVec,
77  int requestFromOutputPort,
78  unsigned long* mtime);
80 
82 
84  virtual int Update();
85  virtual int Update(int port);
87 
89 
90  vtkGetMacro(PipelineMTime, unsigned long);
92 
95  virtual int SetReleaseDataFlag(int port, int n);
96 
98  virtual int GetReleaseDataFlag(int port);
99 
101  virtual int UpdatePipelineMTime();
102 
106  virtual int UpdateDataObject();
107 
109  virtual int UpdateInformation();
110 
114  virtual int UpdateData(int outputPort);
115 
118  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
119 
122  static vtkInformationRequestKey* REQUEST_INFORMATION();
123 
126  static vtkInformationRequestKey* REQUEST_DATA();
127 
130  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
131 
134  static vtkInformationIntegerKey* RELEASE_DATA();
135 
139  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
140 
144  static vtkDataObject* NewDataObject(const char* type);
145 
146 protected:
149 
150  // Helper methods to send requests to the algorithm.
151  virtual int ExecuteDataObject(vtkInformation* request,
152  vtkInformationVector** inInfo,
153  vtkInformationVector* outInfo);
154  virtual int ExecuteInformation(vtkInformation* request,
155  vtkInformationVector** inInfo,
156  vtkInformationVector* outInfo);
157  virtual int ExecuteData(vtkInformation* request,
158  vtkInformationVector** inInfo,
159  vtkInformationVector* outInfo);
160 
161 
162  // Reset the pipeline update values in the given output information object.
163  virtual void ResetPipelineInformation(int, vtkInformation*);
164 
165  // Check whether the data object in the pipeline information for an
166  // output port exists and has a valid type.
167  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
168 
169 
170  // Input connection validity checkers.
171  int InputCountIsValid(vtkInformationVector **);
172  int InputCountIsValid(int port,vtkInformationVector **);
173  int InputTypeIsValid(vtkInformationVector **);
174  int InputTypeIsValid(int port,vtkInformationVector **);
175  virtual int InputTypeIsValid(int port, int index,vtkInformationVector **);
176  int InputFieldsAreValid(vtkInformationVector **);
177  int InputFieldsAreValid(int port,vtkInformationVector **);
178  virtual int InputFieldsAreValid(int port, int index,vtkInformationVector **);
179 
180  // Field existence checkers.
181  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
182  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
183  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
184 
185  // Input port information checkers.
186  int InputIsOptional(int port);
187  int InputIsRepeatable(int port);
188 
189  // Decide whether the output data need to be generated.
190  virtual int NeedToExecuteData(int outputPort,
191  vtkInformationVector** inInfoVec,
192  vtkInformationVector* outInfoVec);
193 
194  // Handle before/after operations for ExecuteData method.
195  virtual void ExecuteDataStart(vtkInformation* request,
196  vtkInformationVector** inInfoVec,
197  vtkInformationVector* outInfoVec);
198  virtual void ExecuteDataEnd(vtkInformation* request,
199  vtkInformationVector** inInfoVec,
200  vtkInformationVector* outInfoVec);
201  virtual void MarkOutputsGenerated(vtkInformation* request,
202  vtkInformationVector** inInfoVec,
203  vtkInformationVector* outInfoVec);
204 
205  // Largest MTime of any algorithm on this executive or preceding
206  // executives.
207  unsigned long PipelineMTime;
208 
209  // Time when information or data were last generated.
213 
214 //BTX
216 //ETX
217 
218 
222 
223 private:
224  vtkDemandDrivenPipeline(const vtkDemandDrivenPipeline&); // Not implemented.
225  void operator=(const vtkDemandDrivenPipeline&); // Not implemented.
226 };
227 
228 #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:87
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:51
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)