Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1b038b4
feat(Controller): events for viewer
JulienChampagnol Aug 5, 2026
731ea16
save wip [skip ci]
JulienChampagnol Aug 5, 2026
37fbc9a
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Aug 5, 2026
477631f
feat(Rpc): publish event on stream true
JulienChampagnol Aug 10, 2026
cfecb6b
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Aug 10, 2026
c570af9
Apply prepare changes
JulienChampagnol Aug 10, 2026
8a2ec71
mypy
JulienChampagnol Aug 10, 2026
7975bff
Merge branch 'feat/viewer_app_controller' of https://github.com/Geode…
JulienChampagnol Aug 10, 2026
7eac565
mypy
JulienChampagnol Aug 10, 2026
3bfb84c
mypy
JulienChampagnol Aug 10, 2026
ee74f85
Apply prepare changes
JulienChampagnol Aug 10, 2026
d2b8b6a
mypy again
JulienChampagnol Aug 10, 2026
2df1d12
Merge branch 'feat/viewer_app_controller' of https://github.com/Geode…
JulienChampagnol Aug 10, 2026
768cd64
publish rpc_params automatically
JulienChampagnol Aug 12, 2026
e600184
Apply prepare changes
JulienChampagnol Aug 12, 2026
440cf4d
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Aug 17, 2026
69dac9f
Apply prepare changes
JulienChampagnol Aug 17, 2026
d6423af
return params.to_dict()
JulienChampagnol Aug 17, 2026
60ed10b
Merge branch 'feat/viewer_app_controller' of https://github.com/Geode…
JulienChampagnol Aug 17, 2026
4cd6900
mypy
JulienChampagnol Aug 17, 2026
c88bcf0
test
JulienChampagnol Aug 17, 2026
7fdab4e
test
JulienChampagnol Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ wslink==1.12.4
yarl>=1
# via aiohttp

opengeodeweb-microservice==1.*,>=1.2.1
6 changes: 4 additions & 2 deletions src/opengeodeweb_viewer/rpc/mesh/points/points_protocols.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Standard library imports
from typing import Any
import os

# Third party imports
from wslink import register as exportRpc # type: ignore
from opengeodeweb_viewer.utils_functions import exportRpc
from opengeodeweb_microservice.schemas import get_schemas_dict

# Local application imports
Expand All @@ -24,14 +25,15 @@ def __init__(self) -> None:
super().__init__()

@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["visibility"]["rpc"])
def setMeshPointsVisibility(self, rpc_params: RpcParams) -> None:
def setMeshPointsVisibility(self, rpc_params: RpcParams) -> dict[str, Any]:
validate_schema(
rpc_params,
self.mesh_points_schemas_dict["visibility"],
self.mesh_points_prefix,
)
params = schemas.Visibility.from_dict(rpc_params)
self.SetPointsVisibility(params.id, params.visibility)
return params.to_dict()

@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["color"]["rpc"])
def setMeshPointsColor(self, rpc_params: RpcParams) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import cast, Any

# Third party imports
from wslink import register as exportRpc # type: ignore
from vtkmodules.vtkIOImage import vtkPNGWriter, vtkJPEGWriter
from vtkmodules.vtkRenderingAnnotation import vtkCubeAxesActor, vtkAxesActor
from vtkmodules.vtkRenderingCore import (
Expand All @@ -27,6 +26,7 @@

# Local application imports
from opengeodeweb_viewer.utils_functions import (
exportRpc,
validate_schema,
RpcParams,
)
Expand Down
21 changes: 21 additions & 0 deletions src/opengeodeweb_viewer/utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,34 @@

# Third party imports
import fastjsonschema # type: ignore
import functools
import math
from typing import Any, Callable, TypeVar
from wslink import register # type: ignore
from vtkmodules.vtkRenderingCore import vtkColorTransferFunction

from opengeodeweb_microservice.schemas import SchemaDict

type RpcParams = dict[str, str]

R = TypeVar("R")


def exportRpc(rpc_id: str) -> Callable[[Callable[..., R]], Callable[..., R]]:
def decorator(function: Callable[..., R]) -> Callable[..., R]:
def wrapper(self: Any, *args: Any, **kwargs: Any) -> R:
do_stream = bool(kwargs.pop("stream", False))
print("do_stream", do_stream, flush=True)
result = function(self, *args, **kwargs)
if do_stream:
rpc_params = args[0] if args else None
self.publish(rpc_id, rpc_params)
return result

return register(rpc_id)(wrapper) # type: ignore[no-any-return]

return decorator


def validate_schema(
rpc_params: RpcParams, schema: SchemaDict, prefix: str = ""
Expand Down
Loading