Skip to content

Commit

Permalink
add ui parameter to show command to be passed downstream to VNC rende…
Browse files Browse the repository at this point in the history
…rable (#478)
  • Loading branch information
mariostieriansys authored Nov 14, 2024
1 parent 15609e8 commit 51de884
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ansys/pyensight/core/renderable.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,13 @@ class RenderableVNC(Renderable):
"""Generates an ansys-nexus-viewer component that can be used to connect to the EnSight VNC remote image renderer."""

def __init__(self, *args, **kwargs) -> None:
ui = kwargs.get("ui")
if kwargs.get("ui"):
kwargs.pop("ui")
super().__init__(*args, **kwargs)
self._ui = ui
self._generate_url()
self._rendertype = "remote"
self._ui = kwargs.get("ui")
self.update()

def _update_2023R2_or_less(self):
Expand Down
4 changes: 3 additions & 1 deletion src/ansys/pyensight/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ def show(
aa: int = 4,
fps: float = 30.0,
num_frames: Optional[int] = None,
ui: Optional[str] = "simple",
) -> "renderable.Renderable":
"""Capture the current EnSight scene or otherwise make it available for
display in a web browser.
Expand Down Expand Up @@ -898,7 +899,7 @@ def show(
if self._html_port is None:
raise RuntimeError("No websocketserver has been associated with this Session")

kwargs = dict(
kwargs: Dict[str, Union[float, int, None, str]] = dict(
height=height, width=width, temporal=temporal, aa=aa, fps=fps, num_frames=num_frames
)
if self._jupyter_notebook: # pragma: no cover
Expand All @@ -924,6 +925,7 @@ def show(
else:
render = RenderableSGEO(self, **kwargs)
elif what == "remote":
kwargs["ui"] = ui
render = RenderableVNC(self, **kwargs)
elif what == "remote_scene":
render = RenderableEVSN(self, **kwargs)
Expand Down

0 comments on commit 51de884

Please sign in to comment.