| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,6 +12,17 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#include "selfdrive/ui/qt/maps/map_panel.h" | 
					 | 
					 | 
					 | 
					#include "selfdrive/ui/qt/maps/map_panel.h" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#endif | 
					 | 
					 | 
					 | 
					#endif | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					static void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setRenderHint(QPainter::Antialiasing); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setOpacity(1.0);  // bg dictates opacity of ellipse
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setPen(Qt::NoPen); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setBrush(bg); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.drawEllipse(center, btn_size / 2, btn_size / 2); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setOpacity(opacity); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.drawPixmap(center - QPoint(img.width() / 2, img.height() / 2), img); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  p.setOpacity(1.0); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { | 
					 | 
					 | 
					 | 
					OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QVBoxLayout *main_layout  = new QVBoxLayout(this); | 
					 | 
					 | 
					 | 
					  QVBoxLayout *main_layout  = new QVBoxLayout(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  main_layout->setMargin(UI_BORDER_SIZE); | 
					 | 
					 | 
					 | 
					  main_layout->setMargin(UI_BORDER_SIZE); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -213,17 +224,8 @@ void ExperimentalButton::updateState(const UIState &s) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void ExperimentalButton::paintEvent(QPaintEvent *event) { | 
					 | 
					 | 
					 | 
					void ExperimentalButton::paintEvent(QPaintEvent *event) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPainter p(this); | 
					 | 
					 | 
					 | 
					  QPainter p(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setRenderHint(QPainter::Antialiasing); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPoint center(btn_size / 2, btn_size / 2); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPixmap img = experimental_mode ? experimental_img : engage_img; | 
					 | 
					 | 
					 | 
					  QPixmap img = experimental_mode ? experimental_img : engage_img; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					  drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(1.0); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setPen(Qt::NoPen); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setBrush(QColor(0, 0, 0, 166)); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawEllipse(center, btn_size / 2, btn_size / 2); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity((isDown() || !engageable) ? 0.6 : 1.0); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawPixmap((btn_size - img_size) / 2, (btn_size - img_size) / 2, img); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -239,16 +241,7 @@ MapSettingsButton::MapSettingsButton(QWidget *parent) : QPushButton(parent) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void MapSettingsButton::paintEvent(QPaintEvent *event) { | 
					 | 
					 | 
					 | 
					void MapSettingsButton::paintEvent(QPaintEvent *event) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPainter p(this); | 
					 | 
					 | 
					 | 
					  QPainter p(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setRenderHint(QPainter::Antialiasing); | 
					 | 
					 | 
					 | 
					  drawIcon(p, QPoint(btn_size / 2, btn_size / 2), settings_img, QColor(0, 0, 0, 166), isDown() ? 0.6 : 1.0); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPoint center(btn_size / 2, btn_size / 2); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(1.0); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setPen(Qt::NoPen); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setBrush(QColor(0, 0, 0, 166)); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawEllipse(center, btn_size / 2, btn_size / 2); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(isDown() ? 0.6 : 1.0); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawPixmap((btn_size - img_size) / 2, (btn_size - img_size) / 2, settings_img); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -436,16 +429,6 @@ void AnnotatedCameraWidget::drawText(QPainter &p, int x, int y, const QString &t | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawText(real_rect.x(), real_rect.bottom(), text); | 
					 | 
					 | 
					 | 
					  p.drawText(real_rect.x(), real_rect.bottom(), text); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void AnnotatedCameraWidget::drawIcon(QPainter &p, int x, int y, QPixmap &img, QBrush bg, float opacity) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(1.0);  // bg dictates opacity of ellipse
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setPen(Qt::NoPen); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setBrush(bg); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawEllipse(x - btn_size / 2, y - btn_size / 2, btn_size, btn_size); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(opacity); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.drawPixmap(x - img.size().width() / 2, y - img.size().height() / 2, img); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  p.setOpacity(1.0); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void AnnotatedCameraWidget::initializeGL() { | 
					 | 
					 | 
					 | 
					void AnnotatedCameraWidget::initializeGL() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  CameraWidget::initializeGL(); | 
					 | 
					 | 
					 | 
					  CameraWidget::initializeGL(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  qInfo() << "OpenGL version:" << QString((const char*)glGetString(GL_VERSION)); | 
					 | 
					 | 
					 | 
					  qInfo() << "OpenGL version:" << QString((const char*)glGetString(GL_VERSION)); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -544,7 +527,7 @@ void AnnotatedCameraWidget::drawDriverState(QPainter &painter, const UIState *s) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  int x = rightHandDM ? width() - offset : offset; | 
					 | 
					 | 
					 | 
					  int x = rightHandDM ? width() - offset : offset; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  int y = height() - offset; | 
					 | 
					 | 
					 | 
					  int y = height() - offset; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  float opacity = dmActive ? 0.65 : 0.2; | 
					 | 
					 | 
					 | 
					  float opacity = dmActive ? 0.65 : 0.2; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  drawIcon(painter, x, y, dm_img, blackColor(70), opacity); | 
					 | 
					 | 
					 | 
					  drawIcon(painter, QPoint(x, y), dm_img, blackColor(70), opacity); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // face
 | 
					 | 
					 | 
					 | 
					  // face
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QPointF face_kpts_draw[std::size(default_face_kpts_3d)]; | 
					 | 
					 | 
					 | 
					  QPointF face_kpts_draw[std::size(default_face_kpts_3d)]; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |