コード例 #1
0
ファイル: Trackball.cpp プロジェクト: Khrylx/3DInnerCarving
void NAMESPACE::Trackball::buttonPressed(uint button, uint x, uint y)
{
  if (button == LIBSL_LEFT_BUTTON) {
    m_Status = m_Status | ROTATING;
    initRotation(x, y);
  }
  else if (button == LIBSL_MIDDLE_BUTTON) {
    m_Status = m_Status | ZOOMING;
    initZoom(x, y);
  }
  else if (button == LIBSL_RIGHT_BUTTON) {
    m_Status = m_Status | TRANSLATING;
    initTranslation(x, y);
  }
}
コード例 #2
0
ファイル: InputController.cpp プロジェクト: trnielsen/mantid
/**
  * Process the mouse press event.
  * Send out movement initialization signals.
  */
void InputController3DMove::mousePressEvent(QMouseEvent *event)
{
    if (event->buttons() & Qt::MidButton)
    {
      emit initZoom(event->x(),event->y());
      m_isButtonPressed=true;
    }
    else if (event->buttons() & Qt::LeftButton)
    {
      emit initRotation(event->x(),event->y());
      m_isButtonPressed=true;
    }
    else if(event->buttons() & Qt::RightButton)
    {
      emit initTranslation(event->x(),event->y());
      m_isButtonPressed=true;
    }
}