void Calcul_differerPoint2D(Calcul * This, double x, double y, ListeCouleurs * lc) { *message = 1000; if ( !((This->xPrec)==x && (This->yPrec)==y && (This->lcPrec).equals(&(This->lcPrec), lc)) ){ //printf("on entre"); This->ix = convertX(x); if ((convertY(y) >= 0) && (convertY(y) < 1000)) This->tabPtsY[convertY(y)] = lc->nbrCouleurs; This->xPrec = x; This->yPrec = y; This->lcPrec = *lc; } }
void MessageScroller::AddText(char* text) { if(LCD_ROWS - usedLines <= LINE_HEIGHT ) { ScrollScreen(LINE_HEIGHT - (LCD_ROWS-usedLines)); } oled->DrawString(text, SIDE_MARGIN, convertY(usedLines), textColor, bgColor); usedLines += LINE_HEIGHT; }
void WidgetGL::mouseDoubleClickEvent(QMouseEvent *event) { if(event->button() == Qt::RightButton) { double px = convertX( event->x() ); double py = convertY( event->y() ); route->push(px, py, camera_s/50.0); } }
void WidgetGL::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::RightButton) { double px = convertX( event->x() ); double py = convertY( event->y() ); route->set(px, py, camera_s/50.0); } mouse_prev_x = event->x(); mouse_prev_y = event->y(); mouse_prev_b = event->button(); }
void WidgetGL::mouseMoveEvent(QMouseEvent *event) { if(mouse_prev_b == Qt::LeftButton) { camera_x += 2.0 * (mouse_prev_x - event->x()) / wid * asp * camera_s; camera_y -= 2.0 * (mouse_prev_y - event->y()) / hei * 1.0 * camera_s; } if(mouse_prev_b == Qt::RightButton) { double px = convertX( event->x() ); double py = convertY( event->y() ); route->move(px, py); } mouse_prev_x = event->x(); mouse_prev_y = event->y(); }
glm::vec2 CoordinateTransform::convert( glm::vec2 vec, CoordinateSystem to ) { return glm::vec2( convertX( vec.x, to ), convertY( vec.y, to ) ); }