To get a sense of the 3D aspects of our drawing, we're going to build some controls into our GUI that allow us to rotate and zoom around the drawing.
We'll start by adding some buttons in MainWindow.__init__() that we can use as controls:
btn_layout = qtw.QHBoxLayout()
main.layout().addLayout(btn_layout)
for direction in ('none', 'left', 'right', 'up', 'down'):
button = qtw.QPushButton(
direction,
autoExclusive=True,
checkable=True,
clicked=getattr(oglw, f'spin_{direction}'))
btn_layout.addWidget(button)
zoom_layout = qtw.QHBoxLayout()
main.layout().addLayout(zoom_layout)
zoom_in = qtw.QPushButton('zoom in', clicked=oglw.zoom_in)
...