ScreenPaintData &ScreenPaintData::operator=(const ScreenPaintData &rhs) { setXScale(rhs.xScale()); setYScale(rhs.yScale()); setZScale(rhs.zScale()); setXTranslation(rhs.xTranslation()); setYTranslation(rhs.yTranslation()); setZTranslation(rhs.zTranslation()); setRotationOrigin(rhs.rotationOrigin()); setRotationAxis(rhs.rotationAxis()); setRotationAngle(rhs.rotationAngle()); return *this; }
void GLWidget::mouseMoveEvent(QMouseEvent *event) { int dx = event->x() - lastPos.x(); int dy = event->y() - lastPos.y(); // Reverse Y-Axis if needed if(GLWidget::yAxisReversed) { dy = -dy; } if ( (event->buttons() & Qt::LeftButton && leftMouseButtonMode == PANNING) || event->buttons() & Qt::MidButton ) { if(width <= height) { setXTranslation(xTrans - dx*2*zoomFactor/width); setYTranslation(yTrans + dy*2*zoomFactor/width); } else { setXTranslation(xTrans - dx*2*zoomFactor/height); setYTranslation(yTrans + dy*2*zoomFactor/height); } } else if ( (event->buttons() & Qt::LeftButton && leftMouseButtonMode == ROTATE) || event->buttons() & Qt::RightButton ) { setXRotation(xRot + 8 * dy); setZRotation(zRot - 8 * dx); } lastPos = event->pos(); }
ScreenPaintData &ScreenPaintData::operator=(const ScreenPaintData &rhs) { setXScale(rhs.xScale()); setYScale(rhs.yScale()); setZScale(rhs.zScale()); setXTranslation(rhs.xTranslation()); setYTranslation(rhs.yTranslation()); setZTranslation(rhs.zTranslation()); setRotationOrigin(rhs.rotationOrigin()); setRotationAxis(rhs.rotationAxis()); setRotationAngle(rhs.rotationAngle()); d->projectionMatrix = rhs.d->projectionMatrix; d->outputGeometry = rhs.d->outputGeometry; return *this; }