VTK  9.3.20240425
vtkDataTransferHelper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
19#ifndef vtkDataTransferHelper_h
20#define vtkDataTransferHelper_h
21
22#include "vtkObject.h"
23#include "vtkRenderingOpenGL2Module.h" // For export macro
24#include "vtkSmartPointer.h" // needed for vtkSmartPointer.
25#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkDataArray;
31class vtkRenderWindow;
32
33class VTKRENDERINGOPENGL2_EXPORT vtkDataTransferHelper : public vtkObject
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
51
53
63 vtkSetVector6Macro(CPUExtent, int);
64 vtkGetVector6Macro(CPUExtent, int);
66
68
75 vtkSetVector6Macro(GPUExtent, int);
76 vtkGetVector6Macro(GPUExtent, int);
78
80
87 vtkSetVector6Macro(TextureExtent, int);
88 vtkGetVector6Macro(TextureExtent, int);
90
96 bool GetExtentIsValid(int* extent);
97
102
107
112
114
127 vtkSetMacro(MinTextureDimension, int);
128 vtkGetMacro(MinTextureDimension, int);
130
132
135 vtkGetObjectMacro(Array, vtkDataArray);
136 void SetArray(vtkDataArray* array);
138
140
143 vtkGetObjectMacro(Texture, vtkTextureObject);
146
172 bool Upload(int components = 0, int* componentList = nullptr);
173
200 bool Download();
201
203
211
214
218 static bool IsSupported(vtkRenderWindow* renWin);
219
220protected:
223
224 int CPUExtent[6];
225 int GPUExtent[6];
226 int TextureExtent[6];
227
233
235
237
238 // We try to reuse the PBO if possible.
240
241private:
243 void operator=(const vtkDataTransferHelper&) = delete;
244};
245
246VTK_ABI_NAMESPACE_END
247#endif
abstract superclass for arrays of numeric data
is a helper class that aids in transferring data between CPU memory and GPU memory.
vtkWeakPointer< vtkRenderWindow > Context
bool GetTextureExtentIsValid()
Tells if TextureExtent is valid.
bool GetGPUExtentIsValid()
Tells if GPUExtent is valid.
void SetContext(vtkRenderWindow *context)
Get/Set the context.
static vtkDataTransferHelper * New()
bool Upload(int components=0, int *componentList=nullptr)
Old comment.
vtkSmartPointer< vtkPixelBufferObject > PBO
bool Download()
old comment: Download Extent from GPU data buffer to CPU.
vtkRenderWindow * GetContext()
Get/Set the context.
vtkSmartPointer< vtkPixelBufferObject > AsyncDownloadPBO
bool GetExtentIsValid(int *extent)
Tells if the given extent (6 int) is valid.
bool GetCPUExtentIsValid()
Tells if CPUExtent is valid.
bool DownloadAsync1()
Splits the download in two operations.
bool GetShaderSupportsTextureInt()
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
~vtkDataTransferHelper() override
bool DownloadAsync2()
Splits the download in two operations.
void SetTexture(vtkTextureObject *texture)
Get/Set the GPU data buffer.
void SetArray(vtkDataArray *array)
Get/Set the CPU data buffer.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPixelBufferObject * GetPBO()
void SetShaderSupportsTextureInt(bool value)
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
Hold a reference to a vtkObjectBase instance.
abstracts an OpenGL texture object.
a weak reference to a vtkObject.