Skip to content

Commit

Permalink
Merge pull request #229 from SciKit-Surgery/228-interaction-vtkoverla…
Browse files Browse the repository at this point in the history
…ywindow

Issue #228, provide constructor arguments for VTK Overlay Window, to control interactions in layers 1 and 3.
  • Loading branch information
MattClarkson committed May 10, 2024
2 parents 6fdce48 + 96d225d commit ff5c6d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-12]
python-ver: [3.8, 3.9]
experimental: [false]
include:
- python-ver: '3.10'
os: ubuntu-latest
experimental: true
- python-ver: '3.10'
os: macos-latest
os: macos-12
experimental: true
- python-ver: '3.10'
os: windows-latest
Expand All @@ -25,7 +25,7 @@ jobs:
os: ubuntu-latest
experimental: true
- python-ver: 3.11
os: macos-latest
os: macos-12
experimental: true
- python-ver: 3.11
os: windows-latest
Expand Down
12 changes: 11 additions & 1 deletion sksurgeryvtk/widgets/vtk_overlay_window.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# pylint: disable=too-many-instance-attributes, no-name-in-module
# pylint: disable=too-many-instance-attributes, no-name-in-module, too-many-statements
# pylint:disable=super-with-arguments, too-many-arguments, line-too-long, too-many-public-methods

"""
Expand Down Expand Up @@ -94,6 +94,8 @@ def __init__(
video_in_layer_2=False, # For backwards compatibility, prior to 3rd Feb 2024.
layer_2_video_mask=None, # For masking in Layer 3
use_depth_peeling=True, # Historically, has defaulted to true.
layer_1_interactive=True, # For backwards compatibility, prior to 3rd Feb 2024.
layer_3_interactive=False # For backwards compatibility, prior to 3rd Feb 2024.
):
"""
Constructs a new VTKOverlayWindow.
Expand Down Expand Up @@ -180,6 +182,10 @@ def __init__(
self.layer_1_renderer = vtk.vtkRenderer()
self.layer_1_renderer.SetLayer(1)
self.layer_1_renderer.LightFollowCameraOn()
if layer_1_interactive:
self.layer_1_renderer.InteractiveOn()
else:
self.layer_1_renderer.InteractiveOff()

# Create and setup layer 2 (masked video) renderer.
self.layer_2_image_actor = vtk.vtkImageActor()
Expand All @@ -196,6 +202,10 @@ def __init__(
self.layer_3_renderer = vtk.vtkRenderer()
self.layer_3_renderer.SetLayer(3)
self.layer_3_renderer.LightFollowCameraOn()
if layer_3_interactive:
self.layer_3_renderer.InteractiveOn()
else:
self.layer_3_renderer.InteractiveOff()

# Create and setup layer 4 (Overlay's, like text annotations) renderer.
self.layer_4_renderer = vtk.vtkRenderer()
Expand Down

0 comments on commit ff5c6d7

Please sign in to comment.