VTK
vtkDataTransferHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataTransferHelper.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 =========================================================================*/
30 #ifndef vtkDataTransferHelper_h
31 #define vtkDataTransferHelper_h
32 
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
34 #include "vtkObject.h"
35 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
36 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
37 
38 class vtkDataArray;
40 class vtkTextureObject;
41 class vtkRenderWindow;
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkDataTransferHelper : public vtkObject
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
55  void SetContext(vtkRenderWindow* context);
58 
60 
67  vtkSetVector6Macro(CPUExtent, int);
68  vtkGetVector6Macro(CPUExtent, int);
70 
72 
77  vtkSetVector6Macro(GPUExtent, int);
78  vtkGetVector6Macro(GPUExtent, int);
80 
82 
86  vtkSetVector6Macro(TextureExtent, int);
87  vtkGetVector6Macro(TextureExtent, int);
89 
93 
96 
99 
102 
104 
114  vtkSetMacro(MinTextureDimension,int);
115  vtkGetMacro(MinTextureDimension,int);
117 
119 
121  void SetArray(vtkDataArray* array);
123 
125 
129 
131 
153  bool Upload(int components=0,
154  int *componentList=NULL);
156 
179  bool Download();
180 
182 
188 
191 
193 
194  static bool IsSupported(vtkRenderWindow* renWin);
195 //BTX
196 protected:
200 
201  int CPUExtent[6];
202  int GPUExtent[6];
203  int TextureExtent[6];
204 
206  vtkTextureObject* Texture;
207  vtkDataArray* Array;
208  bool ShaderSupportsTextureInt;
209  int MinTextureDimension;
210 
211  vtkSmartPointer<vtkPixelBufferObject> AsyncDownloadPBO;
212 
214 
215  // We try to reuse the PBO if possible.
217 private:
218  vtkDataTransferHelper(const vtkDataTransferHelper&); // Not implemented.
219  void operator=(const vtkDataTransferHelper&); // Not implemented.
220 //ETX
221 };
222 
223 #endif
vtkGetVector6Macro
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:380
vtkDataTransferHelper::SetTexture
void SetTexture(vtkTextureObject *texture)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkDataTransferHelper::SetShaderSupportsTextureInt
void SetShaderSupportsTextureInt(bool value)
vtkDataTransferHelper
is a helper class that aids in transferring data between CPU memory and GPU memory.
Definition: vtkDataTransferHelper.h:45
vtkDataTransferHelper::SetContext
void SetContext(vtkRenderWindow *context)
vtkDataTransferHelper::Download
bool Download()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSmartPointer< vtkPixelBufferObject >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkDataTransferHelper::GetExtentIsValid
bool GetExtentIsValid(int *extent)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkDataTransferHelper::GetCPUExtentIsValid
bool GetCPUExtentIsValid()
vtkDataTransferHelper::~vtkDataTransferHelper
~vtkDataTransferHelper()
vtkDataTransferHelper::DownloadAsync1
bool DownloadAsync1()
vtkDataTransferHelper::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
vtkDataTransferHelper::Upload
bool Upload(int components=0, int *componentList=NULL)
vtkDataTransferHelper::SetArray
void SetArray(vtkDataArray *array)
vtkDataTransferHelper::GetGPUExtentIsValid
bool GetGPUExtentIsValid()
vtkDataTransferHelper::GetTextureExtentIsValid
bool GetTextureExtentIsValid()
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkgl::texture
GLenum GLuint texture
Definition: vtkgl.h:12500
vtkDataTransferHelper::GetShaderSupportsTextureInt
bool GetShaderSupportsTextureInt()
vtkDataTransferHelper::GetPBO
vtkPixelBufferObject * GetPBO()
vtkDataTransferHelper::New
static vtkDataTransferHelper * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkSmartPointer.h
vtkWeakPointer.h
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkDataTransferHelper::vtkDataTransferHelper
vtkDataTransferHelper()
vtkDataTransferHelper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSetVector6Macro
#define vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:360
vtkDataTransferHelper::DownloadAsync2
bool DownloadAsync2()
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkgl::components
GLenum GLenum GLuint components
Definition: vtkgl.h:16909
vtkPixelBufferObject
abstracts an OpenGL pixel buffer object.
Definition: vtkPixelBufferObject.h:43
vtkWeakPointer< vtkRenderWindow >
vtkDataTransferHelper::GetContext
vtkRenderWindow * GetContext()