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 "vtkRenderingOpenGLModule.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;
42 class vtkRenderWindow;
43 
45 {
46 public:
47  static vtkDataTransferHelper* New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
56  void SetContext(vtkRenderWindow* context);
57  vtkRenderWindow* GetContext();
59 
61 
68  vtkSetVector6Macro(CPUExtent, int);
69  vtkGetVector6Macro(CPUExtent, int);
71 
73 
78  vtkSetVector6Macro(GPUExtent, int);
79  vtkGetVector6Macro(GPUExtent, int);
81 
83 
87  vtkSetVector6Macro(TextureExtent, int);
88  vtkGetVector6Macro(TextureExtent, int);
90 
93  bool GetExtentIsValid(int *extent);
94 
96  bool GetCPUExtentIsValid();
97 
99  bool GetGPUExtentIsValid();
100 
102  bool GetTextureExtentIsValid();
103 
105 
115  vtkSetMacro(MinTextureDimension,int);
116  vtkGetMacro(MinTextureDimension,int);
118 
120 
121  vtkGetObjectMacro(Array, vtkDataArray);
122  void SetArray(vtkDataArray* array);
124 
126 
127  vtkGetObjectMacro(Texture, vtkTextureObject);
128  void SetTexture(vtkTextureObject* texture);
130 
132 
154  bool Upload(int components=0,
155  int *componentList=NULL);
157 
180  bool Download();
181 
183 
186  bool DownloadAsync1();
187  bool DownloadAsync2();
189 
190  bool GetShaderSupportsTextureInt();
191  void SetShaderSupportsTextureInt(bool value);
192 
194 
195  static bool IsSupported(vtkRenderWindow* renWin);
196 //BTX
197 protected:
201 
203  bool LoadRequiredExtensions(vtkOpenGLExtensionManager*);
204 
205  int CPUExtent[6];
206  int GPUExtent[6];
207  int TextureExtent[6];
208 
214 
216 
217  vtkPixelBufferObject* GetPBO();
218 
219  // We try to reuse the PBO if possible.
221 private:
222  vtkDataTransferHelper(const vtkDataTransferHelper&); // Not implemented.
223  void operator=(const vtkDataTransferHelper&); // Not implemented.
224 //ETX
225 };
226 
227 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSmartPointer< vtkPixelBufferObject > AsyncDownloadPBO
vtkSmartPointer< vtkPixelBufferObject > PBO
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkTextureObject * Texture
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKRENDERINGOPENGL_EXPORT
vtkWeakPointer< vtkRenderWindow > Context
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
abstracts an OpenGL pixel buffer object.
Interface class for querying and using OpenGL extensions.
abstracts an OpenGL texture object.
create a window for renderers to draw into
static vtkObject * New()
is a helper class that aids in transferring data between CPU memory and GPU memory.