VTK  9.1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkDataTransferHelper Class Reference

is a helper class that aids in transferring data between CPU memory and GPU memory. More...

#include <vtkDataTransferHelper.h>

Inheritance diagram for vtkDataTransferHelper:
[legend]
Collaboration diagram for vtkDataTransferHelper:
[legend]

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.
 
vtkDataTransferHelperNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
bool GetExtentIsValid (int *extent)
 Tells if the given extent (6 int) is valid.
 
bool GetCPUExtentIsValid ()
 Tells if CPUExtent is valid.
 
bool GetGPUExtentIsValid ()
 Tells if GPUExtent is valid.
 
bool GetTextureExtentIsValid ()
 Tells if TextureExtent is valid.
 
bool Upload (int components=0, int *componentList=nullptr)
 Old comment.
 
bool Download ()
 old comment: Download Extent from GPU data buffer to CPU.
 
bool GetShaderSupportsTextureInt ()
 
void SetShaderSupportsTextureInt (bool value)
 
void SetContext (vtkRenderWindow *context)
 Get/Set the context.
 
vtkRenderWindowGetContext ()
 Get/Set the context.
 
virtual void SetCPUExtent (int, int, int, int, int, int)
 Set the CPU data extent.
 
virtual void SetCPUExtent (int[6])
 Set the CPU data extent.
 
virtual int * GetCPUExtent ()
 Set the CPU data extent.
 
virtual void GetCPUExtent (int &, int &, int &, int &, int &, int &)
 Set the CPU data extent.
 
virtual void GetCPUExtent (int[6])
 Set the CPU data extent.
 
virtual void SetGPUExtent (int, int, int, int, int, int)
 Set the GPU data extent.
 
virtual void SetGPUExtent (int[6])
 Set the GPU data extent.
 
virtual int * GetGPUExtent ()
 Set the GPU data extent.
 
virtual void GetGPUExtent (int &, int &, int &, int &, int &, int &)
 Set the GPU data extent.
 
virtual void GetGPUExtent (int[6])
 Set the GPU data extent.
 
virtual void SetTextureExtent (int, int, int, int, int, int)
 Set the texture data extent.
 
virtual void SetTextureExtent (int[6])
 Set the texture data extent.
 
virtual int * GetTextureExtent ()
 Set the texture data extent.
 
virtual void GetTextureExtent (int &, int &, int &, int &, int &, int &)
 Set the texture data extent.
 
virtual void GetTextureExtent (int[6])
 Set the texture data extent.
 
virtual void SetMinTextureDimension (int)
 Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent.
 
virtual int GetMinTextureDimension ()
 Define the minimal dimension of the texture regardless of the dimensions of the TextureExtent.
 
virtual vtkDataArrayGetArray ()
 Get/Set the CPU data buffer.
 
void SetArray (vtkDataArray *array)
 Get/Set the CPU data buffer.
 
virtual vtkTextureObjectGetTexture ()
 Get/Set the GPU data buffer.
 
void SetTexture (vtkTextureObject *texture)
 Get/Set the GPU data buffer.
 
bool DownloadAsync1 ()
 Splits the download in two operations.
 
bool DownloadAsync2 ()
 Splits the download in two operations.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
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.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
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.
 
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.
 
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.
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 

Static Public Member Functions

static vtkDataTransferHelperNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkDataTransferHelperSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkRenderWindow *renWin)
 Returns if the context supports the required extensions.
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- 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.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkDataTransferHelper ()
 
 ~vtkDataTransferHelper () override
 
vtkPixelBufferObjectGetPBO ()
 
- 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.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int CPUExtent [6]
 
int GPUExtent [6]
 
int TextureExtent [6]
 
vtkWeakPointer< vtkRenderWindowContext
 
vtkTextureObjectTexture
 
vtkDataArrayArray
 
bool ShaderSupportsTextureInt
 
int MinTextureDimension
 
vtkSmartPointer< vtkPixelBufferObjectAsyncDownloadPBO
 
vtkSmartPointer< vtkPixelBufferObjectPBO
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

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.

See also
vtkPixelBufferObject vtkTextureObject vtkOpenGLExtensionManager

Definition at line 44 of file vtkDataTransferHelper.h.

Member Typedef Documentation

◆ Superclass

Definition at line 48 of file vtkDataTransferHelper.h.

Constructor & Destructor Documentation

◆ vtkDataTransferHelper()

vtkDataTransferHelper::vtkDataTransferHelper ( )
protected

◆ ~vtkDataTransferHelper()

vtkDataTransferHelper::~vtkDataTransferHelper ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkDataTransferHelper * vtkDataTransferHelper::New ( )
static

◆ IsTypeOf()

static vtkTypeBool vtkDataTransferHelper::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkDataTransferHelper::IsA ( const char *  name)
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.

◆ SafeDownCast()

static vtkDataTransferHelper * vtkDataTransferHelper::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkDataTransferHelper::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkDataTransferHelper * vtkDataTransferHelper::NewInstance ( ) const

◆ PrintSelf()

void vtkDataTransferHelper::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

◆ SetContext()

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 if the OpenGL context does not support the required OpenGL extensions.

◆ GetContext()

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 if the OpenGL context does not support the required OpenGL extensions.

◆ SetCPUExtent() [1/2]

virtual void vtkDataTransferHelper::SetCPUExtent ( int  ,
int  ,
int  ,
int  ,
int  ,
int   
)
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.

◆ SetCPUExtent() [2/2]

virtual void vtkDataTransferHelper::SetCPUExtent ( int  [6])
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.

◆ GetCPUExtent() [1/3]

virtual int * vtkDataTransferHelper::GetCPUExtent ( )
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.

◆ GetCPUExtent() [2/3]

virtual void vtkDataTransferHelper::GetCPUExtent ( int &  ,
int &  ,
int &  ,
int &  ,
int &  ,
int &   
)
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.

◆ GetCPUExtent() [3/3]

virtual void vtkDataTransferHelper::GetCPUExtent ( int  [6])
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.

◆ SetGPUExtent() [1/2]

virtual void vtkDataTransferHelper::SetGPUExtent ( int  ,
int  ,
int  ,
int  ,
int  ,
int   
)
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.

◆ SetGPUExtent() [2/2]

virtual void vtkDataTransferHelper::SetGPUExtent ( int  [6])
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.

◆ GetGPUExtent() [1/3]

virtual int * vtkDataTransferHelper::GetGPUExtent ( )
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.

◆ GetGPUExtent() [2/3]

virtual void vtkDataTransferHelper::GetGPUExtent ( int &  ,
int &  ,
int &  ,
int &  ,
int &  ,
int &   
)
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.

◆ GetGPUExtent() [3/3]

virtual void vtkDataTransferHelper::GetGPUExtent ( int  [6])
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.

◆ SetTextureExtent() [1/2]

virtual void vtkDataTransferHelper::SetTextureExtent ( int  ,
int  ,
int  ,
int  ,
int  ,
int   
)
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.

◆ SetTextureExtent() [2/2]

virtual void vtkDataTransferHelper::SetTextureExtent ( int  [6])
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.

◆ GetTextureExtent() [1/3]

virtual int * vtkDataTransferHelper::GetTextureExtent ( )
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.

◆ GetTextureExtent() [2/3]

virtual void vtkDataTransferHelper::GetTextureExtent ( int &  ,
int &  ,
int &  ,
int &  ,
int &  ,
int &   
)
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.

◆ GetTextureExtent() [3/3]

virtual void vtkDataTransferHelper::GetTextureExtent ( int  [6])
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.

◆ GetExtentIsValid()

bool vtkDataTransferHelper::GetExtentIsValid ( int *  extent)

Tells if the given extent (6 int) is valid.

True if min extent<=max extent.

Precondition
extent_exists: extent!=0

◆ GetCPUExtentIsValid()

bool vtkDataTransferHelper::GetCPUExtentIsValid ( )

Tells if CPUExtent is valid.

True if min extent<=max extent.

◆ GetGPUExtentIsValid()

bool vtkDataTransferHelper::GetGPUExtentIsValid ( )

Tells if GPUExtent is valid.

True if min extent<=max extent.

◆ GetTextureExtentIsValid()

bool vtkDataTransferHelper::GetTextureExtentIsValid ( )

Tells if TextureExtent is valid.

True if min extent<=max extent.

◆ SetMinTextureDimension()

virtual void vtkDataTransferHelper::SetMinTextureDimension ( int  )
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.

◆ GetMinTextureDimension()

virtual int vtkDataTransferHelper::GetMinTextureDimension ( )
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.

◆ GetArray()

virtual vtkDataArray * vtkDataTransferHelper::GetArray ( )
virtual

Get/Set the CPU data buffer.

Initial value is 0.

◆ SetArray()

void vtkDataTransferHelper::SetArray ( vtkDataArray array)

Get/Set the CPU data buffer.

Initial value is 0.

◆ GetTexture()

virtual vtkTextureObject * vtkDataTransferHelper::GetTexture ( )
virtual

Get/Set the GPU data buffer.

Initial value is 0.

◆ SetTexture()

void vtkDataTransferHelper::SetTexture ( vtkTextureObject texture)

Get/Set the GPU data buffer.

Initial value is 0.

◆ Upload()

bool vtkDataTransferHelper::Upload ( int  components = 0,
int *  componentList = nullptr 
)

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.

Precondition
array_exists: array!=0
array_not_empty: array->GetNumberOfTuples()>0
valid_cpu_extent: this->GetCPUExtentIsValid()
valid_cpu_extent_size: (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
valid_gpu_extent: this->GetGPUExtentIsValid()
gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
texture_can_exist_or_not: texture==0 || texture!=0
valid_components: (components==0 && componentList==0 && array->GetNumberOfComponents()<=4) || (components>=1 && components<=array->GetNumberOfComponents() && components<=4 && componentList!=0)

◆ Download()

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

Precondition
texture_exists: texture!=0
array_not_empty: array==0 || array->GetNumberOfTuples()>0
valid_cpu_extent: this->GetCPUExtentIsValid()
valid_cpu_extent_size: array==0 || (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
valid_gpu_extent: this->GetGPUExtentIsValid()
gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
valid_components: array==0 || array->GetNumberOfComponents()<=4
components_match: array==0 || (texture->GetComponents()==array->GetNumberOfComponents())

◆ DownloadAsync1()

bool vtkDataTransferHelper::DownloadAsync1 ( )

Splits the download in two operations.

◆ DownloadAsync2()

bool vtkDataTransferHelper::DownloadAsync2 ( )

Splits the download in two operations.

◆ GetShaderSupportsTextureInt()

bool vtkDataTransferHelper::GetShaderSupportsTextureInt ( )

◆ SetShaderSupportsTextureInt()

void vtkDataTransferHelper::SetShaderSupportsTextureInt ( bool  value)

◆ IsSupported()

static bool vtkDataTransferHelper::IsSupported ( vtkRenderWindow renWin)
static

Returns if the context supports the required extensions.

◆ GetPBO()

vtkPixelBufferObject * vtkDataTransferHelper::GetPBO ( )
protected

Member Data Documentation

◆ CPUExtent

int vtkDataTransferHelper::CPUExtent[6]
protected

Definition at line 235 of file vtkDataTransferHelper.h.

◆ GPUExtent

int vtkDataTransferHelper::GPUExtent[6]
protected

Definition at line 236 of file vtkDataTransferHelper.h.

◆ TextureExtent

int vtkDataTransferHelper::TextureExtent[6]
protected

Definition at line 237 of file vtkDataTransferHelper.h.

◆ Context

vtkWeakPointer<vtkRenderWindow> vtkDataTransferHelper::Context
protected

Definition at line 239 of file vtkDataTransferHelper.h.

◆ Texture

vtkTextureObject* vtkDataTransferHelper::Texture
protected

Definition at line 240 of file vtkDataTransferHelper.h.

◆ Array

vtkDataArray* vtkDataTransferHelper::Array
protected

Definition at line 241 of file vtkDataTransferHelper.h.

◆ ShaderSupportsTextureInt

bool vtkDataTransferHelper::ShaderSupportsTextureInt
protected

Definition at line 242 of file vtkDataTransferHelper.h.

◆ MinTextureDimension

int vtkDataTransferHelper::MinTextureDimension
protected

Definition at line 243 of file vtkDataTransferHelper.h.

◆ AsyncDownloadPBO

vtkSmartPointer<vtkPixelBufferObject> vtkDataTransferHelper::AsyncDownloadPBO
protected

Definition at line 245 of file vtkDataTransferHelper.h.

◆ PBO

vtkSmartPointer<vtkPixelBufferObject> vtkDataTransferHelper::PBO
protected

Definition at line 250 of file vtkDataTransferHelper.h.


The documentation for this class was generated from the following file: