Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00027 #ifndef __vtkKWEGPUImageAlgorithmDriver_h
00028 #define __vtkKWEGPUImageAlgorithmDriver_h
00029
00030 #include "vtkImageAlgorithm.h"
00031 #include "VTKEdgeConfigure.h"
00032 #include "vtkStructuredData.h"
00033 #include "vtkWeakPointer.h"
00034 #include "vtkSmartPointer.h"
00035
00036
00037 #include <vtkstd/vector>
00038
00039
00040 class vtkRenderWindow;
00041 class vtkDataTransferHelper;
00042 class vtkKWEExtentCalculator;
00043
00044 class VTKEdge_HYBRID_EXPORT vtkKWEGPUImageAlgorithmDriver : public vtkImageAlgorithm
00045 {
00046 public:
00047 vtkTypeRevisionMacro(vtkKWEGPUImageAlgorithmDriver, vtkImageAlgorithm);
00048 void PrintSelf(ostream& os, vtkIndent indent);
00049
00051
00052 vtkRenderWindow* GetContext();
00053 virtual void SetContext(vtkRenderWindow*);
00055
00056
00057 enum ExtentTypes
00058 {
00059 INVALID=0,
00060 XY_PLANE = VTK_XY_PLANE,
00061 YZ_PLANE = VTK_YZ_PLANE,
00062 XZ_PLANE = VTK_XZ_PLANE,
00063 XYZ_GRID = VTK_XYZ_GRID
00064 };
00065
00066 protected:
00067 class vtkBuses;
00068
00069 vtkKWEGPUImageAlgorithmDriver();
00070 ~vtkKWEGPUImageAlgorithmDriver();
00071
00073
00076 virtual ExtentTypes GetSplitMode(vtkInformation* request,
00077 vtkInformationVector** inputVector,
00078 vtkInformationVector* outputVector) = 0;
00080
00082
00087 virtual int MapOutputExtentToInput(int input_extent[6],
00088 int port, int connection,
00089 vtkInformation* inInfo, const int output_extent[6]) = 0;
00091
00092
00094
00096 virtual bool InitializeExecution(
00097 vtkInformation* vtkNotUsed(request),
00098 vtkInformationVector** vtkNotUsed(inputVector),
00099 vtkInformationVector* vtkNotUsed(outputVector)) {return true;}
00101
00103
00104 virtual bool Execute(vtkBuses* upBuses,
00105 vtkDataTransferHelper* downBus) = 0;
00106 virtual void Execute() { this->Superclass::Execute(); }
00108
00110
00112 virtual bool FinalizeExecution(
00113 vtkInformation* vtkNotUsed(request),
00114 vtkInformationVector** vtkNotUsed(inputVector),
00115 vtkInformationVector* vtkNotUsed(outputVector)) {return true;}
00117
00119
00121 virtual int RequestData(vtkInformation* request,
00122 vtkInformationVector** inputVector,
00123 vtkInformationVector* outputVector);
00125
00127
00128 int RequestUpdateExtent (
00129 vtkInformation *request,
00130 vtkInformationVector **inputVector,
00131 vtkInformationVector *outputVector);
00133
00134 bool ComputeTCoordsRange(double tcoords[6],
00135 const int inputExt[6], const int outputExt[6]);
00136
00137 vtkWeakPointer<vtkRenderWindow> Context;
00138 bool OwnContext;
00139
00140 private:
00141 vtkKWEGPUImageAlgorithmDriver(const vtkKWEGPUImageAlgorithmDriver&);
00142 void operator=(const vtkKWEGPUImageAlgorithmDriver&);
00143
00144 class vtkPipe;
00145 friend class vtkPipe;
00146
00148
00150 vtkBuses* Upload(vtkKWEExtentCalculator* extentCalculator,
00151 vtkInformationVector** inputVector,
00152 vtkPipe& pipe);
00154
00155 bool SetupOutputTexture(ExtentTypes chunkType, vtkDataTransferHelper* down_bus);
00156
00157 };
00158
00159
00160 class vtkKWEGPUImageAlgorithmDriver::vtkBuses : public vtkObjectBase
00161 {
00162 public:
00163 vtkTypeRevisionMacro(vtkBuses, vtkObjectBase);
00164 static vtkBuses* New();
00165
00166 void SetNumberOfPorts(unsigned int num);
00167 void SetNumberOfConnections(unsigned int port, unsigned int num);
00168 vtkDataTransferHelper* GetBus(unsigned int port, unsigned int conn);
00169 void SetBus(unsigned int port, unsigned int conn, vtkDataTransferHelper* bus);
00170
00171 private:
00172 vtkBuses() { }
00173 virtual ~vtkBuses() { }
00174
00175 typedef vtkstd::vector<vtkSmartPointer<vtkDataTransferHelper> > XferHelperVector;
00176 typedef vtkstd::vector<XferHelperVector> VectorOfXferHelperVector;
00177
00178 VectorOfXferHelperVector Buses;
00179 };
00180
00181 #endif
00182
00183