3 #ifndef vtkOpenGLBufferObject_h
4 #define vtkOpenGLBufferObject_h
7 #include "vtkRenderingOpenGL2Module.h"
12 VTK_ABI_NAMESPACE_BEGIN
50 ObjectType GetType()
const;
53 void SetType(ObjectType
value);
56 ObjectUsage GetUsage()
const;
59 void SetUsage(ObjectUsage
value);
62 int GetHandle()
const;
65 bool IsReady()
const {
return this->Dirty ==
false; }
71 bool GenerateBuffer(ObjectType
type);
83 bool Upload(
const T& array, ObjectType
type);
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);
94 bool Allocate(
size_t size, ObjectType
type, ObjectUsage usage);
105 bool Download(T* array,
size_t numElements);
107 bool DownloadRange(T* array, ptrdiff_t
offset,
size_t numElements);
119 bool BindShaderStorage(
int index);
128 void ReleaseGraphicsResources();
141 bool UploadInternal(
const void* buffer,
size_t size,
ObjectType objectType);
142 bool UploadRangeInternal(
146 bool DownloadRangeInternal(
void* buffer, ptrdiff_t
offset,
size_t size);
160 this->
Error =
"Refusing to upload empty array.";
165 array.data(), array.size() *
sizeof(
typename T::value_type), objectType);
174 this->
Error =
"Refusing to upload empty array.";
177 return this->
UploadInternal(array, numElements *
sizeof(T), objectType);
186 this->
Error =
"Refusing to upload empty array.";
191 array.data(),
offset, array.size() *
sizeof(
typename T::value_type), objectType);
199 this->
Error =
"Refusing to upload empty array.";
208 return this->DownloadRangeInternal(array, 0, numElements *
sizeof(T));
214 return this->DownloadRangeInternal(array, offset, numElements *
sizeof(T));
217 VTK_ABI_NAMESPACE_END
bool DownloadRange(T *array, ptrdiff_t offset, size_t numElements)
bool UploadRangeInternal(const void *buffer, ptrdiff_t offset, ptrdiff_t size, ObjectType objectType)
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::string GetError() const
Return a string describing errors.
bool Download(T *array, size_t numElements)
Download data from the buffer object.
a simple class to control print indentation
abstract superclass for arrays of numeric data
void FlagBufferAsDirty()
Indicate that the buffer object needs to be re-uploaded.
object to represent cell connectivity
bool IsReady() const
Determine if the buffer object is ready to be used.
bool Upload(const T &array, ObjectType type)
Upload data to the buffer object.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
bool UploadRange(const T &array, ptrdiff_t offset, ObjectType type)
bool UploadInternal(const void *buffer, size_t size, ObjectType objectType)
represent and manipulate 3D points