HDK
|
A tuple of scalar arrays. More...
#include <GA_DataArrayTuple.h>
Public Types | |
enum | ga_Packing { PACK_NONE, PACK_VECTOR3 } |
Static Public Member Functions | |
static bool | jsonSave (UT_JSONWriter &w, const GA_Range &it, const GA_SaveOptions *options, const GA_DataArray *const *data, int data_tuple_size, GA_Storage data_storage, ga_Packing data_packing) |
static bool | jsonLoad (UT_JSONParser &w, const GA_LoadMap &map, GA_AttributeOwner owner, GA_DataArray *const *data, int data_tuple_size, GA_Storage data_storage, ga_Packing data_packing) |
static bool | jsonSave (UT_JSONWriter &w, const GA_Range &range, const GA_SaveOptions *options, const UT_IntArray *map, int defvalue, const GA_DataArray *const *data, int data_tuple_size, GA_Storage data_storage, ga_Packing data_packing) |
Protected Member Functions | |
GA_DataArray * | buildDataArray (int idx, GA_Offset length, const GA_Defaults &defs) |
bool | isSharedArray (int idx) const |
A tuple of scalar arrays.
This class maintains a tuple of arrays. For example storing a position is kept as three distinct arrays (one for x, y and z). The storage for all arrays is uniform.
See also: JSON Schema: GA_DataArrayTuple
Definition at line 49 of file GA_DataArrayTuple.h.
Regardless of packing, we always have one GA_DataArray for each of our tuple_size components. Packing causes the first set of these data arrays to share data tables and store their actual data in an interleaved format. If tuplesize is larger than the packing size, the extra components are normal arrays, so P + Pw works as expected with a PACK_VECTOR3
Enumerator | |
---|---|
PACK_NONE | |
PACK_VECTOR3 |
Definition at line 58 of file GA_DataArrayTuple.h.
GA_DataArrayTuple::GA_DataArrayTuple | ( | GA_Storage | storage | ) |
GA_DataArrayTuple::GA_DataArrayTuple | ( | const GA_DataArrayTuple & | src | ) |
GA_DataArrayTuple::~GA_DataArrayTuple | ( | ) |
|
protected |
void GA_DataArrayTuple::comparePages | ( | UT_BitArray & | pages, |
const GA_DataArrayTuple & | other | ||
) | const |
void GA_DataArrayTuple::countMemory | ( | UT_MemoryCounter & | counter, |
bool | inclusive | ||
) | const |
Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)
void GA_DataArrayTuple::defragment | ( | const GA_Defragment & | defrag | ) |
Interface for defragmentation
GA_Offset GA_DataArrayTuple::getArraySize | ( | ) | const |
This method queries the (common) size of the arrays.
|
inline |
Definition at line 120 of file GA_DataArrayTuple.h.
|
inline |
Definition at line 126 of file GA_DataArrayTuple.h.
|
inline |
Access to data as arrays of tuples
Definition at line 140 of file GA_DataArrayTuple.h.
|
inline |
Access to data as arrays of tuples
Definition at line 141 of file GA_DataArrayTuple.h.
int64 GA_DataArrayTuple::getMemoryUsage | ( | bool | inclusive | ) | const |
Report memory usage.
|
inline |
Definition at line 119 of file GA_DataArrayTuple.h.
|
inline |
Definition at line 117 of file GA_DataArrayTuple.h.
|
inline |
Definition at line 118 of file GA_DataArrayTuple.h.
void GA_DataArrayTuple::hardenAllPages | ( | GA_Offset | start_offset = GA_Offset(0) , |
GA_Offset | end_offset = GA_INVALID_OFFSET |
||
) |
Harden data pages Will harden all pages overlapping the specified offset range.
|
protected |
bool GA_DataArrayTuple::jsonLoad | ( | UT_JSONParser & | w, |
const GA_LoadMap & | map, | ||
GA_AttributeOwner | owner | ||
) |
Load from a JSON stream.
|
static |
bool GA_DataArrayTuple::jsonSave | ( | UT_JSONWriter & | w, |
const GA_Range & | it, | ||
const GA_SaveOptions * | options | ||
) | const |
Save data to JSON schema.
The data values are stored as an array of structs. That is, if the DataArrayTuple is a 2-vector (tuple size 2) containing 4 elements, the value array will be an array of 4 2-vectors (i.e. [ [0,0], [1,1], [2,2], [3,3] ]). For single valued (tuple size == 1), a single array of values is saved out. The keyword for this is "arrays" vs. "tuples".
|
static |
bool GA_DataArrayTuple::jsonSave | ( | UT_JSONWriter & | w, |
const GA_Range & | range, | ||
const GA_SaveOptions * | options, | ||
const UT_IntArray * | map, | ||
int | defvalue = -1 |
||
) | const |
Save with an integer translation. This method is just like the standard jsonSave() method. However each value is used as an index into the integer array. The value stored in the array is written instead of the raw value.
|
static |
void GA_DataArrayTuple::mergeGrowArrayAndCopy | ( | const GA_MergeMap & | map, |
GA_AttributeOwner | owner, | ||
const GA_DataArrayTuple & | src | ||
) |
GA_DataArrayTuple& GA_DataArrayTuple::operator= | ( | const GA_DataArrayTuple & | src | ) |
void GA_DataArrayTuple::setStorage | ( | GA_Storage | storage, |
const GA_Range & | copy_iterator, | ||
const GA_Defaults & | defs, | ||
bool | allow_packing = false |
||
) |
Changing the storage requires a copy iterator which accesses each and every element of the array and the defaults The allow_packing
parameter should be set if the attribute allows it.
void GA_DataArrayTuple::setTupleSize | ( | int | tuple_size, |
GA_Offset | array_size, | ||
const GA_Defaults & | defs, | ||
ga_Packing | packing = PACK_NONE |
||
) |
Setting the tuple size requires the array_size and the defaults.
void GA_DataArrayTuple::tryCompressAllPages | ( | GA_Offset | start_offset = GA_Offset(0) , |
GA_Offset | end_offset = GA_INVALID_OFFSET |
||
) |
Try to compress data pages Will compress all pages overlapping the specified offset range.