classref: Sync with latest 4.0-dev

This commit is contained in:
Rémi Verschelde
2021-10-05 16:09:21 +02:00
parent 6952796767
commit f6f6c1bf19
958 changed files with 113054 additions and 52009 deletions

View File

@@ -16,43 +16,83 @@ Description
An :ref:`Array<class_Array>` specifically designed to hold 64-bit floating-point values. Packs data tightly, so it saves memory for large array sizes.
**Note:** This type is passed by value and not by reference.
If you only need to pack 32-bit floats tightly, see :ref:`PackedFloat32Array<class_PackedFloat32Array>` for a more memory-friendly alternative.
Methods
-------
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`PackedFloat64Array<class_PackedFloat64Array_method_PackedFloat64Array>` **(** :ref:`Array<class_Array>` from **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append<class_PackedFloat64Array_method_append>` **(** :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append_array<class_PackedFloat64Array_method_append_array>` **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` array **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`empty<class_PackedFloat64Array_method_empty>` **(** **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`insert<class_PackedFloat64Array_method_insert>` **(** :ref:`int<class_int>` idx, :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`invert<class_PackedFloat64Array_method_invert>` **(** **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_back<class_PackedFloat64Array_method_push_back>` **(** :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove<class_PackedFloat64Array_method_remove>` **(** :ref:`int<class_int>` idx **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_PackedFloat64Array_method_resize>` **(** :ref:`int<class_int>` idx **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set<class_PackedFloat64Array_method_set>` **(** :ref:`int<class_int>` idx, :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_PackedFloat64Array_method_size>` **(** **)** |
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`PackedFloat64Array<class_PackedFloat64Array_method_PackedFloat64Array>` **(** **)** |constructor| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`PackedFloat64Array<class_PackedFloat64Array_method_PackedFloat64Array>` **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` from **)** |constructor| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`PackedFloat64Array<class_PackedFloat64Array_method_PackedFloat64Array>` **(** :ref:`Array<class_Array>` from **)** |constructor| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`append<class_PackedFloat64Array_method_append>` **(** :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append_array<class_PackedFloat64Array_method_append_array>` **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` array **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch<class_PackedFloat64Array_method_bsearch>` **(** :ref:`float<class_float>` value, :ref:`bool<class_bool>` before=true **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`duplicate<class_PackedFloat64Array_method_duplicate>` **(** **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`fill<class_PackedFloat64Array_method_fill>` **(** :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has<class_PackedFloat64Array_method_has>` **(** :ref:`float<class_float>` value **)** |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`insert<class_PackedFloat64Array_method_insert>` **(** :ref:`int<class_int>` at_index, :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_empty<class_PackedFloat64Array_method_is_empty>` **(** **)** |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | **operator !=** **(** **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | **operator !=** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | **operator +** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | **operator ==** **(** **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | **operator ==** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | **operator []** **(** :ref:`int<class_int>` index **)** |operator| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_back<class_PackedFloat64Array_method_push_back>` **(** :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove<class_PackedFloat64Array_method_remove>` **(** :ref:`int<class_int>` index **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`resize<class_PackedFloat64Array_method_resize>` **(** :ref:`int<class_int>` new_size **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reverse<class_PackedFloat64Array_method_reverse>` **(** **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set<class_PackedFloat64Array_method_set>` **(** :ref:`int<class_int>` index, :ref:`float<class_float>` value **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_PackedFloat64Array_method_size>` **(** **)** |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort<class_PackedFloat64Array_method_sort>` **(** **)** |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedFloat64Array<class_PackedFloat64Array>` | :ref:`subarray<class_PackedFloat64Array_method_subarray>` **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`to_byte_array<class_PackedFloat64Array_method_to_byte_array>` **(** **)** |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_PackedFloat64Array_method_PackedFloat64Array:
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **PackedFloat64Array** **(** :ref:`Array<class_Array>` from **)**
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **PackedFloat64Array** **(** **)** |constructor|
Constructs an empty ``PackedFloat64Array``.
----
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **PackedFloat64Array** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` from **)** |constructor|
Constructs a ``PackedFloat64Array`` as a copy of the given ``PackedFloat64Array``.
----
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **PackedFloat64Array** **(** :ref:`Array<class_Array>` from **)** |constructor|
Constructs a new ``PackedFloat64Array``. Optionally, you can pass in a generic :ref:`Array<class_Array>` that will be converted.
@@ -60,7 +100,7 @@ Constructs a new ``PackedFloat64Array``. Optionally, you can pass in a generic :
.. _class_PackedFloat64Array_method_append:
- void **append** **(** :ref:`float<class_float>` value **)**
- :ref:`bool<class_bool>` **append** **(** :ref:`float<class_float>` value **)**
Appends an element at the end of the array (alias of :ref:`push_back<class_PackedFloat64Array_method_push_back>`).
@@ -74,33 +114,91 @@ Appends a ``PackedFloat64Array`` at the end of this array.
----
.. _class_PackedFloat64Array_method_empty:
.. _class_PackedFloat64Array_method_bsearch:
- :ref:`bool<class_bool>` **empty** **(** **)**
- :ref:`int<class_int>` **bsearch** **(** :ref:`float<class_float>` value, :ref:`bool<class_bool>` before=true **)**
Returns ``true`` if the array is empty.
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array.
**Note:** Calling :ref:`bsearch<class_PackedFloat64Array_method_bsearch>` on an unsorted array results in unexpected behavior.
----
.. _class_PackedFloat64Array_method_duplicate:
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **duplicate** **(** **)**
Creates a copy of the array, and returns it.
----
.. _class_PackedFloat64Array_method_fill:
- void **fill** **(** :ref:`float<class_float>` value **)**
Assigns the given value to all elements in the array. This can typically be used together with :ref:`resize<class_PackedFloat64Array_method_resize>` to create an array with a given size and initialized elements.
----
.. _class_PackedFloat64Array_method_has:
- :ref:`bool<class_bool>` **has** **(** :ref:`float<class_float>` value **)** |const|
Returns ``true`` if the array contains ``value``.
----
.. _class_PackedFloat64Array_method_insert:
- :ref:`int<class_int>` **insert** **(** :ref:`int<class_int>` idx, :ref:`float<class_float>` value **)**
- :ref:`int<class_int>` **insert** **(** :ref:`int<class_int>` at_index, :ref:`float<class_float>` value **)**
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``).
----
.. _class_PackedFloat64Array_method_invert:
.. _class_PackedFloat64Array_method_is_empty:
- void **invert** **(** **)**
- :ref:`bool<class_bool>` **is_empty** **(** **)** |const|
Reverses the order of the elements in the array.
Returns ``true`` if the array is empty.
----
.. _class_PackedFloat64Array_method_operator !=:
- :ref:`bool<class_bool>` **operator !=** **(** **)** |operator|
----
- :ref:`bool<class_bool>` **operator !=** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator|
----
.. _class_PackedFloat64Array_method_operator +:
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **operator +** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator|
----
.. _class_PackedFloat64Array_method_operator ==:
- :ref:`bool<class_bool>` **operator ==** **(** **)** |operator|
----
- :ref:`bool<class_bool>` **operator ==** **(** :ref:`PackedFloat64Array<class_PackedFloat64Array>` right **)** |operator|
----
.. _class_PackedFloat64Array_method_operator []:
- :ref:`float<class_float>` **operator []** **(** :ref:`int<class_int>` index **)** |operator|
----
.. _class_PackedFloat64Array_method_push_back:
- void **push_back** **(** :ref:`float<class_float>` value **)**
- :ref:`bool<class_bool>` **push_back** **(** :ref:`float<class_float>` value **)**
Appends an element at the end of the array.
@@ -108,7 +206,7 @@ Appends an element at the end of the array.
.. _class_PackedFloat64Array_method_remove:
- void **remove** **(** :ref:`int<class_int>` idx **)**
- void **remove** **(** :ref:`int<class_int>` index **)**
Removes an element from the array by index.
@@ -116,15 +214,23 @@ Removes an element from the array by index.
.. _class_PackedFloat64Array_method_resize:
- void **resize** **(** :ref:`int<class_int>` idx **)**
- :ref:`int<class_int>` **resize** **(** :ref:`int<class_int>` new_size **)**
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
----
.. _class_PackedFloat64Array_method_reverse:
- void **reverse** **(** **)**
Reverses the order of the elements in the array.
----
.. _class_PackedFloat64Array_method_set:
- void **set** **(** :ref:`int<class_int>` idx, :ref:`float<class_float>` value **)**
- void **set** **(** :ref:`int<class_int>` index, :ref:`float<class_float>` value **)**
Changes the float at the given index.
@@ -132,7 +238,37 @@ Changes the float at the given index.
.. _class_PackedFloat64Array_method_size:
- :ref:`int<class_int>` **size** **(** **)**
- :ref:`int<class_int>` **size** **(** **)** |const|
Returns the size of the array.
----
.. _class_PackedFloat64Array_method_sort:
- void **sort** **(** **)**
Sorts the elements of the array in ascending order.
----
.. _class_PackedFloat64Array_method_subarray:
- :ref:`PackedFloat64Array<class_PackedFloat64Array>` **subarray** **(** :ref:`int<class_int>` from, :ref:`int<class_int>` to **)** |const|
----
.. _class_PackedFloat64Array_method_to_byte_array:
- :ref:`PackedByteArray<class_PackedByteArray>` **to_byte_array** **(** **)** |const|
Returns a copy of the data converted to a :ref:`PackedByteArray<class_PackedByteArray>`, where each element have been encoded as 8 bytes.
The size of the new array will be ``float64_array.size() * 8``.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`