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 =========================================================================*/
31 #ifndef vtkDataTransferHelper_h
32 #define vtkDataTransferHelper_h
33 
34 #include "vtkRenderingOpenGLModule.h" // For export macro
35 #include "vtkObject.h"
36 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
37 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
38 
39 class vtkDataArray;
41 class vtkTextureObject;
43 class vtkRenderWindow;
44 
45 class VTKRENDERINGOPENGL_EXPORT vtkDataTransferHelper : public vtkObject
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
60  void SetContext(vtkRenderWindow* context);
63 
65 
75  vtkSetVector6Macro(CPUExtent, int);
76  vtkGetVector6Macro(CPUExtent, int);
78 
80 
87  vtkSetVector6Macro(GPUExtent, int);
88  vtkGetVector6Macro(GPUExtent, int);
90 
92 
99  vtkSetVector6Macro(TextureExtent, int);
100  vtkGetVector6Macro(TextureExtent, int);
102 
109 
114 
119 
124 
126 
139  vtkSetMacro(MinTextureDimension,int);
140  vtkGetMacro(MinTextureDimension,int);
142 
144 
147  vtkGetObjectMacro(Array, vtkDataArray);
148  void SetArray(vtkDataArray* array);
150 
152 
155  vtkGetObjectMacro(Texture, vtkTextureObject);
156  void SetTexture(vtkTextureObject* texture);
158 
179  bool Upload(int components=0,
180  int *componentList=NULL);
181 
205  bool Download();
206 
208 
216 
219 
223  static bool IsSupported(vtkRenderWindow* renWin);
224 
225 protected:
228 
233 
234  int CPUExtent[6];
235  int GPUExtent[6];
236  int TextureExtent[6];
237 
243 
245 
247 
248  // We try to reuse the PBO if possible.
250 private:
251  vtkDataTransferHelper(const vtkDataTransferHelper&) VTK_DELETE_FUNCTION;
252  void operator=(const vtkDataTransferHelper&) VTK_DELETE_FUNCTION;
253 
254 };
255 
256 #endif
vtkDataTransferHelper::SetTexture
void SetTexture(vtkTextureObject *texture)
vtkDataTransferHelper::ShaderSupportsTextureInt
bool ShaderSupportsTextureInt
Definition: vtkDataTransferHelper.h:241
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:46
vtkDataTransferHelper::SetContext
void SetContext(vtkRenderWindow *context)
Get/Set the context.
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkDataTransferHelper::Download
bool Download()
old comment: Download Extent from GPU data buffer to CPU.
vtkDataTransferHelper::Texture
vtkTextureObject * Texture
Definition: vtkDataTransferHelper.h:239
vtkSmartPointer< vtkPixelBufferObject >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkDataTransferHelper::GetExtentIsValid
bool GetExtentIsValid(int *extent)
Tells if the given extent (6 int) is valid.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkDataTransferHelper::PBO
vtkSmartPointer< vtkPixelBufferObject > PBO
Definition: vtkDataTransferHelper.h:249
vtkDataTransferHelper::GetCPUExtentIsValid
bool GetCPUExtentIsValid()
Tells if CPUExtent is valid.
vtkDataTransferHelper::LoadRequiredExtensions
bool LoadRequiredExtensions(vtkOpenGLExtensionManager *)
Load all necessary extensions.
vtkDataTransferHelper::~vtkDataTransferHelper
~vtkDataTransferHelper()
vtkDataTransferHelper::DownloadAsync1
bool DownloadAsync1()
Splits the download in two operations.
vtkDataTransferHelper::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
vtkDataTransferHelper::Upload
bool Upload(int components=0, int *componentList=NULL)
Old comment.
vtkDataTransferHelper::SetArray
void SetArray(vtkDataArray *array)
vtkDataTransferHelper::GetGPUExtentIsValid
bool GetGPUExtentIsValid()
Tells if GPUExtent is valid.
vtkDataTransferHelper::MinTextureDimension
int MinTextureDimension
Definition: vtkDataTransferHelper.h:242
vtkDataTransferHelper::GetTextureExtentIsValid
bool GetTextureExtentIsValid()
Tells if TextureExtent is valid.
vtkOpenGLExtensionManager
Interface class for querying and using OpenGL extensions.
vtkDataTransferHelper::GetShaderSupportsTextureInt
bool GetShaderSupportsTextureInt()
vtkDataTransferHelper::GetPBO
vtkPixelBufferObject * GetPBO()
vtkDataTransferHelper::New
static vtkDataTransferHelper * New()
vtkDataTransferHelper::Array
vtkDataArray * Array
Definition: vtkDataTransferHelper.h:240
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:44
vtkSmartPointer.h
vtkWeakPointer.h
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkDataTransferHelper::vtkDataTransferHelper
vtkDataTransferHelper()
vtkDataTransferHelper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkDataTransferHelper::DownloadAsync2
bool DownloadAsync2()
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkDataTransferHelper::AsyncDownloadPBO
vtkSmartPointer< vtkPixelBufferObject > AsyncDownloadPBO
Definition: vtkDataTransferHelper.h:244
vtkPixelBufferObject
abstracts an OpenGL pixel buffer object.
Definition: vtkPixelBufferObject.h:44
vtkWeakPointer< vtkRenderWindow >
vtkDataTransferHelper::Context
vtkWeakPointer< vtkRenderWindow > Context
Definition: vtkDataTransferHelper.h:238
vtkDataTransferHelper::GetContext
vtkRenderWindow * GetContext()