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 =========================================================================*/
50 #ifndef vtkCompositeDataPipeline_h
51 #define vtkCompositeDataPipeline_h
52 
53 #include "vtkCommonExecutionModelModule.h" // For export macro
55 #include <vtkSmartPointer.h> // smart pointer
56 
57 #include <vector> // for vector in return type
58 
67 
68 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkCompositeDataPipeline :
70 {
71 public:
72  static vtkCompositeDataPipeline* New();
74  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
80  vtkDataObject* GetCompositeOutputData(int port);
81 
86  vtkDataObject* GetCompositeInputData(
87  int port, int index, vtkInformationVector **inInfoVec);
88 
93  static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS();
94 
102  static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA();
103 
114  static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES();
115 
123  static vtkInformationDoubleKey* BLOCK_AMOUNT_OF_DETAIL();
124 
125 protected:
127  ~vtkCompositeDataPipeline() override;
128 
129  int ForwardUpstream(vtkInformation* request) override;
130  virtual int ForwardUpstream(int i, int j, vtkInformation* request);
131 
132  // Copy information for the given request.
134  vtkInformationVector** inInfoVec,
135  vtkInformationVector* outInfoVec) override;
136 
137  virtual void PushInformation(vtkInformation*);
138  virtual void PopInformation (vtkInformation*);
139 
140  int ExecuteDataObject(vtkInformation* request,
141  vtkInformationVector** inInfo,
142  vtkInformationVector* outInfo) override;
143 
144  int ExecuteData(vtkInformation* request,
145  vtkInformationVector** inInfoVec,
146  vtkInformationVector* outInfoVec) override;
147 
148  void ExecuteDataStart(vtkInformation* request,
149  vtkInformationVector** inInfoVec,
150  vtkInformationVector* outInfoVec) override;
151 
152  // Override this check to account for update extent.
153  int NeedToExecuteData(int outputPort,
154  vtkInformationVector** inInfoVec,
155  vtkInformationVector* outInfoVec) override;
156 
157  // Check whether the data object in the pipeline information exists
158  // and has a valid type.
159  virtual int CheckCompositeData(vtkInformation *request,
160  vtkInformationVector** inInfoVec,
161  vtkInformationVector* outInfoVec);
162 
163  // True when the pipeline is iterating over the current (simple) filter
164  // to produce composite output. In this case, ExecuteDataStart() should
165  // NOT Initialize() the composite output.
167 
168  virtual void ExecuteSimpleAlgorithm(vtkInformation* request,
169  vtkInformationVector** inInfoVec,
170  vtkInformationVector* outInfoVec,
171  int compositePort);
172 
173  virtual void ExecuteEach(vtkCompositeDataIterator* iter,
174  vtkInformationVector** inInfoVec,
175  vtkInformationVector* outInfoVec,
176  int compositePort,
177  int connection,
178  vtkInformation* request,
180 
181  std::vector<vtkDataObject*> ExecuteSimpleAlgorithmForBlock(
182  vtkInformationVector** inInfoVec,
183  vtkInformationVector* outInfoVec,
184  vtkInformation* inInfo,
185  vtkInformation* request,
186  vtkDataObject* dobj);
187 
188  bool ShouldIterateOverInput(vtkInformationVector** inInfoVec,
189  int& compositePort);
190 
191  int InputTypeIsValid(int port, int index,
192  vtkInformationVector **inInfoVec) override;
193 
195 
198 
199  void ResetPipelineInformation(int port, vtkInformation*) override;
200 
210  std::vector<vtkSmartPointer<vtkDataObject>> CreateOutputCompositeDataSet(
211  vtkCompositeDataSet* input, int compositePort, int numOutputPorts);
212 
213  // Override this to handle UPDATE_COMPOSITE_INDICES().
214  void MarkOutputsGenerated(vtkInformation* request,
215  vtkInformationVector** inInfoVec,
216  vtkInformationVector* outInfoVec) override;
217 
218  int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo);
219 
220  // Because we sometimes have to swap between "simple" data types and composite
221  // data types, we sometimes want to skip resetting the pipeline information.
222  static vtkInformationIntegerKey* SUPPRESS_RESET_PI();
223 
232  static vtkInformationIntegerVectorKey* DATA_COMPOSITE_INDICES();
233 
234 private:
236  void operator=(const vtkCompositeDataPipeline&) = delete;
237 };
238 
239 #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:39
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:64
virtual int ForwardUpstream(vtkInformation *request)
void ResetPipelineInformation(int port, vtkInformation *) override