def removeOnScreenInfo(self): """ Remove on screen info. """ self.onScreenInfoActors.InitTraversal() actor = self.onScreenInfoActors.GetNextItem() while actor is not None: try: self.vtkRen.RemoveActor(actor) except: pass actor = self.onScreenInfoActors.GetNextItem() self.vtkRenWinInteract.ReInitialize() self.onScreenInfoActors = vtk.vtkActor2DCollection()
def removeOnScreenInfo(self): """ Remove on screen info. """ self.onScreenInfoActors.InitTraversal() actor = self.onScreenInfoActors.GetNextItem() while actor is not None: try: self.vtkRen.RemoveActor(actor) except: pass actor = self.onScreenInfoActors.GetNextItem() self.vtkRenWinInteract.ReInitialize() self.onScreenInfoActors = vtk.vtkActor2DCollection()
def __init__(self, mainWindow, index, parent=None): super(RendererWindow, self).__init__(parent) self.parent = parent self.mainWindow = mainWindow self.rendererIndex = index self.setWindowTitle("Render window %d" % index) self.logger = logging.getLogger(__name__) self.closed = False self.slicePlaneActor = None self.blackBackground = False self.currentAAFrames = 2 self.highlighters = {} self.leftClick = False self.rightClick = False self.parallelProjection = False # layout layout = QtGui.QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) self.setLayout(layout) self.currentPipelineIndex = 0 self.currentPipelineString = "Pipeline 0" self.onScreenInfoActors = vtk.vtkActor2DCollection() # toolbar toolbar = QtGui.QToolBar() layout.addWidget(toolbar) # button to displace lattice frame showCellAction = self.createAction("Toggle cell", slot=self.toggleCellFrame, icon="cell_icon.svg", tip="Toggle cell frame visibility") # button to display axes showAxesAction = self.createAction("Toggle axes", slot=self.toggleAxes, icon="axis_icon.svg", tip="Toggle axes visiblity") # reset camera to cell setCamToCellAction = self.createAction("Reset to cell", slot=self.setCameraToCell, icon="oxygen/zoom-fit-best.png", tip="Reset camera to cell") # rotate image rotateViewPoint = self.createAction("Rotate view point", slot=self.rotateViewPoint, icon="oxygen/transform-rotate.png", tip="Rotate view point") # text selector openTextSelectorAction = self.createAction( "On-screen info", self.showTextSelector, icon="oxygen/preferences-desktop-font.png", tip="Show on-screen text selector") # output dialog showOutputDialogAction = self.createAction( "Output dialog", slot=self.showOutputDialog, icon="oxygen/document-save.png", tip="Show output dialog") # background colour backgroundColourAction = self.createAction( "Toggle background colour", slot=self.toggleBackgroundColour, icon="oxygen/preferences-desktop-display-color.png", tip="Toggle background colour") # aa up aaUpAction = self.createAction("Increase anti-aliasing", slot=self.increaseAA, icon="oxygen/go-up.png", tip="Increase anti-aliasing") # aa up aaDownAction = self.createAction("Decrease anti-aliasing", slot=self.decreaseAA, icon="oxygen/go-down.png", tip="Decrease anti-aliasing") # camera settings cameraSettingsAction = self.createAction( "Camera settings", slot=self.showCameraSettings, icon="oxygen/camera-photo.png", tip="Show camera settings") # parallel projection action projectionAction = self.createAction("Parallel projection", slot=self.toggleProjection, icon="perspective-ava.svg", tip="Parallel projection", checkable=True) # add actions self.addActions( toolbar, (showCellAction, showAxesAction, backgroundColourAction, None, setCamToCellAction, rotateViewPoint, cameraSettingsAction, projectionAction, None, openTextSelectorAction, showOutputDialogAction, None, aaUpAction, aaDownAction)) # VTK render window self.vtkRenWin = vtk.vtkRenderWindow() # VTK interactor iren = vtkWindow.VTKRenWinInteractOverride() iren.SetRenderWindow(self.vtkRenWin) self.vtkRenWinInteract = vtkWindow.VTKWindow(self, rw=self.vtkRenWin, iren=iren) # interactor style self.vtkRenWinInteract._Iren.SetInteractorStyle( vtk.vtkInteractorStyleTrackballCamera()) # disable wheel event? self.vtkRenWinInteract.changeDisableMouseWheel( self.mainWindow.preferences.generalForm.disableMouseWheel) # add observers # self.vtkRenWinInteract._Iren.AddObserver("LeftButtonPressEvent", self.leftButtonPressed) # self.vtkRenWinInteract._Iren.AddObserver("LeftButtonReleaseEvent", self.leftButtonReleased) # self.vtkRenWinInteract._Iren.AddObserver("RightButtonPressEvent", self.rightButtonPressed) # self.vtkRenWinInteract._Iren.AddObserver("RightButtonReleaseEvent", self.rightButtonReleased) # self.vtkRenWinInteract._Iren.AddObserver("MouseMoveEvent", self.mouseMoved) # connect custom signals (add observer does not work for release events) self.vtkRenWinInteract.leftButtonPressed.connect( self.leftButtonPressed) self.vtkRenWinInteract.leftButtonReleased.connect( self.leftButtonReleased) self.vtkRenWinInteract.rightButtonPressed.connect( self.rightButtonPressed) self.vtkRenWinInteract.rightButtonReleased.connect( self.rightButtonReleased) self.vtkRenWinInteract.mouseMoved.connect(self.mouseMoved) # add picker self.vtkPicker = vtk.vtkCellPicker() self.vtkPicker.SetTolerance(0.001) self.vtkPicker.AddObserver("EndPickEvent", self.endPickEvent) self.vtkRenWinInteract.SetPicker(self.vtkPicker) # vtk renderer self.vtkRen = vtk.vtkRenderer() self.vtkRen.SetBackground(1, 1, 1) self.vtkRenWin.AddRenderer(self.vtkRen) self.vtkRenWin.SetAAFrames(self.currentAAFrames) self.vtkRenWinInteract.Initialize() layout.addWidget(self.vtkRenWinInteract) # renderer self.renderer = renderer.Renderer(self) # do a post ref render if the ref is already loaded if self.mainWindow.refLoaded: self.renderer.postRefRender() # output dialog self.outputDialog = OutputDialog(self, self.mainWindow, None, index) # refresh rdf tab if ref already loaded if self.mainWindow.refLoaded: self.outputDialog.rdfTab.refresh() # text selector self.textSelector = onScreenInfoDialog.OnScreenInfoDialog( self.mainWindow, index, parent=self) # view point rotate dialog self.rotateViewPointDialog = simpleDialogs.RotateViewPointDialog( self, parent=self) # which filter list is it associated with label = QtGui.QLabel("Analysis pipeline:") self.analysisPipelineCombo = QtGui.QComboBox() self.analysisPipelineCombo.currentIndexChanged.connect( self.pipelineChanged) self.initPipelines() row = QtGui.QHBoxLayout() row.setContentsMargins(0, 0, 0, 0) row.setAlignment(QtCore.Qt.AlignHCenter) row.addWidget(label) row.addWidget(self.analysisPipelineCombo) layout.addLayout(row)
def __init__(self, parent, mainWindow, width, pipelineIndex, pipelineString): super(PipelineForm, self).__init__(parent) self.mainToolbar = parent self.mainWindow = mainWindow self.toolbarWidth = width self.pipelineIndex = pipelineIndex self.pipelineString = pipelineString self.systemsDialog = mainWindow.systemsDialog self.logger = logging.getLogger(__name__) self.rendererWindows = self.mainWindow.rendererWindows self.pickerContextMenuID = uuid.uuid4() self.pickerContextMenu = QtGui.QMenu(self) self.pickerContextMenu.aboutToHide.connect( self.hidePickerMenuHighlight) self.filterListCount = 0 self.filterLists = [] self.onScreenInfo = {} self.onScreenInfoActors = vtk.vtkActor2DCollection() self.visAtomsList = [] self.refState = None self.inputState = None self.extension = None self.inputStackIndex = None self.filename = None self.currentRunID = None self.abspath = None self.PBC = None self.linkedLattice = None self.fromSFTP = None self.scalarBarAdded = False # layout filterTabLayout = QtGui.QVBoxLayout(self) filterTabLayout.setContentsMargins(0, 0, 0, 0) filterTabLayout.setSpacing(0) filterTabLayout.setAlignment(QtCore.Qt.AlignTop) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignHCenter) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) label = QtGui.QLabel("<b>Pipeline %d settings</b>" % pipelineIndex) rowLayout.addWidget(label) filterTabLayout.addWidget(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # reference selector self.refCombo = QtGui.QComboBox() self.refCombo.setFixedWidth(220) self.refCombo.setToolTip( "Select the reference system for this pipeline") self.refCombo.currentIndexChanged.connect(self.refChanged) # add to row rowLayout.addWidget(QtGui.QLabel("Reference:")) rowLayout.addWidget(self.refCombo) filterTabLayout.addWidget(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # reference selector self.inputCombo = QtGui.QComboBox() self.inputCombo.setFixedWidth(220) self.inputCombo.setToolTip("Select the input system for this pipeline") self.inputCombo.currentIndexChanged.connect(self.inputChanged) # add to row rowLayout.addWidget(QtGui.QLabel("Input:")) rowLayout.addWidget(self.inputCombo) filterTabLayout.addWidget(row) row = QtGui.QHBoxLayout() row.setAlignment(QtCore.Qt.AlignHCenter) row.addWidget(QtGui.QLabel("<b>Property/filter lists:</b>")) filterTabLayout.addLayout(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # buttons for new/trash filter list runAll = QtGui.QPushButton( QtGui.QIcon(iconPath('oxygen/view-refresh.png')), 'Apply lists') runAll.setStatusTip("Apply all property/filter lists") runAll.setToolTip("Apply all property/filter lists") runAll.clicked.connect(self.runAllFilterLists) add = QtGui.QPushButton( QtGui.QIcon(iconPath('oxygen/tab-new-background.png')), 'New list') add.setToolTip("New property/filter list") add.setStatusTip("New property/filter list") add.clicked.connect(self.addFilterList) clear = QtGui.QPushButton( QtGui.QIcon(iconPath('oxygen/tab-close-other.png')), 'Clear lists') clear.setStatusTip("Clear all property/filter lists") clear.setToolTip("Clear all property/filter lists") clear.clicked.connect(self.clearAllFilterLists) rowLayout.addWidget(add) rowLayout.addWidget(clear) rowLayout.addWidget(runAll) filterTabLayout.addWidget(row) # add tab bar for filter lists self.filterTabBar = QtGui.QTabWidget(self) self.filterTabBar.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.filterTabBar.currentChanged[int].connect(self.filterTabBarChanged) self.filterTabBar.setTabsClosable(True) self.filterTabBar.tabCloseRequested.connect(self.tabCloseRequested) filterTabLayout.addWidget(self.filterTabBar) # add a filter list self.addFilterList() # add pbc options group = QtGui.QGroupBox("Periodic boundaries") group.setAlignment(QtCore.Qt.AlignHCenter) groupLayout = QtGui.QVBoxLayout(group) groupLayout.setSpacing(0) groupLayout.setContentsMargins(0, 0, 0, 0) # add PBC check boxes self.PBCXCheckBox = QtGui.QCheckBox("x") self.PBCXCheckBox.setChecked(QtCore.Qt.Checked) self.PBCYCheckBox = QtGui.QCheckBox("y") self.PBCYCheckBox.setChecked(QtCore.Qt.Checked) self.PBCZCheckBox = QtGui.QCheckBox("z") self.PBCZCheckBox.setChecked(QtCore.Qt.Checked) self.PBCXCheckBox.stateChanged[int].connect(self.PBCXChanged) self.PBCYCheckBox.stateChanged[int].connect(self.PBCYChanged) self.PBCZCheckBox.stateChanged[int].connect(self.PBCZChanged) row = QtGui.QWidget(self) rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignHCenter) rowLayout.addWidget(self.PBCXCheckBox) rowLayout.addWidget(self.PBCYCheckBox) rowLayout.addWidget(self.PBCZCheckBox) groupLayout.addWidget(row) # add shift cell and replicate cell buttons self.replicateCellButton = QtGui.QPushButton("Replicate cell") self.replicateCellButton.clicked.connect(self.replicateCell) self.replicateCellButton.setToolTip("Replicate in periodic directions") self.shiftCellButton = QtGui.QPushButton("Shift cell") self.shiftCellButton.clicked.connect(self.shiftCell) self.shiftCellButton.setToolTip("Shift cell in periodic directions") hbox = QtGui.QHBoxLayout() hbox.setContentsMargins(0, 0, 0, 0) hbox.addStretch(1) hbox.addWidget(self.shiftCellButton) hbox.addWidget(self.replicateCellButton) hbox.addStretch(1) groupLayout.addLayout(hbox) # add shift atom button row = QtGui.QWidget(self) rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignHCenter) self.shiftAtomButton = QtGui.QPushButton("Shift atoms") self.shiftAtomButton.clicked.connect(self.shiftAtom) self.shiftAtomButton.setToolTip( "Shift an atom (or set of atoms) in periodic directions") rowLayout.addWidget(self.shiftAtomButton) groupLayout.addWidget(row) filterTabLayout.addWidget(group) # add systems to combos for fn in self.systemsDialog.getDisplayNames(): self.refCombo.addItem(fn) for fn in self.systemsDialog.getDisplayNames(): self.inputCombo.addItem(fn) # refresh if ref already loaded if self.mainWindow.refLoaded: self.refreshAllFilters()
def __init__(self, parent, mainWindow, width, pipelineIndex, pipelineString): super(PipelineForm, self).__init__(parent) self.mainToolbar = parent self.mainWindow = mainWindow self.toolbarWidth = width self.pipelineIndex = pipelineIndex self.pipelineString = pipelineString self.systemsDialog = mainWindow.systemsDialog self.logger = logging.getLogger(__name__) self.rendererWindows = self.mainWindow.rendererWindows self.pickerContextMenuID = uuid.uuid4() self.pickerContextMenu = QtGui.QMenu(self) self.pickerContextMenu.aboutToHide.connect(self.hidePickerMenuHighlight) self.filterListCount = 0 self.filterLists = [] self.onScreenInfo = {} self.onScreenInfoActors = vtk.vtkActor2DCollection() self.visAtomsList = [] self.refState = None self.inputState = None self.extension = None self.inputStackIndex = None self.filename = None self.currentRunID = None self.abspath = None self.PBC = None self.linkedLattice = None self.fromSFTP = None self.scalarBarAdded = False # layout filterTabLayout = QtGui.QVBoxLayout(self) filterTabLayout.setContentsMargins(0, 0, 0, 0) filterTabLayout.setSpacing(0) filterTabLayout.setAlignment(QtCore.Qt.AlignTop) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignHCenter) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) label = QtGui.QLabel("<b>Pipeline %d settings</b>" % pipelineIndex) rowLayout.addWidget(label) filterTabLayout.addWidget(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # reference selector self.refCombo = QtGui.QComboBox() self.refCombo.setFixedWidth(220) self.refCombo.setToolTip("Select the reference system for this pipeline") self.refCombo.currentIndexChanged.connect(self.refChanged) # add to row rowLayout.addWidget(QtGui.QLabel("Reference:")) rowLayout.addWidget(self.refCombo) filterTabLayout.addWidget(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # reference selector self.inputCombo = QtGui.QComboBox() self.inputCombo.setFixedWidth(220) self.inputCombo.setToolTip("Select the input system for this pipeline") self.inputCombo.currentIndexChanged.connect(self.inputChanged) # add to row rowLayout.addWidget(QtGui.QLabel("Input:")) rowLayout.addWidget(self.inputCombo) filterTabLayout.addWidget(row) row = QtGui.QHBoxLayout() row.setAlignment(QtCore.Qt.AlignHCenter) row.addWidget(QtGui.QLabel("<b>Property/filter lists:</b>")) filterTabLayout.addLayout(row) # row row = QtGui.QWidget() rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignTop) rowLayout.setContentsMargins(0, 0, 0, 0) rowLayout.setSpacing(0) # buttons for new/trash filter list runAll = QtGui.QPushButton(QtGui.QIcon(iconPath('oxygen/view-refresh.png')), 'Apply lists') runAll.setStatusTip("Apply all property/filter lists") runAll.setToolTip("Apply all property/filter lists") runAll.clicked.connect(self.runAllFilterLists) add = QtGui.QPushButton(QtGui.QIcon(iconPath('oxygen/tab-new-background.png')), 'New list') add.setToolTip("New property/filter list") add.setStatusTip("New property/filter list") add.clicked.connect(self.addFilterList) clear = QtGui.QPushButton(QtGui.QIcon(iconPath('oxygen/tab-close-other.png')), 'Clear lists') clear.setStatusTip("Clear all property/filter lists") clear.setToolTip("Clear all property/filter lists") clear.clicked.connect(self.clearAllFilterLists) rowLayout.addWidget(add) rowLayout.addWidget(clear) rowLayout.addWidget(runAll) filterTabLayout.addWidget(row) # add tab bar for filter lists self.filterTabBar = QtGui.QTabWidget(self) self.filterTabBar.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.filterTabBar.currentChanged[int].connect(self.filterTabBarChanged) self.filterTabBar.setTabsClosable(True) self.filterTabBar.tabCloseRequested.connect(self.tabCloseRequested) filterTabLayout.addWidget(self.filterTabBar) # add a filter list self.addFilterList() # add pbc options group = QtGui.QGroupBox("Periodic boundaries") group.setAlignment(QtCore.Qt.AlignHCenter) groupLayout = QtGui.QVBoxLayout(group) groupLayout.setSpacing(0) groupLayout.setContentsMargins(0, 0, 0, 0) # add PBC check boxes self.PBCXCheckBox = QtGui.QCheckBox("x") self.PBCXCheckBox.setChecked(QtCore.Qt.Checked) self.PBCYCheckBox = QtGui.QCheckBox("y") self.PBCYCheckBox.setChecked(QtCore.Qt.Checked) self.PBCZCheckBox = QtGui.QCheckBox("z") self.PBCZCheckBox.setChecked(QtCore.Qt.Checked) self.PBCXCheckBox.stateChanged[int].connect(self.PBCXChanged) self.PBCYCheckBox.stateChanged[int].connect(self.PBCYChanged) self.PBCZCheckBox.stateChanged[int].connect(self.PBCZChanged) row = QtGui.QWidget(self) rowLayout = QtGui.QHBoxLayout(row) rowLayout.setAlignment(QtCore.Qt.AlignHCenter) rowLayout.addWidget(self.PBCXCheckBox) rowLayout.addWidget(self.PBCYCheckBox) rowLayout.addWidget(self.PBCZCheckBox) groupLayout.addWidget(row) # add shift cell and replicate cell buttons self.replicateCellButton = QtGui.QPushButton("Replicate cell") self.replicateCellButton.clicked.connect(self.replicateCell) self.replicateCellButton.setToolTip("Replicate in periodic directions") self.shiftCellButton = QtGui.QPushButton("Shift cell") self.shiftCellButton.clicked.connect(self.shiftCell) self.shiftCellButton.setToolTip("Shift cell in periodic directions") hbox = QtGui.QHBoxLayout() hbox.setContentsMargins(0, 0, 0, 0) hbox.addStretch(1) hbox.addWidget(self.shiftCellButton) hbox.addWidget(self.replicateCellButton) hbox.addStretch(1) groupLayout.addLayout(hbox) filterTabLayout.addWidget(group) # add systems to combos for fn in self.systemsDialog.getDisplayNames(): self.refCombo.addItem(fn) for fn in self.systemsDialog.getDisplayNames(): self.inputCombo.addItem(fn) # refresh if ref already loaded if self.mainWindow.refLoaded: self.refreshAllFilters()
def __init__(self, mainWindow, index, parent=None): super(RendererWindow, self).__init__(parent) self.parent = parent self.mainWindow = mainWindow self.rendererIndex = index self.setWindowTitle("Render window %d" % index) self.logger = logging.getLogger(__name__) self.closed = False self.slicePlaneActor = None self.blackBackground = False self.currentAAFrames = 2 self.highlighters = {} self.leftClick = False self.rightClick = False self.parallelProjection = False # layout layout = QtGui.QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) self.setLayout(layout) self.currentPipelineIndex = 0 self.currentPipelineString = "Pipeline 0" self.onScreenInfoActors = vtk.vtkActor2DCollection() # toolbar toolbar = QtGui.QToolBar() layout.addWidget(toolbar) # button to displace lattice frame showCellAction = self.createAction("Toggle cell", slot=self.toggleCellFrame, icon="cell_icon.svg", tip="Toggle cell frame visibility") # button to display axes showAxesAction = self.createAction("Toggle axes", slot=self.toggleAxes, icon="axis_icon.svg", tip="Toggle axes visiblity") # reset camera to cell setCamToCellAction = self.createAction("Reset to cell", slot=self.setCameraToCell, icon="oxygen/zoom-fit-best.png", tip="Reset camera to cell") # rotate image rotateViewPoint = self.createAction("Rotate view point", slot=self.rotateViewPoint, icon="oxygen/transform-rotate.png", tip="Rotate view point") # text selector openTextSelectorAction = self.createAction("On-screen info", self.showTextSelector, icon="oxygen/preferences-desktop-font.png", tip="Show on-screen text selector") # output dialog showOutputDialogAction = self.createAction("Output dialog", slot=self.showOutputDialog, icon="oxygen/document-save.png", tip="Show output dialog") # background colour backgroundColourAction = self.createAction("Toggle background colour", slot=self.toggleBackgroundColour, icon="oxygen/preferences-desktop-display-color.png", tip="Toggle background colour") # aa up aaUpAction = self.createAction("Increase anti-aliasing", slot=self.increaseAA, icon="oxygen/go-up.png", tip="Increase anti-aliasing") # aa up aaDownAction = self.createAction("Decrease anti-aliasing", slot=self.decreaseAA, icon="oxygen/go-down.png", tip="Decrease anti-aliasing") # camera settings cameraSettingsAction = self.createAction("Camera settings", slot=self.showCameraSettings, icon="oxygen/camera-photo.png", tip="Show camera settings") # parallel projection action projectionAction = self.createAction("Parallel projection", slot=self.toggleProjection, icon="perspective-ava.svg", tip="Parallel projection", checkable=True) # add actions self.addActions(toolbar, (showCellAction, showAxesAction, backgroundColourAction, None, setCamToCellAction, rotateViewPoint, cameraSettingsAction, projectionAction, None, openTextSelectorAction, showOutputDialogAction, None, aaUpAction, aaDownAction)) # VTK render window self.vtkRenWin = vtk.vtkRenderWindow() # VTK interactor self.vtkRenWinInteract = QVTKRenderWindowInteractor(self, rw=self.vtkRenWin) # interactor style self.vtkRenWinInteract._Iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera()) # disable wheel event? self.vtkRenWinInteract.changeDisableMouseWheel(self.mainWindow.preferences.generalForm.disableMouseWheel) # add observers # self.vtkRenWinInteract._Iren.AddObserver("LeftButtonPressEvent", self.leftButtonPressed) # connect signals from QVTK self.vtkRenWinInteract.leftButtonPressOverride.connect(self.leftButtonPressed) self.vtkRenWinInteract.leftButtonReleaseOverride.connect(self.leftButtonReleased) self.vtkRenWinInteract.rightButtonPressOverride.connect(self.rightButtonPressed) self.vtkRenWinInteract.rightButtonReleaseOverride.connect(self.rightButtonReleased) self.vtkRenWinInteract.mouseMoveOverride.connect(self.mouseMoved) # add picker self.vtkPicker = vtk.vtkCellPicker() self.vtkPicker.SetTolerance(0.001) self.vtkPicker.AddObserver("EndPickEvent", self.endPickEvent) self.vtkRenWinInteract.SetPicker(self.vtkPicker) # vtk renderer self.vtkRen = vtk.vtkRenderer() self.vtkRen.SetBackground(1, 1, 1) self.vtkRenWin.AddRenderer(self.vtkRen) self.vtkRenWin.SetAAFrames(self.currentAAFrames) self.vtkRenWinInteract.Initialize() self.vtkRenWinInteract.Start() layout.addWidget(self.vtkRenWinInteract) # renderer self.renderer = renderer.Renderer(self) # do a post ref render if the ref is already loaded if self.mainWindow.refLoaded: self.renderer.postRefRender() # output dialog self.outputDialog = OutputDialog(self, self.mainWindow, None, index) # refresh rdf tab if ref already loaded if self.mainWindow.refLoaded: self.outputDialog.rdfTab.refresh() # text selector self.textSelector = onScreenInfoDialog.OnScreenInfoDialog(self.mainWindow, index, parent=self) # view point rotate dialog self.rotateViewPointDialog = simpleDialogs.RotateViewPointDialog(self, parent=self) # which filter list is it associated with label = QtGui.QLabel("Analysis pipeline:") self.analysisPipelineCombo = QtGui.QComboBox() self.analysisPipelineCombo.currentIndexChanged.connect(self.pipelineChanged) self.initPipelines() row = QtGui.QHBoxLayout() row.setContentsMargins(0, 0, 0, 0) row.setAlignment(QtCore.Qt.AlignHCenter) row.addWidget(label) row.addWidget(self.analysisPipelineCombo) layout.addLayout(row)