Permalink
Browse files

Merge pull request #12779 from aeslaughter/peacock-camera-update

Allow the camera motion speed to be controlled
  • Loading branch information...
permcody committed Jan 29, 2019
2 parents fd0f8e8 + 1526e72 commit fc2eb0b0c132c17e7cffb699567e35f1578d96ec
Showing with 6 additions and 2 deletions.
  1. +6 −0 python/chigger/RenderWindow.py
  2. +0 −2 python/chigger/base/KeyPressInteractorStyle.py
@@ -34,6 +34,8 @@ def getOptions():
allow=['interactive', 'modal', 'interactive2D'])
opt.add('test', False, "When True the interaction is disabled and the window closes "
"immediately after rendering.")
opt.add('motion_factor', "Control the interaction motion rate. "
"(calls vtkInteractorStyle::SetMotionFactor)")
opt.add('offscreen', False, "Enable offscreen rendering.")
opt.add('chigger', False, "Places a chigger logo in the lower left corner.")
opt.add('smoothing', False, "Enable VTK render window smoothing options.")
@@ -201,6 +203,10 @@ def update(self, **kwargs):
elif style == 'modal':
self.__vtkinteractor.SetInteractorStyle(vtk.vtkInteractorStyleUser())

if self.isOptionValid('motion_factor'):
self.__vtkinteractor.GetInteractorStyle(). \
SetMotionFactor(self.getOption('motion_factor'))

# Background settings
self._results[0].updateOptions(self._options)

@@ -19,8 +19,6 @@ def __init__(self, parent=None, **kwargs):
self.AddObserver("KeyPressEvent", self.keyPress)
super(KeyPressInteractorStyle, self).__init__(parent, **kwargs)

self.SetMotionFactor(0.1*self.GetMotionFactor())

def keyPress(self, obj, event): #pylint: disable=unused-argument
"""
Executes when a key is pressed.

0 comments on commit fc2eb0b

Please sign in to comment.