Array

Inheritance diagram of rumba.Array
class Array

An array of values.

The values in the array can have any type.:cvar Array default_value: Static. The default value.

Methods

__getitem__

operator[](i: int) -> Value

__init__

Constructor(s)

__len__

__lshift__

operator<<(value: Value) -> Array

append

Alias for push_back, only available in Python.

as_Box3f(i)

Returns the i-th value as a Box3f.

as_Color4f(i)

Returns the i-th value as a Color4f.

as_M44d(i)

Returns the i-th value as a M44d.

as_Quatd(i)

Returns the i-th value as a Quatd.

as_V2d(i)

Returns the i-th value as a V2d.

as_V3d(i)

Returns the i-th value as a V3d.

as_V4d(i)

Returns the i-th value as a V4d.

as_bool(i)

Returns a value as a bool.

as_double(i)

Returns the i-th value as a float.

as_float(i)

Returns the i-th value as a float.

as_int(i)

Returns the i-th value as an integer.

as_string(i)

Returns the i-th value as a string.

push_back(value)

Insert a value at the end of the array.

read(i)

Returns the i-th value.

resize(size)

resize the array.

size()

Returns the array size.

write(i, v)

Write the i-th array element.

Properties

default_value

__init__()

Constructor(s)

Array ()

Construct an empty Array.

Array (v: Value)

Cast a Value object in Array.

If v has not the good type, a default value is constructed.

append()

Alias for push_back, only available in Python.

as_Box3f(i: int) Imath.Box3f

Returns the i-th value as a Box3f.

You must be sure this value is a Box3f or you will have an empty box.

Parameters

i (int) – the index of the value to query

Return type

Imath.Box3f

as_Color4f(i: int) Imath.Color4f

Returns the i-th value as a Color4f.

You must be sure this value is a Color4f or you will have {0,0,0,0}.

Parameters

i (int) – the index of the value to query

Return type

Imath.Color4f

as_M44d(i: int) Imath.M44d

Returns the i-th value as a M44d.

You must be sure this value is a M44d or you will have an identity matrix.

Parameters

i (int) – the index of the value to query

Return type

Imath.M44d

as_Quatd(i: int) Imath.Quatd

Returns the i-th value as a Quatd.

You must be sure this value is a Quatd or you will have an identity quaternion.

Parameters

i (int) – the index of the value to query

Return type

Imath.Quatd

as_V2d(i: int) Imath.V2d

Returns the i-th value as a V2d.

You must be sure this value is a V2d or you will have {0,0}.

Parameters

i (int) – the index of the value to query

Return type

Imath.V2d

as_V3d(i: int) Imath.V3d

Returns the i-th value as a V3d.

You must be sure this value is a V3d or you will have {0,0,0}.

Parameters

i (int) – the index of the value to query

Return type

Imath.V3d

as_V4d(i: int) Imath.V4d

Returns the i-th value as a V4d.

You must be sure this value is a V4d or you will have {0,0,0,0}.

Parameters

i (int) – the index of the value to query

Return type

Imath.V4d

as_bool(i: int) bool

Returns a value as a bool.

You must be sure this value is an integer, a float or a boolean or you get false.

Parameters

i (int) – the index of the value to query

Return type

bool

as_double(i: int) double

Returns the i-th value as a float.

You must be sure this value is an integer, a float or a boolean or you get 0.f.

Parameters

i (int) – the index of the value to query

Return type

double

as_float(i: int) float

Returns the i-th value as a float.

You must be sure this value is an integer, a float or a boolean or you get 0.f.

Parameters

i (int) – the index of the value to query

Return type

float

as_int(i: int) int

Returns the i-th value as an integer.

You must be sure this value is an integer, a float or a boolean or you get 0.

Parameters

i (int) – the index of the value to query

Return type

int

as_string(i: int) unicode

Returns the i-th value as a string.

You must be sure this value is a string or you will have an empty string.

Parameters

i (int) – the index of the value to query

Return type

unicode

push_back(value: Value) None

Insert a value at the end of the array.

The array size is increased by one.

read(i: int) Value

Returns the i-th value.

Expect an access violation error if i is out of bounds.

Return type

Value

resize(size: int) None

resize the array.

size() int

Returns the array size.

Return type

int

write(i: int, v: Value) None

Write the i-th array element.

Expect an access violation error if i is out of bounds.