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 vtkCompositeDataIterator; 00057 class vtkInformationDoubleKey; 00058 class vtkInformationIntegerVectorKey; 00059 class vtkInformationObjectBaseKey; 00060 class vtkInformationStringKey; 00061 class vtkInformationDataObjectKey; 00062 class vtkInformationIntegerKey; 00063 00064 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkCompositeDataPipeline : 00065 public vtkStreamingDemandDrivenPipeline 00066 { 00067 public: 00068 static vtkCompositeDataPipeline* New(); 00069 vtkTypeMacro(vtkCompositeDataPipeline,vtkStreamingDemandDrivenPipeline); 00070 void PrintSelf(ostream& os, vtkIndent indent); 00071 00074 vtkDataObject* GetCompositeOutputData(int port); 00075 00077 00079 vtkDataObject* GetCompositeInputData( 00080 int port, int index, vtkInformationVector **inInfoVec); 00082 00085 static vtkInformationIntegerKey* LOAD_REQUESTED_BLOCKS(); 00086 00092 static vtkInformationObjectBaseKey* COMPOSITE_DATA_META_DATA(); 00093 00102 static vtkInformationIntegerVectorKey* UPDATE_COMPOSITE_INDICES(); 00103 00110 static vtkInformationDoubleKey* BLOCK_AMOUNT_OF_DETAIL(); 00111 00112 protected: 00113 vtkCompositeDataPipeline(); 00114 ~vtkCompositeDataPipeline(); 00115 00116 virtual int ForwardUpstream(vtkInformation* request); 00117 virtual int ForwardUpstream(int i, int j, vtkInformation* request); 00118 00119 // Copy information for the given request. 00120 virtual void CopyDefaultInformation(vtkInformation* request, int direction, 00121 vtkInformationVector** inInfoVec, 00122 vtkInformationVector* outInfoVec); 00123 00124 virtual void PushInformation(vtkInformation*); 00125 virtual void PopInformation (vtkInformation*); 00126 00127 virtual int ExecuteDataObject(vtkInformation* request, 00128 vtkInformationVector** inInfo, 00129 vtkInformationVector* outInfo); 00130 00131 virtual int ExecuteData(vtkInformation* request, 00132 vtkInformationVector** inInfoVec, 00133 vtkInformationVector* outInfoVec); 00134 00135 virtual void ExecuteDataStart(vtkInformation* request, 00136 vtkInformationVector** inInfoVec, 00137 vtkInformationVector* outInfoVec); 00138 00139 // Override this check to account for update extent. 00140 virtual int NeedToExecuteData(int outputPort, 00141 vtkInformationVector** inInfoVec, 00142 vtkInformationVector* outInfoVec); 00143 00144 // Check whether the data object in the pipeline information for an 00145 // output port exists and has a valid type. 00146 virtual int CheckCompositeData(vtkInformation *request, 00147 int port, 00148 vtkInformationVector** inInfoVec, 00149 vtkInformationVector* outInfoVec); 00150 00151 // True when the pipeline is iterating over the current (simple) filter 00152 // to produce composite output. In this case, ExecuteDataStart() should 00153 // NOT Initialize() the composite output. 00154 int InLocalLoop; 00155 00156 virtual void ExecuteSimpleAlgorithm(vtkInformation* request, 00157 vtkInformationVector** inInfoVec, 00158 vtkInformationVector* outInfoVec, 00159 int compositePort); 00160 00161 virtual void ExecuteEach(vtkCompositeDataIterator* iter, 00162 vtkInformationVector** inInfoVec, 00163 vtkInformationVector* outInfoVec, 00164 int compositePort, 00165 int connection, 00166 vtkInformation* request, 00167 vtkCompositeDataSet* compositeOutput); 00168 00169 vtkDataObject* ExecuteSimpleAlgorithmForBlock( 00170 vtkInformationVector** inInfoVec, 00171 vtkInformationVector* outInfoVec, 00172 vtkInformation* inInfo, 00173 vtkInformation* outInfo, 00174 vtkInformation* request, 00175 vtkDataObject* dobj); 00176 00177 bool ShouldIterateOverInput(vtkInformationVector** inInfoVec, 00178 int& compositePort); 00179 00180 virtual int InputTypeIsValid(int port, int index, 00181 vtkInformationVector **inInfoVec); 00182 00183 vtkInformation* InformationCache; 00184 00185 vtkInformation* GenericRequest; 00186 vtkInformation* DataObjectRequest; 00187 vtkInformation* InformationRequest; 00188 vtkInformation* UpdateExtentRequest; 00189 vtkInformation* DataRequest; 00190 00191 00192 virtual void ResetPipelineInformation(int port, vtkInformation*); 00193 00195 00202 vtkCompositeDataSet* CreateOutputCompositeDataSet( 00203 vtkCompositeDataSet* input, int compositePort); 00205 00206 // Override this to handle UPDATE_COMPOSITE_INDICES(). 00207 virtual void MarkOutputsGenerated(vtkInformation* request, 00208 vtkInformationVector** inInfoVec, 00209 vtkInformationVector* outInfoVec); 00210 00211 int NeedToExecuteBasedOnCompositeIndices(vtkInformation* outInfo); 00212 00213 // Because we sometimes have to swap between "simple" data types and composite 00214 // data types, we sometimes want to skip resetting the pipeline information. 00215 static vtkInformationIntegerKey* SUPPRESS_RESET_PI(); 00216 00222 static vtkInformationIntegerVectorKey* DATA_COMPOSITE_INDICES(); 00223 00224 private: 00225 vtkCompositeDataPipeline(const vtkCompositeDataPipeline&); // Not implemented. 00226 void operator=(const vtkCompositeDataPipeline&); // Not implemented. 00227 }; 00228 00229 #endif