Skip to content

Commit

Permalink
Add to default requirements and a partially working triad in the vtk …
Browse files Browse the repository at this point in the history
…plotter
  • Loading branch information
jonnymaserati committed Dec 17, 2023
1 parent 731e3be commit e4e82a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'numpy',
'scipy',
'openpyxl',
'pandas',
'pint',
'pyproj', # required for getting survey parameters
'PyYAML',
Expand All @@ -40,7 +41,6 @@
requirements_easy = set([
'magnetic_field_calculator', # used to get default mag data for survey
'networkx',
'pandas',
'tabulate',
'trimesh',
'utm',
Expand Down
15 changes: 14 additions & 1 deletion welleng/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
from vtkmodules.vtkRenderingCore import (
vtkRenderWindow, vtkRenderWindowInteractor, vtkRenderer
)
from vtkmodules.vtkInteractionWidgets import (
vtkCameraOrientationWidget,
vtkOrientationMarkerWidget
)

from .version import __version__ as VERSION

Expand Down Expand Up @@ -143,7 +147,7 @@ def get_center(self):

return tuple(center)

def show(self, add_axes=True, **kwargs):
def show(self, add_axes=True, orientation_marker=False, **kwargs):
"""
Convenient method for opening a window to view the rendered scene.
"""
Expand Down Expand Up @@ -180,6 +184,15 @@ def show(self, add_axes=True, **kwargs):
self.GetActiveCamera().Zoom(0.8)

interactive = kwargs.get('interactive', True)

if orientation_marker:
cow = vtkCameraOrientationWidget()
cow.SetParentRenderer(self)
# cow.SetDefaultRenderer(self)

cow.Off()
cow.EnabledOn()

if interactive:
renderWindowInteractor.Start()

Expand Down

0 comments on commit e4e82a0

Please sign in to comment.