Exemplo n.º 1
0
 def viewAll(self):
     p1 = self._zinc_view.getViewParameters()
     self._zinc_view.getSceneviewer().viewAll()
     p2 = self._zinc_view.getViewParameters()
     c = CommandChangeView(p1, p2)
     c.setCallbackMethod(self._zinc_view.setViewParameters)
     self._undo_redo_stack.push(c)
Exemplo n.º 2
0
    def mouseReleaseEvent(self, event):
        sceneviewer = self._zinc_view.getSceneviewer()
        scene_input = sceneviewer.createSceneviewerinput()
        scene_input.setPosition(event.x(), event.y())
        scene_input.setEventType(Sceneviewerinput.EVENT_TYPE_BUTTON_RELEASE)
        scene_input.setButtonType(button_map[event.button()])

        sceneviewer.processSceneviewerinput(scene_input)
        end_view_parameters = self._zinc_view.getViewParameters()
        c = CommandChangeView(self._start_view_parameters, end_view_parameters)
        c.setCallbackMethod(self._zinc_view.setViewParameters)
        self._undo_redo_stack.push(c)
 def mouseReleaseEvent(self, event):
     if self._start_position is not None:
         # Do undo redo command
         end_view_parameters = self._zinc_view.getViewParameters()
         c = CommandChangeView(self._start_view_parameters, end_view_parameters)
         c.setCallbackMethod(self._zinc_view.setViewParameters)
         self._undo_redo_stack.push(c)
         # Reset start position for when we are tracking the
         # mouse movement even when a button is not pressed.
         self._start_position = None
     else:
         super(Abstract2DHandler, self).mouseReleaseEvent(event)
 def mouseReleaseEvent(self, event):
     if self._start_position is not None:
         # Do undo redo command
         end_view_parameters = self._zinc_view.getViewParameters()
         c = CommandChangeView(self._start_view_parameters,
                               end_view_parameters)
         c.setCallbackMethod(self._zinc_view.setViewParameters)
         self._undo_redo_stack.push(c)
         # Reset start position for when we are tracking the
         # mouse movement even when a button is not pressed.
         self._start_position = None
     else:
         super(Abstract2DHandler, self).mouseReleaseEvent(event)