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
00021
00067 #ifndef __vtkKWEGPUArrayCalculator_h
00068 #define __vtkKWEGPUArrayCalculator_h
00069
00070 #include "vtkArrayCalculator.h"
00071 #include "VTKEdgeConfigure.h"
00072
00073
00074 class vtkKWEFunctionToGLSL;
00075 class vtkRenderWindow;
00076 class vtkFloatArray;
00077
00078 class VTKEdge_HYBRID_EXPORT vtkKWEGPUArrayCalculator : public vtkArrayCalculator
00079 {
00080 public:
00081 vtkTypeRevisionMacro(vtkKWEGPUArrayCalculator,vtkArrayCalculator);
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00084 static vtkKWEGPUArrayCalculator *New();
00085
00087
00088 vtkGetObjectMacro(Context, vtkRenderWindow);
00089 void SetContext(vtkRenderWindow *);
00091
00094 bool GetSupportedByHardware();
00095
00097 virtual void SetFunction(const char* function);
00098
00100
00109 vtkSetMacro(SizeThreshold,vtkIdType);
00110 vtkGetMacro(SizeThreshold,vtkIdType);
00112
00114
00118 vtkGetMacro(UseCalibration,int);
00119 vtkSetMacro(UseCalibration,int);
00120 vtkBooleanMacro(UseCalibration,int);
00122
00129 void Calibrate();
00130
00132
00134 vtkGetMacro(CalibratedSizeThreshold,vtkIdType);
00136
00139 virtual void RemoveScalarVariables();
00140
00143 virtual void RemoveVectorVariables();
00144
00146 virtual void RemoveCoordinateScalarVariables();
00147
00149 virtual void RemoveCoordinateVectorVariables();
00150
00152
00156 vtkSetMacro(MaxGPUMemorySizeInBytes,vtkIdType);
00157 vtkGetMacro(MaxGPUMemorySizeInBytes,vtkIdType);
00159
00160 protected:
00161 vtkKWEGPUArrayCalculator();
00162 virtual ~vtkKWEGPUArrayCalculator();
00163
00164 void SimulateGPUComputation(vtkFloatArray *values);
00165
00166 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00167
00168 virtual void ComputeSubRange(vtkDataArray *array,
00169 vtkIdType first,
00170 vtkIdType last,
00171 double subRange[2]);
00172
00173 vtkRenderWindow *Context;
00174
00175 vtkKWEFunctionToGLSL *FunctionParserToGLSL;
00176
00177 vtkIdType MaxGPUMemorySizeInBytes;
00178
00179 vtkIdType SizeThreshold;
00180 int UseCalibration;
00181 vtkIdType CalibratedSizeThreshold;
00182 bool CalibrationDone;
00183 bool SupportedByHardware;
00184
00185 private:
00186 vtkKWEGPUArrayCalculator(const vtkKWEGPUArrayCalculator&);
00187 void operator=(const vtkKWEGPUArrayCalculator&);
00188 };
00189
00190 #endif