Skip to content

Commit bc6c54f

Browse files
committed
revert
1 parent f111e56 commit bc6c54f

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
validate_schema,
1212
RpcParams,
1313
RpcParamsWithColor,
14-
JsonValue,
1514
)
1615
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
1716

@@ -25,24 +24,18 @@ class VtkMeshPointsView(VtkMeshView):
2524
def __init__(self) -> None:
2625
super().__init__()
2726

28-
@exportRpc(
29-
mesh_points_prefix + cast(str, mesh_points_schemas_dict["visibility"]["rpc"])
30-
)
27+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["visibility"]["rpc"])
3128
def setMeshPointsVisibility(self, params: RpcParams) -> None:
3229
validate_schema(
33-
params,
34-
cast(dict[str, JsonValue], self.mesh_points_schemas_dict["visibility"]),
35-
self.mesh_points_prefix,
30+
params, self.mesh_points_schemas_dict["visibility"], self.mesh_points_prefix
3631
)
3732
id, visibility = params["id"], params["visibility"]
3833
self.SetPointsVisibility(id, visibility)
3934

40-
@exportRpc(mesh_points_prefix + cast(str, mesh_points_schemas_dict["color"]["rpc"]))
35+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["color"]["rpc"])
4136
def setMeshPointsColor(self, params: RpcParamsWithColor) -> None:
4237
validate_schema(
43-
params,
44-
cast(dict[str, JsonValue], self.mesh_points_schemas_dict["color"]),
45-
self.mesh_points_prefix,
38+
params, self.mesh_points_schemas_dict["color"], self.mesh_points_prefix
4639
)
4740
id, red, green, blue = (
4841
params["id"],
@@ -52,26 +45,19 @@ def setMeshPointsColor(self, params: RpcParamsWithColor) -> None:
5245
)
5346
self.SetPointsColor(id, red, green, blue)
5447

55-
@exportRpc(mesh_points_prefix + cast(str, mesh_points_schemas_dict["size"]["rpc"]))
48+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["size"]["rpc"])
5649
def setMeshPointsSize(self, params: RpcParams) -> None:
5750
validate_schema(
58-
params,
59-
cast(dict[str, JsonValue], self.mesh_points_schemas_dict["size"]),
60-
self.mesh_points_prefix,
51+
params, self.mesh_points_schemas_dict["size"], self.mesh_points_prefix
6152
)
6253
id, size = params["id"], params["size"]
6354
self.SetPointsSize(id, size)
6455

65-
@exportRpc(
66-
mesh_points_prefix
67-
+ cast(str, mesh_points_schemas_dict["vertex_attribute"]["rpc"])
68-
)
56+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["vertex_attribute"]["rpc"])
6957
def setMeshPointsVertexAttribute(self, params: RpcParams) -> None:
7058
validate_schema(
7159
params,
72-
cast(
73-
dict[str, JsonValue], self.mesh_points_schemas_dict["vertex_attribute"]
74-
),
60+
self.mesh_points_schemas_dict["vertex_attribute"],
7561
self.mesh_points_prefix,
7662
)
7763
id, name = params["id"], params["name"]

src/tests/mesh/points/test_mesh_points_protocols.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Standard library imports
2-
from typing import Callable, cast
2+
from typing import Callable
33

44
# Third party imports
55
from src.opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
@@ -20,7 +20,7 @@ def test_points_visibility(
2020

2121
server.call(
2222
VtkMeshPointsView.mesh_points_prefix
23-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["visibility"]["rpc"]),
23+
+ VtkMeshPointsView.mesh_points_schemas_dict["visibility"]["rpc"],
2424
[{"id": mesh_id, "visibility": True}],
2525
)
2626
assert server.compare_image(3, "mesh/points/visibility.jpeg") == True
@@ -34,7 +34,7 @@ def test_points_size(
3434

3535
server.call(
3636
VtkMeshPointsView.mesh_points_prefix
37-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["size"]["rpc"]),
37+
+ VtkMeshPointsView.mesh_points_schemas_dict["size"]["rpc"],
3838
[{"id": mesh_id, "size": 15}],
3939
)
4040
assert server.compare_image(3, "mesh/points/size.jpeg") == True
@@ -48,7 +48,7 @@ def test_points_color(
4848

4949
server.call(
5050
VtkMeshPointsView.mesh_points_prefix
51-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["color"]["rpc"]),
51+
+ VtkMeshPointsView.mesh_points_schemas_dict["color"]["rpc"],
5252
[{"id": mesh_id, "color": {"r": 255, "g": 0, "b": 0}}],
5353
)
5454
assert server.compare_image(3, "mesh/points/color.jpeg") == True
@@ -61,29 +61,28 @@ def test_points_with_point_set(
6161

6262
dataset_factory(id=mesh_id, viewable_file_name="points.vtp")
6363
server.call(
64-
VtkMeshView.mesh_prefix
65-
+ cast(str, VtkMeshView.mesh_schemas_dict["register"]["rpc"]),
64+
VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"],
6665
[{"id": mesh_id}],
6766
)
6867
assert server.compare_image(3, "mesh/points/register_point_set.jpeg") == True
6968

7069
server.call(
7170
VtkMeshPointsView.mesh_points_prefix
72-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["size"]["rpc"]),
71+
+ VtkMeshPointsView.mesh_points_schemas_dict["size"]["rpc"],
7372
[{"id": mesh_id, "size": 10}],
7473
)
7574
assert server.compare_image(3, "mesh/points/point_set_size.jpeg") == True
7675

7776
server.call(
7877
VtkMeshPointsView.mesh_points_prefix
79-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["color"]["rpc"]),
78+
+ VtkMeshPointsView.mesh_points_schemas_dict["color"]["rpc"],
8079
[{"id": mesh_id, "color": {"r": 255, "g": 0, "b": 0}}],
8180
)
8281
assert server.compare_image(3, "mesh/points/point_set_color.jpeg") == True
8382

8483
server.call(
8584
VtkMeshPointsView.mesh_points_prefix
86-
+ cast(str, VtkMeshPointsView.mesh_points_schemas_dict["visibility"]["rpc"]),
85+
+ VtkMeshPointsView.mesh_points_schemas_dict["visibility"]["rpc"],
8786
[{"id": mesh_id, "visibility": False}],
8887
)
8988
assert server.compare_image(3, "mesh/points/point_set_visibility.jpeg") == True

0 commit comments

Comments
 (0)