24 #ifndef PXR_IMAGING_HD_BUFFER_ARRAY_RANGE_H
25 #define PXR_IMAGING_HD_BUFFER_ARRAY_RANGE_H
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
31 #include "pxr/base/vt/value.h"
32 #include "pxr/imaging/hd/bufferArray.h"
36 PXR_NAMESPACE_OPEN_SCOPE
39 using HdBufferSpecVector = std::vector<struct HdBufferSpec>;
40 using HdBufferArrayRangeSharedPtr = std::shared_ptr<class HdBufferArrayRange>;
41 using HdBufferSourceSharedPtr = std::shared_ptr<class HdBufferSource>;
67 virtual bool IsValid()
const = 0;
77 virtual bool Resize(
int numElements) = 0;
80 virtual void CopyData(HdBufferSourceSharedPtr
const &bufferSource) = 0;
113 virtual void DebugDump(std::ostream &out)
const = 0;
121 virtual void GetBufferSpecs(HdBufferSpecVector *bufferSpecs)
const = 0;
128 HdBufferArrayRange(
const HdBufferArrayRange &) =
delete;
129 HdBufferArrayRange &operator=(
const HdBufferArrayRange &) =
delete;
150 void Set(
int index, HdBufferArrayRangeSharedPtr
const &range);
155 HdBufferArrayRangeSharedPtr
const &
Get(
int index)
const;
163 std::vector<HdBufferArrayRangeSharedPtr> _ranges;
167 PXR_NAMESPACE_CLOSE_SCOPE
169 #endif // PXR_IMAGING_HD_BUFFER_ARRAY_RANGE_H
virtual bool IsValid() const =0
Returns true if this range is valid.
The union provides a set of flags that provide hints to the memory management system about the proper...
Similar to a VAO, this object is a bundle of coherent buffers.
virtual VtValue ReadData(TfToken const &name) const =0
Read back the buffer content.
bool IsAggregatedWith(HdBufferArrayRangeSharedPtr const &other) const
Returns true if the underlying buffer array is aggregated to other's.
virtual int GetByteOffset(TfToken const &resourceName) const =0
Returns the byte offset at which this range begins in the underlying buffer array for the given resou...
virtual bool IsImmutable() const =0
Returns true if this range is marked as immutable.
virtual size_t GetVersion() const =0
Returns the version of the buffer array.
Interface class for representing range (subset) locator of HdBufferArray.
virtual size_t GetMaxNumElements() const =0
Returns the max number of elements.
A resizable container of HdBufferArrayRanges.
virtual int GetElementOffset() const =0
Returns the offset at which this range begins in the underlying buffer array in terms of elements...
virtual bool IsAssigned() const =0
Returns true is the range has been assigned to a buffer.
HD_API void Set(int index, HdBufferArrayRangeSharedPtr const &range)
Set range into the container at index.
Token for efficient comparison, assignment, and hashing of known strings.
HdBufferArrayRangeContainer(int size)
Constructor.
virtual void CopyData(HdBufferSourceSharedPtr const &bufferSource)=0
Copy source data into buffer.
virtual void DebugDump(std::ostream &out) const =0
Debug output.
virtual void GetBufferSpecs(HdBufferSpecVector *bufferSpecs) const =0
Gets the bufferSpecs for all resources.
virtual bool Resize(int numElements)=0
Resize memory area for this range.
virtual const void * _GetAggregation() const =0
Returns the aggregation container to be used in IsAggregatedWith()
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
virtual HD_API ~HdBufferArrayRange()
Destructor (do nothing).
virtual HdBufferArrayUsageHint GetUsageHint() const =0
Gets the usage hint on the underlying buffer array.
virtual void IncrementVersion()=0
Increment the version of the buffer array.
HD_API HdBufferArrayRangeSharedPtr const & Get(int index) const
Returns the bar at index.
virtual size_t GetNumElements() const =0
Returns the number of elements.
virtual void SetBufferArray(HdBufferArray *bufferArray)=0
Sets the buffer array associated with this buffer;.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
HD_API void Resize(int size)
Resize the buffer array range container to size size.