VTK
|
is a helper class that aids in transferring data between CPU memory and GPU memory. More...
#include <vtkDataTransferHelper.h>
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. More... | |
vtkDataTransferHelper * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
bool | GetExtentIsValid (int *extent) |
Tells if the given extent (6 int) is valid. More... | |
bool | GetCPUExtentIsValid () |
Tells if CPUExtent is valid. More... | |
bool | GetGPUExtentIsValid () |
Tells if GPUExtent is valid. More... | |
bool | GetTextureExtentIsValid () |
Tells if TextureExtent is valid. More... | |
bool | Upload (int components=0, int *componentList=nullptr) |
Old comment. More... | |
bool | Download () |
old comment: Download Extent from GPU data buffer to CPU. More... | |
bool | GetShaderSupportsTextureInt () |
void | SetShaderSupportsTextureInt (bool value) |
void | SetContext (vtkRenderWindow *context) |
Get/Set the context. More... | |
vtkRenderWindow * | GetContext () |
Get/Set the context. More... | |
virtual void | SetCPUExtent (int, int, int, int, int, int) |
Set the CPU data extent. More... | |
virtual void | SetCPUExtent (int[6]) |
Set the CPU data extent. More... | |
virtual int * | GetCPUExtent () |
Set the CPU data extent. More... | |
virtual void | GetCPUExtent (int &, int &, int &, int &, int &, int &) |
Set the CPU data extent. More... | |
virtual void | GetCPUExtent (int[6]) |
Set the CPU data extent. More... | |
virtual void | SetGPUExtent (int, int, int, int, int, int) |
Set the GPU data extent. More... | |
virtual void | SetGPUExtent (int[6]) |
Set the GPU data extent. More... | |
virtual int * | GetGPUExtent () |
Set the GPU data extent. More... | |
virtual void | GetGPUExtent (int &, int &, int &, int &, int &, int &) |
Set the GPU data extent. More... | |
virtual void | GetGPUExtent (int[6]) |
Set the GPU data extent. More... | |
virtual void | SetTextureExtent (int, int, int, int, int, int) |
Set the texture data extent. More... | |
virtual void | SetTextureExtent (int[6]) |
Set the texture data extent. More... | |
virtual int * | GetTextureExtent () |
Set the texture data extent. More... | |
virtual void | GetTextureExtent (int &, int &, int &, int &, int &, int &) |
Set the texture data extent. More... | |
virtual void | GetTextureExtent (int[6]) |
Set the texture data extent. More... | |
virtual void | SetMinTextureDimension (int) |
Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent. More... | |
virtual int | GetMinTextureDimension () |
Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent. More... | |
virtual vtkDataArray * | GetArray () |
Get/Set the CPU data buffer. More... | |
void | SetArray (vtkDataArray *array) |
Get/Set the CPU data buffer. More... | |
virtual vtkTextureObject * | GetTexture () |
Get/Set the GPU data buffer. More... | |
void | SetTexture (vtkTextureObject *texture) |
Get/Set the GPU data buffer. More... | |
bool | DownloadAsync1 () |
Splits the download in two operations. More... | |
bool | DownloadAsync2 () |
Splits the download in two operations. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. More... | |
virtual void | DebugOff () |
Turn debugging output off. More... | |
bool | GetDebug () |
Get the value of the debug flag. More... | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. More... | |
virtual void | Modified () |
Update the modification time for this object. More... | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. More... | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. More... | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. More... | |
virtual void | Delete () |
Delete a VTK object. More... | |
virtual void | FastDelete () |
Delete a reference to this object. More... | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. More... | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). More... | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). More... | |
int | GetReferenceCount () |
Return the current reference count of this object. More... | |
void | SetReferenceCount (int) |
Sets the reference count. More... | |
void | PrintRevisions (ostream &) |
Legacy. More... | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
Static Public Member Functions | |
static vtkDataTransferHelper * | New () |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkDataTransferHelper * | SafeDownCast (vtkObjectBase *o) |
static bool | IsSupported (vtkRenderWindow *renWin) |
Returns if the context supports the required extensions. More... | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. More... | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. More... | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkDataTransferHelper () | |
~vtkDataTransferHelper () override | |
vtkPixelBufferObject * | GetPBO () |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. More... | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. More... | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
int | CPUExtent [6] |
int | GPUExtent [6] |
int | TextureExtent [6] |
vtkWeakPointer< vtkRenderWindow > | Context |
vtkTextureObject * | Texture |
vtkDataArray * | Array |
bool | ShaderSupportsTextureInt |
int | MinTextureDimension |
vtkSmartPointer< vtkPixelBufferObject > | AsyncDownloadPBO |
vtkSmartPointer< vtkPixelBufferObject > | PBO |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
is a helper class that aids in transferring data between CPU memory and GPU memory.
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.
Definition at line 44 of file vtkDataTransferHelper.h.
Definition at line 48 of file vtkDataTransferHelper.h.
|
protected |
|
overrideprotected |
|
static |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class.
Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObjectBase.
|
static |
|
protectedvirtual |
vtkDataTransferHelper* vtkDataTransferHelper::NewInstance | ( | ) | const |
|
overridevirtual |
void vtkDataTransferHelper::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* vtkDataTransferHelper::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.
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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.
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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.
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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.
|
virtual |
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 vtkDataTransferHelper::GetExtentIsValid | ( | int * | extent | ) |
Tells if the given extent (6 int) is valid.
True if min extent<=max extent.
bool vtkDataTransferHelper::GetCPUExtentIsValid | ( | ) |
Tells if CPUExtent is valid.
True if min extent<=max extent.
bool vtkDataTransferHelper::GetGPUExtentIsValid | ( | ) |
Tells if GPUExtent is valid.
True if min extent<=max extent.
bool vtkDataTransferHelper::GetTextureExtentIsValid | ( | ) |
Tells if TextureExtent is valid.
True if min extent<=max extent.
|
virtual |
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 writing 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.
|
virtual |
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 writing 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.
|
virtual |
Get/Set the CPU data buffer.
Initial value is 0.
void vtkDataTransferHelper::SetArray | ( | vtkDataArray * | array | ) |
Get/Set the CPU data buffer.
Initial value is 0.
|
virtual |
Get/Set the GPU data buffer.
Initial value is 0.
void vtkDataTransferHelper::SetTexture | ( | vtkTextureObject * | texture | ) |
Get/Set the GPU data buffer.
Initial value is 0.
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 vtkDataTransferHelper::Download | ( | ) |
old comment: Download 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 vtkDataTransferHelper::DownloadAsync1 | ( | ) |
Splits the download in two operations.
bool vtkDataTransferHelper::DownloadAsync2 | ( | ) |
Splits the download in two operations.
bool vtkDataTransferHelper::GetShaderSupportsTextureInt | ( | ) |
void vtkDataTransferHelper::SetShaderSupportsTextureInt | ( | bool | value | ) |
|
static |
Returns if the context supports the required extensions.
|
protected |
|
protected |
Definition at line 228 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 229 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 230 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 232 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 233 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 234 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 235 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 236 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 238 of file vtkDataTransferHelper.h.
|
protected |
Definition at line 243 of file vtkDataTransferHelper.h.