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 =========================================================================*/
26 #ifndef __vtkDemandDrivenPipeline_h
27 #define __vtkDemandDrivenPipeline_h
28 
29 #include "vtkExecutive.h"
30 
31 class vtkAbstractArray;
32 class vtkDataArray;
34 class vtkDemandDrivenPipelineInternals;
35 class vtkFieldData;
36 class vtkInformation;
41 
42 class VTK_FILTERING_EXPORT vtkDemandDrivenPipeline : public vtkExecutive
43 {
44 public:
45  static vtkDemandDrivenPipeline* New();
46  vtkTypeMacro(vtkDemandDrivenPipeline,vtkExecutive);
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
52  virtual int ProcessRequest(vtkInformation* request,
53  vtkInformationVector** inInfo,
54  vtkInformationVector* outInfo);
56 
58 
59  virtual int
60  ComputePipelineMTime(vtkInformation* request,
61  vtkInformationVector** inInfoVec,
62  vtkInformationVector* outInfoVec,
63  int requestFromOutputPort,
64  unsigned long* mtime);
66 
68 
70  virtual int Update();
71  virtual int Update(int port);
73 
75 
76  vtkGetMacro(PipelineMTime, unsigned long);
78 
81  virtual int SetReleaseDataFlag(int port, int n);
82 
84  virtual int GetReleaseDataFlag(int port);
85 
87  virtual int UpdatePipelineMTime();
88 
92  virtual int UpdateDataObject();
93 
95  virtual int UpdateInformation();
96 
100  virtual int UpdateData(int outputPort);
101 
103  static vtkInformationRequestKey* REQUEST_DATA_OBJECT();
104 
107  static vtkInformationRequestKey* REQUEST_INFORMATION();
108 
110  static vtkInformationRequestKey* REQUEST_DATA();
111 
114  static vtkInformationRequestKey* REQUEST_DATA_NOT_GENERATED();
115 
118  static vtkInformationIntegerKey* RELEASE_DATA();
119 
123  static vtkInformationIntegerKey* DATA_NOT_GENERATED();
124 
128  static vtkDataObject* NewDataObject(const char* type);
129 
132  static vtkInformationIntegerKey* REQUEST_REGENERATE_INFORMATION();
133 
134 protected:
137 
138  // Helper methods to send requests to the algorithm.
139  virtual int ExecuteDataObject(vtkInformation* request,
140  vtkInformationVector** inInfo,
141  vtkInformationVector* outInfo);
142  virtual int ExecuteInformation(vtkInformation* request,
143  vtkInformationVector** inInfo,
144  vtkInformationVector* outInfo);
145  virtual int ExecuteData(vtkInformation* request,
146  vtkInformationVector** inInfo,
147  vtkInformationVector* outInfo);
148 
149 
150  // Reset the pipeline update values in the given output information object.
151  virtual void ResetPipelineInformation(int port, vtkInformation*);
152 
153  // Check whether the data object in the pipeline information for an
154  // output port exists and has a valid type.
155  virtual int CheckDataObject(int port, vtkInformationVector* outInfo);
156 
157 
158  // Input connection validity checkers.
159  int InputCountIsValid(vtkInformationVector **);
160  int InputCountIsValid(int port,vtkInformationVector **);
161  int InputTypeIsValid(vtkInformationVector **);
162  int InputTypeIsValid(int port,vtkInformationVector **);
163  virtual int InputTypeIsValid(int port, int index,vtkInformationVector **);
164  int InputFieldsAreValid(vtkInformationVector **);
165  int InputFieldsAreValid(int port,vtkInformationVector **);
166  virtual int InputFieldsAreValid(int port, int index,vtkInformationVector **);
167 
168  // Field existence checkers.
169  int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
170  int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
171  int ArrayIsValid(vtkAbstractArray* array, vtkInformation* field);
172 
173  // Input port information checkers.
174  int InputIsOptional(int port);
175  int InputIsRepeatable(int port);
176 
177  // Decide whether the output data need to be generated.
178  virtual int NeedToExecuteData(int outputPort,
179  vtkInformationVector** inInfoVec,
180  vtkInformationVector* outInfoVec);
181 
182  // Handle before/after operations for ExecuteData method.
183  virtual void ExecuteDataStart(vtkInformation* request,
184  vtkInformationVector** inInfoVec,
185  vtkInformationVector* outInfoVec);
186  virtual void ExecuteDataEnd(vtkInformation* request,
187  vtkInformationVector** inInfoVec,
188  vtkInformationVector* outInfoVec);
189  virtual void MarkOutputsGenerated(vtkInformation* request,
190  vtkInformationVector** inInfoVec,
191  vtkInformationVector* outInfoVec);
192 
193  // Largest MTime of any algorithm on this executive or preceding
194  // executives.
195  unsigned long PipelineMTime;
196 
197  // Time when information or data were last generated.
201 
202 //BTX
203  friend class vtkCompositeDataPipeline;
204 //ETX
205 
206 
210 
211 private:
212  vtkDemandDrivenPipeline(const vtkDemandDrivenPipeline&); // Not implemented.
213  void operator=(const vtkDemandDrivenPipeline&); // Not implemented.
214 };
215 
216 #endif
Key for unsigned long values in vtkInformation.
Store vtkAlgorithm input/output information.
#define VTK_FILTERING_EXPORT
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:33
a simple class to control print indentation
Definition: vtkIndent.h:37
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:53
represent and manipulate attribute data in a dataset
Key for vector-of-keys values.
Store zero or more vtkInformation instances.
helper class to get VTK data object types as string and instantiate them