diff --git a/GraphicsView/include/CGAL/Qt/camera_impl.h b/GraphicsView/include/CGAL/Qt/camera_impl.h index e669f2aea70..59ee6c05da7 100644 --- a/GraphicsView/include/CGAL/Qt/camera_impl.h +++ b/GraphicsView/include/CGAL/Qt/camera_impl.h @@ -32,7 +32,8 @@ #include #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ /*! Default constructor. @@ -2534,4 +2535,4 @@ void Camera::getFrustum(double frustum[6]) frustum[4] = n; frustum[5] = f; } - +}}//end of namespace diff --git a/GraphicsView/include/CGAL/Qt/constraint_impl.h b/GraphicsView/include/CGAL/Qt/constraint_impl.h index 9c6f300b882..c37fca4a729 100644 --- a/GraphicsView/include/CGAL/Qt/constraint_impl.h +++ b/GraphicsView/include/CGAL/Qt/constraint_impl.h @@ -31,7 +31,9 @@ #include #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + //////////////////////////////////////////////////////////////////////////////// // Constraint // @@ -296,3 +298,5 @@ void CameraConstraint::constrainRotation(Quaternion &rotation, break; } } + +}}//end namespace diff --git a/GraphicsView/include/CGAL/Qt/frame_impl.h b/GraphicsView/include/CGAL/Qt/frame_impl.h index cc3890efcb4..7e516d8d941 100644 --- a/GraphicsView/include/CGAL/Qt/frame_impl.h +++ b/GraphicsView/include/CGAL/Qt/frame_impl.h @@ -32,7 +32,9 @@ #include #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + /*! Creates a default Frame. @@ -1181,3 +1183,4 @@ void Frame::projectOnLine(const Vec &origin, const Vec &direction) { proj.projectOnAxis(direction); translate(shift - proj); } +}} diff --git a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h index 02cb9fb693d..a591734c161 100644 --- a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h +++ b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h @@ -29,7 +29,9 @@ #include #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + /*! Creates a KeyFrameInterpolator, with \p frame as associated frame(). @@ -579,5 +581,6 @@ void KeyFrameInterpolator::KeyFrame::flipOrientationIfNeeded( if (Quaternion::dot(prev, q_) < 0.0) q_.negate(); } - #endif // DOXYGEN + +}} diff --git a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h index 3940e676226..0f9c76e0d58 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedCameraFrame_impl.h @@ -34,7 +34,8 @@ #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ /*! Default constructor. @@ -483,3 +484,5 @@ ManipulatedCameraFrame::pitchYawQuaternion(int x, int y, camera->screenWidth()); return rotY * rotX; } + +}} diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h index 72a14ed231d..e8ded238fa0 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h @@ -36,7 +36,9 @@ #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + /*! Default constructor. @@ -587,3 +589,4 @@ ManipulatedFrame::deformedBallQuaternion(int x, int y, qreal cx, qreal cy, return Quaternion(axis, angle); } #endif // DOXYGEN +}} diff --git a/GraphicsView/include/CGAL/Qt/mouseGrabber_impl.h b/GraphicsView/include/CGAL/Qt/mouseGrabber_impl.h index 5c0ba6cdd13..1550214ddb8 100644 --- a/GraphicsView/include/CGAL/Qt/mouseGrabber_impl.h +++ b/GraphicsView/include/CGAL/Qt/mouseGrabber_impl.h @@ -29,7 +29,9 @@ #include -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + // Static private variable CGAL_INLINE_FUNCTION @@ -91,3 +93,4 @@ void MouseGrabber::clearMouseGrabberPool(bool autoDelete) { qDeleteAll(MouseGrabber::MouseGrabberPool()); MouseGrabber::MouseGrabberPool().clear(); } +}} diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 2531b7c2991..cedfc286084 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -55,8 +55,7 @@ #include #include -using namespace CGAL::qglviewer; - +namespace CGAL{ // Static private variable CGAL_INLINE_FUNCTION QList &CGAL::QGLViewer::QGLViewerPool() { @@ -100,7 +99,7 @@ void CGAL::QGLViewer::defaultConstructor() { CGAL::QGLViewer::QGLViewerPool().replace(poolIndex, this); else CGAL::QGLViewer::QGLViewerPool().append(this); - camera_ = new Camera(this); + camera_ = new qglviewer::Camera(this); setCamera(camera()); setDefaultShortcuts(); @@ -575,58 +574,58 @@ void CGAL::QGLViewer::setCameraIsEdited(bool edit) { CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setDefaultShortcuts() { // D e f a u l t a c c e l e r a t o r s - setShortcut(DRAW_AXIS, ::Qt::Key_A); - setShortcut(DRAW_GRID, ::Qt::Key_G); - setShortcut(DISPLAY_FPS, ::Qt::Key_F); - setShortcut(ENABLE_TEXT, ::Qt::SHIFT + ::Qt::Key_Question); - setShortcut(EXIT_VIEWER, ::Qt::Key_Escape); - setShortcut(CAMERA_MODE, ::Qt::Key_Space); - setShortcut(FULL_SCREEN, ::Qt::ALT + ::Qt::Key_Return); - setShortcut(STEREO, ::Qt::Key_S); - setShortcut(ANIMATION, ::Qt::Key_Return); - setShortcut(HELP, ::Qt::Key_H); - setShortcut(EDIT_CAMERA, ::Qt::Key_C); - setShortcut(MOVE_CAMERA_LEFT, ::Qt::Key_Left); - setShortcut(MOVE_CAMERA_RIGHT, ::Qt::Key_Right); - setShortcut(MOVE_CAMERA_UP, ::Qt::Key_Up); - setShortcut(MOVE_CAMERA_DOWN, ::Qt::Key_Down); - setShortcut(INCREASE_FLYSPEED, ::Qt::Key_Plus); - setShortcut(DECREASE_FLYSPEED, ::Qt::Key_Minus); + setShortcut(qglviewer::DRAW_AXIS, ::Qt::Key_A); + setShortcut(qglviewer::DRAW_GRID, ::Qt::Key_G); + setShortcut(qglviewer::DISPLAY_FPS, ::Qt::Key_F); + setShortcut(qglviewer::ENABLE_TEXT, ::Qt::SHIFT + ::Qt::Key_Question); + setShortcut(qglviewer::EXIT_VIEWER, ::Qt::Key_Escape); + setShortcut(qglviewer::CAMERA_MODE, ::Qt::Key_Space); + setShortcut(qglviewer::FULL_SCREEN, ::Qt::ALT + ::Qt::Key_Return); + setShortcut(qglviewer::STEREO, ::Qt::Key_S); + setShortcut(qglviewer::ANIMATION, ::Qt::Key_Return); + setShortcut(qglviewer::HELP, ::Qt::Key_H); + setShortcut(qglviewer::EDIT_CAMERA, ::Qt::Key_C); + setShortcut(qglviewer::MOVE_CAMERA_LEFT, ::Qt::Key_Left); + setShortcut(qglviewer::MOVE_CAMERA_RIGHT, ::Qt::Key_Right); + setShortcut(qglviewer::MOVE_CAMERA_UP, ::Qt::Key_Up); + setShortcut(qglviewer::MOVE_CAMERA_DOWN, ::Qt::Key_Down); + setShortcut(qglviewer::INCREASE_FLYSPEED, ::Qt::Key_Plus); + setShortcut(qglviewer::DECREASE_FLYSPEED, ::Qt::Key_Minus); - keyboardActionDescription_[DISPLAY_FPS] = + keyboardActionDescription_[qglviewer::DISPLAY_FPS] = tr("Toggles the display of the FPS", "DISPLAY_FPS action description"); - keyboardActionDescription_[FULL_SCREEN] = + keyboardActionDescription_[qglviewer::FULL_SCREEN] = tr("Toggles full screen display", "FULL_SCREEN action description"); - keyboardActionDescription_[DRAW_AXIS] = tr( + keyboardActionDescription_[qglviewer::DRAW_AXIS] = tr( "Toggles the display of the world axis", "DRAW_AXIS action description"); - keyboardActionDescription_[DRAW_GRID] = + keyboardActionDescription_[qglviewer::DRAW_GRID] = tr("Toggles the display of the XY grid", "DRAW_GRID action description"); - keyboardActionDescription_[CAMERA_MODE] = tr( + keyboardActionDescription_[qglviewer::CAMERA_MODE] = tr( "Changes camera mode (observe or fly)", "CAMERA_MODE action description"); - keyboardActionDescription_[STEREO] = + keyboardActionDescription_[qglviewer::STEREO] = tr("Toggles stereo display", "STEREO action description"); - keyboardActionDescription_[HELP] = + keyboardActionDescription_[qglviewer::HELP] = tr("Opens this help window", "HELP action description"); - keyboardActionDescription_[ANIMATION] = + keyboardActionDescription_[qglviewer::ANIMATION] = tr("Starts/stops the animation", "ANIMATION action description"); - keyboardActionDescription_[EDIT_CAMERA] = + keyboardActionDescription_[qglviewer::EDIT_CAMERA] = tr("Toggles camera paths display", "EDIT_CAMERA action description"); // TODO change - keyboardActionDescription_[ENABLE_TEXT] = + keyboardActionDescription_[qglviewer::ENABLE_TEXT] = tr("Toggles the display of the text", "ENABLE_TEXT action description"); - keyboardActionDescription_[EXIT_VIEWER] = + keyboardActionDescription_[qglviewer::EXIT_VIEWER] = tr("Exits program", "EXIT_VIEWER action description"); - keyboardActionDescription_[MOVE_CAMERA_LEFT] = + keyboardActionDescription_[qglviewer::MOVE_CAMERA_LEFT] = tr("Moves camera left", "MOVE_CAMERA_LEFT action description"); - keyboardActionDescription_[MOVE_CAMERA_RIGHT] = + keyboardActionDescription_[qglviewer::MOVE_CAMERA_RIGHT] = tr("Moves camera right", "MOVE_CAMERA_RIGHT action description"); - keyboardActionDescription_[MOVE_CAMERA_UP] = + keyboardActionDescription_[qglviewer::MOVE_CAMERA_UP] = tr("Moves camera up", "MOVE_CAMERA_UP action description"); - keyboardActionDescription_[MOVE_CAMERA_DOWN] = + keyboardActionDescription_[qglviewer::MOVE_CAMERA_DOWN] = tr("Moves camera down", "MOVE_CAMERA_DOWN action description"); - keyboardActionDescription_[INCREASE_FLYSPEED] = + keyboardActionDescription_[qglviewer::INCREASE_FLYSPEED] = tr("Increases fly speed", "INCREASE_FLYSPEED action description"); - keyboardActionDescription_[DECREASE_FLYSPEED] = + keyboardActionDescription_[qglviewer::DECREASE_FLYSPEED] = tr("Decreases fly speed", "DECREASE_FLYSPEED action description"); // K e y f r a m e s s h o r t c u t k e y s @@ -655,38 +654,38 @@ void CGAL::QGLViewer::setDefaultMouseBindings() { //#CONNECTION# toggleCameraMode() for (int handler = 0; handler < 2; ++handler) { - MouseHandler mh = (MouseHandler)(handler); + qglviewer::MouseHandler mh = (qglviewer::MouseHandler)(handler); ::Qt::KeyboardModifiers modifiers = - (mh == FRAME) ? frameKeyboardModifiers : cameraKeyboardModifiers; + (mh == qglviewer::FRAME) ? frameKeyboardModifiers : cameraKeyboardModifiers; - setMouseBinding(modifiers, ::Qt::LeftButton, mh, ROTATE); - setMouseBinding(modifiers, ::Qt::MidButton, mh, ZOOM); - setMouseBinding(modifiers, ::Qt::RightButton, mh, TRANSLATE); + setMouseBinding(modifiers, ::Qt::LeftButton, mh, qglviewer::ROTATE); + setMouseBinding(modifiers, ::Qt::MidButton, mh, qglviewer::ZOOM); + setMouseBinding(modifiers, ::Qt::RightButton, mh, qglviewer::TRANSLATE); - setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, mh, SCREEN_ROTATE); + setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, mh, qglviewer::SCREEN_ROTATE); - setWheelBinding(modifiers, mh, ZOOM); + setWheelBinding(modifiers, mh, qglviewer::ZOOM); } // Z o o m o n r e g i o n - setMouseBinding(::Qt::ShiftModifier, ::Qt::MidButton, CAMERA, ZOOM_ON_REGION); + setMouseBinding(::Qt::ShiftModifier, ::Qt::MidButton, qglviewer::CAMERA, qglviewer::ZOOM_ON_REGION); // S e l e c t - setMouseBinding(::Qt::ShiftModifier, ::Qt::LeftButton, SELECT); + setMouseBinding(::Qt::ShiftModifier, ::Qt::LeftButton, qglviewer::SELECT); - setMouseBinding(::Qt::ShiftModifier, ::Qt::RightButton, RAP_FROM_PIXEL); + setMouseBinding(::Qt::ShiftModifier, ::Qt::RightButton, qglviewer::RAP_FROM_PIXEL); // D o u b l e c l i c k - setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, ALIGN_CAMERA, true); - setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, SHOW_ENTIRE_SCENE, true); - setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, CENTER_SCENE, true); + setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, qglviewer::ALIGN_CAMERA, true); + setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, qglviewer::SHOW_ENTIRE_SCENE, true); + setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, qglviewer::CENTER_SCENE, true); - setMouseBinding(frameKeyboardModifiers, ::Qt::LeftButton, ALIGN_FRAME, true); + setMouseBinding(frameKeyboardModifiers, ::Qt::LeftButton, qglviewer::ALIGN_FRAME, true); // middle double click makes no sense for manipulated frame - setMouseBinding(frameKeyboardModifiers, ::Qt::RightButton, CENTER_FRAME, true); + setMouseBinding(frameKeyboardModifiers, ::Qt::RightButton, qglviewer::CENTER_FRAME, true); // A c t i o n s w i t h k e y m o d i f i e r s - setMouseBinding(::Qt::Key_Z, ::Qt::NoModifier, ::Qt::LeftButton, ZOOM_ON_PIXEL); - setMouseBinding(::Qt::Key_Z, ::Qt::NoModifier, ::Qt::RightButton, ZOOM_TO_FIT); + setMouseBinding(::Qt::Key_Z, ::Qt::NoModifier, ::Qt::LeftButton, qglviewer::ZOOM_ON_PIXEL); + setMouseBinding(::Qt::Key_Z, ::Qt::NoModifier, ::Qt::RightButton, qglviewer::ZOOM_TO_FIT); #ifdef Q_OS_MAC // Specific Mac bindings for touchpads. Two fingers emulate a wheelEvent which @@ -696,12 +695,12 @@ void CGAL::QGLViewer::setDefaultMouseBindings() { // override previous settings. const ::Qt::KeyboardModifiers macKeyboardModifiers = ::Qt::AltModifier; - setMouseBinding(macKeyboardModifiers, ::Qt::LeftButton, CAMERA, TRANSLATE); - setMouseBinding(macKeyboardModifiers, ::Qt::LeftButton, CENTER_SCENE, true); + setMouseBinding(macKeyboardModifiers, ::Qt::LeftButton, qglviewer::CAMERA, qglviewer::TRANSLATE); + setMouseBinding(macKeyboardModifiers, ::Qt::LeftButton, qglviewer::CENTER_SCENE, true); setMouseBinding(frameKeyboardModifiers | macKeyboardModifiers, ::Qt::LeftButton, - CENTER_FRAME, true); + qglviewer::CENTER_FRAME, true); setMouseBinding(frameKeyboardModifiers | macKeyboardModifiers, ::Qt::LeftButton, - FRAME, TRANSLATE); + qglviewer::FRAME, qglviewer::TRANSLATE); #endif } @@ -727,7 +726,7 @@ CGAL::qglviewer::KeyFrameInterpolator::interpolated() signals are connected to t viewer update() slot. The connections with the previous viewer's camera are removed. */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::setCamera(Camera *const camera) { +void CGAL::QGLViewer::setCamera(qglviewer::Camera *const camera) { if (!camera) return; @@ -753,7 +752,7 @@ void CGAL::QGLViewer::setCamera(Camera *const camera) { CGAL_INLINE_FUNCTION void CGAL::QGLViewer::connectAllCameraKFIInterpolatedSignals(bool connection) { - for (QMap::ConstIterator + for (QMap::ConstIterator it = camera()->kfi_.begin(), end = camera()->kfi_.end(); it != end; ++it) { @@ -812,7 +811,7 @@ void CGAL::QGLViewer::renderText(int x, int y, const QString &str, CGAL_INLINE_FUNCTION void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &str, const QFont &font) { - const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z)); + const qglviewer::Vec proj = camera_->projectedCoordinatesOf(qglviewer::Vec(x, y, z)); renderText(proj.x, proj.y, str, font); } #endif @@ -1157,52 +1156,52 @@ static QString mouseButtonsString(::Qt::MouseButtons b) { } CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::performClickAction(ClickAction ca, const QMouseEvent *const e) { +void CGAL::QGLViewer::performClickAction(qglviewer::ClickAction ca, const QMouseEvent *const e) { // Note: action that need it should call update(). switch (ca) { // # CONNECTION setMouseBinding prevents adding NO_CLICK_ACTION in // clickBinding_ This case should hence not be possible. Prevents unused case // warning. - case NO_CLICK_ACTION: + case qglviewer::NO_CLICK_ACTION: break; - case ZOOM_ON_PIXEL: + case qglviewer::ZOOM_ON_PIXEL: camera()->interpolateToZoomOnPixel(e->pos()); break; - case ZOOM_TO_FIT: + case qglviewer::ZOOM_TO_FIT: camera()->interpolateToFitScene(); break; - case SELECT: + case qglviewer::SELECT: select(e); update(); break; - case RAP_FROM_PIXEL: + case qglviewer::RAP_FROM_PIXEL: if (!camera()->setPivotPointFromPixel(e->pos())) camera()->setPivotPoint(sceneCenter()); setVisualHintsMask(1); update(); break; - case RAP_IS_CENTER: + case qglviewer::RAP_IS_CENTER: camera()->setPivotPoint(sceneCenter()); setVisualHintsMask(1); update(); break; - case CENTER_FRAME: + case qglviewer::CENTER_FRAME: if (manipulatedFrame()) manipulatedFrame()->projectOnLine(camera()->position(), camera()->viewDirection()); break; - case CENTER_SCENE: + case qglviewer::CENTER_SCENE: camera()->centerScene(); break; - case SHOW_ENTIRE_SCENE: + case qglviewer::SHOW_ENTIRE_SCENE: camera()->showEntireScene(); break; - case ALIGN_FRAME: + case qglviewer::ALIGN_FRAME: if (manipulatedFrame()) manipulatedFrame()->alignWithFrame(camera()->frame()); break; - case ALIGN_CAMERA: - Frame *frame = new Frame(); + case qglviewer::ALIGN_CAMERA: + qglviewer::Frame *frame = new qglviewer::Frame(); frame->setTranslation(camera()->pivotPoint()); camera()->frame()->alignWithFrame(frame, true); delete frame; @@ -1244,13 +1243,13 @@ void CGAL::QGLViewer::mousePressEvent(QMouseEvent *e) { it = mouseBinding_.begin(), end = mouseBinding_.end(); it != end; ++it) - if ((it.value().handler == FRAME) && (it.key().button == e->button())) { - ManipulatedFrame *mf = - dynamic_cast(mouseGrabber()); + if ((it.value().handler == qglviewer::FRAME) && (it.key().button == e->button())) { + qglviewer::ManipulatedFrame *mf = + dynamic_cast(mouseGrabber()); if (mouseGrabberIsAManipulatedCameraFrame_) { - mf->ManipulatedFrame::startAction(it.value().action, + mf->qglviewer::ManipulatedFrame::startAction(it.value().action, it.value().withConstraint); - mf->ManipulatedFrame::mousePressEvent(e, camera()); + mf->qglviewer::ManipulatedFrame::mousePressEvent(e, camera()); } else { mf->startAction(it.value().action, it.value().withConstraint); mf->mousePressEvent(e, camera()); @@ -1268,11 +1267,11 @@ void CGAL::QGLViewer::mousePressEvent(QMouseEvent *e) { if (mouseBinding_.contains(mbp)) { MouseActionPrivate map = mouseBinding_[mbp]; switch (map.handler) { - case CAMERA: + case qglviewer::CAMERA: camera()->frame()->startAction(map.action, map.withConstraint); camera()->frame()->mousePressEvent(e, camera()); break; - case FRAME: + case qglviewer::FRAME: if (manipulatedFrame()) { if (manipulatedFrameIsACamera_) { manipulatedFrame()->ManipulatedFrame::startAction( @@ -1285,7 +1284,7 @@ void CGAL::QGLViewer::mousePressEvent(QMouseEvent *e) { } break; } - if (map.action == SCREEN_ROTATE) + if (map.action == qglviewer::SCREEN_ROTATE) // Display visual hint line update(); } else @@ -1334,8 +1333,8 @@ void CGAL::QGLViewer::mouseMoveEvent(QMouseEvent *e) { mouseGrabber()->checkIfGrabsMouse(e->x(), e->y(), camera()); if (mouseGrabber()->grabsMouse()) if (mouseGrabberIsAManipulatedCameraFrame_) - (dynamic_cast(mouseGrabber())) - ->ManipulatedFrame::mouseMoveEvent(e, camera()); + (dynamic_cast(mouseGrabber())) + ->qglviewer::ManipulatedFrame::mouseMoveEvent(e, camera()); else mouseGrabber()->mouseMoveEvent(e, camera()); else @@ -1349,7 +1348,7 @@ void CGAL::QGLViewer::mouseMoveEvent(QMouseEvent *e) { camera()->frame()->mouseMoveEvent(e, camera()); // #CONNECTION# manipulatedCameraFrame::mouseMoveEvent specific if at the // beginning - if (camera()->frame()->action_ == ZOOM_ON_REGION) + if (camera()->frame()->action_ == qglviewer::ZOOM_ON_REGION) update(); } else // ! if ((manipulatedFrame()) && (manipulatedFrame()->isManipulated())) @@ -1358,7 +1357,7 @@ void CGAL::QGLViewer::mouseMoveEvent(QMouseEvent *e) { else manipulatedFrame()->mouseMoveEvent(e, camera()); else if (hasMouseTracking()) { - Q_FOREACH (MouseGrabber *mg, MouseGrabber::MouseGrabberPool()) { + Q_FOREACH (qglviewer::MouseGrabber *mg, qglviewer::MouseGrabber::MouseGrabberPool()) { mg->checkIfGrabsMouse(e->x(), e->y(), camera()); if (mg->grabsMouse()) { setMouseGrabber(mg); @@ -1384,8 +1383,8 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::mouseReleaseEvent(QMouseEvent *e) { if (mouseGrabber()) { if (mouseGrabberIsAManipulatedCameraFrame_) - (dynamic_cast(mouseGrabber())) - ->ManipulatedFrame::mouseReleaseEvent(e, camera()); + (dynamic_cast(mouseGrabber())) + ->qglviewer::ManipulatedFrame::mouseReleaseEvent(e, camera()); else mouseGrabber()->mouseReleaseEvent(e, camera()); mouseGrabber()->checkIfGrabsMouse(e->x(), e->y(), camera()); @@ -1421,13 +1420,13 @@ void CGAL::QGLViewer::wheelEvent(QWheelEvent *e) { it = wheelBinding_.begin(), end = wheelBinding_.end(); it != end; ++it) - if (it.value().handler == FRAME) { - ManipulatedFrame *mf = - dynamic_cast(mouseGrabber()); + if (it.value().handler == qglviewer::FRAME) { + qglviewer::ManipulatedFrame *mf = + dynamic_cast(mouseGrabber()); if (mouseGrabberIsAManipulatedCameraFrame_) { - mf->ManipulatedFrame::startAction(it.value().action, + mf->qglviewer::ManipulatedFrame::startAction(it.value().action, it.value().withConstraint); - mf->ManipulatedFrame::wheelEvent(e, camera()); + mf->qglviewer::ManipulatedFrame::wheelEvent(e, camera()); } else { mf->startAction(it.value().action, it.value().withConstraint); mf->wheelEvent(e, camera()); @@ -1444,11 +1443,11 @@ void CGAL::QGLViewer::wheelEvent(QWheelEvent *e) { if (wheelBinding_.contains(wbp)) { MouseActionPrivate map = wheelBinding_[wbp]; switch (map.handler) { - case CAMERA: + case qglviewer::CAMERA: camera()->frame()->startAction(map.action, map.withConstraint); camera()->frame()->wheelEvent(e, camera()); break; - case FRAME: + case qglviewer::FRAME: if (manipulatedFrame()) { if (manipulatedFrameIsACamera_) { manipulatedFrame()->ManipulatedFrame::startAction( @@ -1544,16 +1543,16 @@ CGAL::qglviewer::MouseGrabber::checkIfGrabsMouse() test performed by mouseMoveEv If the MouseGrabber is disabled (see mouseGrabberIsEnabled()), this method silently does nothing. */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::setMouseGrabber(MouseGrabber *mouseGrabber) { +void CGAL::QGLViewer::setMouseGrabber(qglviewer::MouseGrabber *mouseGrabber) { if (!mouseGrabberIsEnabled(mouseGrabber)) return; mouseGrabber_ = mouseGrabber; mouseGrabberIsAManipulatedFrame_ = - (dynamic_cast(mouseGrabber) != NULL); + (dynamic_cast(mouseGrabber) != NULL); mouseGrabberIsAManipulatedCameraFrame_ = - ((dynamic_cast(mouseGrabber) != NULL) && + ((dynamic_cast(mouseGrabber) != NULL) && (mouseGrabber != camera()->frame())); Q_EMIT mouseGrabberChanged(mouseGrabber); } @@ -1569,7 +1568,7 @@ void CGAL::QGLViewer::setMouseGrabberIsEnabled( } CGAL_INLINE_FUNCTION -QString CGAL::QGLViewer::mouseActionString(MouseAction ma) { +QString CGAL::QGLViewer::mouseActionString(qglviewer::MouseAction ma) { switch (ma) { case CGAL::qglviewer::NO_MOUSE_ACTION: return QString::null; @@ -1828,10 +1827,10 @@ QString CGAL::QGLViewer::mouseString() const { if (!text.isNull()) { switch (itmb.value().handler) { - case CAMERA: + case qglviewer::CAMERA: text += " " + tr("camera", "Suffix after action"); break; - case FRAME: + case qglviewer::FRAME: text += " " + tr("manipulated frame", "Suffix after action"); break; } @@ -1852,10 +1851,10 @@ QString CGAL::QGLViewer::mouseString() const { if (!text.isNull()) { switch (itw.value().handler) { - case CAMERA: + case qglviewer::CAMERA: text += " " + tr("camera", "Suffix after action"); break; - case FRAME: + case qglviewer::FRAME: text += " " + tr("manipulated frame", "Suffix after action"); break; } @@ -1866,7 +1865,7 @@ QString CGAL::QGLViewer::mouseString() const { mouseBinding[cbp] = text; } - for (QMap::ConstIterator + for (QMap::ConstIterator itcb = clickBinding_.begin(), endcb = clickBinding_.end(); itcb != endcb; ++itcb) @@ -2017,13 +2016,13 @@ QString CGAL::QGLViewer::keyboardString() const { } // 3 - KeyboardAction bindings description - for (QMap::ConstIterator + for (QMap::ConstIterator it = keyboardBinding_.begin(), end = keyboardBinding_.end(); it != end; ++it) if ((it.value() != 0) && ((!cameraIsInRotateMode()) || - ((it.key() != INCREASE_FLYSPEED) && (it.key() != DECREASE_FLYSPEED)))) + ((it.key() != qglviewer::INCREASE_FLYSPEED) && (it.key() != qglviewer::DECREASE_FLYSPEED)))) keyDescription[it.value()] = keyboardActionDescription_[it.key()]; // Add to text in sorted order @@ -2191,7 +2190,7 @@ void CGAL::QGLViewer::keyPressEvent(QKeyEvent *e) { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); - QMap::ConstIterator it = keyboardBinding_ + QMap::ConstIterator it = keyboardBinding_ .begin(), end = keyboardBinding_.end(); @@ -2215,7 +2214,7 @@ void CGAL::QGLViewer::keyPressEvent(QKeyEvent *e) { else { // Stop previous interpolation before starting a new one. if (index != previousPathId_) { - KeyFrameInterpolator *previous = + qglviewer::KeyFrameInterpolator *previous = camera()->keyFrameInterpolator(previousPathId_); if ((previous) && (previous->interpolationIsStarted())) previous->resetInterpolation(); @@ -2269,71 +2268,71 @@ void CGAL::QGLViewer::keyReleaseEvent(QKeyEvent *e) { } CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::handleKeyboardAction(KeyboardAction id) { +void CGAL::QGLViewer::handleKeyboardAction(qglviewer::KeyboardAction id) { switch (id) { - case DRAW_AXIS: + case qglviewer::DRAW_AXIS: toggleAxisIsDrawn(); break; - case DRAW_GRID: + case qglviewer::DRAW_GRID: toggleGridIsDrawn(); break; - case DISPLAY_FPS: + case qglviewer::DISPLAY_FPS: toggleFPSIsDisplayed(); break; - case ENABLE_TEXT: + case qglviewer::ENABLE_TEXT: toggleTextIsEnabled(); break; - case EXIT_VIEWER: + case qglviewer::EXIT_VIEWER: saveStateToFileForAllViewers(); qApp->closeAllWindows(); break; - case FULL_SCREEN: + case qglviewer::FULL_SCREEN: toggleFullScreen(); break; - case STEREO: + case qglviewer::STEREO: toggleStereoDisplay(); break; - case ANIMATION: + case qglviewer::ANIMATION: toggleAnimation(); break; - case HELP: + case qglviewer::HELP: help(); break; - case EDIT_CAMERA: + case qglviewer::EDIT_CAMERA: toggleCameraIsEdited(); break; - case CAMERA_MODE: + case qglviewer::CAMERA_MODE: toggleCameraMode(); displayMessage(cameraIsInRotateMode() ? tr("Camera in observer mode", "Feedback message") : tr("Camera in fly mode", "Feedback message")); break; - case MOVE_CAMERA_LEFT: + case qglviewer::MOVE_CAMERA_LEFT: camera()->frame()->translate(camera()->frame()->inverseTransformOf( - Vec(-10.0 * camera()->flySpeed(), 0.0, 0.0))); + qglviewer::Vec(-10.0 * camera()->flySpeed(), 0.0, 0.0))); update(); break; - case MOVE_CAMERA_RIGHT: + case qglviewer::MOVE_CAMERA_RIGHT: camera()->frame()->translate(camera()->frame()->inverseTransformOf( - Vec(10.0 * camera()->flySpeed(), 0.0, 0.0))); + qglviewer::Vec(10.0 * camera()->flySpeed(), 0.0, 0.0))); update(); break; - case MOVE_CAMERA_UP: + case qglviewer::MOVE_CAMERA_UP: camera()->frame()->translate(camera()->frame()->inverseTransformOf( - Vec(0.0, 10.0 * camera()->flySpeed(), 0.0))); + qglviewer::Vec(0.0, 10.0 * camera()->flySpeed(), 0.0))); update(); break; - case MOVE_CAMERA_DOWN: + case qglviewer::MOVE_CAMERA_DOWN: camera()->frame()->translate(camera()->frame()->inverseTransformOf( - Vec(0.0, -10.0 * camera()->flySpeed(), 0.0))); + qglviewer::Vec(0.0, -10.0 * camera()->flySpeed(), 0.0))); update(); break; - case INCREASE_FLYSPEED: + case qglviewer::INCREASE_FLYSPEED: camera()->setFlySpeed(camera()->flySpeed() * 1.5); break; - case DECREASE_FLYSPEED: + case qglviewer::DECREASE_FLYSPEED: camera()->setFlySpeed(camera()->flySpeed() / 1.5); break; } @@ -2372,7 +2371,7 @@ Only one shortcut can be assigned to a given CGAL::QGLViewer::KeyboardAction (ne bindings replace previous ones). If several KeyboardAction are binded to the same shortcut, only one of them is active. */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::setShortcut(KeyboardAction action, unsigned int key) { +void CGAL::QGLViewer::setShortcut(qglviewer::KeyboardAction action, unsigned int key) { keyboardBinding_[action] = key; } @@ -2394,7 +2393,7 @@ See the keyboard page for details and default values and the keyboardAndMouse example for a practical illustration. */ CGAL_INLINE_FUNCTION -unsigned int CGAL::QGLViewer::shortcut(KeyboardAction action) const { +unsigned int CGAL::QGLViewer::shortcut(qglviewer::KeyboardAction action) const { if (keyboardBinding_.contains(action)) return keyboardBinding_[action]; else @@ -2506,8 +2505,8 @@ CGAL_INLINE_FUNCTION action). */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setMouseBinding(::Qt::KeyboardModifiers modifiers, - ::Qt::MouseButton button, MouseHandler handler, - MouseAction action, bool withConstraint) { + ::Qt::MouseButton button, qglviewer::MouseHandler handler, + qglviewer::MouseAction action, bool withConstraint) { setMouseBinding(::Qt::Key(0), modifiers, button, handler, action, withConstraint); } @@ -2553,12 +2552,12 @@ See also setMouseBinding(::Qt::KeyboardModifiers, ::Qt::MouseButtons, ClickActio bool, int), setWheelBinding() and clearMouseBindings(). */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers modifiers, - ::Qt::MouseButton button, MouseHandler handler, - MouseAction action, bool withConstraint) { - if ((handler == FRAME) && - ((action == MOVE_FORWARD) || (action == MOVE_BACKWARD) || - (action == ROLL) || (action == LOOK_AROUND) || - (action == ZOOM_ON_REGION))) { + ::Qt::MouseButton button, qglviewer::MouseHandler handler, + qglviewer::MouseAction action, bool withConstraint) { + if ((handler == qglviewer::FRAME) && + ((action == qglviewer::MOVE_FORWARD) || (action == qglviewer::MOVE_BACKWARD) || + (action == qglviewer::ROLL) || (action == qglviewer::LOOK_AROUND) || + (action == qglviewer::ZOOM_ON_REGION))) { qWarning("Cannot bind %s to FRAME", mouseActionString(action).toLatin1().constData()); return; @@ -2575,7 +2574,7 @@ void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod map.withConstraint = withConstraint; MouseBindingPrivate mbp(modifiers, button, key); - if (action == NO_MOUSE_ACTION) + if (action == qglviewer::NO_MOUSE_ACTION) mouseBinding_.remove(mbp); else mouseBinding_.insert(mbp, map); @@ -2593,7 +2592,7 @@ void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setMouseBinding(::Qt::KeyboardModifiers modifiers, - ::Qt::MouseButton button, ClickAction action, + ::Qt::MouseButton button, qglviewer::ClickAction action, bool doubleClick, ::Qt::MouseButtons buttonsBefore) { setMouseBinding(::Qt::Key(0), modifiers, button, action, doubleClick, @@ -2628,7 +2627,7 @@ MouseAction, bool), setWheelBinding() and clearMouseBindings(). */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers modifiers, - ::Qt::MouseButton button, ClickAction action, + ::Qt::MouseButton button, qglviewer::ClickAction action, bool doubleClick, ::Qt::MouseButtons buttonsBefore) { if ((buttonsBefore != ::Qt::NoButton) && !doubleClick) { @@ -2645,7 +2644,7 @@ void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod ClickBindingPrivate cbp(modifiers, button, doubleClick, buttonsBefore, key); // #CONNECTION performClickAction comment on NO_CLICK_ACTION - if (action == NO_CLICK_ACTION) + if (action == qglviewer::NO_CLICK_ACTION) clickBinding_.remove(cbp); else clickBinding_.insert(cbp, action); @@ -2663,7 +2662,7 @@ void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod to be pressed to activate this action). */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setWheelBinding(::Qt::KeyboardModifiers modifiers, - MouseHandler handler, MouseAction action, + qglviewer::MouseHandler handler, qglviewer::MouseAction action, bool withConstraint) { setWheelBinding(::Qt::Key(0), modifiers, handler, action, withConstraint); } @@ -2682,18 +2681,18 @@ CGAL::QGLViewer::MOVE_FORWARD moves at a constant speed defined by CGAL::qglviewer::Camera::flySpeed(). */ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setWheelBinding(::Qt::Key key, ::Qt::KeyboardModifiers modifiers, - MouseHandler handler, MouseAction action, + qglviewer::MouseHandler handler, qglviewer::MouseAction action, bool withConstraint) { //#CONNECTION# ManipulatedFrame::wheelEvent and // ManipulatedCameraFrame::wheelEvent switches - if ((action != ZOOM) && (action != MOVE_FORWARD) && - (action != MOVE_BACKWARD) && (action != NO_MOUSE_ACTION)) { + if ((action != qglviewer::ZOOM) && (action != qglviewer::MOVE_FORWARD) && + (action != qglviewer::MOVE_BACKWARD) && (action != qglviewer::NO_MOUSE_ACTION)) { qWarning("Cannot bind %s to wheel", mouseActionString(action).toLatin1().constData()); return; } - if ((handler == FRAME) && (action != ZOOM) && (action != NO_MOUSE_ACTION)) { + if ((handler == qglviewer::FRAME) && (action != qglviewer::ZOOM) && (action != qglviewer::NO_MOUSE_ACTION)) { qWarning("Cannot bind %s to FRAME wheel", mouseActionString(action).toLatin1().constData()); return; @@ -2705,7 +2704,7 @@ void CGAL::QGLViewer::setWheelBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod map.withConstraint = withConstraint; WheelBindingPrivate wbp(modifiers, key); - if (action == NO_MOUSE_ACTION) + if (action == qglviewer::NO_MOUSE_ACTION) wheelBinding_.remove(wbp); else wheelBinding_[wbp] = map; @@ -2750,14 +2749,14 @@ if (ma != CGAL::QGLViewer::NO_MOUSE_ACTION) ... Use mouseHandler() to know which object (CGAL::QGLViewer::CAMERA or CGAL::QGLViewer::FRAME) will execute this action. */ CGAL_INLINE_FUNCTION -MouseAction CGAL::QGLViewer::mouseAction(::Qt::Key key, +qglviewer::MouseAction CGAL::QGLViewer::mouseAction(::Qt::Key key, ::Qt::KeyboardModifiers modifiers, ::Qt::MouseButton button) const { MouseBindingPrivate mbp(modifiers, button, key); if (mouseBinding_.contains(mbp)) return mouseBinding_[mbp].action; else - return NO_MOUSE_ACTION; + return qglviewer::NO_MOUSE_ACTION; } @@ -2798,7 +2797,7 @@ them is returned. See also setMouseBinding(), getClickActionBinding() and getMouseActionBinding(). */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::getWheelActionBinding(MouseHandler handler, MouseAction action, +void CGAL::QGLViewer::getWheelActionBinding(qglviewer::MouseHandler handler, qglviewer::MouseAction action, bool withConstraint, ::Qt::Key &key, ::Qt::KeyboardModifiers &modifiers) const { for (QMap::ConstIterator @@ -2827,7 +2826,7 @@ MouseAction, one of them is returned. See also setMouseBinding(), getClickActionBinding() and getWheelActionBinding(). */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::getMouseActionBinding(MouseHandler handler, MouseAction action, +void CGAL::QGLViewer::getMouseActionBinding(qglviewer::MouseHandler handler, qglviewer::MouseAction action, bool withConstraint, ::Qt::Key &key, ::Qt::KeyboardModifiers &modifiers, ::Qt::MouseButton &button) const { @@ -2857,14 +2856,14 @@ setWheelBinding(). Same as mouseAction(), but for the wheel action. See also wheelHandler(). */ -MouseAction +qglviewer::MouseAction CGAL_INLINE_FUNCTION CGAL::QGLViewer::wheelAction(::Qt::Key key, ::Qt::KeyboardModifiers modifiers) const { WheelBindingPrivate wbp(modifiers, key); if (wheelBinding_.contains(wbp)) return wheelBinding_[wbp].action; else - return NO_MOUSE_ACTION; + return qglviewer::NO_MOUSE_ACTION; } /*! Returns the MouseHandler (if any) that receives wheel events when the \p @@ -2896,7 +2895,7 @@ CGAL::QGLViewer::clickAction(::Qt::Key key, ::Qt::KeyboardModifiers modifiers, if (clickBinding_.contains(cbp)) return clickBinding_[cbp]; else - return NO_CLICK_ACTION; + return qglviewer::NO_CLICK_ACTION; } /*! Returns the mouse and keyboard state that triggers \p action. @@ -2909,12 +2908,12 @@ buttons trigger in the ClickAction, one of them is returned. See also setMouseBinding(), getMouseActionBinding() and getWheelActionBinding(). */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::getClickActionBinding(ClickAction action, ::Qt::Key &key, +void CGAL::QGLViewer::getClickActionBinding(qglviewer::ClickAction action, ::Qt::Key &key, ::Qt::KeyboardModifiers &modifiers, ::Qt::MouseButton &button, bool &doubleClick, ::Qt::MouseButtons &buttonsBefore) const { - for (QMap::ConstIterator + for (QMap::ConstIterator it = clickBinding_.begin(), end = clickBinding_.end(); it != end; ++it) @@ -2943,7 +2942,7 @@ bool CGAL::QGLViewer::cameraIsInRotateMode() const { ::Qt::Key key; ::Qt::KeyboardModifiers modifiers; ::Qt::MouseButton button; - getMouseActionBinding(CAMERA, ROTATE, true /*constraint*/, key, modifiers, + getMouseActionBinding(qglviewer::CAMERA, qglviewer::ROTATE, true /*constraint*/, key, modifiers, button); return button != ::Qt::NoButton; } @@ -2967,12 +2966,12 @@ void CGAL::QGLViewer::toggleCameraMode() { ::Qt::Key key; ::Qt::KeyboardModifiers modifiers; ::Qt::MouseButton button; - getMouseActionBinding(CAMERA, ROTATE, true /*constraint*/, key, modifiers, + getMouseActionBinding(qglviewer::CAMERA, qglviewer::ROTATE, true /*constraint*/, key, modifiers, button); bool rotateMode = button != ::Qt::NoButton; if (!rotateMode) { - getMouseActionBinding(CAMERA, MOVE_FORWARD, true /*constraint*/, key, + getMouseActionBinding(qglviewer::CAMERA, qglviewer::MOVE_FORWARD, true /*constraint*/, key, modifiers, button); } @@ -2981,31 +2980,31 @@ void CGAL::QGLViewer::toggleCameraMode() { camera()->frame()->updateSceneUpVector(); camera()->frame()->stopSpinning(); - setMouseBinding(modifiers, ::Qt::LeftButton, CAMERA, MOVE_FORWARD); - setMouseBinding(modifiers, ::Qt::MidButton, CAMERA, LOOK_AROUND); - setMouseBinding(modifiers, ::Qt::RightButton, CAMERA, MOVE_BACKWARD); + setMouseBinding(modifiers, ::Qt::LeftButton, qglviewer::CAMERA, qglviewer::MOVE_FORWARD); + setMouseBinding(modifiers, ::Qt::MidButton, qglviewer::CAMERA, qglviewer::LOOK_AROUND); + setMouseBinding(modifiers, ::Qt::RightButton, qglviewer::CAMERA, qglviewer::MOVE_BACKWARD); - setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, CAMERA, ROLL); + setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, qglviewer::CAMERA, qglviewer::ROLL); - setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, NO_CLICK_ACTION, true); - setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, NO_CLICK_ACTION, true); - setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, NO_CLICK_ACTION, true); + setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, qglviewer::NO_CLICK_ACTION, true); + setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, qglviewer::NO_CLICK_ACTION, true); + setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, qglviewer::NO_CLICK_ACTION, true); - setWheelBinding(modifiers, CAMERA, MOVE_FORWARD); + setWheelBinding(modifiers, qglviewer::CAMERA, qglviewer::MOVE_FORWARD); } else { // Should stop flyTimer. But unlikely and not easy. - setMouseBinding(modifiers, ::Qt::LeftButton, CAMERA, ROTATE); - setMouseBinding(modifiers, ::Qt::MidButton, CAMERA, ZOOM); - setMouseBinding(modifiers, ::Qt::RightButton, CAMERA, TRANSLATE); + setMouseBinding(modifiers, ::Qt::LeftButton, qglviewer::CAMERA, qglviewer::ROTATE); + setMouseBinding(modifiers, ::Qt::MidButton, qglviewer::CAMERA, qglviewer::ZOOM); + setMouseBinding(modifiers, ::Qt::RightButton, qglviewer::CAMERA, qglviewer::TRANSLATE); - setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, CAMERA, - SCREEN_ROTATE); + setMouseBinding(::Qt::Key_R, modifiers, ::Qt::LeftButton, qglviewer::CAMERA, + qglviewer::SCREEN_ROTATE); - setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, ALIGN_CAMERA, true); - setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, SHOW_ENTIRE_SCENE, true); - setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, CENTER_SCENE, true); + setMouseBinding(::Qt::NoModifier, ::Qt::LeftButton, qglviewer::ALIGN_CAMERA, true); + setMouseBinding(::Qt::NoModifier, ::Qt::MidButton, qglviewer::SHOW_ENTIRE_SCENE, true); + setMouseBinding(::Qt::NoModifier, ::Qt::RightButton, qglviewer::CENTER_SCENE, true); - setWheelBinding(modifiers, CAMERA, ZOOM); + setWheelBinding(modifiers, qglviewer::CAMERA, qglviewer::ZOOM); } } @@ -3026,7 +3025,7 @@ Note that a CGAL::qglviewer::ManipulatedCameraFrame can be set as the manipulatedFrame(): it is possible to manipulate the camera of a first viewer in a second viewer. */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::setManipulatedFrame(ManipulatedFrame *frame) { +void CGAL::QGLViewer::setManipulatedFrame(qglviewer::ManipulatedFrame *frame) { if (manipulatedFrame()) { manipulatedFrame()->stopSpinning(); @@ -3041,7 +3040,7 @@ void CGAL::QGLViewer::setManipulatedFrame(ManipulatedFrame *frame) { manipulatedFrameIsACamera_ = ((manipulatedFrame() != camera()->frame()) && - (dynamic_cast(manipulatedFrame()) != NULL)); + (dynamic_cast(manipulatedFrame()) != NULL)); if (manipulatedFrame()) { // Prevent multiple connections, that would result in useless display @@ -4076,3 +4075,4 @@ void CGAL::QGLViewer::saveSnapshot() } +} diff --git a/GraphicsView/include/CGAL/Qt/quaternion_impl.h b/GraphicsView/include/CGAL/Qt/quaternion_impl.h index 69b8c39a193..5dd599da5d6 100644 --- a/GraphicsView/include/CGAL/Qt/quaternion_impl.h +++ b/GraphicsView/include/CGAL/Qt/quaternion_impl.h @@ -32,7 +32,9 @@ #include // RAND_MAX // All the methods are declared inline in Quaternion.h -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + /*! Constructs a Quaternion that will rotate from the \p from direction to the \p to direction. @@ -554,3 +556,4 @@ Quaternion Quaternion::randomQuaternion() { qreal t2 = 2.0 * CGAL_PI * (rand() / (qreal)RAND_MAX); return Quaternion(sin(t1) * r1, cos(t1) * r1, sin(t2) * r2, cos(t2) * r2); } +}} diff --git a/GraphicsView/include/CGAL/Qt/vec_impl.h b/GraphicsView/include/CGAL/Qt/vec_impl.h index 99e5acd1add..340c6cbf62c 100644 --- a/GraphicsView/include/CGAL/Qt/vec_impl.h +++ b/GraphicsView/include/CGAL/Qt/vec_impl.h @@ -32,7 +32,9 @@ // Most of the methods are declared inline in vec.h -using namespace CGAL::qglviewer; +namespace CGAL{ +namespace qglviewer{ + /*! Projects the Vec on the axis of direction \p direction that passes through the origin. @@ -176,3 +178,4 @@ CGAL_INLINE_FUNCTION std::ostream &operator<<(std::ostream &o, const Vec &v) { return o << v.x << '\t' << v.y << '\t' << v.z; } +}}