FreeMat
|
Section: Visualization Toolkit Rendering Classes
vtkDataTransferHelper is a helper class that aids in transferring data between the CPU memory and the GPU memory. The data in GPU memory is stored as textures which that in CPU memory is stored as vtkDataArray. vtkDataTransferHelper provides API to transfer only a sub-extent of CPU structured data to/from the GPU.
To create an instance of class vtkDataTransferHelper, simply invoke its constructor as follows
obj = vtkDataTransferHelper
The class vtkDataTransferHelper has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj
is an instance of the vtkDataTransferHelper class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkDataTransferHelper = obj.NewInstance ()
vtkDataTransferHelper = obj.SafeDownCast (vtkObject o)
obj.SetContext (vtkRenderWindow context)
- Get/Set the context. Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions. vtkRenderWindow = obj.GetContext ()
- Get/Set the context. Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions. obj.SetCPUExtent (int , int , int , int , int , int )
- Set the CPU data extent. The extent matches the vtkDataArray size. If the vtkDataArray comes from an vtkImageData and it is part of the point data, it is usually the vtkImageData extent. It can be on cell data too, but in this case it does not match the vtkImageData extent. If the vtkDataArray comes from a vtkDataSet, just set it to a one-dimenstional extent equal to the number of tuples. Initial value is (0,0,0,0,0,0), a valid one tuple array. obj.SetCPUExtent (int a[6])
- Set the CPU data extent. The extent matches the vtkDataArray size. If the vtkDataArray comes from an vtkImageData and it is part of the point data, it is usually the vtkImageData extent. It can be on cell data too, but in this case it does not match the vtkImageData extent. If the vtkDataArray comes from a vtkDataSet, just set it to a one-dimenstional extent equal to the number of tuples. Initial value is (0,0,0,0,0,0), a valid one tuple array. int = obj. GetCPUExtent ()
- Set the CPU data extent. The extent matches the vtkDataArray size. If the vtkDataArray comes from an vtkImageData and it is part of the point data, it is usually the vtkImageData extent. It can be on cell data too, but in this case it does not match the vtkImageData extent. If the vtkDataArray comes from a vtkDataSet, just set it to a one-dimenstional extent equal to the number of tuples. Initial value is (0,0,0,0,0,0), a valid one tuple array. obj.SetGPUExtent (int , int , int , int , int , int )
- Set the GPU data extent. This is the sub-extent to copy from or to the GPU. This extent matches the size of the data to transfer. GPUExtent and TextureExtent don't have to match (GPUExtent can be 1D whereas TextureExtent is 2D) but the number of elements have to match. Initial value is (0,0,0,0,0,0), a valid one tuple array. obj.SetGPUExtent (int a[6])
- Set the GPU data extent. This is the sub-extent to copy from or to the GPU. This extent matches the size of the data to transfer. GPUExtent and TextureExtent don't have to match (GPUExtent can be 1D whereas TextureExtent is 2D) but the number of elements have to match. Initial value is (0,0,0,0,0,0), a valid one tuple array. int = obj. GetGPUExtent ()
- Set the GPU data extent. This is the sub-extent to copy from or to the GPU. This extent matches the size of the data to transfer. GPUExtent and TextureExtent don't have to match (GPUExtent can be 1D whereas TextureExtent is 2D) but the number of elements have to match. Initial value is (0,0,0,0,0,0), a valid one tuple array. obj.SetTextureExtent (int , int , int , int , int , int )
- Set the texture data extent. This is the extent of the texture image that will receive the data. This extent matches the size of the data to transfer. If it is set to an invalid extent, GPUExtent is used. See more comment on GPUExtent. Initial value is an invalid extent. obj.SetTextureExtent (int a[6])
- Set the texture data extent. This is the extent of the texture image that will receive the data. This extent matches the size of the data to transfer. If it is set to an invalid extent, GPUExtent is used. See more comment on GPUExtent. Initial value is an invalid extent. int = obj. GetTextureExtent ()
- Set the texture data extent. This is the extent of the texture image that will receive the data. This extent matches the size of the data to transfer. If it is set to an invalid extent, GPUExtent is used. See more comment on GPUExtent. Initial value is an invalid extent. bool = obj.GetExtentIsValid (int extent)
- Tells if the given extent (6 int) is valid. True if min extent<=max extent. bool = obj.GetCPUExtentIsValid ()
- Tells if CPUExtent is valid. True if min extent<=max extent. bool = obj.GetGPUExtentIsValid ()
- Tells if GPUExtent is valid. True if min extent<=max extent. bool = obj.GetTextureExtentIsValid ()
- Tells if TextureExtent is valid. True if min extent<=max extent. obj.SetMinTextureDimension (int )
- Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent. Initial value is 1. A texture extent can have a given dimension 0D (one value), 1D, 2D or 3D. By default 0D and 1D are translated into a 1D texture, 2D is translated into a 2D texture, 3D is translated into a 3D texture. To make life easier when writting GLSL code and use only one type of sampler (ex: sampler2d), the default behavior can be changed by forcing a type of texture with this ivar. 1: default behavior. Initial value. 2: force 0D and 1D to be in a 2D texture 3: force 0D, 1D and 2D texture to be in a 3D texture. int = obj.GetMinTextureDimension ()
- Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent. Initial value is 1. A texture extent can have a given dimension 0D (one value), 1D, 2D or 3D. By default 0D and 1D are translated into a 1D texture, 2D is translated into a 2D texture, 3D is translated into a 3D texture. To make life easier when writting GLSL code and use only one type of sampler (ex: sampler2d), the default behavior can be changed by forcing a type of texture with this ivar. 1: default behavior. Initial value. 2: force 0D and 1D to be in a 2D texture 3: force 0D, 1D and 2D texture to be in a 3D texture. vtkDataArray = obj.GetArray ()
- Get/Set the CPU data buffer. Initial value is 0. obj.SetArray (vtkDataArray array)
- Get/Set the CPU data buffer. Initial value is 0. vtkTextureObject = obj.GetTexture ()
- Get/Set the GPU data buffer. Initial value is 0. obj.SetTexture (vtkTextureObject texture)
- Get/Set the GPU data buffer. Initial value is 0. bool = obj.Upload (int components, int componentListNULL)
- Old comment. Upload Extent from CPU data buffer to GPU. The WholeExtent must match the Array size. New comment. Upload GPUExtent from CPU vtkDataArray to GPU texture. It is possible to send a subset of the components or to specify and order of components or both. If components=0, componentList is ignored and all components are passed, a texture cannot have more than 4 components. bool = obj.Download ()
- old comment: Downlad Extent from GPU data buffer to CPU. GPU data size must exactly match Extent. CPU data buffer will be resized to match WholeExtent in which only the Extent will be filled with the GPU data. new comment: Download GPUExtent from GPU texture to CPU vtkDataArray. If Array is not provided, it will be created with the size of CPUExtent. But only the tuples covered by GPUExtent will be download. In this case, if GPUExtent does not cover all GPUExtent, some of the vtkDataArray will be uninitialized. Reminder: A=>B <=> !A||B bool = obj.DownloadAsync1 ()
- Splits the download in two operations Asynchronously download from texture memory to PBO (DownloadAsync1()). Copy from pbo to user array (DownloadAsync2()). bool = obj.DownloadAsync2 ()
- Splits the download in two operations Asynchronously download from texture memory to PBO (DownloadAsync1()). Copy from pbo to user array (DownloadAsync2()). bool = obj.GetShaderSupportsTextureInt ()
obj.SetShaderSupportsTextureInt (bool value)