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(int port, int index, vtkInformationVector** inInfoVec);
81 
86  static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS();
87 
95  static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA();
96 
107  static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES();
108 
116  static vtkInformationDoubleKey* BLOCK_AMOUNT_OF_DETAIL();
117 
118 protected:
120  ~vtkCompositeDataPipeline() override;
121 
122  int ForwardUpstream(vtkInformation* request) override;
123  virtual int ForwardUpstream(int i, int j, vtkInformation* request);
124 
125  // Copy information for the given request.
127  vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) override;
128 
129  virtual void PushInformation(vtkInformation*);
130  virtual void PopInformation(vtkInformation*);
131 
132  int ExecuteDataObject(
133  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
134 
135  int ExecuteData(vtkInformation* request, vtkInformationVector** inInfoVec,
136  vtkInformationVector* outInfoVec) override;
137 
138  void ExecuteDataStart(vtkInformation* request, vtkInformationVector** inInfoVec,
139  vtkInformationVector* outInfoVec) override;
140 
141  // Override this check to account for update extent.
142  int NeedToExecuteData(
143  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) override;
144 
145  // Check whether the data object in the pipeline information exists
146  // and has a valid type.
147  virtual int CheckCompositeData(
148  vtkInformation* request, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
149 
150  // True when the pipeline is iterating over the current (simple) filter
151  // to produce composite output. In this case, ExecuteDataStart() should
152  // NOT Initialize() the composite output.
154 
155  virtual void ExecuteSimpleAlgorithm(vtkInformation* request, vtkInformationVector** inInfoVec,
156  vtkInformationVector* outInfoVec, int compositePort);
157 
158  virtual void ExecuteEach(vtkCompositeDataIterator* iter, vtkInformationVector** inInfoVec,
159  vtkInformationVector* outInfoVec, int compositePort, int connection, vtkInformation* request,
161 
162  std::vector<vtkDataObject*> ExecuteSimpleAlgorithmForBlock(vtkInformationVector** inInfoVec,
163  vtkInformationVector* outInfoVec, vtkInformation* inInfo, vtkInformation* request,
164  vtkDataObject* dobj);
165 
166  bool ShouldIterateOverInput(vtkInformationVector** inInfoVec, int& compositePort);
167 
168  int InputTypeIsValid(int port, int index, vtkInformationVector** inInfoVec) override;
169 
171 
174 
175  void ResetPipelineInformation(int port, vtkInformation*) override;
176 
186  std::vector<vtkSmartPointer<vtkDataObject> > CreateOutputCompositeDataSet(
187  vtkCompositeDataSet* input, int compositePort, int numOutputPorts);
188 
189  // Override this to handle UPDATE_COMPOSITE_INDICES().
190  void MarkOutputsGenerated(vtkInformation* request, vtkInformationVector** inInfoVec,
191  vtkInformationVector* outInfoVec) override;
192 
193  int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo);
194 
195  // Because we sometimes have to swap between "simple" data types and composite
196  // data types, we sometimes want to skip resetting the pipeline information.
197  static vtkInformationIntegerKey* SUPPRESS_RESET_PI();
198 
207  static vtkInformationIntegerVectorKey* DATA_COMPOSITE_INDICES();
208 
209 private:
211  void operator=(const vtkCompositeDataPipeline&) = delete;
212 };
213 
214 #endif
vtkStreamingDemandDrivenPipeline::MarkOutputsGenerated
void MarkOutputsGenerated(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:33
vtkX3D::vector
Definition: vtkX3D.h:243
vtkX3D::direction
Definition: vtkX3D.h:266
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkDemandDrivenPipeline::ExecuteData
virtual int ExecuteData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkInformationDataObjectKey
Key for vtkDataObject values.
Definition: vtkInformationDataObjectKey.h:33
vtkStreamingDemandDrivenPipeline.h
vtkSmartPointer< vtkCompositeDataSet >
vtkStreamingDemandDrivenPipeline::ExecuteDataStart
void ExecuteDataStart(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
vtkInformationDoubleKey
Key for double values in vtkInformation.
Definition: vtkInformationDoubleKey.h:31
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:45
vtkStreamingDemandDrivenPipeline::NeedToExecuteData
int NeedToExecuteData(int outputPort, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
vtkX3D::port
Definition: vtkX3D.h:453
vtkStreamingDemandDrivenPipeline::ResetPipelineInformation
void ResetPipelineInformation(int port, vtkInformation *) override
vtkCompositeDataPipeline
Executive supporting composite datasets.
Definition: vtkCompositeDataPipeline.h:62
vtkStreamingDemandDrivenPipeline::New
static vtkStreamingDemandDrivenPipeline * New()
vtkInformationObjectBaseKey
Key for vtkObjectBase values.
Definition: vtkInformationObjectBaseKey.h:33
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:31
vtkCompositeDataIterator
superclass for composite data iterators
Definition: vtkCompositeDataIterator.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkStreamingDemandDrivenPipeline::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCompositeDataPipeline::InformationRequest
vtkInformation * InformationRequest
Definition: vtkCompositeDataPipeline.h:173
vtkCompositeDataPipeline::GenericRequest
vtkInformation * GenericRequest
Definition: vtkCompositeDataPipeline.h:172
vtkSmartPointer.h
vtkDemandDrivenPipeline::ExecuteDataObject
virtual int ExecuteDataObject(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkDemandDrivenPipeline::InputTypeIsValid
int InputTypeIsValid(vtkInformationVector **)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkExecutive::ForwardUpstream
virtual int ForwardUpstream(vtkInformation *request)
vtkDemandDrivenPipeline::vtkCompositeDataPipeline
friend class vtkCompositeDataPipeline
Definition: vtkDemandDrivenPipeline.h:225
vtkCompositeDataPipeline::InformationCache
vtkInformation * InformationCache
Definition: vtkCompositeDataPipeline.h:170
vtkInformationIntegerVectorKey
Key for integer vector values.
Definition: vtkInformationIntegerVectorKey.h:31
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
vtkX3D::index
Definition: vtkX3D.h:252
vtkStreamingDemandDrivenPipeline
Executive supporting partial updates.
Definition: vtkStreamingDemandDrivenPipeline.h:46
vtkStreamingDemandDrivenPipeline::CopyDefaultInformation
void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
vtkCompositeDataPipeline::InLocalLoop
int InLocalLoop
Definition: vtkCompositeDataPipeline.h:153