HDK
|
#include <GT_CountArray.h>
Public Member Functions | |
GT_CountArray () | |
GT_CountArray (const GT_DataArrayHandle &counts, GT_Size mincount=0, GT_Size maxcount=0) | |
GT_CountArray (const GT_CountArray &counts, const GT_DataArrayHandle &raw_offsets, GT_Size mincount, GT_Size maxcount) | |
exint | getMemoryUsage () const |
Return memory used. More... | |
void | harden () |
harden the data array More... | |
void | clear () |
Clear the count array. More... | |
GT_Storage | getStorage () const |
Return the storage type. More... | |
void | init (const GT_DataArrayHandle &counts, GT_Size mincount=0, GT_Size maxcount=0) |
Initialize given an array of counts. More... | |
void | init (exint entries, exint repeated_value) |
GT_Size | entries () const |
GT_Offset | getOffset (exint idx) const |
GT_Size | getCount (exint idx) const |
std::pair< GT_Size, GT_Size > | getOffsetCount (exint idx) const |
bool | isEqual (const GT_CountArray &other) const |
Test equality. More... | |
bool | operator== (const GT_CountArray &other) const |
bool | operator!= (const GT_CountArray &other) const |
GT_Size | getMinCount () const |
Return the minimum value that getCount() can return. More... | |
GT_Size | getMaxCount () const |
Return the maximum value that getCount() can return. More... | |
GT_Size | sumCounts () const |
Return the sum of all the counts. More... | |
const GT_DataArrayHandle & | rawOffsets () const |
GT_DataArrayHandle | extractCounts () const |
GT_DataArrayHandle | extractOffsets () const |
GT_DataArrayHandle | buildRepeatList () const |
Creates a list of {0,0,0, 1,1,1,1,1, 2,2} from {3,5,2}. More... | |
bool | save (UT_JSONWriter &w) const |
A count/offset array
In a polygon mesh, there is a list of faces. Each face has a number of vertices and a list of vertices. Thus, for each polygon, there's an offset into the vertex array and a count of the number of vertices to extract. This array manages those offsets/counts efficiently For example, if there are counts [3, 4, 2], the corresponding offset array would be [0, 3, 7]. Thus:
Definition at line 35 of file GT_CountArray.h.
|
inline |
Definition at line 38 of file GT_CountArray.h.
|
inline |
Definition at line 44 of file GT_CountArray.h.
|
inline |
Clone from the source count array, but swapping out the offset array with the given one.
Definition at line 53 of file GT_CountArray.h.
GT_DataArrayHandle GT_CountArray::buildRepeatList | ( | ) | const |
Creates a list of {0,0,0, 1,1,1,1,1, 2,2} from {3,5,2}.
|
inline |
Clear the count array.
Definition at line 70 of file GT_CountArray.h.
|
inline |
Definition at line 89 of file GT_CountArray.h.
GT_DataArrayHandle GT_CountArray::extractCounts | ( | ) | const |
GT_DataArrayHandle GT_CountArray::extractOffsets | ( | ) | const |
Definition at line 94 of file GT_CountArray.h.
|
inline |
Return the maximum value that getCount()
can return.
Definition at line 130 of file GT_CountArray.h.
exint GT_CountArray::getMemoryUsage | ( | ) | const |
Return memory used.
|
inline |
Return the minimum value that getCount()
can return.
Definition at line 128 of file GT_CountArray.h.
Definition at line 90 of file GT_CountArray.h.
Definition at line 103 of file GT_CountArray.h.
|
inline |
Return the storage type.
Definition at line 77 of file GT_CountArray.h.
void GT_CountArray::harden | ( | ) |
harden the data array
void GT_CountArray::init | ( | const GT_DataArrayHandle & | counts, |
GT_Size | mincount = 0 , |
||
GT_Size | maxcount = 0 |
||
) |
Initialize given an array of counts.
Initialize when you know that there are entries
that are all the same repeated_value
.
|
inline |
Test equality.
Definition at line 111 of file GT_CountArray.h.
|
inline |
Definition at line 124 of file GT_CountArray.h.
|
inline |
Definition at line 122 of file GT_CountArray.h.
|
inline |
Definition at line 135 of file GT_CountArray.h.
bool GT_CountArray::save | ( | UT_JSONWriter & | w | ) | const |
Saves as an array of the counts (not the offsets). i.e. [ getCount(0), getCount(1), ... getCount(n) ]
|
inline |
Return the sum of all the counts.
Definition at line 133 of file GT_CountArray.h.