amulet-core 2.0.4a1.post250728120836__cp311-cp311-win_amd64.whl → 2.0.5a1__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of amulet-core might be problematic. Click here for more details.
- amulet/core/__init__.py +1 -0
- amulet/core/__init__.pyi +1 -1
- amulet/core/_amulet_core.cp311-win_amd64.pyd +0 -0
- amulet/core/_amulet_core.pyi +1 -1
- amulet/core/_version.py +3 -3
- amulet/core/amulet_core.dll +0 -0
- amulet/core/amulet_core.lib +0 -0
- amulet/core/amulet_coreConfig.cmake +2 -0
- amulet/core/biome/__init__.pyi +3 -3
- amulet/core/block/__init__.pyi +9 -9
- amulet/core/block_entity/__init__.pyi +3 -3
- amulet/core/chunk/__init__.pyi +1 -1
- amulet/core/chunk/component/__init__.pyi +1 -1
- amulet/core/chunk/component/block_component.pyi +1 -1
- amulet/core/chunk/component/section_array_map.pyi +42 -26
- amulet/core/entity/__init__.pyi +3 -3
- amulet/core/palette/__init__.pyi +1 -1
- amulet/core/palette/biome_palette.pyi +6 -6
- amulet/core/palette/block_palette.pyi +4 -4
- amulet/core/selection/__init__.pyi +20 -3
- amulet/core/selection/box.hpp +27 -16
- amulet/core/selection/box.pyi +20 -10
- amulet/core/selection/box_group.hpp +89 -0
- amulet/core/selection/{group.pyi → box_group.pyi} +34 -33
- amulet/core/selection/cuboid.hpp +41 -0
- amulet/core/selection/cuboid.pyi +49 -0
- amulet/core/selection/ellipsoid.hpp +42 -0
- amulet/core/selection/ellipsoid.pyi +47 -0
- amulet/core/selection/shape.hpp +73 -0
- amulet/core/selection/shape.pyi +56 -0
- amulet/core/selection/shape_group.hpp +73 -0
- amulet/core/selection/shape_group.pyi +118 -0
- amulet/core/version/__init__.pyi +5 -5
- {amulet_core-2.0.4a1.post250728120836.dist-info → amulet_core-2.0.5a1.dist-info}/METADATA +7 -7
- amulet_core-2.0.5a1.dist-info/RECORD +54 -0
- amulet/core/selection/group.hpp +0 -80
- amulet_core-2.0.4a1.post250728120836.dist-info/RECORD +0 -46
- {amulet_core-2.0.4a1.post250728120836.dist-info → amulet_core-2.0.5a1.dist-info}/WHEEL +0 -0
- {amulet_core-2.0.4a1.post250728120836.dist-info → amulet_core-2.0.5a1.dist-info}/entry_points.txt +0 -0
- {amulet_core-2.0.4a1.post250728120836.dist-info → amulet_core-2.0.5a1.dist-info}/top_level.txt +0 -0
|
@@ -5,10 +5,12 @@ import types
|
|
|
5
5
|
import typing
|
|
6
6
|
|
|
7
7
|
import amulet.core.selection.box
|
|
8
|
+
import amulet.core.selection.shape_group
|
|
9
|
+
import amulet.utils.matrix
|
|
8
10
|
|
|
9
|
-
__all__ = ["
|
|
11
|
+
__all__: list[str] = ["SelectionBoxGroup"]
|
|
10
12
|
|
|
11
|
-
class
|
|
13
|
+
class SelectionBoxGroup:
|
|
12
14
|
"""
|
|
13
15
|
A container for zero or more :class:`SelectionBox` instances.
|
|
14
16
|
|
|
@@ -18,46 +20,42 @@ class SelectionGroup:
|
|
|
18
20
|
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
19
21
|
def __bool__(self) -> bool:
|
|
20
22
|
"""
|
|
21
|
-
|
|
23
|
+
Are there any selections in the group.
|
|
22
24
|
"""
|
|
23
25
|
|
|
24
26
|
@typing.overload
|
|
25
|
-
def __eq__(self,
|
|
27
|
+
def __eq__(self, other: SelectionBoxGroup) -> bool:
|
|
26
28
|
"""
|
|
27
|
-
Does the contents of this :class:`
|
|
29
|
+
Does the contents of this :class:`SelectionBoxGroup` match the other :class:`SelectionBoxGroup`.
|
|
28
30
|
|
|
29
31
|
Note if the boxes do not exactly match this will return False even if the volume represented is the same.
|
|
30
32
|
|
|
31
|
-
:param other: The other :class:`
|
|
33
|
+
:param other: The other :class:`SelectionBoxGroup` to compare with.
|
|
32
34
|
:return: True if the boxes contained match.
|
|
33
35
|
"""
|
|
34
36
|
|
|
35
37
|
@typing.overload
|
|
36
|
-
def __eq__(self,
|
|
38
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
37
39
|
@typing.overload
|
|
38
40
|
def __init__(self) -> None:
|
|
39
41
|
"""
|
|
40
|
-
Create an empty
|
|
42
|
+
Create an empty SelectionBoxGroup.
|
|
41
43
|
|
|
42
|
-
>>>
|
|
44
|
+
>>> SelectionBoxGroup()
|
|
43
45
|
"""
|
|
44
46
|
|
|
45
47
|
@typing.overload
|
|
46
|
-
def __init__(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
>>> SelectionGroup(SelectionBox(0, 0, 0, 1, 1, 1))
|
|
51
|
-
"""
|
|
52
|
-
|
|
48
|
+
def __init__(
|
|
49
|
+
self, shape_group: amulet.core.selection.shape_group.SelectionShapeGroup
|
|
50
|
+
) -> None: ...
|
|
53
51
|
@typing.overload
|
|
54
52
|
def __init__(
|
|
55
53
|
self, boxes: collections.abc.Iterable[amulet.core.selection.box.SelectionBox]
|
|
56
54
|
) -> None:
|
|
57
55
|
"""
|
|
58
|
-
Create a
|
|
56
|
+
Create a SelectionBoxGroup from the boxes in the iterable.
|
|
59
57
|
|
|
60
|
-
>>>
|
|
58
|
+
>>> SelectionBoxGroup([
|
|
61
59
|
>>> SelectionBox(0, 0, 0, 1, 1, 1),
|
|
62
60
|
>>> SelectionBox(1, 1, 1, 1, 1, 1)
|
|
63
61
|
>>> ])
|
|
@@ -119,16 +117,21 @@ class SelectionGroup:
|
|
|
119
117
|
"""
|
|
120
118
|
|
|
121
119
|
@typing.overload
|
|
122
|
-
def intersects(self, other:
|
|
120
|
+
def intersects(self, other: SelectionBoxGroup) -> bool: ...
|
|
121
|
+
def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionBoxGroup:
|
|
122
|
+
"""
|
|
123
|
+
Transform the boxes in this group by the given transformation matrix.
|
|
124
|
+
"""
|
|
125
|
+
|
|
123
126
|
def translate(
|
|
124
|
-
self,
|
|
125
|
-
) ->
|
|
127
|
+
self, dx: typing.SupportsInt, dy: typing.SupportsInt, dz: typing.SupportsInt
|
|
128
|
+
) -> SelectionBoxGroup:
|
|
126
129
|
"""
|
|
127
|
-
Create a new :class:`
|
|
130
|
+
Create a new :class:`SelectionBoxGroup` based on this one with the coordinates moved by the given offset.
|
|
128
131
|
|
|
129
|
-
:param
|
|
130
|
-
:param
|
|
131
|
-
:param
|
|
132
|
+
:param dx: The x offset.
|
|
133
|
+
:param dy: The y offset.
|
|
134
|
+
:param dz: The z offset.
|
|
132
135
|
:return: The new selection with the given offset.
|
|
133
136
|
"""
|
|
134
137
|
|
|
@@ -148,6 +151,12 @@ class SelectionGroup:
|
|
|
148
151
|
:raises RuntimeError: If there are no boxes in the selection.
|
|
149
152
|
"""
|
|
150
153
|
|
|
154
|
+
@property
|
|
155
|
+
def boxes(self) -> collections.abc.Iterator[amulet.core.selection.box.SelectionBox]:
|
|
156
|
+
"""
|
|
157
|
+
An iterator of the :class:`SelectionBox` instances stored for this group.
|
|
158
|
+
"""
|
|
159
|
+
|
|
151
160
|
@property
|
|
152
161
|
def max(self) -> tuple[int, int, int]:
|
|
153
162
|
"""
|
|
@@ -211,11 +220,3 @@ class SelectionGroup:
|
|
|
211
220
|
|
|
212
221
|
:raises RuntimeError: If there are no boxes in the selection.
|
|
213
222
|
"""
|
|
214
|
-
|
|
215
|
-
@property
|
|
216
|
-
def selection_boxes(
|
|
217
|
-
self,
|
|
218
|
-
) -> collections.abc.Iterator[amulet.core.selection.box.SelectionBox]:
|
|
219
|
-
"""
|
|
220
|
-
An iterator of the :class:`SelectionBox` instances stored for this group.
|
|
221
|
-
"""
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <amulet/core/dll.hpp>
|
|
4
|
+
|
|
5
|
+
#include "shape.hpp"
|
|
6
|
+
|
|
7
|
+
namespace Amulet {
|
|
8
|
+
|
|
9
|
+
class AMULET_CORE_EXPORT SelectionCuboid : public SelectionShape {
|
|
10
|
+
public:
|
|
11
|
+
SelectionCuboid();
|
|
12
|
+
SelectionCuboid(const Matrix4x4&);
|
|
13
|
+
|
|
14
|
+
SelectionCuboid(
|
|
15
|
+
double min_x,
|
|
16
|
+
double min_y,
|
|
17
|
+
double min_z,
|
|
18
|
+
double size_x,
|
|
19
|
+
double size_y,
|
|
20
|
+
double size_z
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
SelectionCuboid(const SelectionCuboid& other);
|
|
24
|
+
|
|
25
|
+
std::string serialise() const override;
|
|
26
|
+
|
|
27
|
+
std::unique_ptr<SelectionShape> copy() const override;
|
|
28
|
+
explicit operator std::set<SelectionBox>() const override;
|
|
29
|
+
|
|
30
|
+
// Transform
|
|
31
|
+
SelectionCuboid translate_cuboid(double dx, double dy, double dz) const;
|
|
32
|
+
SelectionCuboid transform_cuboid(const Matrix4x4&) const;
|
|
33
|
+
std::unique_ptr<SelectionShape> transform(const Matrix4x4&) const override;
|
|
34
|
+
|
|
35
|
+
bool almost_equal(const SelectionCuboid&) const;
|
|
36
|
+
bool almost_equal(const SelectionShape&) const override;
|
|
37
|
+
bool operator==(const SelectionCuboid&) const;
|
|
38
|
+
bool operator==(const SelectionShape&) const override;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace Amulet
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import amulet.core.selection.shape
|
|
6
|
+
import amulet.utils.matrix
|
|
7
|
+
|
|
8
|
+
__all__: list[str] = ["SelectionCuboid"]
|
|
9
|
+
|
|
10
|
+
class SelectionCuboid(amulet.core.selection.shape.SelectionShape):
|
|
11
|
+
"""
|
|
12
|
+
The SelectionCuboid class represents a single spherical selection.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@typing.overload
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
min_x: typing.SupportsFloat,
|
|
19
|
+
min_y: typing.SupportsFloat,
|
|
20
|
+
min_z: typing.SupportsFloat,
|
|
21
|
+
size_x: typing.SupportsFloat,
|
|
22
|
+
size_y: typing.SupportsFloat,
|
|
23
|
+
size_z: typing.SupportsFloat,
|
|
24
|
+
) -> None: ...
|
|
25
|
+
@typing.overload
|
|
26
|
+
def __init__(self, matrix: amulet.utils.matrix.Matrix4x4) -> None: ...
|
|
27
|
+
def __repr__(self) -> str: ...
|
|
28
|
+
def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionCuboid:
|
|
29
|
+
"""
|
|
30
|
+
Create a new :class:`SelectionCuboid` based on this one transformed by the given matrix.
|
|
31
|
+
|
|
32
|
+
:param matrix: The matrix to transform by.
|
|
33
|
+
:return: The new selection with the added transform.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def translate(
|
|
37
|
+
self,
|
|
38
|
+
dx: typing.SupportsFloat,
|
|
39
|
+
dy: typing.SupportsFloat,
|
|
40
|
+
dz: typing.SupportsFloat,
|
|
41
|
+
) -> SelectionCuboid:
|
|
42
|
+
"""
|
|
43
|
+
Create a new :class:`SelectionCuboid` based on this one with the coordinates moved by the given offset.
|
|
44
|
+
|
|
45
|
+
:param dx: The x offset.
|
|
46
|
+
:param dy: The y offset.
|
|
47
|
+
:param dz: The z offset.
|
|
48
|
+
:return: The new selection with the given offset.
|
|
49
|
+
"""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <cstdint>
|
|
3
|
+
|
|
4
|
+
#include <amulet/core/dll.hpp>
|
|
5
|
+
|
|
6
|
+
#include "shape.hpp"
|
|
7
|
+
|
|
8
|
+
namespace Amulet {
|
|
9
|
+
|
|
10
|
+
class SelectionBox;
|
|
11
|
+
|
|
12
|
+
// The SelectionEllipsoid class represents a single spherical selection.
|
|
13
|
+
class AMULET_CORE_EXPORT SelectionEllipsoid : public SelectionShape {
|
|
14
|
+
public:
|
|
15
|
+
SelectionEllipsoid();
|
|
16
|
+
SelectionEllipsoid(const Matrix4x4&);
|
|
17
|
+
|
|
18
|
+
SelectionEllipsoid(
|
|
19
|
+
double x,
|
|
20
|
+
double y,
|
|
21
|
+
double z,
|
|
22
|
+
double radius);
|
|
23
|
+
|
|
24
|
+
SelectionEllipsoid(const SelectionEllipsoid& other);
|
|
25
|
+
|
|
26
|
+
std::string serialise() const override;
|
|
27
|
+
|
|
28
|
+
std::unique_ptr<SelectionShape> copy() const override;
|
|
29
|
+
explicit operator std::set<SelectionBox>() const override;
|
|
30
|
+
|
|
31
|
+
// Transform
|
|
32
|
+
SelectionEllipsoid translate_ellipsoid(double dx, double dy, double dz) const;
|
|
33
|
+
SelectionEllipsoid transform_ellipsoid(const Matrix4x4&) const;
|
|
34
|
+
std::unique_ptr<SelectionShape> transform(const Matrix4x4&) const override;
|
|
35
|
+
|
|
36
|
+
bool almost_equal(const SelectionEllipsoid&) const;
|
|
37
|
+
bool almost_equal(const SelectionShape&) const override;
|
|
38
|
+
bool operator==(const SelectionEllipsoid&) const;
|
|
39
|
+
bool operator==(const SelectionShape&) const override;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace Amulet
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import amulet.core.selection.shape
|
|
6
|
+
import amulet.utils.matrix
|
|
7
|
+
|
|
8
|
+
__all__: list[str] = ["SelectionEllipsoid"]
|
|
9
|
+
|
|
10
|
+
class SelectionEllipsoid(amulet.core.selection.shape.SelectionShape):
|
|
11
|
+
"""
|
|
12
|
+
The SelectionEllipsoid class represents a single ellipsoid selection.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@typing.overload
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
x: typing.SupportsFloat,
|
|
19
|
+
y: typing.SupportsFloat,
|
|
20
|
+
z: typing.SupportsFloat,
|
|
21
|
+
radius: typing.SupportsFloat,
|
|
22
|
+
) -> None: ...
|
|
23
|
+
@typing.overload
|
|
24
|
+
def __init__(self, matrix: amulet.utils.matrix.Matrix4x4) -> None: ...
|
|
25
|
+
def __repr__(self) -> str: ...
|
|
26
|
+
def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionEllipsoid:
|
|
27
|
+
"""
|
|
28
|
+
Create a new :class:`SelectionEllipsoid` based on this one transformed by the given matrix.
|
|
29
|
+
|
|
30
|
+
:param matrix: The matrix to transform by.
|
|
31
|
+
:return: The new selection with the added transform.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def translate(
|
|
35
|
+
self,
|
|
36
|
+
dx: typing.SupportsFloat,
|
|
37
|
+
dy: typing.SupportsFloat,
|
|
38
|
+
dz: typing.SupportsFloat,
|
|
39
|
+
) -> SelectionEllipsoid:
|
|
40
|
+
"""
|
|
41
|
+
Create a new :class:`SelectionEllipsoid` based on this one with the coordinates moved by the given offset.
|
|
42
|
+
|
|
43
|
+
:param dx: The x offset.
|
|
44
|
+
:param dy: The y offset.
|
|
45
|
+
:param dz: The z offset.
|
|
46
|
+
:return: The new selection with the given offset.
|
|
47
|
+
"""
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <functional>
|
|
4
|
+
#include <list>
|
|
5
|
+
#include <memory>
|
|
6
|
+
#include <optional>
|
|
7
|
+
#include <set>
|
|
8
|
+
#include <string>
|
|
9
|
+
#include <string_view>
|
|
10
|
+
#include <utility>
|
|
11
|
+
|
|
12
|
+
#include <amulet/utils/matrix.hpp>
|
|
13
|
+
|
|
14
|
+
#include <amulet/core/dll.hpp>
|
|
15
|
+
|
|
16
|
+
namespace Amulet {
|
|
17
|
+
|
|
18
|
+
class SelectionBox;
|
|
19
|
+
class SelectionBoxGroup;
|
|
20
|
+
|
|
21
|
+
class AMULET_CORE_EXPORT SelectionShape {
|
|
22
|
+
private:
|
|
23
|
+
Matrix4x4 _matrix;
|
|
24
|
+
|
|
25
|
+
public:
|
|
26
|
+
SelectionShape() = default;
|
|
27
|
+
SelectionShape(const Matrix4x4& matrix)
|
|
28
|
+
: _matrix(matrix)
|
|
29
|
+
{
|
|
30
|
+
}
|
|
31
|
+
virtual ~SelectionShape() = default;
|
|
32
|
+
|
|
33
|
+
const Matrix4x4& get_matrix() const;
|
|
34
|
+
void set_matrix(const Matrix4x4&);
|
|
35
|
+
|
|
36
|
+
// Convert the class to human readable plain text.
|
|
37
|
+
virtual std::string serialise() const = 0;
|
|
38
|
+
|
|
39
|
+
// Deserialise the serialised data back to an object.
|
|
40
|
+
static std::unique_ptr<SelectionShape> deserialise(std::string_view, size_t&);
|
|
41
|
+
static std::unique_ptr<SelectionShape> deserialise(std::string_view);
|
|
42
|
+
|
|
43
|
+
using Deserialiser = std::function<
|
|
44
|
+
std::unique_ptr<SelectionShape>(std::string_view, size_t&)>;
|
|
45
|
+
|
|
46
|
+
static bool register_deserialiser(Deserialiser);
|
|
47
|
+
|
|
48
|
+
// Create a copy of the class.
|
|
49
|
+
virtual std::unique_ptr<SelectionShape> copy() const = 0;
|
|
50
|
+
|
|
51
|
+
explicit operator std::unique_ptr<SelectionShape>() const
|
|
52
|
+
{
|
|
53
|
+
return copy();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Convert the shape into unit voxels.
|
|
57
|
+
virtual explicit operator std::set<SelectionBox>() const = 0;
|
|
58
|
+
explicit operator SelectionBoxGroup() const;
|
|
59
|
+
SelectionBoxGroup voxelise() const;
|
|
60
|
+
|
|
61
|
+
// translate and transform
|
|
62
|
+
virtual std::unique_ptr<SelectionShape> transform(const Matrix4x4&) const = 0;
|
|
63
|
+
std::unique_ptr<SelectionShape> translate(double dx, double dy, double dz) const
|
|
64
|
+
{
|
|
65
|
+
return transform(Matrix4x4::translation_matrix(dx, dy, dz));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Equality
|
|
69
|
+
virtual bool almost_equal(const SelectionShape&) const = 0;
|
|
70
|
+
virtual bool operator==(const SelectionShape&) const = 0;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace Amulet
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import types
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import amulet.core.selection.box_group
|
|
7
|
+
import amulet.utils.matrix
|
|
8
|
+
|
|
9
|
+
__all__: list[str] = ["SelectionShape"]
|
|
10
|
+
|
|
11
|
+
class SelectionShape:
|
|
12
|
+
"""
|
|
13
|
+
A base class for selection classes.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
17
|
+
matrix: amulet.utils.matrix.Matrix4x4
|
|
18
|
+
@staticmethod
|
|
19
|
+
def deserialise(s: str) -> SelectionShape:
|
|
20
|
+
"""
|
|
21
|
+
Deserialise the serialised data back to an object.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
@typing.overload
|
|
25
|
+
def __eq__(self, other: SelectionShape) -> bool: ...
|
|
26
|
+
@typing.overload
|
|
27
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
28
|
+
def almost_equal(self, other: SelectionShape) -> bool:
|
|
29
|
+
"""
|
|
30
|
+
Check if this shape is equal or almost equal to another shape.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def serialise(self) -> str:
|
|
34
|
+
"""
|
|
35
|
+
Convert the class to human readable plain text.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def transform(self, matrix: amulet.utils.matrix.Matrix4x4) -> SelectionShape:
|
|
39
|
+
"""
|
|
40
|
+
Translate the shape by the given matrix
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def translate(
|
|
44
|
+
self,
|
|
45
|
+
dx: typing.SupportsFloat,
|
|
46
|
+
dy: typing.SupportsFloat,
|
|
47
|
+
dz: typing.SupportsFloat,
|
|
48
|
+
) -> SelectionShape:
|
|
49
|
+
"""
|
|
50
|
+
Translate the shape by the given amount
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
def voxelise(self) -> amulet.core.selection.box_group.SelectionBoxGroup:
|
|
54
|
+
"""
|
|
55
|
+
Convert the selection to a SelectionBoxGroup.
|
|
56
|
+
"""
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <string_view>
|
|
6
|
+
#include <vector>
|
|
7
|
+
|
|
8
|
+
#include <amulet/core/dll.hpp>
|
|
9
|
+
|
|
10
|
+
#include "shape.hpp"
|
|
11
|
+
|
|
12
|
+
namespace Amulet {
|
|
13
|
+
|
|
14
|
+
class SelectionBox;
|
|
15
|
+
class SelectionBoxGroup;
|
|
16
|
+
|
|
17
|
+
class AMULET_CORE_EXPORT SelectionShapeGroup {
|
|
18
|
+
private:
|
|
19
|
+
std::vector<std::shared_ptr<SelectionShape>> _shapes;
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
SelectionShapeGroup();
|
|
23
|
+
SelectionShapeGroup(std::vector<std::shared_ptr<SelectionShape>> shapes);
|
|
24
|
+
|
|
25
|
+
SelectionShapeGroup(const SelectionShapeGroup&);
|
|
26
|
+
SelectionShapeGroup& operator=(const SelectionShapeGroup&);
|
|
27
|
+
|
|
28
|
+
SelectionShapeGroup(SelectionShapeGroup&&);
|
|
29
|
+
SelectionShapeGroup& operator=(SelectionShapeGroup&&);
|
|
30
|
+
|
|
31
|
+
SelectionShapeGroup deep_copy() const;
|
|
32
|
+
|
|
33
|
+
std::string serialise() const;
|
|
34
|
+
static SelectionShapeGroup deserialise(std::string_view);
|
|
35
|
+
|
|
36
|
+
const std::vector<std::shared_ptr<SelectionShape>>& get_shapes() const
|
|
37
|
+
{
|
|
38
|
+
return _shapes;
|
|
39
|
+
}
|
|
40
|
+
std::vector<std::shared_ptr<SelectionShape>>& get_shapes()
|
|
41
|
+
{
|
|
42
|
+
return _shapes;
|
|
43
|
+
}
|
|
44
|
+
void set_shapes(std::vector<std::shared_ptr<SelectionShape>> shapes)
|
|
45
|
+
{
|
|
46
|
+
_shapes = std::move(shapes);
|
|
47
|
+
}
|
|
48
|
+
std::vector<std::shared_ptr<SelectionShape>>::const_iterator begin() const
|
|
49
|
+
{
|
|
50
|
+
return _shapes.begin();
|
|
51
|
+
}
|
|
52
|
+
std::vector<std::shared_ptr<SelectionShape>>::const_iterator end() const
|
|
53
|
+
{
|
|
54
|
+
return _shapes.end();
|
|
55
|
+
}
|
|
56
|
+
operator bool() const
|
|
57
|
+
{
|
|
58
|
+
return !_shapes.empty();
|
|
59
|
+
}
|
|
60
|
+
size_t count() const
|
|
61
|
+
{
|
|
62
|
+
return _shapes.size();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
explicit operator SelectionBoxGroup() const;
|
|
66
|
+
explicit operator std::set<SelectionBox>() const;
|
|
67
|
+
SelectionBoxGroup voxelise() const;
|
|
68
|
+
|
|
69
|
+
bool almost_equal(const SelectionShapeGroup&) const;
|
|
70
|
+
bool operator==(const SelectionShapeGroup&) const;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import collections.abc
|
|
4
|
+
import types
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import amulet.core.selection.box_group
|
|
8
|
+
import amulet.core.selection.shape
|
|
9
|
+
|
|
10
|
+
__all__: list[str] = ["SelectionShapeGroup"]
|
|
11
|
+
|
|
12
|
+
class SelectionShapeGroup:
|
|
13
|
+
"""
|
|
14
|
+
A group of selection shapes.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
18
|
+
@staticmethod
|
|
19
|
+
def deserialise(s: str) -> SelectionShapeGroup: ...
|
|
20
|
+
def __bool__(self) -> bool:
|
|
21
|
+
"""
|
|
22
|
+
Are there any selections in the group.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __contains__(self, item: typing.Any) -> bool: ...
|
|
26
|
+
def __copy__(self) -> SelectionShapeGroup: ...
|
|
27
|
+
def __deepcopy__(self, memo: dict) -> SelectionShapeGroup: ...
|
|
28
|
+
def __delitem__(self, index: typing.SupportsInt) -> None: ...
|
|
29
|
+
@typing.overload
|
|
30
|
+
def __eq__(self, other: SelectionShapeGroup) -> bool: ...
|
|
31
|
+
@typing.overload
|
|
32
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
33
|
+
@typing.overload
|
|
34
|
+
def __getitem__(
|
|
35
|
+
self, index: typing.SupportsInt
|
|
36
|
+
) -> amulet.core.selection.shape.SelectionShape: ...
|
|
37
|
+
@typing.overload
|
|
38
|
+
def __getitem__(
|
|
39
|
+
self, item: slice
|
|
40
|
+
) -> list[amulet.core.selection.shape.SelectionShape]: ...
|
|
41
|
+
def __iadd__(
|
|
42
|
+
self,
|
|
43
|
+
values: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
|
|
44
|
+
) -> typing.Any: ...
|
|
45
|
+
@typing.overload
|
|
46
|
+
def __init__(self) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Create an empty SelectionShapeGroup.
|
|
49
|
+
|
|
50
|
+
>>> SelectionShapeGroup()
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
@typing.overload
|
|
54
|
+
def __init__(
|
|
55
|
+
self, box_group: amulet.core.selection.box_group.SelectionBoxGroup
|
|
56
|
+
) -> None: ...
|
|
57
|
+
@typing.overload
|
|
58
|
+
def __init__(
|
|
59
|
+
self,
|
|
60
|
+
shapes: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
|
|
61
|
+
) -> None:
|
|
62
|
+
"""
|
|
63
|
+
Create a SelectionShapeGroup from the selections in the iterable.
|
|
64
|
+
|
|
65
|
+
>>> SelectionShapeGroup([
|
|
66
|
+
>>> SelectionCuboid(0, 0, 0, 5, 5, 5),
|
|
67
|
+
>>> SelectionEllipsoid(7.5, 0, 0, 2.5)
|
|
68
|
+
>>> ])
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
def __iter__(
|
|
72
|
+
self,
|
|
73
|
+
) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]: ...
|
|
74
|
+
def __len__(self) -> int:
|
|
75
|
+
"""
|
|
76
|
+
The number of :class:`SelectionShape` classes in the group.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
def __repr__(self) -> str: ...
|
|
80
|
+
def __reversed__(
|
|
81
|
+
self,
|
|
82
|
+
) -> collections.abc.Iterator[amulet.core.selection.shape.SelectionShape]: ...
|
|
83
|
+
def __setitem__(
|
|
84
|
+
self,
|
|
85
|
+
index: typing.SupportsInt,
|
|
86
|
+
item: amulet.core.selection.shape.SelectionShape,
|
|
87
|
+
) -> None: ...
|
|
88
|
+
def almost_equal(self, other: SelectionShapeGroup) -> bool:
|
|
89
|
+
"""
|
|
90
|
+
Returns True of the shape groups are equal or almost equal.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
def append(self, value: amulet.core.selection.shape.SelectionShape) -> None: ...
|
|
94
|
+
def clear(self) -> None: ...
|
|
95
|
+
def count(self, value: amulet.core.selection.shape.SelectionShape) -> int: ...
|
|
96
|
+
def extend(
|
|
97
|
+
self,
|
|
98
|
+
values: collections.abc.Iterable[amulet.core.selection.shape.SelectionShape],
|
|
99
|
+
) -> None: ...
|
|
100
|
+
def index(
|
|
101
|
+
self,
|
|
102
|
+
value: amulet.core.selection.shape.SelectionShape,
|
|
103
|
+
start: typing.SupportsInt = 0,
|
|
104
|
+
stop: typing.SupportsInt = 9223372036854775807,
|
|
105
|
+
) -> int: ...
|
|
106
|
+
def insert(
|
|
107
|
+
self,
|
|
108
|
+
index: typing.SupportsInt,
|
|
109
|
+
item: amulet.core.selection.shape.SelectionShape,
|
|
110
|
+
) -> None: ...
|
|
111
|
+
def pop(self, index: typing.SupportsInt = -1) -> typing.Any: ...
|
|
112
|
+
def remove(self, value: amulet.core.selection.shape.SelectionShape) -> None: ...
|
|
113
|
+
def reverse(self) -> None: ...
|
|
114
|
+
def serialise(self) -> str: ...
|
|
115
|
+
def voxelise(self) -> amulet.core.selection.box_group.SelectionBoxGroup:
|
|
116
|
+
"""
|
|
117
|
+
Convert the shapes to a SelectionBoxGroup.
|
|
118
|
+
"""
|
amulet/core/version/__init__.pyi
CHANGED
|
@@ -5,7 +5,7 @@ import types
|
|
|
5
5
|
import typing
|
|
6
6
|
from builtins import str as PlatformType
|
|
7
7
|
|
|
8
|
-
__all__ = [
|
|
8
|
+
__all__: list[str] = [
|
|
9
9
|
"PlatformType",
|
|
10
10
|
"PlatformVersionContainer",
|
|
11
11
|
"VersionNumber",
|
|
@@ -51,9 +51,9 @@ class VersionNumber:
|
|
|
51
51
|
|
|
52
52
|
def __contains__(self, arg0: typing.SupportsInt) -> bool: ...
|
|
53
53
|
@typing.overload
|
|
54
|
-
def __eq__(self,
|
|
54
|
+
def __eq__(self, other: VersionNumber) -> bool: ...
|
|
55
55
|
@typing.overload
|
|
56
|
-
def __eq__(self,
|
|
56
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
57
57
|
def __ge__(self, arg0: VersionNumber) -> bool: ...
|
|
58
58
|
@typing.overload
|
|
59
59
|
def __getitem__(self, item: typing.SupportsInt) -> int: ...
|
|
@@ -94,9 +94,9 @@ class VersionRange:
|
|
|
94
94
|
|
|
95
95
|
__hash__: typing.ClassVar[None] = None # type: ignore
|
|
96
96
|
@typing.overload
|
|
97
|
-
def __eq__(self,
|
|
97
|
+
def __eq__(self, other: VersionRange) -> bool: ...
|
|
98
98
|
@typing.overload
|
|
99
|
-
def __eq__(self,
|
|
99
|
+
def __eq__(self, other: typing.Any) -> bool | types.NotImplementedType: ...
|
|
100
100
|
def __init__(
|
|
101
101
|
self, platform: str, min_version: VersionNumber, max_version: VersionNumber
|
|
102
102
|
) -> None: ...
|