void ClipPlanes::makeClipConnections() { for(int i=0; i<m_clips.count(); i++) m_clips[i]->disconnect(); for(int i=0; i<m_clips.count(); i++) { connect(m_clips[i], SIGNAL(selectForEditing()), this, SLOT(selectForEditing())); connect(m_clips[i], SIGNAL(deselectForEditing()), this, SLOT(deselectForEditing())); } }
void ClipGrabber::mousePressEvent(QMouseEvent* const event, Camera* const camera) { m_pointPressed = -1; m_pressed = true; m_prevPos = event->pos(); Vec voxelScaling = Global::voxelScaling(); Vec pp = Vec(m_prevPos.x(), m_prevPos.y(), 0); Vec pos = VECPRODUCT(position(), voxelScaling); pos = Matrix::xformVec(m_xform, pos); bool flag; if (xActive(camera, pos, pp, flag)) { if (flag) setMoveAxis(MoveX0); else setMoveAxis(MoveX1); emit selectForEditing(); return; } else if (yActive(camera, pos, pp, flag)) { if (flag) setMoveAxis(MoveY0); else setMoveAxis(MoveY1); emit selectForEditing(); return; } else if (zActive(camera, pos, pp)) { setMoveAxis(MoveZ); emit selectForEditing(); return; } }