From 01901bd0b40b09b2838eb364280e9b1085ffbe2a Mon Sep 17 00:00:00 2001 From: Tao Schiro Date: Wed, 18 Nov 2026 11:56:23 +0100 Subject: [PATCH 1/4] feat(orientation_widget): "none" marker hides the orientation widget set_orientation_widget accepts "none": the VTK orientation widget is disabled, so a front can draw its own orientation marker (OpenGeodeWeb-Front ogwFront.orientationOverlay). The visibility flag that VTK resets when disabling the widget is restored, so switching back to axes or compass keeps it. Schemas regenerated. --- opengeodeweb_viewer_schemas.json | 3 +- opengeodeweb_viewer_typed_schemas.d.ts | 2 +- src/opengeodeweb_viewer/orientation_marker.py | 3 ++ .../schemas/set_orientation_widget.json | 3 +- .../viewer/schemas/set_orientation_widget.py | 1 + .../rpc/viewer/viewer_protocols.py | 10 +++++-- tests/test_viewer_protocols.py | 30 +++++++++++++++++++ 7 files changed, 47 insertions(+), 5 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index d0cf0494..c8645b46 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -4964,7 +4964,8 @@ "type": "string", "enum": [ "axes", - "compass" + "compass", + "none" ] } }, diff --git a/opengeodeweb_viewer_typed_schemas.d.ts b/opengeodeweb_viewer_typed_schemas.d.ts index 9181c7f1..a75be255 100644 --- a/opengeodeweb_viewer_typed_schemas.d.ts +++ b/opengeodeweb_viewer_typed_schemas.d.ts @@ -1346,7 +1346,7 @@ export interface ViewerSetOrientationWidgetParams { marker: Marker; } -export type Marker = "axes" | "compass"; +export type Marker = "axes" | "compass" | "none"; export interface ViewerSetOrientationWidgetResponse { } diff --git a/src/opengeodeweb_viewer/orientation_marker.py b/src/opengeodeweb_viewer/orientation_marker.py index d46c713f..cf28633f 100644 --- a/src/opengeodeweb_viewer/orientation_marker.py +++ b/src/opengeodeweb_viewer/orientation_marker.py @@ -15,6 +15,9 @@ from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm from vtkmodules.vtkRenderingCore import vtkProp, vtkTextProperty +# Marker value hiding the VTK orientation marker, for fronts drawing their own +NO_MARKER = "none" + # VTK's own caption look, kept while the scene text style is the default one DEFAULT_CAPTION_COLOR = (1.0, 1.0, 1.0) diff --git a/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.json b/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.json index 636f18a6..3f2669fd 100644 --- a/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.json +++ b/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.json @@ -6,7 +6,8 @@ "type": "string", "enum": [ "axes", - "compass" + "compass", + "none" ] } }, diff --git a/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.py b/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.py index 043b2085..663c2604 100644 --- a/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.py +++ b/src/opengeodeweb_viewer/rpc/viewer/schemas/set_orientation_widget.py @@ -9,6 +9,7 @@ class Marker(Enum): AXES = "axes" COMPASS = "compass" + NONE = "none" @dataclass diff --git a/src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py b/src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py index 06f31df2..c51c4ef3 100644 --- a/src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py +++ b/src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py @@ -32,7 +32,7 @@ ) from vtkmodules.vtkRenderingUI import vtkGenericRenderWindowInteractor -from opengeodeweb_viewer.orientation_marker import build_marker, style_marker +from opengeodeweb_viewer.orientation_marker import NO_MARKER, build_marker, style_marker from opengeodeweb_viewer.rpc.viewer import schemas from opengeodeweb_viewer.text_style import TextStyle from opengeodeweb_viewer.typed_rpc import typed_rpc @@ -138,9 +138,15 @@ def update_orientation_widget( if widget is None: return schemas.SetOrientationWidgetResponse() visibility = widget.GetOrientationMarker().GetVisibility() + widget.EnabledOff() + if params.marker.value == NO_MARKER: + # The front draws its own marker. Disabling the widget hides the current marker and + # resets its visibility flag: restore it, so axes toggles keep applying to it until + # a VTK marker is requested again + widget.GetOrientationMarker().SetVisibility(visibility) + return schemas.SetOrientationWidgetResponse() marker = build_marker(params.marker.value) style_marker(marker, self.get_scene_text_style()) - widget.EnabledOff() widget.SetOrientationMarker(marker) widget.EnabledOn() widget.InteractiveOff() diff --git a/tests/test_viewer_protocols.py b/tests/test_viewer_protocols.py index 7e8538b1..039d6283 100644 --- a/tests/test_viewer_protocols.py +++ b/tests/test_viewer_protocols.py @@ -371,6 +371,36 @@ def test_orientation_widget_keeps_visibility(server: ServerMonitor) -> None: assert server.compare_image("viewer/axes_off.jpeg") +def test_set_orientation_widget_none(server: ServerMonitor) -> None: + test_reset_visualization(server) + orientation_widget_rpc = ( + VtkViewerView.viewer_prefix + + VtkViewerView.viewer_schemas_dict["set_orientation_widget"]["rpc"] + ) + server.call(orientation_widget_rpc, [{"marker": "none"}]) + assert server.compare_image("viewer/axes_off.jpeg") + + server.call(orientation_widget_rpc, [{"marker": "axes"}]) + assert server.compare_image("viewer/reset_visualization.jpeg") + + +def test_orientation_widget_none_keeps_visibility(server: ServerMonitor) -> None: + test_reset_visualization(server) + orientation_widget_rpc = ( + VtkViewerView.viewer_prefix + + VtkViewerView.viewer_schemas_dict["set_orientation_widget"]["rpc"] + ) + server.call(orientation_widget_rpc, [{"marker": "none"}]) + server.call( + VtkViewerView.viewer_prefix + VtkViewerView.viewer_schemas_dict["axes"]["rpc"], + [{"visibility": False}], + ) + assert server.compare_image("viewer/axes_off.jpeg") + + server.call(orientation_widget_rpc, [{"marker": "axes"}]) + assert server.compare_image("viewer/axes_off.jpeg") + + def test_update_camera(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: test_register_mesh(server, dataset_factory) From 29de8a602adb6e40d3d89cd12cfb64019e863b05 Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Wed, 18 Nov 2026 10:57:18 +0000 Subject: [PATCH 2/4] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7821d149..0e8e27eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -61,4 +61,3 @@ wslink==2.6.0 yarl==1.* # via aiohttp -opengeodeweb-microservice==1.*,>=1.3.2 From 5268f22a18bd4420da1dac0c7a3f80940609599f Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:06:50 +0000 Subject: [PATCH 3/4] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1d86f2d5..0e8e27eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -61,4 +61,3 @@ wslink==2.6.0 yarl==1.* # via aiohttp -opengeodeweb-microservice==1.*,>=1.3.3rc1 From dcf844b901f91624e175816505b993b2bbc234ec Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Thu, 19 Nov 2026 12:49:18 +0000 Subject: [PATCH 4/4] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e87b5c40..0e8e27eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -61,4 +61,3 @@ wslink==2.6.0 yarl==1.* # via aiohttp -opengeodeweb-microservice==1.*,>=1.3.3