HDK
|
An array of numbers with various storage types. More...
#include <GA_DataArray.h>
Classes | |
class | directAttributeAdapter |
class | ga_SubPageBlock |
Static Public Member Functions | |
static void | setTuple (GA_DataArray *const *dest, const GA_Range &di, const GA_DataArray *const *src, int tuple_size) |
Set the value for a tuple of data array from a source tuple. More... | |
static void | setTuple (GA_DataArray *const *dest, const GA_Range &di, const GA_DataArray *const *src, const GA_Range &si, int tuple_size) |
static void | setTuple (GA_DataArray *const *dest, const GA_DataArray *const *src, const GA_Range &si, const GA_MergeOffsetMap &map, int tuple_size) |
template<typename DESTTYPE , typename MYTYPE > | |
static DESTTYPE | directGetterScalar (const GA_DataArray *const *data, GA_Offset off, int comp) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directSetterScalar (GA_DataArray *const *data, GA_Offset off, int comp, SRCTYPE val) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directAdderScalar (GA_DataArray *const *data, GA_Offset off, int comp, SRCTYPE val) |
template<typename DESTTYPE , typename MYTYPE > | |
static void | directGetterVector (DESTTYPE &value, const GA_DataArray *const *data, GA_Offset off) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directSetterVector (GA_DataArray *const *data, GA_Offset off, const SRCTYPE &val) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directAdderVector (GA_DataArray *const *data, GA_Offset off, const SRCTYPE &val) |
template<typename DESTTYPE , typename MYTYPE > | |
static DESTTYPE | directVector3GetterScalar (const GA_DataArray *const *d, GA_Offset off, int comp) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directVector3SetterScalar (GA_DataArray *const *data, GA_Offset off, int comp, SRCTYPE val) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directVector3AdderScalar (GA_DataArray *const *data, GA_Offset off, int comp, SRCTYPE val) |
template<typename DESTTYPE , typename MYTYPE > | |
static void | directVector3GetterVector (DESTTYPE &value, const GA_DataArray *const *data, GA_Offset off) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directVector3SetterVector (GA_DataArray *const *data, GA_Offset off, const SRCTYPE &val) |
template<typename SRCTYPE , typename MYTYPE > | |
static void | directVector3AdderVector (GA_DataArray *const *data, GA_Offset off, const SRCTYPE &val) |
template<typename T , typename BASETYPE , typename MYTYPE , bool READONLY> | |
static T * | directPageGetterVary (GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , int TUPLE_SIZE, typename MYTYPE , bool READONLY> | |
static T * | directVector3PageGetterVary (GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static T * | directPageGetter (GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static T * | directVector3PageGetter (GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static T * | directPageGetterRO (const GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static T * | directVector3PageGetterRO (const GA_DataArray *const *data, T *marshall, GA_Offset off, int comp, bool &isconstant) |
template<typename T , typename BASETYPE , int TUPLE_SIZE, typename MYTYPE > | |
static void | directVector3PageSetterVary (GA_DataArray *const *data, const T *srcdata, GA_Offset off, int comp) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static void | directPageSetter (GA_DataArray *const *data, const T *srcdata, GA_Offset off, int comp) |
template<typename T , typename BASETYPE , typename MYTYPE > | |
static void | directVector3PageSetter (GA_DataArray *const *data, const T *srcdata, GA_Offset off, int comp) |
An array of numbers with various storage types.
GA_DataArray provides a way of storing arrays of scalar values. The array can have various storage types from 8-bit integer to 64-bit reals.
There are basic operations on the array.
See also: JSON Schema: GA_DataArray
Definition at line 49 of file GA_DataArray.h.
GA_DataArray::GA_DataArray | ( | GA_Storage | storage, |
GA_Offset | size, | ||
int64 | value | ||
) |
GA_DataArray::GA_DataArray | ( | GA_Storage | storage, |
GA_Offset | size, | ||
fpreal | value | ||
) |
GA_DataArray::GA_DataArray | ( | GA_Storage | storage, |
GA_Offset | size, | ||
int | slice, | ||
UT_Vector3D | value | ||
) |
Creates a shared array if slice is other than 0. You must invoke shareData() on the resulting data to steal the 0th entries data tables.
GA_DataArray::GA_DataArray | ( | const GA_DataArray & | src | ) |
GA_DataArray::~GA_DataArray | ( | ) |
void GA_DataArray::clear | ( | ) |
Changes all values back to their defaults Ignored for shared arrays.
Clears a specific value to the default.
void GA_DataArray::comparePages | ( | UT_BitArray & | pages, |
const GA_DataArray & | other | ||
) | const |
void GA_DataArray::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_DataArray::defragment | ( | const GA_Defragment & | defrag | ) |
Interface for defragmentation
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
|
static |
Direct access to compound objects.
Access data from the array
Definition at line 127 of file GA_DataArray.h.
Access data from the array
Definition at line 128 of file GA_DataArray.h.
Access data from the array
Definition at line 129 of file GA_DataArray.h.
Access data from the array
Definition at line 130 of file GA_DataArray.h.
|
inline |
Query the size of the array.
Definition at line 82 of file GA_DataArray.h.
Access data from the array
Definition at line 125 of file GA_DataArray.h.
int64 GA_DataArray::getMemoryUsage | ( | bool | inclusive | ) | const |
Report memory usage.
|
inline |
Query the storage used for the array data.
Definition at line 85 of file GA_DataArray.h.
void GA_DataArray::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.
bool GA_DataArray::isNan | ( | GA_Offset | ai | ) | const |
Test for NAN's
bool GA_DataArray::isNan | ( | const GA_Range & | di | ) | const |
Test for NAN's
|
inline |
Definition at line 235 of file GA_DataArray.h.
bool GA_DataArray::jsonLoad | ( | UT_JSONParser & | p, |
const GA_LoadMap & | map, | ||
GA_AttributeOwner | owner | ||
) |
Load from a JSON stream.
bool GA_DataArray::jsonSave | ( | UT_JSONWriter & | w, |
const GA_Range & | it | ||
) | const |
bool GA_DataArray::jsonSave | ( | UT_JSONWriter & | w, |
const GA_Range & | range, | ||
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.
GA_Size GA_DataArray::marshallConstantFlagsForOutputPagesFast | ( | const UT_ValArray< GA_PageNum > & | internal_page_map, |
UT_BitArray & | constant_flags | ||
) | const |
Marshall a bit array indicating which output pages are constant given the internal page mapping. The mapping consists of a list of internal pages with the start of each output page indicated by a negative value, (-(internal_page + 1)).
This method considers any internal pages not already marked constant as varying.
Returns the total number of constant output pages.
GA_Size GA_DataArray::marshallConstantFlagsForOutputPagesSlow | ( | const UT_Array< ga_SubPageBlock > & | internal_page_map, |
UT_BitArray & | constant_flags | ||
) | const |
void GA_DataArray::mergeGrowArrayAndCopy | ( | const GA_MergeMap & | map, |
GA_AttributeOwner | owner, | ||
const GA_DataArray & | src | ||
) |
mergeGrowArrayAndCopy() is called to grow the data array while copying data from the source. If the array is packed, this must only be invoked on the 0th array, and the other shared arrays must be updated by calling shareData()
Interface for defragmentation
GA_DataArray& GA_DataArray::operator= | ( | const GA_DataArray & | src | ) |
void GA_DataArray::remapAndCount | ( | GA_Offset | start_offset, |
GA_Offset | end_offset, | ||
const UT_IntArray & | old2new, | ||
UT_IntArray & | count | ||
) |
Remaps all numbers through the lookup table. Negative numbers get mapped to -1. Counts the number of occurrences of each number in the counter, which should be pre-allocated to your maximum size. Inclusive count measures the source indices, not destination.
void GA_DataArray::set | ( | GA_Offset | di, |
const GA_DataArray & | src, | ||
GA_Offset | si | ||
) |
void GA_DataArray::set | ( | const GA_Range & | di, |
const GA_DataArray & | src, | ||
GA_Offset | si | ||
) |
void GA_DataArray::set | ( | const GA_Range & | di, |
const GA_DataArray & | src | ||
) |
void GA_DataArray::set | ( | const GA_Range & | di, |
const GA_DataArray & | src, | ||
const GA_Range & | si | ||
) |
Set a range of values in the array.
Change the size of the array If the array is packed, this must only be invoked on the 0th array, and the other shared arrays must be updated by calling shareData()
|
static |
Set the value for a tuple of data array from a source tuple.
|
static |
|
static |
void GA_DataArray::shareData | ( | GA_DataArray * | src | ) |
We can have multiple data arrays refer to the same structure with different slice/vectorsizes. The 0th is always the true owner the rest need to do a shareData to track any changes.
void GA_DataArray::tryCompressAllPages | ( | GA_Offset | start_offset = GA_Offset(0) , |
GA_Offset | end_offset = GA_INVALID_OFFSET |
||
) |
Try to compress data pages Will try to compress all pages overlapping the specified offset range.
Compresses a specific page. Pass in the offset whose page you wish to compress, not the page id.
void GA_DataArray::xlate | ( | const GA_Range & | di, |
const UT_IntArray & | map, | ||
int64 | invalid = -1 |
||
) |
Integer values in the array are re-mapped to the values stored in the map.