Skip to content

Commit

Permalink
Issue #46 assign key "n" for resetting object visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Mar 13, 2019
1 parent a97021a commit 9b5efd5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions geomdl/visualization/VisVTK.py
Expand Up @@ -51,10 +51,11 @@ def keypress_callback(self, obj, ev):
* ``f``: fly to point (click somewhere in the window and press to fly)
* ``r``: reset the camera
* ``s`` and ``w``: switch between solid and wireframe modes
* ``d``: print debug information (of picked object, point, etc.)
* ``b``: change background color
* ``arrow keys``: pan the model
* ``h``: change object visibility
* ``d``: print debug information (of picked object, point, etc.)
* ``n``: reset object visibility
* ``arrow keys``: pan the model
Please refer to `vtkInteractorStyle <https://vtk.org/doc/nightly/html/classvtkInteractorStyle.html>`_ class
reference for more details.
Expand Down Expand Up @@ -96,9 +97,14 @@ def keypress_callback(self, obj, ev):
print("Name:", actor.GetMapper().GetArrayName())
print("Index:", actor.GetMapper().GetArrayId())
print("Selected point:", picker.GetSelectionPoint()[0:2])
print("# of visible actors:", renderer.VisibleActorCount())
if key == 'h':
if actor is not None:
actor.SetVisibility(not actor.GetVisibility())
if key == 'n':
actors = renderer.GetActors() # vtkActorCollection
for actor in actors:
actor.VisibilityOn()

# Update render window
render_window.Render()
Expand Down

0 comments on commit 9b5efd5

Please sign in to comment.