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 "vtkCommonExecutionModelModule.h" // For export macro
54 
62 
63 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkCompositeDataPipeline :
65 {
66 public:
67  static vtkCompositeDataPipeline* New();
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
74  virtual int ProcessRequest(vtkInformation* request,
75  vtkInformationVector** inInfo,
76  vtkInformationVector* outInfo);
78 
81  vtkDataObject* GetCompositeOutputData(int port);
82 
84 
86  vtkDataObject* GetCompositeInputData(
87  int port, int index, vtkInformationVector **inInfoVec);
89 
92  static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS();
93 
99  static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA();
100 
109  static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES();
110 
116  static vtkInformationIntegerVectorKey* COMPOSITE_INDICES();
117 
118 
119 protected:
122 
123  virtual int ForwardUpstream(vtkInformation* request);
124  virtual int ForwardUpstream(int i, int j, vtkInformation* request);
125 
126  // Copy information for the given request.
127  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
128  vtkInformationVector** inInfoVec,
129  vtkInformationVector* outInfoVec);
130 
131  virtual void CopyFromDataToInformation(
132  vtkDataObject* dobj, vtkInformation* inInfo);
133  virtual void PushInformation(vtkInformation*);
134  virtual void PopInformation (vtkInformation*);
135 
136  virtual int ExecuteDataObject(vtkInformation* request,
137  vtkInformationVector** inInfo,
138  vtkInformationVector* outInfo);
139 
140  virtual int ExecuteData(vtkInformation* request,
141  vtkInformationVector** inInfoVec,
142  vtkInformationVector* outInfoVec);
143 
144  virtual void ExecuteDataStart(vtkInformation* request,
145  vtkInformationVector** inInfoVec,
146  vtkInformationVector* outInfoVec);
147 
148  // Override this check to account for update extent.
149  virtual int NeedToExecuteData(int outputPort,
150  vtkInformationVector** inInfoVec,
151  vtkInformationVector* outInfoVec);
152 
153  // Override this check to account for iterating over temporal data.
154  virtual int NeedToExecuteBasedOnTime(vtkInformation *outInfo,
155  vtkDataObject *dataObject);
156 
157  // Check whether the data object in the pipeline information for an
158  // output port exists and has a valid type.
159  virtual int CheckCompositeData(vtkInformation *request,
160  int port,
161  vtkInformationVector** inInfoVec,
162  vtkInformationVector* outInfoVec);
163 
164  // True when the pipeline is iterating over the current (simple) filter
165  // to produce composite output. In this case, ExecuteDataStart() should
166  // NOT Initialize() the composite output.
168 
169  virtual void ExecuteSimpleAlgorithm(vtkInformation* request,
170  vtkInformationVector** inInfoVec,
171  vtkInformationVector* outInfoVec,
172  int compositePort);
173  vtkDataObject* ExecuteSimpleAlgorithmForBlock(
174  vtkInformationVector** inInfoVec,
175  vtkInformationVector* outInfoVec,
176  vtkInformation* inInfo,
177  vtkInformation* outInfo,
178  vtkInformation* request,
179  vtkDataObject* dobj);
180 
181  bool ShouldIterateOverInput(int& compositePort);
182 
183  virtual int InputTypeIsValid(int port, int index,
184  vtkInformationVector **inInfoVec);
185 
187 
193 
194  // Because we sometimes have to swap between "simple" data types and composite
195  // data types, we sometimes want to skip resetting the pipeline information.
197 
198  virtual void ResetPipelineInformation(int port, vtkInformation*);
199 
201 
208  vtkCompositeDataSet* CreateOutputCompositeDataSet(
209  vtkCompositeDataSet* input, int compositePort);
211 
212  // Override this to handle UPDATE_COMPOSITE_INDICES().
213  virtual void MarkOutputsGenerated(vtkInformation* request,
214  vtkInformationVector** inInfoVec,
215  vtkInformationVector* outInfoVec);
216 
217  int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo);
218 
219 private:
220  vtkCompositeDataPipeline(const vtkCompositeDataPipeline&); // Not implemented.
221  void operator=(const vtkCompositeDataPipeline&); // Not implemented.
222 };
223 
224 #endif