I have currently build a GUI which shows a list and a image concurrently I would also like to show the point-cloud of the current surrounding at the same time and to be able to access everything in the GUI.
I have tried the VTK visualization tool, the issue is that the rendering loop blocks everything else until the window gets closed.
I am currently trying to use the GLViewWidget of PyQtGraph, but I am not able to insert it on the position like I want and was able to do with other items in the GUI.
I had to assign the window as a parent to be even able to see the widget. But it jumps into the left corner of the window.
def init_gui(self, win_height=800, win_width=1800):
#self.w = self
#self.w.scene().sigMouseClicked.connect(self.mousePressEvent) #mouseMoveEvent
#self.w.scene().sigMouseMoved.connect(self.mouseMoveEvent)
pg.setConfigOptions(imageAxisOrder='row-major')
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
self.w = pg.GraphicsWindow(size=(win_width,win_height), border=True)
self.list_imgs = QtGui.QListWidget()
self.list_marks = QtGui.QListWidget()
self.btn_Del_Mark = QtGui.QPushButton('Del Mark')
self.btn_MarkPed = QtGui.QPushButton('Mark ped')
self.btn_MarkCycl = QtGui.QPushButton('Mark cyc')
self.btn_MarkCar = QtGui.QPushButton('Mark car')
self.btn_Rst = QtGui.QPushButton('Reset JSON')
self.btn_Save = QtGui.QPushButton('Save JSON')
self.btn_Next = QtGui.QPushButton('Next ->')
self.btn_Back = QtGui.QPushButton('Back <-')
self.btn_Predict_2D = QtGui.QPushButton('Predict 2D')
self.btn_Predict_3D = QtGui.QPushButton('Predict 3D')
self.btn_Pipeline = QtGui.QPushButton('Run Pipeline')
self.lbl_list1 = QtGui.QLabel()
self.lbl_list2 = QtGui.QLabel()
self.lbl_img_path = QtGui.QLabel()
self.lbl_list1.setText("Images")
self.lbl_list2.setText("Markings")
self.w.setWindowTitle('Visualizing traffic situation')
self.vb = pg.ViewBox()
self.vb.setAspectLocked()
self.img = pg.ImageItem()
self.vb.addItem(self.img)
self.vb.invertY(True)
layout = pg.GraphicsLayout()
self.lbl_list1.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_list2.setAlignment(QtCore.Qt.AlignCenter)
#self.qgwidg = QtGui.Qg
self.graph_3d = gl.GLViewWidget(parent=self.w)
self.graph_3d.opts['distance'] = 20
self.graph_3d.show()
self.graph_3d.setParent(self.w)
#self.graph_3d.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.graph_3d.setMinimumSize(800, 400)
offset_grp_1 = 2
offset_grp_2 = 3
offset_grp_3 = 4
layout.addItem(self.vb , 1, 9, 6, 20)
layout.addItem(self.proxyWidget(self.graph_3d, width=(600), height=(500)), 10, 3, 10, 20)
layout.addItem(self.proxyWidget(self.lbl_list1 , width=(int(1./10.*win_width)), height=(int(0.9/20.*win_height))), 0,1,1,1)
layout.addItem(self.proxyWidget(self.lbl_list2 , width=(int(1./10.*win_width)), height=(int(0.9/20.*win_height))), 0,2,1,1)
layout.addItem(self.proxyWidget(self.lbl_img_path , height=(int(0.9/20.*win_height))), 0,3,1,20)
layout.addItem(self.proxyWidget(self.list_imgs , width=(int(1./10.*win_width))), 1,1,20,1)
layout.addItem(self.proxyWidget(self.list_marks , width=(int(1./10.*win_width))), 1,2,20,1)
layout.addItem(self.proxyWidget(self.btn_Next , width=(int(1./10.*win_width))), 0+offset_grp_1,0)
layout.addItem(self.proxyWidget(self.btn_Back , width=(int(1./10.*win_width))), 1+offset_grp_1,0)
layout.addItem(self.proxyWidget(self.btn_Predict_2D, width=(int(1./10.*win_width))), 2+offset_grp_2,0)
layout.addItem(self.proxyWidget(self.btn_Predict_3D, width=(int(1./10.*win_width))), 3+offset_grp_2,0)
layout.addItem(self.proxyWidget(self.btn_Pipeline , width=(int(1./10.*win_width))), 4+offset_grp_2,0)
layout.addItem(self.proxyWidget(self.btn_MarkPed , width=(int(1./10.*win_width))), 5+offset_grp_3,0)
layout.addItem(self.proxyWidget(self.btn_MarkCycl , width=(int(1./10.*win_width))), 6+offset_grp_3,0)
layout.addItem(self.proxyWidget(self.btn_MarkCar , width=(int(1./10.*win_width))), 7+offset_grp_3,0)
layout.addItem(self.proxyWidget(self.btn_Del_Mark , width=(int(1./10.*win_width))), 8+offset_grp_3,0)
layout.addItem(self.proxyWidget(self.btn_Rst , width=(int(1./10.*win_width))), 9+offset_grp_3,0)
layout.addItem(self.proxyWidget(self.btn_Save , width=(int(1./10.*win_width))), 10+offset_grp_3,0)
self.w.addItem(layout)
self.setUp_pen_types()
self.qt_connections()
The result looks like this - allthough I want to have the rendered 3D scene, with the black background color, below the 2D image widget.