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 "vtkObject.h"
34 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
35 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
36 
37 class vtkDataArray;
39 class vtkTextureObject;
41 class vtkRenderWindow;
42 
44 {
45 public:
46  static vtkDataTransferHelper* New();
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
55  void SetContext(vtkRenderWindow* context);
56  vtkRenderWindow* GetContext();
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 
92  bool GetExtentIsValid(int *extent);
93 
95  bool GetCPUExtentIsValid();
96 
98  bool GetGPUExtentIsValid();
99 
101  bool GetTextureExtentIsValid();
102 
104 
114  vtkSetMacro(MinTextureDimension,int);
115  vtkGetMacro(MinTextureDimension,int);
117 
119 
120  vtkGetObjectMacro(Array, vtkDataArray);
121  void SetArray(vtkDataArray* array);
123 
125 
126  vtkGetObjectMacro(Texture, vtkTextureObject);
127  void SetTexture(vtkTextureObject* texture);
129 
131 
156  bool Upload(int components=0,
157  int *componentList=NULL);
159 
185  bool Download();
186 
188 
191  bool DownloadAsync1();
192  bool DownloadAsync2();
194 
195  bool GetShaderSupportsTextureInt();
196  void SetShaderSupportsTextureInt(bool value);
197 
199 
200  static bool IsSupported(vtkRenderWindow* renWin);
201 //BTX
202 protected:
206 
208  bool LoadRequiredExtensions(vtkOpenGLExtensionManager*);
209 
210  int CPUExtent[6];
211  int GPUExtent[6];
212  int TextureExtent[6];
213 
219 
221 
222  vtkPixelBufferObject* GetPBO();
223 
224  // We try to reuse the PBO if possible.
226 private:
227  vtkDataTransferHelper(const vtkDataTransferHelper&); // Not implemented.
228  void operator=(const vtkDataTransferHelper&); // Not implemented.
229 //ETX
230 };
231 
232 #endif