HDK
|
#include <GA_OffsetMatrix.h>
Public Member Functions | |
GA_OffsetMatrix () | |
~GA_OffsetMatrix () | |
int64 | getMemoryUsage (bool inclusive) const |
Report memory usage. More... | |
void | countMemory (UT_MemoryCounter &counter, bool inclusive) const |
void | clear () |
clear removes all of the entries More... | |
GA_Size | rows () const |
Returns the used rows of the matrix (always <= to getRowCapacity()) More... | |
GA_Size | getRows () const |
GA_Size | cols () const |
Returns the used columns of the matrix (always <= to getRowCapacity()) More... | |
GA_Size | getCols () const |
void | reserve (GA_Size rows, GA_Size cols) |
void | setEntries (GA_Size rows, GA_Size cols) |
Set the array size. More... | |
GA_Size | appendRow () |
Add a single entry (may grow array) More... | |
GA_Size | insertRow (GA_Size index) |
Add a single entry (may grow array) More... | |
GA_Size | removeRow (GA_Size i) |
Remove the entry at the given offset. More... | |
GA_Size | appendCol () |
Add a single entry (may grow array) More... | |
GA_Size | insertCol (GA_Size index) |
Add a single entry (may grow array) More... | |
GA_Size | removeCol (GA_Size i) |
Remove the entry at the given offset. More... | |
void | set (GA_Size row, GA_Size col, GA_Offset value) |
Set the index to the value. More... | |
GA_Offset | get (GA_Size row, GA_Size col) const |
The the value at the index. More... | |
GA_Offset | operator() (GA_Size row, GA_Size col) const |
Convenience () operator to access the list entries. More... | |
void | cycle (GA_Size rowshift, GA_Size colshift) |
Cyclically shift the rows and/or columns. More... | |
GA_Size | find (GA_Offset value) const |
bool | jsonPointMatrix (UT_JSONWriter &w, const GA_SaveMap &save) const |
Save the offsets by doing the mapping to the points in the save map. More... | |
bool | jsonVertexMatrix (UT_JSONWriter &w, const GA_SaveMap &save) const |
Save the offsets by doing the mapping to the vertices in the save map. More... | |
bool | jsonPrimitiveMatrix (UT_JSONWriter &w, const GA_SaveMap &save) const |
Save the offsets by doing the mapping to the primitives in the save map. More... | |
bool | jsonPointMatrix (UT_JSONParser &p, const GA_LoadMap &load) |
Load a point list from a JSON stream. More... | |
bool | jsonVertexMatrix (UT_JSONParser &p, const GA_LoadMap &load) |
Load a vertex list from a JSON stream. More... | |
bool | jsonPrimitiveMatrix (UT_JSONParser &p, const GA_LoadMap &load) |
Load a primitive list from a JSON stream. More... | |
bool | jsonLoad (UT_JSONParser &p, GA_Offset load_offset) |
Generic load given a load offset. More... | |
GA_Size | swapOffsetValues (const GA_Defragment &defrag) |
GA_OffsetMatrix implements an array of GA_Offsets. Copy-on-write is used to reduce memory usage and make the copying of a GA_OffsetMatrix an inexpensive operation.
See also: JSON Schema: GA_OffsetMatrix, GA_OffsetList
Definition at line 35 of file GA_OffsetMatrix.h.
|
inlineexplicit |
Definition at line 38 of file GA_OffsetMatrix.h.
|
inline |
Definition at line 39 of file GA_OffsetMatrix.h.
|
inline |
Add a single entry (may grow array)
Definition at line 85 of file GA_OffsetMatrix.h.
|
inline |
Add a single entry (may grow array)
Definition at line 78 of file GA_OffsetMatrix.h.
|
inline |
clear removes all of the entries
Definition at line 55 of file GA_OffsetMatrix.h.
|
inline |
Returns the used columns of the matrix (always <= to getRowCapacity())
Definition at line 66 of file GA_OffsetMatrix.h.
void GA_OffsetMatrix::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.)
Cyclically shift the rows and/or columns.
Returns the first linear index in the matrix whose value is equal to value, or -1 if not present
Definition at line 108 of file GA_OffsetMatrix.h.
The the value at the index.
Definition at line 96 of file GA_OffsetMatrix.h.
|
inline |
Definition at line 67 of file GA_OffsetMatrix.h.
|
inline |
Report memory usage.
Definition at line 42 of file GA_OffsetMatrix.h.
|
inline |
Definition at line 64 of file GA_OffsetMatrix.h.
bool GA_OffsetMatrix::jsonLoad | ( | UT_JSONParser & | p, |
GA_Offset | load_offset | ||
) |
Generic load given a load offset.
bool GA_OffsetMatrix::jsonPointMatrix | ( | UT_JSONWriter & | w, |
const GA_SaveMap & | save | ||
) | const |
Save the offsets by doing the mapping to the points in the save map.
bool GA_OffsetMatrix::jsonPointMatrix | ( | UT_JSONParser & | p, |
const GA_LoadMap & | load | ||
) |
Load a point list from a JSON stream.
bool GA_OffsetMatrix::jsonPrimitiveMatrix | ( | UT_JSONWriter & | w, |
const GA_SaveMap & | save | ||
) | const |
Save the offsets by doing the mapping to the primitives in the save map.
bool GA_OffsetMatrix::jsonPrimitiveMatrix | ( | UT_JSONParser & | p, |
const GA_LoadMap & | load | ||
) |
Load a primitive list from a JSON stream.
bool GA_OffsetMatrix::jsonVertexMatrix | ( | UT_JSONWriter & | w, |
const GA_SaveMap & | save | ||
) | const |
Save the offsets by doing the mapping to the vertices in the save map.
bool GA_OffsetMatrix::jsonVertexMatrix | ( | UT_JSONParser & | p, |
const GA_LoadMap & | load | ||
) |
Load a vertex list from a JSON stream.
Convenience () operator to access the list entries.
Definition at line 100 of file GA_OffsetMatrix.h.
Reserve capacity for a number of rows/columns. The capacity may not be decreased.
Definition at line 71 of file GA_OffsetMatrix.h.
|
inline |
Returns the used rows of the matrix (always <= to getRowCapacity())
Definition at line 63 of file GA_OffsetMatrix.h.
Set the index to the value.
Definition at line 93 of file GA_OffsetMatrix.h.
|
inline |
Swap offset values for defragmentation process. When defragmenting, offsets will move. This method will update all references to offsets to their new values. This returns the number of values updated.
Definition at line 115 of file GA_OffsetMatrix.h.