HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GusdGT_VtArray< T > Class Template Reference

#include <GT_VtArray.h>

+ Inheritance diagram for GusdGT_VtArray< T >:

Public Types

using This = GusdGT_VtArray< T >
 
using ValueType = T
 
using ArrayType = VtArray< T >
 
using PODType = typename GusdPodTupleTraits< T >::ValueType
 

Public Member Functions

 SYS_STATIC_ASSERT (GusdIsPodTuple< T >())
 
 GusdGT_VtArray (const ArrayType &array, GT_Type type=GT_TYPE_NONE)
 
 GusdGT_VtArray (GT_Type type=GT_TYPE_NONE)
 
 ~GusdGT_VtArray () override=default
 
const char * className () const override
 
const Toperator() (GT_Offset o) const
 
PODType operator() (GT_Offset o, int idx) const
 
const ArrayTypeoperator* () const
 
const PODTypedata () const
 
const voidgetBackingData () const override
 
void swap (ArrayType &o)
 Swap our array contents with another array. More...
 
SYS_HashType hashRange (exint b, exint e) const override
 
bool isEqual (const GT_DataArray &src) const override
 Compare whether two data arrays are equal. More...
 
GT_DataArrayHandle harden () const override
 Create a "hardened" version of the array. More...
 
const PODTypegetData (GT_Offset o) const
 
template<typename PODT >
PODT getT (GT_Offset o, int idx=0) const
 
template<typename PODT >
const PODT * getArrayT (GT_DataArrayHandle &buf) const
 
template<typename PODT >
void importT (GT_Offset o, PODT *dst, int tsize=-1) const
 Extract a tuple into dst. More...
 
template<typename PODT >
void fillArrayT (PODT *dst, GT_Offset start, GT_Size length, int tsize=-1, int stride=-1) const
 Extract data for entire array into dst. More...
 
template<typename PODT >
void extendedFillT (PODT *dst, GT_Offset start, GT_Size length, int tsize=-1, int nrepeats=1, int stride=-1) const
 Extended form of array extraction that supports repeated elems. More...
 
GT_Storage getStorage () const override
 Type of data stored in the array. More...
 
GT_Size getTupleSize () const override
 Number of elements for each array element. More...
 
GT_Size entries () const override
 Number of entries in the array. More...
 
GT_Type getTypeInfo () const override
 Return "type" information for the data. This defaults to GT_TYPE_NONE. More...
 
int64 getMemoryUsage () const override
 
 _DECL_GETTERS (I8, int8)
 
 _DECL_GETTERS (I16, int16)
 
 _DECL_GETTERS (U8, uint8)
 
 _DECL_GETTERS (I32, int32)
 
 _DECL_GETTERS (I64, int64)
 
 _DECL_GETTERS (F16, fpreal16)
 
 _DECL_GETTERS (F32, fpreal32)
 
 _DECL_GETTERS (F64, fpreal64)
 
- Public Member Functions inherited from GT_DataArray
 GT_DataArray ()
 
 GT_DataArray (const GT_DataArray &src)
 
virtual ~GT_DataArray ()
 
virtual GT_Size itemSize (GT_Offset) const
 Return the number of elements in the array for the given item. More...
 
virtual GT_Size getTotalArrayEntries () const
 
virtual bool hasArrayEntries () const
 Returns "true" if each entry is an array. More...
 
virtual bool getPointerAliasing (const void *data) const
 Return "true" if there's pointer aliasing. More...
 
virtual bool isValid () const
 Data array is valid; can be sampled from. More...
 
virtual int64 getDataId () const
 
template<typename T >
const TgetArray (GT_DataArrayHandle &buffer) const
 Template-friendly version of getU8Array() and related methods. More...
 
virtual void getStrings (UT_StringArray &strings) const
 
void fillStrings (UT_StringArray &result, int tuple_idx=0) const
 
virtual void fillStringArray (UT_StringArray &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void getDictionaries (UT_Array< UT_OptionsHolder > &dicts) const
 
virtual void fillDictionaryArray (UT_Array< UT_OptionsHolder > &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void extendedFillArray (uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1, fpreal black=0, fpreal white=1) const
 
bool getMinMax (fpreal64 *min, fpreal64 *max) const
 Enlarge a bounding box with values of this 3-tuple array. More...
 
bool enlargeBounds (UT_BoundingBox &b) const
 
GT_Storage checkIndexing (GT_IndexingMode mode) const
 Test to see whether the data array requires int32 or int64 indexing. More...
 
void dumpValues (const char *msg=NULL) const
 For debugging, print values to stdout. More...
 
bool save (UT_JSONWriter &w, bool flat=true) const
 
void copyDataId (const GT_DataArray &src)
 
void setDataId (int64 id)
 
virtual void updateGeoDetail (const GU_ConstDetailHandle &dtl, const char *attrib_name, GT_Owner attrib_owner, const int expected_size)
 Update cached data, in case the underlying attribute changed. More...
 
template<typename T >
T getValue (GT_Offset index) const
 Public accessor for POD types. More...
 
template<typename T >
T lerpValue (GT_Offset i0, GT_Offset i1, fpreal t) const
 
template<typename T >
T bilerpValue (GT_Offset u0v0, GT_Offset u1v0, GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
 
virtual uint8 getU8 (GT_Offset offset, int idx=0) const =0
 
virtual int8 getI8 (GT_Offset offset, int idx=0) const
 
virtual int16 getI16 (GT_Offset offset, int idx=0) const
 
virtual int32 getI32 (GT_Offset offset, int idx=0) const =0
 
virtual int64 getI64 (GT_Offset offset, int idx=0) const
 
virtual fpreal16 getF16 (GT_Offset offset, int idx=0) const
 
virtual fpreal32 getF32 (GT_Offset offset, int idx=0) const =0
 
virtual fpreal64 getF64 (GT_Offset offset, int idx=0) const
 
virtual bool getSA (UT_StringArray &a, GT_Offset offset) const
 
virtual GT_Dict getDict (GT_Offset offset, int idx=0) const
 
virtual bool getDictA (UT_Array< UT_OptionsHolder > &a, GT_Offset offset) const
 
virtual bool getFA16 (UT_ValArray< fpreal16 > &a, GT_Offset offset) const
 
virtual bool getFA32 (UT_ValArray< fpreal32 > &a, GT_Offset offset) const
 
virtual bool getFA64 (UT_ValArray< fpreal64 > &a, GT_Offset offset) const
 
virtual bool getUA8 (UT_ValArray< uint8 > &a, GT_Offset offset) const
 
virtual bool getIA8 (UT_ValArray< int8 > &a, GT_Offset offset) const
 
virtual bool getIA16 (UT_ValArray< int16 > &a, GT_Offset offset) const
 
virtual bool getIA32 (UT_ValArray< int32 > &a, GT_Offset offset) const
 
virtual bool getIA64 (UT_ValArray< int64 > &a, GT_Offset offset) const
 
virtual const uint8getU8Array (GT_DataArrayHandle &buffer) const
 
virtual const int8getI8Array (GT_DataArrayHandle &buffer) const
 
virtual const int16getI16Array (GT_DataArrayHandle &buffer) const
 
virtual const int32getI32Array (GT_DataArrayHandle &buffer) const
 
virtual const int64getI64Array (GT_DataArrayHandle &buffer) const
 
virtual const fpreal16getF16Array (GT_DataArrayHandle &buffer) const
 
virtual const fpreal32getF32Array (GT_DataArrayHandle &buffer) const
 
virtual const fpreal64getF64Array (GT_DataArrayHandle &buffer) const
 
const fprealgetRealArray (GT_DataArrayHandle &buffer) const
 
void import (GT_Offset idx, int8 *data, GT_Size size=0) const
 
void import (GT_Offset idx, int16 *data, GT_Size size=0) const
 
void import (GT_Offset idx, int32 *data, GT_Size size=0) const
 
void import (GT_Offset idx, int64 *data, GT_Size size=0) const
 
void import (GT_Offset idx, fpreal16 *data, GT_Size size=0) const
 
void import (GT_Offset idx, fpreal32 *data, GT_Size size=0) const
 
void import (GT_Offset idx, fpreal64 *data, GT_Size size=0) const
 
void import (GT_Offset idx, UT_ValArray< fpreal16 > &data) const
 
void import (GT_Offset idx, UT_ValArray< fpreal32 > &data) const
 
void import (GT_Offset idx, UT_ValArray< fpreal64 > &data) const
 
void import (GT_Offset idx, UT_ValArray< uint8 > &data) const
 
void import (GT_Offset idx, UT_ValArray< int8 > &data) const
 
void import (GT_Offset idx, UT_ValArray< int16 > &data) const
 
void import (GT_Offset idx, UT_ValArray< int32 > &data) const
 
void import (GT_Offset idx, UT_ValArray< int64 > &data) const
 
void import (GT_Offset idx, UT_StringArray &data) const
 
void import (GT_Offset idx, UT_Array< UT_OptionsHolder > &data) const
 
void import (GT_Offset idx, uint8 *data, GT_Size size=0, fpreal black=0, fpreal white=1) const
 
void fillArray (int8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (int16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (int32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (int64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
 
void fillArray (uint8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1, fpreal black=0, fpreal white=1) const
 
void fillVec3BBox (fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int tsize, int stride=-1)
 
void fillVec3BBox (fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int tsize, int stride=-1)
 
void fillArray (UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
void fillArray (UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void extendedFill (uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (int8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (int16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (int32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (int64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual void extendedFill (fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
 
virtual const uint8get (GT_Offset i, uint8 *store, int sz) const
 
virtual const int8get (GT_Offset i, int8 *store, int sz) const
 
virtual const int16get (GT_Offset i, int16 *store, int sz) const
 
virtual const int32get (GT_Offset i, int32 *store, int sz) const
 
virtual const int64get (GT_Offset i, int64 *store, int sz) const
 
virtual const fpreal16get (GT_Offset i, fpreal16 *store, int z) const
 
virtual const fpreal32get (GT_Offset i, fpreal32 *store, int z) const
 
virtual const fpreal64get (GT_Offset i, fpreal64 *store, int z) const
 
virtual void getRange (exint &lo, exint &hi, int tuple_idx=0) const
 
virtual void getRange (fpreal &lo, fpreal &hi, int tidx=0) const
 
SYS_HashType hash () const
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< GT_DataArray >
SYS_FORCE_INLINE UT_IntrusiveRefCounter () noexcept
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &) noexcept
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const noexcept
 Return current counter. More...
 
SYS_FORCE_INLINE bool conditionalAddRef () noexcept
 

Static Public Attributes

static const int tupleSize = GusdGetTupleSize<T>()
 
static const GT_Storage storage
 

Protected Member Functions

void _UpdateDataPointer (bool makeUnique)
 
- Protected Member Functions inherited from GT_DataArray
virtual bool computeMinMax (fpreal64 *min, fpreal64 *max) const
 
SYS_STATIC_FORCE_INLINE GT_Size fixImportTupleSize (GT_Size size, GT_Size tuple_size)
 
template<typename T_POD >
void t_extendedFill (T_POD *dest, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride) const
 Templated method to fill an array. More...
 
template<typename T_POD >
void t_extendedFillArray (UT_Array< T_POD > &dest, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 Templated method to fill an array attribute. More...
 
virtual void doImport (GT_Offset idx, uint8 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, int8 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, int16 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, int32 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, int64 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, fpreal16 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, fpreal32 *data, GT_Size size) const
 
virtual void doImport (GT_Offset idx, fpreal64 *data, GT_Size size) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< fpreal16 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< fpreal32 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< fpreal64 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< uint8 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< int8 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< int16 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< int32 > &data) const
 
virtual void doImportArray (GT_Offset idx, UT_ValArray< int64 > &data) const
 
virtual void doImportQuantized (GT_Offset idx, uint8 *data, GT_Size size, fpreal black, fpreal white) const
 
virtual void doFillArray (uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (int8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (int16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (int32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (int64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (fpreal16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (fpreal32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArray (fpreal64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
 
virtual void doFillArrayAttr (UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillArrayAttr (UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
 
virtual void doFillQuantizedArray (uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride, fpreal black, fpreal white) const
 
virtual void doExtendedQuantizedFill (uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int nrepeats, int stride, fpreal black, fpreal white) const
 
virtual void doFillVec3BBox (fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int, int stride)
 
virtual void doFillVec3BBox (fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int, int stride)
 
- Protected Member Functions inherited from UT_IntrusiveRefCounter< GT_DataArray >
SYS_FORCE_INLINE ~UT_IntrusiveRefCounter ()
 Destructor: Only derived classes can destruct this. More...
 

Protected Attributes

ArrayType _array
 
const GT_Type _type
 
GT_Size _size
 
const PODType_data
 

Additional Inherited Members

- Static Public Member Functions inherited from GT_DataArray
static bool isBigInteger (GT_Size size)
 Quick & dirty test to see if a size is bigger than a 32 bit int. More...
 
static voidoperator new (size_t size)
 
static voidoperator new (size_t size, void *p)
 
static void operator delete (void *p, size_t size)
 

Detailed Description

template<class T>
class GusdGT_VtArray< T >

GT_DataArray implementation that wraps a VtArray.

This allows, in some cases, for arrays read in from USD to be pushed into GT prims without having to incur copying. Example:

VtArray<int> valsFromUSD;

These arrays are designed to be read-only. If you need to make edits, use the following pattern:

// swap data into tmp array, modify.
srcData.swap(tmp);
tmp[10] = 37;
// swap data back into place.
srcData.swap(tmp);

Note that this kind of swapping trick does not require the full array to be copied; only the internal references are swapped.

Definition at line 67 of file GT_VtArray.h.

Member Typedef Documentation

template<class T>
using GusdGT_VtArray< T >::ArrayType = VtArray<T>

Definition at line 74 of file GT_VtArray.h.

template<class T>
using GusdGT_VtArray< T >::PODType = typename GusdPodTupleTraits<T>::ValueType

Definition at line 75 of file GT_VtArray.h.

template<class T>
using GusdGT_VtArray< T >::This = GusdGT_VtArray<T>

Definition at line 72 of file GT_VtArray.h.

template<class T>
using GusdGT_VtArray< T >::ValueType = T

Definition at line 73 of file GT_VtArray.h.

Constructor & Destructor Documentation

template<class T >
GusdGT_VtArray< T >::GusdGT_VtArray ( const ArrayType array,
GT_Type  type = GT_TYPE_NONE 
)

Definition at line 241 of file GT_VtArray.h.

template<class T >
GusdGT_VtArray< T >::GusdGT_VtArray ( GT_Type  type = GT_TYPE_NONE)

Definition at line 249 of file GT_VtArray.h.

template<class T>
GusdGT_VtArray< T >::~GusdGT_VtArray ( )
overridedefault

Member Function Documentation

template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( I8  ,
int8   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( I16  ,
int16   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( U8  ,
uint8   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( I32  ,
int32   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( I64  ,
int64   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( F16  ,
fpreal16   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( F32  ,
fpreal32   
)
template<class T>
GusdGT_VtArray< T >::_DECL_GETTERS ( F64  ,
fpreal64   
)
template<class T >
void GusdGT_VtArray< T >::_UpdateDataPointer ( bool  makeUnique)
protected

Update our _data member to point at the array data. This must be called after any operation that changes the contents of _array.

Definition at line 256 of file GT_VtArray.h.

template<class T>
const char* GusdGT_VtArray< T >::className ( ) const
inlineoverridevirtual

Implements GT_DataArray.

Definition at line 86 of file GT_VtArray.h.

template<class T>
const PODType* GusdGT_VtArray< T >::data ( ) const
inline

Definition at line 99 of file GT_VtArray.h.

template<class T>
GT_Size GusdGT_VtArray< T >::entries ( ) const
inlineoverridevirtual

Number of entries in the array.

Implements GT_DataArray.

Definition at line 165 of file GT_VtArray.h.

template<class T >
template<typename PODT >
void GusdGT_VtArray< T >::extendedFillT ( PODT *  dst,
GT_Offset  start,
GT_Size  length,
int  tsize = -1,
int  nrepeats = 1,
int  stride = -1 
) const

Extended form of array extraction that supports repeated elems.

Definition at line 359 of file GT_VtArray.h.

template<class T >
template<typename PODT >
void GusdGT_VtArray< T >::fillArrayT ( PODT *  dst,
GT_Offset  start,
GT_Size  length,
int  tsize = -1,
int  stride = -1 
) const

Extract data for entire array into dst.

Definition at line 331 of file GT_VtArray.h.

template<class T >
template<typename PODT >
const PODT * GusdGT_VtArray< T >::getArrayT ( GT_DataArrayHandle buf) const

Get access to a raw array of data. If OTHERPODT is not the same as the array's underlying type, the raw array will be stored in the given buf.

Definition at line 299 of file GT_VtArray.h.

template<class T>
const void* GusdGT_VtArray< T >::getBackingData ( ) const
inlineoverridevirtual

If the array has backing storage, this method can be used to access the storage. The backing storage must be a flat array of interleaved values of the given pod type. For example, if the array has 35 entries of fpreal32 color (RGB) data, the pointer returned should be mapped to an array that's (35*3) fpreal32 values with the first three values representing the RGB values for the first item in the array.

Reimplemented from GT_DataArray.

Definition at line 100 of file GT_VtArray.h.

template<class T>
const PODType* GusdGT_VtArray< T >::getData ( GT_Offset  o) const
inline

Definition at line 131 of file GT_VtArray.h.

template<class T>
int64 GusdGT_VtArray< T >::getMemoryUsage ( ) const
inlineoverridevirtual

Get an approximation of the memory usage. Since data is shared, this may be an over-estimation of the memory used.

Implements GT_DataArray.

Definition at line 167 of file GT_VtArray.h.

template<class T>
GT_Storage GusdGT_VtArray< T >::getStorage ( ) const
inlineoverridevirtual

Type of data stored in the array.

Implements GT_DataArray.

Definition at line 163 of file GT_VtArray.h.

template<class T >
template<typename PODT >
PODT GusdGT_VtArray< T >::getT ( GT_Offset  o,
int  idx = 0 
) const

Access to individual elements as given POD type. For performance, this is preferred to the virtual getXX() methods.

Definition at line 288 of file GT_VtArray.h.

template<class T>
GT_Size GusdGT_VtArray< T >::getTupleSize ( ) const
inlineoverridevirtual

Number of elements for each array element.

Implements GT_DataArray.

Definition at line 164 of file GT_VtArray.h.

template<class T>
GT_Type GusdGT_VtArray< T >::getTypeInfo ( ) const
inlineoverridevirtual

Return "type" information for the data. This defaults to GT_TYPE_NONE.

Reimplemented from GT_DataArray.

Definition at line 166 of file GT_VtArray.h.

template<class T >
GT_DataArrayHandle GusdGT_VtArray< T >::harden ( ) const
overridevirtual

Create a "hardened" version of the array.

Reimplemented from GT_DataArray.

Definition at line 277 of file GT_VtArray.h.

template<class T>
SYS_HashType GusdGT_VtArray< T >::hashRange ( exint  begin,
exint  end 
) const
inlineoverridevirtual

Compute a hash of the data in the array. The base class hash is computed

for (i = begin; i < end; ++i) {
import(i, tmp, getTupleSize());
for (t = 0; t < getTupleSize(); t++)
SYShashCombine(hash, hashNumeric(tmp[t]));
}

Where hashNumeric returns the value for integer types. Real data is cast to the corresponding unsigned integer values. For example, fpreal16

void hashNumeric(SYS_HashType &hash, fpreal16 v) {
SYShashCombine(hash, *(const uint16 *)(&v));
}
void hashNumeric(SYS_HashType &hash, fpreal32 v) {
SYShashCombine(hash, *(const uint32 *)(&v));
}

Reimplemented from GT_DataArray.

Definition at line 105 of file GT_VtArray.h.

template<class T >
template<typename PODT >
void GusdGT_VtArray< T >::importT ( GT_Offset  o,
PODT *  dst,
int  tsize = -1 
) const

Extract a tuple into dst.

Definition at line 316 of file GT_VtArray.h.

template<class T>
bool GusdGT_VtArray< T >::isEqual ( const GT_DataArray src) const
inlineoverridevirtual

Compare whether two data arrays are equal.

Reimplemented from GT_DataArray.

Definition at line 109 of file GT_VtArray.h.

template<class T>
const T& GusdGT_VtArray< T >::operator() ( GT_Offset  o) const
inline

Definition at line 88 of file GT_VtArray.h.

template<class T>
PODType GusdGT_VtArray< T >::operator() ( GT_Offset  o,
int  idx 
) const
inline

Definition at line 94 of file GT_VtArray.h.

template<class T>
const ArrayType& GusdGT_VtArray< T >::operator* ( ) const
inline

Definition at line 97 of file GT_VtArray.h.

template<class T >
void GusdGT_VtArray< T >::swap ( ArrayType o)

Swap our array contents with another array.

Definition at line 267 of file GT_VtArray.h.

template<class T>
GusdGT_VtArray< T >::SYS_STATIC_ASSERT ( GusdIsPodTuple< T ())

Member Data Documentation

template<class T>
ArrayType GusdGT_VtArray< T >::_array
protected

Definition at line 232 of file GT_VtArray.h.

template<class T>
const PODType* GusdGT_VtArray< T >::_data
protected

Definition at line 235 of file GT_VtArray.h.

template<class T>
GT_Size GusdGT_VtArray< T >::_size
protected

Definition at line 234 of file GT_VtArray.h.

template<class T>
const GT_Type GusdGT_VtArray< T >::_type
protected

Definition at line 233 of file GT_VtArray.h.

template<class T>
const GT_Storage GusdGT_VtArray< T >::storage
static
Initial value:

Definition at line 78 of file GT_VtArray.h.

template<class T>
const int GusdGT_VtArray< T >::tupleSize = GusdGetTupleSize<T>()
static

Definition at line 77 of file GT_VtArray.h.


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