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 =========================================================================*/
44 #ifndef vtkCompositeDataPipeline_h
45 #define vtkCompositeDataPipeline_h
46 
47 #include "vtkCommonExecutionModelModule.h" // For export macro
49 #include <vtkSmartPointer.h> // smart pointer
50 
51 #include <vector> // for vector in return type
52 
61 
62 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkCompositeDataPipeline :
64 {
65 public:
66  static vtkCompositeDataPipeline* New();
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
74  vtkDataObject* GetCompositeOutputData(int port);
75 
80  vtkDataObject* GetCompositeInputData(
81  int port, int index, vtkInformationVector **inInfoVec);
82 
87  static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS();
88 
96  static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA();
97 
108  static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES();
109 
117  static vtkInformationDoubleKey* BLOCK_AMOUNT_OF_DETAIL();
118 
119 protected:
121  ~vtkCompositeDataPipeline() override;
122 
123  int ForwardUpstream(vtkInformation* request) override;
124  virtual int ForwardUpstream(int i, int j, vtkInformation* request);
125 
126  // Copy information for the given request.
128  vtkInformationVector** inInfoVec,
129  vtkInformationVector* outInfoVec) override;
130 
131  virtual void PushInformation(vtkInformation*);
132  virtual void PopInformation (vtkInformation*);
133 
134  int ExecuteDataObject(vtkInformation* request,
135  vtkInformationVector** inInfo,
136  vtkInformationVector* outInfo) override;
137 
138  int ExecuteData(vtkInformation* request,
139  vtkInformationVector** inInfoVec,
140  vtkInformationVector* outInfoVec) override;
141 
142  void ExecuteDataStart(vtkInformation* request,
143  vtkInformationVector** inInfoVec,
144  vtkInformationVector* outInfoVec) override;
145 
146  // Override this check to account for update extent.
147  int NeedToExecuteData(int outputPort,
148  vtkInformationVector** inInfoVec,
149  vtkInformationVector* outInfoVec) override;
150 
151  // Check whether the data object in the pipeline information exists
152  // and has a valid type.
153  virtual int CheckCompositeData(vtkInformation *request,
154  vtkInformationVector** inInfoVec,
155  vtkInformationVector* outInfoVec);
156 
157  // True when the pipeline is iterating over the current (simple) filter
158  // to produce composite output. In this case, ExecuteDataStart() should
159  // NOT Initialize() the composite output.
161 
162  virtual void ExecuteSimpleAlgorithm(vtkInformation* request,
163  vtkInformationVector** inInfoVec,
164  vtkInformationVector* outInfoVec,
165  int compositePort);
166 
167  virtual void ExecuteEach(vtkCompositeDataIterator* iter,
168  vtkInformationVector** inInfoVec,
169  vtkInformationVector* outInfoVec,
170  int compositePort,
171  int connection,
172  vtkInformation* request,
174 
175  std::vector<vtkDataObject*> ExecuteSimpleAlgorithmForBlock(
176  vtkInformationVector** inInfoVec,
177  vtkInformationVector* outInfoVec,
178  vtkInformation* inInfo,
179  vtkInformation* request,
180  vtkDataObject* dobj);
181 
182  bool ShouldIterateOverInput(vtkInformationVector** inInfoVec,
183  int& compositePort);
184 
185  int InputTypeIsValid(int port, int index,
186  vtkInformationVector **inInfoVec) override;
187 
189 
192 
193  void ResetPipelineInformation(int port, vtkInformation*) override;
194 
204  std::vector<vtkSmartPointer<vtkDataObject>> CreateOutputCompositeDataSet(
205  vtkCompositeDataSet* input, int compositePort, int numOutputPorts);
206 
207  // Override this to handle UPDATE_COMPOSITE_INDICES().
208  void MarkOutputsGenerated(vtkInformation* request,
209  vtkInformationVector** inInfoVec,
210  vtkInformationVector* outInfoVec) override;
211 
212  int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo);
213 
214  // Because we sometimes have to swap between "simple" data types and composite
215  // data types, we sometimes want to skip resetting the pipeline information.
216  static vtkInformationIntegerKey* SUPPRESS_RESET_PI();
217 
226  static vtkInformationIntegerVectorKey* DATA_COMPOSITE_INDICES();
227 
228 private:
230  void operator=(const vtkCompositeDataPipeline&) = delete;
231 };
232 
233 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkStreamingDemandDrivenPipeline * New()
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
virtual int ExecuteData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Hold a reference to a vtkObjectBase instance.
Key for string values in vtkInformation.
void ExecuteDataStart(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
superclass for composite data iterators
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:33
Key for integer values in vtkInformation.
virtual int ExecuteDataObject(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
int NeedToExecuteData(int outputPort, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
Key for vtkObjectBase values.
int InputTypeIsValid(vtkInformationVector **)
void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
Executive supporting composite datasets.
Key for double values in vtkInformation.
void MarkOutputsGenerated(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
Store zero or more vtkInformation instances.
Executive supporting partial updates.
general representation of visualization data
Definition: vtkDataObject.h:58
virtual int ForwardUpstream(vtkInformation *request)
void ResetPipelineInformation(int port, vtkInformation *) override