VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCompositeDataPipeline.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00049 #ifndef __vtkCompositeDataPipeline_h 00050 #define __vtkCompositeDataPipeline_h 00051 00052 #include "vtkCommonExecutionModelModule.h" // For export macro 00053 #include "vtkStreamingDemandDrivenPipeline.h" 00054 00055 class vtkCompositeDataSet; 00056 class vtkInformationDoubleKey; 00057 class vtkInformationIntegerVectorKey; 00058 class vtkInformationObjectBaseKey; 00059 class vtkInformationStringKey; 00060 class vtkInformationDataObjectKey; 00061 class vtkInformationIntegerKey; 00062 00063 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkCompositeDataPipeline : 00064 public vtkStreamingDemandDrivenPipeline 00065 { 00066 public: 00067 static vtkCompositeDataPipeline* New(); 00068 vtkTypeMacro(vtkCompositeDataPipeline,vtkStreamingDemandDrivenPipeline); 00069 void PrintSelf(ostream& os, vtkIndent indent); 00070 00073 vtkDataObject* GetCompositeOutputData(int port); 00074 00076 00078 vtkDataObject* GetCompositeInputData( 00079 int port, int index, vtkInformationVector **inInfoVec); 00081 00084 static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS(); 00085 00091 static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA(); 00092 00101 static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES(); 00102 00108 static vtkInformationIntegerVectorKey* COMPOSITE_INDICES(); 00109 00110 00111 protected: 00112 vtkCompositeDataPipeline(); 00113 ~vtkCompositeDataPipeline(); 00114 00115 virtual int ForwardUpstream(vtkInformation* request); 00116 virtual int ForwardUpstream(int i, int j, vtkInformation* request); 00117 00118 // Copy information for the given request. 00119 virtual void CopyDefaultInformation(vtkInformation* request, int direction, 00120 vtkInformationVector** inInfoVec, 00121 vtkInformationVector* outInfoVec); 00122 00123 virtual void CopyFromDataToInformation( 00124 vtkDataObject* dobj, vtkInformation* inInfo); 00125 virtual void PushInformation(vtkInformation*); 00126 virtual void PopInformation (vtkInformation*); 00127 00128 virtual int ExecuteDataObject(vtkInformation* request, 00129 vtkInformationVector** inInfo, 00130 vtkInformationVector* outInfo); 00131 00132 virtual int ExecuteData(vtkInformation* request, 00133 vtkInformationVector** inInfoVec, 00134 vtkInformationVector* outInfoVec); 00135 00136 virtual void ExecuteDataStart(vtkInformation* request, 00137 vtkInformationVector** inInfoVec, 00138 vtkInformationVector* outInfoVec); 00139 00140 // Override this check to account for update extent. 00141 virtual int NeedToExecuteData(int outputPort, 00142 vtkInformationVector** inInfoVec, 00143 vtkInformationVector* outInfoVec); 00144 00145 // Check whether the data object in the pipeline information for an 00146 // output port exists and has a valid type. 00147 virtual int CheckCompositeData(vtkInformation *request, 00148 int port, 00149 vtkInformationVector** inInfoVec, 00150 vtkInformationVector* outInfoVec); 00151 00152 // True when the pipeline is iterating over the current (simple) filter 00153 // to produce composite output. In this case, ExecuteDataStart() should 00154 // NOT Initialize() the composite output. 00155 int InLocalLoop; 00156 00157 virtual void ExecuteSimpleAlgorithm(vtkInformation* request, 00158 vtkInformationVector** inInfoVec, 00159 vtkInformationVector* outInfoVec, 00160 int compositePort); 00161 vtkDataObject* ExecuteSimpleAlgorithmForBlock( 00162 vtkInformationVector** inInfoVec, 00163 vtkInformationVector* outInfoVec, 00164 vtkInformation* inInfo, 00165 vtkInformation* outInfo, 00166 vtkInformation* request, 00167 vtkDataObject* dobj); 00168 00169 bool ShouldIterateOverInput(int& compositePort); 00170 00171 virtual int InputTypeIsValid(int port, int index, 00172 vtkInformationVector **inInfoVec); 00173 00174 vtkInformation* InformationCache; 00175 00176 vtkInformation* GenericRequest; 00177 vtkInformation* DataObjectRequest; 00178 vtkInformation* InformationRequest; 00179 vtkInformation* UpdateExtentRequest; 00180 vtkInformation* DataRequest; 00181 00182 // Because we sometimes have to swap between "simple" data types and composite 00183 // data types, we sometimes want to skip resetting the pipeline information. 00184 int SuppressResetPipelineInformation; 00185 00186 virtual void ResetPipelineInformation(int port, vtkInformation*); 00187 00189 00196 vtkCompositeDataSet* CreateOutputCompositeDataSet( 00197 vtkCompositeDataSet* input, int compositePort); 00199 00200 // Override this to handle UPDATE_COMPOSITE_INDICES(). 00201 virtual void MarkOutputsGenerated(vtkInformation* request, 00202 vtkInformationVector** inInfoVec, 00203 vtkInformationVector* outInfoVec); 00204 00205 int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo); 00206 00207 private: 00208 vtkCompositeDataPipeline(const vtkCompositeDataPipeline&); // Not implemented. 00209 void operator=(const vtkCompositeDataPipeline&); // Not implemented. 00210 }; 00211 00212 #endif