Constructor
new Size(values)
Name | Type | Description |
---|---|---|
values | Array.<number> | The size values. |
- Source
Classes
Methods
canScroll(viewOrientation) → {boolean}
Check if the associated data is scrollable: either in 3D or in other directions.
Name | Type | Description |
---|---|---|
viewOrientation | Matrix33 | The orientation matrix. |
- Source
True if scrollable.
- Type:
- boolean
canScroll3D(viewOrientationopt) → {boolean}
Check if the associated data is scrollable in 3D.
Name | Type | Attributes | Description |
---|---|---|---|
viewOrientation | Matrix33 | <optional> | The orientation matrix. |
- Source
True if scrollable.
- Type:
- boolean
equals(rhs) → {boolean}
Check for equality.
Name | Type | Description |
---|---|---|
rhs | Size | The object to compare to. |
- Source
True if both objects are equal.
- Type:
- boolean
get(i) → {number}
Get the size value at the given array index.
Name | Type | Description |
---|---|---|
i | number | The index to get. |
- Source
The value.
- Type:
- number
get2D() → {Scalar2D}
Get the 2D base of this size.
- Source
The 2D base [0,1] as {x,y}.
- Type:
- Scalar2D
getDimSize(dimension, startopt) → {number}
Get the size of a given dimension.
Name | Type | Attributes | Description |
---|---|---|---|
dimension | number | The dimension. | |
start | number | <optional> | Optional start dimension to start counting from. |
- Source
The size.
- Type:
- number
getTotalSize(startopt) → {number}
Get the total size.
Name | Type | Attributes | Description |
---|---|---|---|
start | number | <optional> | Optional start dimension to base the offset on. |
- Source
The total size.
- Type:
- number
getValues() → {Array.<number>}
Get the values of this index.
- Source
The array of values.
- Type:
- Array.<number>
indexToOffset(index, startopt) → {number}
Convert an index to an offset in memory.
Name | Type | Attributes | Description |
---|---|---|---|
index | Index | The index to convert. | |
start | number | <optional> | Optional start dimension to base the offset on. |
- Source
The offset.
- Type:
- number
isInBounds(index, dirs) → {boolean}
Check that an index is within bounds.
Name | Type | Description |
---|---|---|
index | Index | The index to check. |
dirs | Array.<number> | Optional list of directions to check. |
- Source
True if the given coordinates are within bounds.
- Type:
- boolean
length() → {number}
Get the length of the index.
- Source
The length.
- Type:
- number
moreThanOne(dimension) → {boolean}
Check if a dimension exists and has more than one element.
Name | Type | Description |
---|---|---|
dimension | number | The dimension to check. |
- Source
True if the size is more than one.
- Type:
- boolean
offsetToIndex(offset) → {Index}
Convert an offset in memory to an index.
Name | Type | Description |
---|---|---|
offset | number | The offset to convert. |
- Source
The index.
- Type:
- Index
toString() → {string}
Get a string representation of the size.
- Source
The Size as a string.
- Type:
- string