HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_OffsetMatrix Class Reference

#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)
 

Detailed Description

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.

Constructor & Destructor Documentation

GA_OffsetMatrix::GA_OffsetMatrix ( )
inlineexplicit

Definition at line 38 of file GA_OffsetMatrix.h.

GA_OffsetMatrix::~GA_OffsetMatrix ( )
inline

Definition at line 39 of file GA_OffsetMatrix.h.

Member Function Documentation

GA_Size GA_OffsetMatrix::appendCol ( )
inline

Add a single entry (may grow array)

Definition at line 85 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::appendRow ( )
inline

Add a single entry (may grow array)

Definition at line 78 of file GA_OffsetMatrix.h.

void GA_OffsetMatrix::clear ( )
inline

clear removes all of the entries

Definition at line 55 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::cols ( ) const
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.)

void GA_OffsetMatrix::cycle ( GA_Size  rowshift,
GA_Size  colshift 
)

Cyclically shift the rows and/or columns.

GA_Size GA_OffsetMatrix::find ( GA_Offset  value) const
inline

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.

GA_Offset GA_OffsetMatrix::get ( GA_Size  row,
GA_Size  col 
) const
inline

The the value at the index.

Definition at line 96 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::getCols ( ) const
inline

Definition at line 67 of file GA_OffsetMatrix.h.

int64 GA_OffsetMatrix::getMemoryUsage ( bool  inclusive) const
inline

Report memory usage.

Definition at line 42 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::getRows ( ) const
inline

Definition at line 64 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::insertCol ( GA_Size  index)

Add a single entry (may grow array)

GA_Size GA_OffsetMatrix::insertRow ( GA_Size  index)

Add a single entry (may grow array)

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.

JSON Schema: GA_OffsetMatrix

{
"name" : "GA_OffsetMatrix",
"description" :
"A 2D matrix of offsets/indicies.
Each item in the array represents a row of the matrix."
"type" : "array",
"items" : { "$ref" : "GA_OffsetList" }
}
See Also
JSON_FileFormat
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.

GA_Offset GA_OffsetMatrix::operator() ( GA_Size  row,
GA_Size  col 
) const
inline

Convenience () operator to access the list entries.

Definition at line 100 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::removeCol ( GA_Size  i)

Remove the entry at the given offset.

GA_Size GA_OffsetMatrix::removeRow ( GA_Size  i)

Remove the entry at the given offset.

void GA_OffsetMatrix::reserve ( GA_Size  rows,
GA_Size  cols 
)
inline

Reserve capacity for a number of rows/columns. The capacity may not be decreased.

Definition at line 71 of file GA_OffsetMatrix.h.

GA_Size GA_OffsetMatrix::rows ( ) const
inline

Returns the used rows of the matrix (always <= to getRowCapacity())

Definition at line 63 of file GA_OffsetMatrix.h.

void GA_OffsetMatrix::set ( GA_Size  row,
GA_Size  col,
GA_Offset  value 
)
inline

Set the index to the value.

Definition at line 93 of file GA_OffsetMatrix.h.

void GA_OffsetMatrix::setEntries ( GA_Size  rows,
GA_Size  cols 
)

Set the array size.

GA_Size GA_OffsetMatrix::swapOffsetValues ( const GA_Defragment defrag)
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.


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