コード例 #1
0
ファイル: RGraphicsView.cpp プロジェクト: fallenwind/qcad
/**
 * This should be called by the mouse move event handler of a higher level
 * GUI toolkit. Events are forwarded to the scene and the navigation action
 * that is attached to this view.
 */
void RGraphicsView::handleMouseMoveEvent(RMouseEvent& event) {
    lastKnownModelPosition = event.getModelPosition();
    lastKnownScreenPosition = event.getScreenPosition();
    if (scene != NULL) {
        scene->handleMouseMoveEvent(event);
    }
    if (navigationAction != NULL) {
        navigationAction->mouseMoveEvent(event);
    }
}
コード例 #2
0
ファイル: RGraphicsView.cpp プロジェクト: fallenwind/qcad
/**
 * This should be called by the mouse double click event handler of a higher level
 * GUI toolkit. Events are forwarded to the scene and the navigation action
 * that is attached to this view.
 */
void RGraphicsView::handleMouseDoubleClickEvent(RMouseEvent& event) {
    lastKnownModelPosition = event.getModelPosition();
    lastKnownScreenPosition = event.getScreenPosition();
    if (scene == NULL) {
        return;
    }
    scene->handleMouseDoubleClickEvent(event);
    if (navigationAction!=NULL) {
        navigationAction->mouseDoubleClickEvent(event);
    }
}
コード例 #3
0
ファイル: RGraphicsView.cpp プロジェクト: fallenwind/qcad
/**
 * This should be called by the mouse press event handler of a higher level
 * GUI toolkit. Events are forwarded to the scene and the navigation action
 * that is attached to this view.
 */
void RGraphicsView::handleMousePressEvent(RMouseEvent& event) {
    lastKnownModelPosition = event.getModelPosition();
    lastKnownScreenPosition = event.getScreenPosition();
    if (scene == NULL) {
        return;
    }
    scene->handleMousePressEvent(event);
    if (navigationAction!=NULL) {
        navigationAction->mousePressEvent(event);
    }

    // remember mouse press position to use for mouse release:
    //mousePressScreenPosition = event.getScreenPosition();
    //mousePressModelPosition = event.getModelPosition();
}
コード例 #4
0
ファイル: RGraphicsView.cpp プロジェクト: fallenwind/qcad
/**
 * This should be called by the mouse release event handler of a higher level
 * GUI toolkit. Events are forwarded to the scene and the navigation action
 * that is attached to this view.
 */
void RGraphicsView::handleMouseReleaseEvent(RMouseEvent& event) {
    // use mouse press position for release and final posisiton:
//    if (mousePressModelPosition.isValid()) {
//        event.setModelPosition(mousePressModelPosition);
//        mousePressModelPosition = RVector::invalid;
//    }
//    if (mousePressScreenPosition.isValid()) {
//        event.setScreenPosition(mousePressScreenPosition);
//        mousePressScreenPosition = RVector::invalid;
//    }

    lastKnownModelPosition = event.getModelPosition();
    lastKnownScreenPosition = event.getScreenPosition();
    if (scene == NULL) {
        return;
    }
    scene->handleMouseReleaseEvent(event);
    if (navigationAction!=NULL && !event.isAccepted()) {
        navigationAction->mouseReleaseEvent(event);
    }
}