VTK
vtkCompositeDataPipeline.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeDataPipeline.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 =========================================================================*/
49 #ifndef __vtkCompositeDataPipeline_h
50 #define __vtkCompositeDataPipeline_h
51 
52 #include "vtkStreamingDemandDrivenPipeline.h"
53 
61 
62 class VTK_FILTERING_EXPORT vtkCompositeDataPipeline : public vtkStreamingDemandDrivenPipeline
63 {
64 public:
65  static vtkCompositeDataPipeline* New();
66  vtkTypeMacro(vtkCompositeDataPipeline,vtkStreamingDemandDrivenPipeline);
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
72  virtual int ProcessRequest(vtkInformation* request,
73  vtkInformationVector** inInfo,
74  vtkInformationVector* outInfo);
76 
79  vtkDataObject* GetCompositeOutputData(int port);
80 
82 
84  vtkDataObject* GetCompositeInputData(
85  int port, int index, vtkInformationVector **inInfoVec);
87 
89  static vtkInformationIntegerKey* REQUIRES_TIME_DOWNSTREAM();
90 
96  static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA();
97 
106  static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES();
107 
113  static vtkInformationIntegerVectorKey* COMPOSITE_INDICES();
114 
120  static vtkInformationIntegerKey* COMPOSITE_INDEX();
121 
122 protected:
125 
126  virtual int ForwardUpstream(vtkInformation* request);
127  virtual int ForwardUpstream(int i, int j, vtkInformation* request);
128 
129  // Copy information for the given request.
130  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
131  vtkInformationVector** inInfoVec,
132  vtkInformationVector* outInfoVec);
133 
134  virtual void CopyFromDataToInformation(
135  vtkDataObject* dobj, vtkInformation* inInfo);
136  virtual void PushInformation(vtkInformation*);
137  virtual void PopInformation (vtkInformation*);
138 
139  virtual int ExecuteDataObject(vtkInformation* request,
140  vtkInformationVector** inInfo,
141  vtkInformationVector* outInfo);
142 
143  virtual int ExecuteData(vtkInformation* request,
144  vtkInformationVector** inInfoVec,
145  vtkInformationVector* outInfoVec);
146 
147  virtual void ExecuteDataStart(vtkInformation* request,
148  vtkInformationVector** inInfoVec,
149  vtkInformationVector* outInfoVec);
150 
151  // Override this check to account for update extent.
152  virtual int NeedToExecuteData(int outputPort,
153  vtkInformationVector** inInfoVec,
154  vtkInformationVector* outInfoVec);
155 
156  // Override this check to account for iterating over temporal data.
157  virtual int NeedToExecuteBasedOnTime(vtkInformation *outInfo,
158  vtkDataObject *dataObject);
159 
160  // Check whether the data object in the pipeline information for an
161  // output port exists and has a valid type.
162  virtual int CheckCompositeData(vtkInformation *request,
163  int port,
164  vtkInformationVector** inInfoVec,
165  vtkInformationVector* outInfoVec);
166 
167  // True when the pipeline is iterating over the current (simple) filter
168  // to produce composite output. In this case, ExecuteDataStart() should
169  // NOT Initialize() the composite output.
171 
172  virtual void ExecuteSimpleAlgorithm(vtkInformation* request,
173  vtkInformationVector** inInfoVec,
174  vtkInformationVector* outInfoVec,
175  int compositePort);
176  virtual void ExecuteSimpleAlgorithmTime(vtkInformation* request,
177  vtkInformationVector** inInfoVec,
178  vtkInformationVector* outInfoVec);
179  vtkDataObject* ExecuteSimpleAlgorithmForBlock(
180  vtkInformationVector** inInfoVec,
181  vtkInformationVector* outInfoVec,
182  vtkInformation* inInfo,
183  vtkInformation* outInfo,
184  vtkInformation* request,
185  vtkDataObject* dobj);
186 
187  bool ShouldIterateOverInput(int& compositePort);
188  bool ShouldIterateTemporalData(vtkInformation *request,
189  vtkInformationVector** inInfoVec,
190  vtkInformationVector *outInfoVec);
191  virtual int InputTypeIsValid(int port, int index,
192  vtkInformationVector **inInfoVec);
193 
195 
201 
202  // Because we sometimes have to swap between "simple" data types and composite
203  // data types, we sometimes want to skip resetting the pipeline information.
205 
206  virtual void ResetPipelineInformation(int port, vtkInformation*);
207 
209 
216  vtkCompositeDataSet* CreateOutputCompositeDataSet(
217  vtkCompositeDataSet* input, int compositePort);
219 
220  // Override this to handle UPDATE_COMPOSITE_INDICES().
221  virtual void MarkOutputsGenerated(vtkInformation* request,
222  vtkInformationVector** inInfoVec,
223  vtkInformationVector* outInfoVec);
224 
225  int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo);
226 
227 private:
228  vtkCompositeDataPipeline(const vtkCompositeDataPipeline&); // Not implemented.
229  void operator=(const vtkCompositeDataPipeline&); // Not implemented.
230 };
231 
232 #endif
Store vtkAlgorithm input/output information.
#define VTK_FILTERING_EXPORT
Key for vtkDataObject values.
Key for string values in vtkInformation.
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:37
Key for integer values in vtkInformation.
Key for vtkObjectBase values.
Executive supporting composite datasets.
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
helper class to get VTK data object types as string and instantiate them