3#ifndef vtkOpenGLBufferObject_h
4#define vtkOpenGLBufferObject_h
7#include "vtkRenderingOpenGL2Module.h"
12VTK_ABI_NAMESPACE_BEGIN
65 bool IsReady()
const {
return this->Dirty ==
false; }
85 bool UploadRange(
const T& array, ptrdiff_t offset,
ObjectType type);
88 bool Upload(
const T* array,
size_t numElements,
ObjectType type);
90 bool UploadRange(
const T* array, ptrdiff_t offset,
size_t numElements,
ObjectType type);
105 bool Download(T* array,
size_t numElements);
107 bool DownloadRange(T* array, ptrdiff_t offset,
size_t numElements);
143 const void* buffer, ptrdiff_t offset, ptrdiff_t size,
ObjectType objectType);
146 bool DownloadRangeInternal(
void* buffer, ptrdiff_t offset,
size_t size);
160 this->
Error =
"Refusing to upload empty array.";
164 return this->
UploadInternal(&array[0], array.size() *
sizeof(
typename T::value_type), objectType);
173 this->
Error =
"Refusing to upload empty array.";
176 return this->
UploadInternal(array, numElements *
sizeof(T), objectType);
185 this->
Error =
"Refusing to upload empty array.";
190 &array[0], offset, array.size() *
sizeof(
typename T::value_type), objectType);
198 this->
Error =
"Refusing to upload empty array.";
207 return this->DownloadRangeInternal(array, 0, numElements *
sizeof(T));
213 return this->DownloadRangeInternal(array, offset, numElements *
sizeof(T));
object to represent cell connectivity
abstract superclass for arrays of numeric data
a simple class to control print indentation
abstract base class for most VTK objects
void SetType(ObjectType value)
Set the type of the buffer object.
void ReleaseGraphicsResources()
bool IsReady() const
Determine if the buffer object is ready to be used.
bool Release()
Release the buffer.
ObjectType GetType() const
Get the type of the buffer object.
bool BindShaderStorage(int index)
Bind the buffer to a shader storage point.
~vtkOpenGLBufferObject() override
ObjectUsage GetUsage() const
Get the usage of the buffer object.
bool DownloadRange(T *array, ptrdiff_t offset, size_t numElements)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Bind()
Bind the buffer object ready for rendering.
bool UploadInternal(const void *buffer, size_t size, ObjectType objectType)
bool Upload(const T &array, ObjectType type)
Upload data to the buffer object.
bool GenerateBuffer(ObjectType type)
Generate the opengl buffer for this Handle.
bool Allocate(size_t size, ObjectType type, ObjectUsage usage)
Allocates a buffer of type with size bytes.
int GetHandle() const
Get the handle of the buffer object.
static vtkOpenGLBufferObject * New()
bool UploadRange(const T &array, ptrdiff_t offset, ObjectType type)
bool Download(T *array, size_t numElements)
Download data from the buffer object.
std::string GetError() const
Return a string describing errors.
size_t GetSize()
Get size of the buffer in bytes.
void FlagBufferAsDirty()
Indicate that the buffer object needs to be re-uploaded.
void SetUsage(ObjectUsage value)
Set the usage of the buffer object.
bool UploadRangeInternal(const void *buffer, ptrdiff_t offset, ptrdiff_t size, ObjectType objectType)
represent and manipulate 3D points