According to the style
code
Class MainApp(QMainWindow, main_ui): def __init__(self): Qmainwindow.__init__ (self) self.setupui (self) self.vtk_view () def init_vtk_view(self): # add VTK control self.vtk_vertical_layout = QVBoxLayout(self.view_widget) self.vtk_widget = QVTKRenderWindowInteractor(self.view_widget) self.vtk_vertical_layout.addWidget(self.vtk_widget) # 1. Create RenderWindow self.render_window = self.vtk_widget.getrenderWindow () # 2. Create a render the self. The renderer = VTK. VtkRenderer () the self. The renderer. SetBackground (1.0, 1.0, # 1.0) at the bottom of the Settings page color value self. The renderer. SetBackground2 (0.1, 0.2, # 0.4) set at the top of the page color value self. The renderer. SetGradientBackground open (# 1) gradient background setting self. Render_window. AddRenderer (self. The renderer) self.render_window.Render() # 3. Interaction of setting up the self. Iren = self. Render_window. GetInteractor () # for interactive self. Style = VTK. VtkInteractorStyleTrackballCamera (#) One of the interactive styles in which, Users by controlling the camera to the object is rotating, amplification, narrow operations such as the self. The style.css. SetDefaultRenderer (self. The renderer) self. Iren. SetInteractorStyle (self) style # 4. Add the world coordinate system axesActor = VTK. VtkAxesActor () the self. Axes_widget = VTK. VtkOrientationMarkerWidget () self.axes_widget.SetOrientationMarker(axesActor) self.axes_widget.SetInteractor(self.iren) self.axes_widget.EnabledOn() Self.axes_widget.interactiveoff () # Whether the coordinate system can be movedCopy the code