| camera.h | | camera.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 55 | |
| also means that the Camera frame() can be attached to a Frame::referenceF
rame() which enables | | also means that the Camera frame() can be attached to a Frame::referenceF
rame() which enables | |
| complex Camera setups. | | complex Camera setups. | |
| | | | |
| Different displacements can be performed using the mouse. The list of pos
sible actions is defined | | Different displacements can be performed using the mouse. The list of pos
sible actions is defined | |
| by the QGLViewer::MouseAction enum. Use QGLViewer::setMouseBinding() to a
ttach a specific action | | by the QGLViewer::MouseAction enum. Use QGLViewer::setMouseBinding() to a
ttach a specific action | |
| to an arbitrary mouse button-state key binding. These actions are detaile
d in the <a | | to an arbitrary mouse button-state key binding. These actions are detaile
d in the <a | |
| href="../mouse.html">mouse page</a>. | | href="../mouse.html">mouse page</a>. | |
| | | | |
| The default button binding are: QGLViewer::ROTATE (left), QGLViewer::ZOOM
(middle) and | | The default button binding are: QGLViewer::ROTATE (left), QGLViewer::ZOOM
(middle) and | |
| QGLViewer::TRANSLATE (right). With this configuration, the Camera \e obse
rves a scene and rotates | | QGLViewer::TRANSLATE (right). With this configuration, the Camera \e obse
rves a scene and rotates | |
|
| around its revolveAroundPoint(). You can switch between this mode and a f
ly mode using the | | around its pivotPoint(). You can switch between this mode and a fly mode
using the | |
| QGLViewer::CAMERA_MODE (see QGLViewer::toggleCameraMode()) keyboard short
cut (default is 'Space'). | | QGLViewer::CAMERA_MODE (see QGLViewer::toggleCameraMode()) keyboard short
cut (default is 'Space'). | |
| | | | |
| <h3>Other functionalities</h3> | | <h3>Other functionalities</h3> | |
| | | | |
| The type() of the Camera can be Camera::ORTHOGRAPHIC or Camera::PERSPECTI
VE (see Type()). | | The type() of the Camera can be Camera::ORTHOGRAPHIC or Camera::PERSPECTI
VE (see Type()). | |
| fieldOfView() is meaningless with Camera::ORTHOGRAPHIC. | | fieldOfView() is meaningless with Camera::ORTHOGRAPHIC. | |
| | | | |
| The near and far planes of the Camera are fitted to the scene and determi
ned from | | The near and far planes of the Camera are fitted to the scene and determi
ned from | |
| QGLViewer::sceneRadius(), QGLViewer::sceneCenter() and zClippingCoefficie
nt() by the zNear() and | | QGLViewer::sceneRadius(), QGLViewer::sceneCenter() and zClippingCoefficie
nt() by the zNear() and | |
| zFar() methods. Reasonable values on the scene extends hence have to be p
rovided to the QGLViewer | | zFar() methods. Reasonable values on the scene extends hence have to be p
rovided to the QGLViewer | |
| | | | |
| skipping to change at line 103 | | skipping to change at line 103 | |
| Camera(); | | Camera(); | |
| virtual ~Camera(); | | virtual ~Camera(); | |
| | | | |
| Camera(const Camera& camera); | | Camera(const Camera& camera); | |
| Camera& operator=(const Camera& camera); | | Camera& operator=(const Camera& camera); | |
| | | | |
| /*! Enumerates the two possible types of Camera. | | /*! Enumerates the two possible types of Camera. | |
| | | | |
| See type() and setType(). This type mainly defines different Camera
projection matrix (see | | See type() and setType(). This type mainly defines different Camera
projection matrix (see | |
| loadProjectionMatrix()). Many other methods (pointUnderPixel(), conv
ertClickToLine(), | | loadProjectionMatrix()). Many other methods (pointUnderPixel(), conv
ertClickToLine(), | |
|
| projectedCoordinatesOf(), pixelGLRatio()...) take this Type into acc
ount. */ | | projectedCoordinatesOf(), pixelGLRatio()...) are affected by this Ty
pe. */ | |
| enum Type { PERSPECTIVE, ORTHOGRAPHIC }; | | enum Type { PERSPECTIVE, ORTHOGRAPHIC }; | |
| | | | |
| /*! @name Position and orientation */ | | /*! @name Position and orientation */ | |
| //@{ | | //@{ | |
| public: | | public: | |
| Vec position() const; | | Vec position() const; | |
| Vec upVector() const; | | Vec upVector() const; | |
| Vec viewDirection() const; | | Vec viewDirection() const; | |
| Vec rightVector() const; | | Vec rightVector() const; | |
| Quaternion orientation() const; | | Quaternion orientation() const; | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 150 | |
| /*! @name Frustum */ | | /*! @name Frustum */ | |
| //@{ | | //@{ | |
| public: | | public: | |
| /*! Returns the Camera::Type of the Camera. | | /*! Returns the Camera::Type of the Camera. | |
| | | | |
| Set by setType(). Mainly used by loadProjectionMatrix(). | | Set by setType(). Mainly used by loadProjectionMatrix(). | |
| | | | |
| A Camera::PERSPECTIVE Camera uses a classical projection mainly defi
ned by its fieldOfView(). | | A Camera::PERSPECTIVE Camera uses a classical projection mainly defi
ned by its fieldOfView(). | |
| | | | |
| With a Camera::ORTHOGRAPHIC type(), the fieldOfView() is meaningless
and the width and height of | | With a Camera::ORTHOGRAPHIC type(), the fieldOfView() is meaningless
and the width and height of | |
|
| the Camera frustum are inferred from the distance to the revolveArou
ndPoint() using | | the Camera frustum are inferred from the distance to the pivotPoint(
) using | |
| getOrthoWidthHeight(). | | getOrthoWidthHeight(). | |
| | | | |
| Both types use zNear() and zFar() (to define their clipping planes)
and aspectRatio() (for | | Both types use zNear() and zFar() (to define their clipping planes)
and aspectRatio() (for | |
| frustum shape). */ | | frustum shape). */ | |
| Type type() const { return type_; } | | Type type() const { return type_; } | |
| | | | |
| /*! Returns the vertical field of view of the Camera (in radians). | | /*! Returns the vertical field of view of the Camera (in radians). | |
| | | | |
| Value is set using setFieldOfView(). Default value is pi/4 radians.
This value is meaningless if | | Value is set using setFieldOfView(). Default value is pi/4 radians.
This value is meaningless if | |
| the Camera type() is Camera::ORTHOGRAPHIC. | | the Camera type() is Camera::ORTHOGRAPHIC. | |
| | | | |
| skipping to change at line 291 | | skipping to change at line 291 | |
| | | | |
| /*! Returns the position of the scene center, defined in the world c
oordinate system. | | /*! Returns the position of the scene center, defined in the world c
oordinate system. | |
| | | | |
| The scene observed by the Camera should be roughly centered on this
position, and included in a | | The scene observed by the Camera should be roughly centered on this
position, and included in a | |
| sceneRadius() sphere. This approximate description of the scene perm
its a zNear() and zFar() | | sceneRadius() sphere. This approximate description of the scene perm
its a zNear() and zFar() | |
| clipping planes definition, and allows convenient positioning method
s such as showEntireScene(). | | clipping planes definition, and allows convenient positioning method
s such as showEntireScene(). | |
| | | | |
| Default value is (0,0,0) (world origin). Use setSceneCenter() to cha
nge it. See also | | Default value is (0,0,0) (world origin). Use setSceneCenter() to cha
nge it. See also | |
| setSceneBoundingBox(). | | setSceneBoundingBox(). | |
| | | | |
|
| Note that QGLViewer::sceneCenter() (resp. QGLViewer::setSceneCenter(
)) simply call this method | | Note that QGLViewer::sceneCenter() (resp. QGLViewer::setSceneCenter(
)) simply calls this method | |
| (resp. setSceneCenter()) on its associated QGLViewer::camera(). */ | | (resp. setSceneCenter()) on its associated QGLViewer::camera(). */ | |
| Vec sceneCenter() const { return sceneCenter_; } | | Vec sceneCenter() const { return sceneCenter_; } | |
| float distanceToSceneCenter() const; | | float distanceToSceneCenter() const; | |
| | | | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| void setSceneRadius(float radius); | | void setSceneRadius(float radius); | |
| void setSceneCenter(const Vec& center); | | void setSceneCenter(const Vec& center); | |
| bool setSceneCenterFromPixel(const QPoint& pixel); | | bool setSceneCenterFromPixel(const QPoint& pixel); | |
| void setSceneBoundingBox(const Vec& min, const Vec& max); | | void setSceneBoundingBox(const Vec& min, const Vec& max); | |
| //@} | | //@} | |
| | | | |
|
| /*! @name Revolve Around Point */ | | /*! @name Pivot Point */ | |
| //@{ | | //@{ | |
| public Q_SLOTS: | | public Q_SLOTS: | |
|
| void setRevolveAroundPoint(const Vec& rap); | | void setPivotPoint(const Vec& point); | |
| bool setRevolveAroundPointFromPixel(const QPoint& pixel); | | bool setPivotPointFromPixel(const QPoint& pixel); | |
| | | | |
| | | public: | |
| | | Vec pivotPoint() const; | |
| | | | |
|
| | | #ifndef DOXYGEN | |
| | | public Q_SLOTS: | |
| | | void setRevolveAroundPoint(const Vec& point); | |
| | | bool setRevolveAroundPointFromPixel(const QPoint& pixel); | |
| public: | | public: | |
| Vec revolveAroundPoint() const; | | Vec revolveAroundPoint() const; | |
|
| | | #endif | |
| //@} | | //@} | |
| | | | |
| /*! @name Associated frame */ | | /*! @name Associated frame */ | |
| //@{ | | //@{ | |
| public: | | public: | |
| /*! Returns the ManipulatedCameraFrame attached to the Camera. | | /*! Returns the ManipulatedCameraFrame attached to the Camera. | |
| | | | |
| This ManipulatedCameraFrame defines its position() and orientation()
and can translate mouse | | This ManipulatedCameraFrame defines its position() and orientation()
and can translate mouse | |
| events into Camera displacement. Set using setFrame(). */ | | events into Camera displacement. Set using setFrame(). */ | |
| ManipulatedCameraFrame* frame() const { return frame_; } | | ManipulatedCameraFrame* frame() const { return frame_; } | |
| | | | |
| skipping to change at line 351 | | skipping to change at line 359 | |
| //@{ | | //@{ | |
| public: | | public: | |
| virtual void loadProjectionMatrix(bool reset=true) const; | | virtual void loadProjectionMatrix(bool reset=true) const; | |
| virtual void loadModelViewMatrix(bool reset=true) const; | | virtual void loadModelViewMatrix(bool reset=true) const; | |
| void computeProjectionMatrix() const; | | void computeProjectionMatrix() const; | |
| void computeModelViewMatrix() const; | | void computeModelViewMatrix() const; | |
| | | | |
| virtual void loadProjectionMatrixStereo(bool leftBuffer=true) const; | | virtual void loadProjectionMatrixStereo(bool leftBuffer=true) const; | |
| virtual void loadModelViewMatrixStereo(bool leftBuffer=true) const; | | virtual void loadModelViewMatrixStereo(bool leftBuffer=true) const; | |
| | | | |
|
| | | void getProjectionMatrix(GLfloat m[16]) const; | |
| void getProjectionMatrix(GLdouble m[16]) const; | | void getProjectionMatrix(GLdouble m[16]) const; | |
|
| void getModelViewMatrix(GLdouble m[16]) const; | | | |
| void getModelViewProjectionMatrix(GLdouble m[16]) const; | | | |
| | | | |
|
| #ifndef DOXYGEN | | | |
| // Required for windows which otherwise silently fills | | | |
| void getProjectionMatrix(GLfloat m[16]) const; | | | |
| void getModelViewMatrix(GLfloat m[16]) const; | | void getModelViewMatrix(GLfloat m[16]) const; | |
|
| #endif | | void getModelViewMatrix(GLdouble m[16]) const; | |
| | | | |
| | | void getModelViewProjectionMatrix(GLfloat m[16]) const; | |
| | | void getModelViewProjectionMatrix(GLdouble m[16]) const; | |
| //@} | | //@} | |
| | | | |
| /*! @name Drawing */ | | /*! @name Drawing */ | |
| //@{ | | //@{ | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| static void drawCamera(float scale=1.0, float aspectRatio=1.33, floa
t fieldOfView=M_PI/4.0); | | static void drawCamera(float scale=1.0, float aspectRatio=1.33, floa
t fieldOfView=M_PI/4.0); | |
| #endif | | #endif | |
| virtual void draw(bool drawFarPlane=true, float scale=1.0) const; | | virtual void draw(bool drawFarPlane=true, float scale=1.0) const; | |
| //@} | | //@} | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 14 lines changed or deleted | | 21 lines changed or added | |
|
| domUtils.h | | domUtils.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| | | | |
| public: | | public: | |
| static float floatFromDom(const QDomElement& e, const QString& attri
bute, float defValue) | | static float floatFromDom(const QDomElement& e, const QString& attri
bute, float defValue) | |
| { | | { | |
| float value = defValue; | | float value = defValue; | |
| if (e.hasAttribute(attribute)) { | | if (e.hasAttribute(attribute)) { | |
| const QString s = e.attribute(attribute); | | const QString s = e.attribute(attribute); | |
| bool ok; | | bool ok; | |
| value = s.toFloat(&ok); | | value = s.toFloat(&ok); | |
| if (!ok) { | | if (!ok) { | |
|
| warning("Bad float syntax for attribute \""+ | | warning(QString("'%1' is not a valid float s | |
| attribute+"\" in initialization of \""+e.tagName()+"\". Setting value to "+ | | yntax for attribute \"%2\" in initialization of \"%3\". Setting value to %4 | |
| QString::number(value)+"."); | | .") | |
| | | .arg(s).arg(attribute).arg(e | |
| | | .tagName()).arg(QString::number(defValue))); | |
| value = defValue; | | value = defValue; | |
| } | | } | |
|
| } else | | } else { | |
| warning("\""+attribute+"\" attribute missing in init | | warning(QString("\"%1\" attribute missing in initial | |
| ialization of \""+e.tagName()+"\". Setting value to "+QString::number(value | | ization of \"%2\". Setting value to %3.") | |
| )+"."); | | .arg(attribute).arg(e.tagName()).arg | |
| | | (QString::number(value))); | |
| | | } | |
| | | | |
| #if defined(isnan) | | #if defined(isnan) | |
| // The "isnan" method may not be available on all platforms. | | // The "isnan" method may not be available on all platforms. | |
| // Find its equivalent or simply remove these two lines | | // Find its equivalent or simply remove these two lines | |
| if (isnan(value)) | | if (isnan(value)) | |
|
| warning("Warning, attribute \""+attribute+"\" initia | | warning(QString("Warning, attribute \"%1\" initializ | |
| lized to Not a Number in \""+e.tagName()+"\""); | | ed to Not a Number in \"%2\"") | |
| | | .arg(attribute).arg(e.tagName())); | |
| #endif | | #endif | |
| | | | |
| return value; | | return value; | |
| } | | } | |
| | | | |
| static double doubleFromDom(const QDomElement& e, const QString& att
ribute, double defValue) | | static double doubleFromDom(const QDomElement& e, const QString& att
ribute, double defValue) | |
| { | | { | |
| double value = defValue; | | double value = defValue; | |
| if (e.hasAttribute(attribute)) { | | if (e.hasAttribute(attribute)) { | |
| const QString s = e.attribute(attribute); | | const QString s = e.attribute(attribute); | |
| bool ok; | | bool ok; | |
| value = s.toDouble(&ok); | | value = s.toDouble(&ok); | |
| if (!ok) { | | if (!ok) { | |
|
| warning("Bad double syntax for attribute \"" | | warning(QString("'%1' is not a valid double | |
| +attribute+"\" in initialization of \""+e.tagName()+"\". Setting value to " | | syntax for attribute \"%2\" in initialization of \"%3\". Setting value to % | |
| +QString::number(value)+"."); | | 4.") | |
| | | .arg(s).arg(attribute).arg(e | |
| | | .tagName()).arg(QString::number(defValue))); | |
| value = defValue; | | value = defValue; | |
| } | | } | |
|
| } else | | } else { | |
| warning("\""+attribute+"\" attribute missing in init | | warning(QString("\"%1\" attribute missing in initial | |
| ialization of \""+e.tagName()+"\". Setting value to "+QString::number(value | | ization of \"%2\". Setting value to %3.") | |
| )+"."); | | .arg(attribute).arg(e.tagName()).arg | |
| | | (QString::number(value))); | |
| | | } | |
| | | | |
| #if defined(isnan) | | #if defined(isnan) | |
| // The "isnan" method may not be available on all platforms. | | // The "isnan" method may not be available on all platforms. | |
| // Find its equivalent or simply remove these two lines | | // Find its equivalent or simply remove these two lines | |
| if (isnan(value)) | | if (isnan(value)) | |
|
| warning("Warning, attribute \""+attribute+"\" initia | | warning(QString("Warning, attribute \"%1\" initializ | |
| lized to Not a Number in \""+e.tagName()+"\""); | | ed to Not a Number in \"%2\"") | |
| | | .arg(attribute).arg(e.tagName())); | |
| #endif | | #endif | |
| | | | |
| return value; | | return value; | |
| } | | } | |
| | | | |
| static int intFromDom(const QDomElement& e, const QString& attribute
, int defValue) | | static int intFromDom(const QDomElement& e, const QString& attribute
, int defValue) | |
| { | | { | |
| int value = defValue; | | int value = defValue; | |
| if (e.hasAttribute(attribute)) | | if (e.hasAttribute(attribute)) | |
| { | | { | |
| const QString s = e.attribute(attribute); | | const QString s = e.attribute(attribute); | |
| bool ok; | | bool ok; | |
|
| s.toInt(&ok); | | value = s.toInt(&ok); | |
| if (ok) | | if (!ok) { | |
| value = s.toInt(); | | warning(QString("'%1' is not a valid integer | |
| else | | syntax for attribute \"%2\" in initialization of \"%3\". Setting value to | |
| warning("Bad integer syntax for attribute \" | | %4.") | |
| "+attribute+"\" in initialization of \""+e.tagName()+"\". Setting value to | | .arg(s).arg(attribute).arg(e | |
| "+QString::number(value)+"."); | | .tagName()).arg(QString::number(defValue))); | |
| | | value = defValue; | |
| | | } | |
| | | } else { | |
| | | warning(QString("\"%1\" attribute missing in initial | |
| | | ization of \"%2\". Setting value to %3.") | |
| | | .arg(attribute).arg(e.tagName()).arg | |
| | | (QString::number(value))); | |
| } | | } | |
|
| else | | | |
| warning("\""+attribute+"\" attribute missing in init | | | |
| ialization of \""+e.tagName()+"\". Setting value to "+QString::number(value | | | |
| )+"."); | | | |
| return value; | | return value; | |
| } | | } | |
| | | | |
| static bool boolFromDom(const QDomElement& e, const QString& attribu
te, bool defValue) | | static bool boolFromDom(const QDomElement& e, const QString& attribu
te, bool defValue) | |
| { | | { | |
| bool value = defValue; | | bool value = defValue; | |
| if (e.hasAttribute(attribute)) | | if (e.hasAttribute(attribute)) | |
| { | | { | |
| const QString s = e.attribute(attribute); | | const QString s = e.attribute(attribute); | |
| if (s.toLower() == QString("true")) | | if (s.toLower() == QString("true")) | |
| value = true; | | value = true; | |
| else if (s.toLower() == QString("false")) | | else if (s.toLower() == QString("false")) | |
| value = false; | | value = false; | |
| else | | else | |
| { | | { | |
|
| warning("Bad boolean syntax for attribute \" | | warning(QString("'%1' is not a valid boolean | |
| "+attribute+"\" in initialization of \""+e.tagName()+"\" (should be \"true\ | | syntax for attribute \"%2\" in initialization of \"%3\". Setting value to | |
| " or \"false\")."); | | %4.") | |
| warning("Setting value to "+(value?QString(" | | .arg(s).arg(attribute).arg(e | |
| true."):QString("false."))); | | .tagName()).arg(defValue?"true":"false")); | |
| } | | } | |
|
| | | } else { | |
| | | warning(QString("\"%1\" attribute missing in initial | |
| | | ization of \"%2\". Setting value to %3.") | |
| | | .arg(attribute).arg(e.tagName()).arg | |
| | | (value?"true":"false")); | |
| } | | } | |
|
| else | | | |
| warning("\""+attribute+"\" attribute missing in init | | | |
| ialization of \""+e.tagName()+"\". Setting value to "+(value?QString("true. | | | |
| "):QString("false."))); | | | |
| return value; | | return value; | |
| } | | } | |
| | | | |
|
| | | static void setBoolAttribute(QDomElement& element, const QString& at | |
| | | tribute, bool value) { | |
| | | element.setAttribute(attribute, (value ? "true" : "false")); | |
| | | } | |
| | | | |
| static QDomElement QColorDomElement(const QColor& color, const QStri
ng& name, QDomDocument& doc) | | static QDomElement QColorDomElement(const QColor& color, const QStri
ng& name, QDomDocument& doc) | |
| { | | { | |
| QDomElement de = doc.createElement(name); | | QDomElement de = doc.createElement(name); | |
| de.setAttribute("red", QString::number(color.red())); | | de.setAttribute("red", QString::number(color.red())); | |
| de.setAttribute("green", QString::number(color.green())); | | de.setAttribute("green", QString::number(color.green())); | |
| de.setAttribute("blue", QString::number(color.blue())); | | de.setAttribute("blue", QString::number(color.blue())); | |
| return de; | | return de; | |
| } | | } | |
| | | | |
| static QColor QColorFromDom(const QDomElement& e) | | static QColor QColorFromDom(const QDomElement& e) | |
| | | | |
End of changes. 13 change blocks. |
| 39 lines changed or deleted | | 60 lines changed or added | |
|
| frame.h | | frame.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 156 | |
| frame is encountered): | | frame is encountered): | |
| \code | | \code | |
| // Emits the Frame modified() signal when its referenceFrame() is mo
dified(). | | // Emits the Frame modified() signal when its referenceFrame() is mo
dified(). | |
| connect(myFrame->referenceFrame(), SIGNAL(modified()), myFrame, SIGN
AL(modified())); | | connect(myFrame->referenceFrame(), SIGNAL(modified()), myFrame, SIGN
AL(modified())); | |
| \endcode | | \endcode | |
| | | | |
| \attention Connecting this signal to a QGLWidget::update() slot (or
a method that calls it) | | \attention Connecting this signal to a QGLWidget::update() slot (or
a method that calls it) | |
| will prevent you from modifying the Frame \e inside your QGLViewer::
draw() method as it would | | will prevent you from modifying the Frame \e inside your QGLViewer::
draw() method as it would | |
| result in an infinite loop. However, QGLViewer::draw() should not mo
dify the scene. | | result in an infinite loop. However, QGLViewer::draw() should not mo
dify the scene. | |
| | | | |
|
| \note For efficiency reasons, this signal is emitted even if the Fra | | \note Note that this signal might be emitted even if the Frame is no | |
| me is not actually modified, for | | t actually modified, for | |
| instance with translate(Vec(0,0,0)) or setPosition(position()). */ | | instance after a translate(Vec(0,0,0)) or a setPosition(position()). | |
| | | */ | |
| void modified(); | | void modified(); | |
| | | | |
| /*! This signal is emitted when the Frame is interpolated by a KeyFr
ameInterpolator. | | /*! This signal is emitted when the Frame is interpolated by a KeyFr
ameInterpolator. | |
| | | | |
| See the KeyFrameInterpolator documentation for details. | | See the KeyFrameInterpolator documentation for details. | |
| | | | |
| If a KeyFrameInterpolator is used to successively interpolate severa
l Frames in your scene, | | If a KeyFrameInterpolator is used to successively interpolate severa
l Frames in your scene, | |
| connect the KeyFrameInterpolator::interpolated() signal instead (ide
ntical, but independent of | | connect the KeyFrameInterpolator::interpolated() signal instead (ide
ntical, but independent of | |
| the interpolated Frame). */ | | the interpolated Frame). */ | |
| void interpolated(); | | void interpolated(); | |
| | | | |
| skipping to change at line 185 | | skipping to change at line 185 | |
| void setPosition(float x, float y, float z); | | void setPosition(float x, float y, float z); | |
| void setPositionWithConstraint(Vec& position); | | void setPositionWithConstraint(Vec& position); | |
| | | | |
| void setOrientation(const Quaternion& orientation); | | void setOrientation(const Quaternion& orientation); | |
| void setOrientation(double q0, double q1, double q2, double q3); | | void setOrientation(double q0, double q1, double q2, double q3); | |
| void setOrientationWithConstraint(Quaternion& orientation); | | void setOrientationWithConstraint(Quaternion& orientation); | |
| | | | |
| void setPositionAndOrientation(const Vec& position, const Quaternion
& orientation); | | void setPositionAndOrientation(const Vec& position, const Quaternion
& orientation); | |
| void setPositionAndOrientationWithConstraint(Vec& position, Quaterni
on& orientation); | | void setPositionAndOrientationWithConstraint(Vec& position, Quaterni
on& orientation); | |
| | | | |
|
| /*! Returns the position of the Frame, defined in the world coordina | | Vec position() const; | |
| te system. See also | | | |
| orientation(), setPosition() and translation(). */ | | | |
| Vec position() const { return inverseCoordinatesOf(Vec(0.0,0.0,0.0)) | | | |
| ; } | | | |
| Quaternion orientation() const; | | Quaternion orientation() const; | |
| | | | |
| void getPosition(float& x, float& y, float& z) const; | | void getPosition(float& x, float& y, float& z) const; | |
| void getOrientation(double& q0, double& q1, double& q2, double& q3)
const; | | void getOrientation(double& q0, double& q1, double& q2, double& q3)
const; | |
| //@} | | //@} | |
| | | | |
| public: | | public: | |
| /*! @name Local translation and rotation w/r reference Frame */ | | /*! @name Local translation and rotation w/r reference Frame */ | |
| //@{ | | //@{ | |
| /*! Sets the translation() of the frame, locally defined with respec
t to the referenceFrame(). | | /*! Sets the translation() of the frame, locally defined with respec
t to the referenceFrame(). | |
| | | | |
| skipping to change at line 287 | | skipping to change at line 285 | |
| void rotate(Quaternion& q); | | void rotate(Quaternion& q); | |
| void rotate(const Quaternion& q); | | void rotate(const Quaternion& q); | |
| // Some compilers complain about "overloading cannot distinguish fro
m previous declaration" | | // Some compilers complain about "overloading cannot distinguish fro
m previous declaration" | |
| // Simply comment out the following method and its associated implem
entation | | // Simply comment out the following method and its associated implem
entation | |
| void rotate(double q0, double q1, double q2, double q3); | | void rotate(double q0, double q1, double q2, double q3); | |
| void rotate(double& q0, double& q1, double& q2, double& q3); | | void rotate(double& q0, double& q1, double& q2, double& q3); | |
| | | | |
| void rotateAroundPoint(Quaternion& rotation, const Vec& point); | | void rotateAroundPoint(Quaternion& rotation, const Vec& point); | |
| void rotateAroundPoint(const Quaternion& rotation, const Vec& point)
; | | void rotateAroundPoint(const Quaternion& rotation, const Vec& point)
; | |
| | | | |
|
| void alignWithFrame(const Frame* const frame, bool move=false, float
threshold=0.85f); | | void alignWithFrame(const Frame* const frame, bool move=false, float
threshold=0.0f); | |
| void projectOnLine(const Vec& origin, const Vec& direction); | | void projectOnLine(const Vec& origin, const Vec& direction); | |
| //@} | | //@} | |
| | | | |
| /*! @name Coordinate system transformation of 3D coordinates */ | | /*! @name Coordinate system transformation of 3D coordinates */ | |
| //@{ | | //@{ | |
| Vec coordinatesOf(const Vec& src) const; | | Vec coordinatesOf(const Vec& src) const; | |
| Vec inverseCoordinatesOf(const Vec& src) const; | | Vec inverseCoordinatesOf(const Vec& src) const; | |
| Vec localCoordinatesOf(const Vec& src) const; | | Vec localCoordinatesOf(const Vec& src) const; | |
| Vec localInverseCoordinatesOf(const Vec& src) const; | | Vec localInverseCoordinatesOf(const Vec& src) const; | |
| Vec coordinatesOfIn(const Vec& src, const Frame* const in) const; | | Vec coordinatesOfIn(const Vec& src, const Frame* const in) const; | |
| | | | |
End of changes. 4 change blocks. |
| 10 lines changed or deleted | | 7 lines changed or added | |
|
| manipulatedCameraFrame.h | | manipulatedCameraFrame.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| | | | |
| namespace qglviewer { | | namespace qglviewer { | |
| /*! \brief The ManipulatedCameraFrame class represents a ManipulatedFrame w
ith Camera specific mouse bindings. | | /*! \brief The ManipulatedCameraFrame class represents a ManipulatedFrame w
ith Camera specific mouse bindings. | |
| \class ManipulatedCameraFrame manipulatedCameraFrame.h QGLViewer/manipula
tedCameraFrame.h | | \class ManipulatedCameraFrame manipulatedCameraFrame.h QGLViewer/manipula
tedCameraFrame.h | |
| | | | |
| A ManipulatedCameraFrame is a specialization of a ManipulatedFrame, desig
ned to be set as the | | A ManipulatedCameraFrame is a specialization of a ManipulatedFrame, desig
ned to be set as the | |
| Camera::frame(). Mouse motions are basically interpreted in a negated way
: when the mouse goes to | | Camera::frame(). Mouse motions are basically interpreted in a negated way
: when the mouse goes to | |
| the right, the ManipulatedFrame translation goes to the right, while the
ManipulatedCameraFrame | | the right, the ManipulatedFrame translation goes to the right, while the
ManipulatedCameraFrame | |
| has to go to the \e left, so that the \e scene seems to move to the right
. | | has to go to the \e left, so that the \e scene seems to move to the right
. | |
| | | | |
|
| A ManipulatedCameraFrame rotates around its revolveAroundPoint(), which c | | A ManipulatedCameraFrame rotates around its pivotPoint(), which correspon | |
| orresponds to the | | ds to the | |
| associated Camera::revolveAroundPoint(). | | associated Camera::pivotPoint(). | |
| | | | |
| A ManipulatedCameraFrame can also "fly" in the scene. It basically moves
forward, and turns | | A ManipulatedCameraFrame can also "fly" in the scene. It basically moves
forward, and turns | |
|
| according to the mouse motion. See flySpeed(), flyUpVector() and the QGLV
iewer::MOVE_FORWARD and | | according to the mouse motion. See flySpeed(), sceneUpVector() and the QG
LViewer::MOVE_FORWARD and | |
| QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction. | | QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction. | |
| | | | |
| See the <a href="../mouse.html">mouse page</a> for a description of the p
ossible actions that can | | See the <a href="../mouse.html">mouse page</a> for a description of the p
ossible actions that can | |
| be performed using the mouse and their bindings. | | be performed using the mouse and their bindings. | |
| \nosubgrouping */ | | \nosubgrouping */ | |
| class QGLVIEWER_EXPORT ManipulatedCameraFrame : public ManipulatedFrame | | class QGLVIEWER_EXPORT ManipulatedCameraFrame : public ManipulatedFrame | |
| { | | { | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| friend class Camera; | | friend class Camera; | |
| friend class ::QGLViewer; | | friend class ::QGLViewer; | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
| ManipulatedCameraFrame(); | | ManipulatedCameraFrame(); | |
| /*! Virtual destructor. Empty. */ | | /*! Virtual destructor. Empty. */ | |
| virtual ~ManipulatedCameraFrame() {} | | virtual ~ManipulatedCameraFrame() {} | |
| | | | |
| ManipulatedCameraFrame(const ManipulatedCameraFrame& mcf); | | ManipulatedCameraFrame(const ManipulatedCameraFrame& mcf); | |
| ManipulatedCameraFrame& operator=(const ManipulatedCameraFrame& mcf)
; | | ManipulatedCameraFrame& operator=(const ManipulatedCameraFrame& mcf)
; | |
| | | | |
|
| /*! @name Revolve around point */ | | /*! @name Pivot point */ | |
| //@{ | | //@{ | |
| public: | | public: | |
|
| /*! Returns the point the ManipulatedCameraFrame revolves around whe
n rotated. | | /*! Returns the point the ManipulatedCameraFrame pivot point, around
which the camera rotates. | |
| | | | |
| It is defined in the world coordinate system. Default value is (0,0,
0). | | It is defined in the world coordinate system. Default value is (0,0,
0). | |
| | | | |
|
| When the ManipulatedCameraFrame is associated to a Camera, Camera::r
evolveAroundPoint() also | | When the ManipulatedCameraFrame is associated to a Camera, Camera::p
ivotPoint() also | |
| returns this value. This point can interactively be changed using th
e mouse (see | | returns this value. This point can interactively be changed using th
e mouse (see | |
|
| QGLViewer::RAP_FROM_PIXEL and QGLViewer::RAP_IS_CENTER in the <a hre | | Camera::setPivotPointFromPixel() and QGLViewer::RAP_FROM_PIXEL and Q | |
| f="../mouse.html">mouse | | GLViewer::RAP_IS_CENTER | |
| page</a>). */ | | in the <a href="../mouse.html">mouse page</a>). */ | |
| Vec revolveAroundPoint() const { return revolveAroundPoint_; } | | Vec pivotPoint() const { return pivotPoint_; } | |
| /*! Sets the revolveAroundPoint(), defined in the world coordinate s | | /*! Sets the pivotPoint(), defined in the world coordinate system. * | |
| ystem. */ | | / | |
| void setRevolveAroundPoint(const Vec& revolveAroundPoint) { revolveA | | void setPivotPoint(const Vec& point) { pivotPoint_ = point; } | |
| roundPoint_ = revolveAroundPoint; } | | | |
| | | #ifndef DOXYGEN | |
| | | Vec revolveAroundPoint() const { qWarning("revolveAroundPoint() is d | |
| | | eprecated, use pivotPoint() instead"); return pivotPoint(); } | |
| | | void setRevolveArountPoint(const Vec& point) { qWarning("setRevolveA | |
| | | roundPoint() is deprecated, use setPivotPoint() instead"); setPivotPoint(po | |
| | | int); } | |
| | | #endif | |
| | | //@} | |
| | | | |
| | | /*! @name Camera manipulation */ | |
| | | //@{ | |
| | | public: | |
| | | /*! Returns \c true when the frame's rotation is constrained around | |
| | | the sceneUpVector(), | |
| | | and \c false otherwise, when the rotation is completely free | |
| | | (default). | |
| | | | |
| | | In free mode, the associated camera can be arbitrarily rotat | |
| | | ed in the scene, along its | |
| | | three axis, thus possibly leading to any arbitrary orientati | |
| | | on. | |
| | | | |
| | | When you setRotatesAroundUpVector() to \c true, the sceneUpV | |
| | | ector() defines a | |
| | | 'vertical' direction around which the camera rotates. The ca | |
| | | mera can rotate left | |
| | | or right, around this axis. It can also be moved up or down | |
| | | to show the 'top' and | |
| | | 'bottom' views of the scene. As a result, the sceneUpVector( | |
| | | ) will always appear vertical | |
| | | in the scene, and the horizon is preserved and stays project | |
| | | ed along the camera's | |
| | | horizontal axis. | |
| | | | |
| | | Note that setting this value to \c true when the sceneUpVect | |
| | | or() is not already | |
| | | vertically projected will break these invariants. It will al | |
| | | so limit the possible movement | |
| | | of the camera, possibly up to a lock when the sceneUpVector( | |
| | | ) is projected horizontally. | |
| | | Use Camera::setUpVector() to define the sceneUpVector() and | |
| | | align the camera before calling | |
| | | this method to ensure this does not happen. */ | |
| | | bool rotatesAroundUpVector() const { return rotatesAroundUpVector_; | |
| | | } | |
| | | /*! Sets the value of rotatesAroundUpVector(). | |
| | | | |
| | | Default value is false (free rotation). */ | |
| | | void setRotatesAroundUpVector(bool constrained) { rotatesAroundUpVec | |
| | | tor_ = constrained; } | |
| | | | |
| | | /*! Returns whether or not the QGLViewer::ZOOM action zooms on the p | |
| | | ivot point. | |
| | | | |
| | | When set to \c false (default), a zoom action will move the camera | |
| | | along its Camera::viewDirection(), | |
| | | i.e. back and forth along a direction perpendicular to the project | |
| | | ion screen. | |
| | | | |
| | | setZoomsOnPivotPoint() to \c true will move the camera along an ax | |
| | | is defined by the | |
| | | Camera::pivotPoint() and its current position instead. As a result | |
| | | , the projected position of the | |
| | | pivot point on screen will stay the same during a zoom. */ | |
| | | bool zoomsOnPivotPoint() const { return zoomsOnPivotPoint_; } | |
| | | /*! Sets the value of zoomsOnPivotPoint(). | |
| | | | |
| | | Default value is false. */ | |
| | | void setZoomsOnPivotPoint(bool enabled) { zoomsOnPivotPoint_ = enabl | |
| | | ed; } | |
| | | | |
| | | private: | |
| | | #ifndef DOXYGEN | |
| | | void zoom(float delta, const Camera * const camera); | |
| | | #endif | |
| //@} | | //@} | |
| | | | |
| /*! @name Fly parameters */ | | /*! @name Fly parameters */ | |
| //@{ | | //@{ | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| /*! Sets the flySpeed(), defined in OpenGL units. | | /*! Sets the flySpeed(), defined in OpenGL units. | |
| | | | |
| Default value is 0.0, but it is modified according to the QGLViewer:
:sceneRadius() when the | | Default value is 0.0, but it is modified according to the QGLViewer:
:sceneRadius() when the | |
| ManipulatedCameraFrame is set as the Camera::frame(). */ | | ManipulatedCameraFrame is set as the Camera::frame(). */ | |
| void setFlySpeed(float speed) { flySpeed_ = speed; } | | void setFlySpeed(float speed) { flySpeed_ = speed; } | |
| | | | |
|
| /*! Sets the flyUpVector(), defined in the world coordinate system. | | /*! Sets the sceneUpVector(), defined in the world coordinate system
. | |
| | | | |
|
| Default value is (0,1,0), but it is updated by the Camera when set a | | Default value is (0,1,0), but it is updated by the Camera when this | |
| s its Camera::frame(). Use | | object is set as its Camera::frame(). | |
| Camera::setUpVector() instead in that case. */ | | Using Camera::setUpVector() instead is probably a better solution. * | |
| void setFlyUpVector(const Vec& up) { flyUpVector_ = up; } | | / | |
| | | void setSceneUpVector(const Vec& up) { sceneUpVector_ = up; } | |
| | | | |
| public: | | public: | |
| /*! Returns the fly speed, expressed in OpenGL units. | | /*! Returns the fly speed, expressed in OpenGL units. | |
| | | | |
| It corresponds to the incremental displacement that is periodically
applied to the | | It corresponds to the incremental displacement that is periodically
applied to the | |
| ManipulatedCameraFrame position when a QGLViewer::MOVE_FORWARD or QG
LViewer::MOVE_BACKWARD | | ManipulatedCameraFrame position when a QGLViewer::MOVE_FORWARD or QG
LViewer::MOVE_BACKWARD | |
| QGLViewer::MouseAction is proceeded. | | QGLViewer::MouseAction is proceeded. | |
| | | | |
| \attention When the ManipulatedCameraFrame is set as the Camera::fra
me(), this value is set | | \attention When the ManipulatedCameraFrame is set as the Camera::fra
me(), this value is set | |
| according to the QGLViewer::sceneRadius() by QGLViewer::setSceneRadi
us(). */ | | according to the QGLViewer::sceneRadius() by QGLViewer::setSceneRadi
us(). */ | |
| float flySpeed() const { return flySpeed_; } | | float flySpeed() const { return flySpeed_; } | |
| | | | |
|
| /*! Returns the up vector used in fly mode, expressed in the world c
oordinate system. | | /*! Returns the up vector of the scene, expressed in the world coord
inate system. | |
| | | | |
|
| Fly mode corresponds to the QGLViewer::MOVE_FORWARD and QGLViewer::M | | In 'fly mode' (corresponding to the QGLViewer::MOVE_FORWARD and QGLV | |
| OVE_BACKWARD | | iewer::MOVE_BACKWARD | |
| QGLViewer::MouseAction bindings. In these modes, horizontal displace | | QGLViewer::MouseAction bindings), horizontal displacements of the mo | |
| ments of the mouse rotate | | use rotate | |
| the ManipulatedCameraFrame around this vector. Vertical displacement
s rotate always around the | | the ManipulatedCameraFrame around this vector. Vertical displacement
s rotate always around the | |
| Camera \c X axis. | | Camera \c X axis. | |
| | | | |
|
| Default value is (0,1,0), but it is updated by the Camera when set a | | This value is also used when setRotationIsConstrained() is set to \c | |
| s its Camera::frame(). | | true to define the up vector | |
| Camera::setOrientation() and Camera::setUpVector()) modify this valu | | (and incidentally the 'horizon' plane) around which the camera will | |
| e and should be used | | rotate. | |
| | | | |
| | | Default value is (0,1,0), but it is updated by the Camera when this | |
| | | object is set as its Camera::frame(). | |
| | | Camera::setOrientation() and Camera::setUpVector()) direclty modify | |
| | | this value and should be used | |
| instead. */ | | instead. */ | |
|
| Vec flyUpVector() const { return flyUpVector_; } | | Vec sceneUpVector() const { return sceneUpVector_; } | |
| | | | |
| | | #ifndef DOXYGEN | |
| | | Vec flyUpVector() const; | |
| | | void setFlyUpVector(const Vec& up); | |
| | | #endif | |
| //@} | | //@} | |
| | | | |
| /*! @name Mouse event handlers */ | | /*! @name Mouse event handlers */ | |
| //@{ | | //@{ | |
| protected: | | protected: | |
| virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* con
st camera); | | virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* con
st camera); | |
| virtual void mouseMoveEvent (QMouseEvent* const event, Camera* con
st camera); | | virtual void mouseMoveEvent (QMouseEvent* const event, Camera* con
st camera); | |
| virtual void wheelEvent (QWheelEvent* const event, Camera* con
st camera); | | virtual void wheelEvent (QWheelEvent* const event, Camera* con
st camera); | |
| //@} | | //@} | |
| | | | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 210 | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| protected: | | protected: | |
| virtual void startAction(int ma, bool withConstraint=true); // int i
s really a QGLViewer::MouseAction | | virtual void startAction(int ma, bool withConstraint=true); // int i
s really a QGLViewer::MouseAction | |
| #endif | | #endif | |
| | | | |
| private Q_SLOTS: | | private Q_SLOTS: | |
| virtual void flyUpdate(); | | virtual void flyUpdate(); | |
| | | | |
| private: | | private: | |
|
| void updateFlyUpVector(); | | void updateSceneUpVector(); | |
| Quaternion turnQuaternion(int x, const Camera* const camera); | | Quaternion turnQuaternion(int x, const Camera* const camera); | |
| Quaternion pitchYawQuaternion(int x, int y, const Camera* const came
ra); | | Quaternion pitchYawQuaternion(int x, int y, const Camera* const came
ra); | |
| | | | |
| private: | | private: | |
| // Fly mode data | | // Fly mode data | |
| float flySpeed_; | | float flySpeed_; | |
| float driveSpeed_; | | float driveSpeed_; | |
|
| Vec flyUpVector_; | | Vec sceneUpVector_; | |
| QTimer flyTimer_; | | QTimer flyTimer_; | |
| | | | |
|
| Vec revolveAroundPoint_; | | bool rotatesAroundUpVector_; | |
| | | // Inverse the direction of an horizontal mouse motion. Depends on t | |
| | | he projected | |
| | | // screen orientation of the vertical axis when the mouse button is | |
| | | pressed. | |
| | | bool constrainedRotationIsReversed_; | |
| | | | |
| | | bool zoomsOnPivotPoint_; | |
| | | | |
| | | Vec pivotPoint_; | |
| }; | | }; | |
| | | | |
| } // namespace qglviewer | | } // namespace qglviewer | |
| | | | |
| #endif // QGLVIEWER_MANIPULATED_CAMERA_FRAME_H | | #endif // QGLVIEWER_MANIPULATED_CAMERA_FRAME_H | |
| | | | |
End of changes. 16 change blocks. |
| 34 lines changed or deleted | | 129 lines changed or added | |
|
| manipulatedFrame.h | | manipulatedFrame.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 142 | | skipping to change at line 142 | |
| you need to connect this signal to all the viewers. | | you need to connect this signal to all the viewers. | |
| | | | |
| See also the manipulated(), modified(), interpolated() and KeyFrameI
nterpolator::interpolated() | | See also the manipulated(), modified(), interpolated() and KeyFrameI
nterpolator::interpolated() | |
| signals' documentations. */ | | signals' documentations. */ | |
| void spun(); | | void spun(); | |
| | | | |
| /*! @name Manipulation sensitivity */ | | /*! @name Manipulation sensitivity */ | |
| //@{ | | //@{ | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| /*! Defines the rotationSensitivity(). */ | | /*! Defines the rotationSensitivity(). */ | |
|
| void setRotationSensitivity(float sensitivity) { rotSensitivity_ = s
ensitivity; } | | void setRotationSensitivity(float sensitivity) { rotationSensitivity
_ = sensitivity; } | |
| /*! Defines the translationSensitivity(). */ | | /*! Defines the translationSensitivity(). */ | |
|
| void setTranslationSensitivity(float sensitivity) { transSensitivity
_ = sensitivity; } | | void setTranslationSensitivity(float sensitivity) { translationSensi
tivity_ = sensitivity; } | |
| /*! Defines the spinningSensitivity(), in pixels per milliseconds. *
/ | | /*! Defines the spinningSensitivity(), in pixels per milliseconds. *
/ | |
| void setSpinningSensitivity(float sensitivity) { spinningSensitivity
_ = sensitivity; } | | void setSpinningSensitivity(float sensitivity) { spinningSensitivity
_ = sensitivity; } | |
| /*! Defines the wheelSensitivity(). */ | | /*! Defines the wheelSensitivity(). */ | |
| void setWheelSensitivity(float sensitivity) { wheelSensitivity_ = se
nsitivity; } | | void setWheelSensitivity(float sensitivity) { wheelSensitivity_ = se
nsitivity; } | |
|
| | | /*! Defines the zoomSensitivity(). */ | |
| | | void setZoomSensitivity(float sensitivity) { zoomSensitivity_ = sens | |
| | | itivity; } | |
| | | | |
| public: | | public: | |
| /*! Returns the influence of a mouse displacement on the Manipulated
Frame rotation. | | /*! Returns the influence of a mouse displacement on the Manipulated
Frame rotation. | |
| | | | |
| Default value is 1.0. With an identical mouse displacement, a higher
value will generate a | | Default value is 1.0. With an identical mouse displacement, a higher
value will generate a | |
| larger rotation (and inversely for lower values). A 0.0 value will f
orbid ManipulatedFrame mouse | | larger rotation (and inversely for lower values). A 0.0 value will f
orbid ManipulatedFrame mouse | |
| rotation (see also constraint()). | | rotation (see also constraint()). | |
| | | | |
| See also setRotationSensitivity(), translationSensitivity(), spinnin
gSensitivity() and | | See also setRotationSensitivity(), translationSensitivity(), spinnin
gSensitivity() and | |
| wheelSensitivity(). */ | | wheelSensitivity(). */ | |
|
| float rotationSensitivity() const { return rotSensitivity_; } | | float rotationSensitivity() const { return rotationSensitivity_; } | |
| /*! Returns the influence of a mouse displacement on the Manipulated
Frame translation. | | /*! Returns the influence of a mouse displacement on the Manipulated
Frame translation. | |
| | | | |
| Default value is 1.0. You should not have to modify this value, sinc
e with 1.0 the | | Default value is 1.0. You should not have to modify this value, sinc
e with 1.0 the | |
| ManipulatedFrame precisely stays under the mouse cursor. | | ManipulatedFrame precisely stays under the mouse cursor. | |
| | | | |
| With an identical mouse displacement, a higher value will generate a
larger translation (and | | With an identical mouse displacement, a higher value will generate a
larger translation (and | |
| inversely for lower values). A 0.0 value will forbid ManipulatedFram
e mouse translation (see | | inversely for lower values). A 0.0 value will forbid ManipulatedFram
e mouse translation (see | |
| also constraint()). | | also constraint()). | |
| | | | |
| \note When the ManipulatedFrame is used to move a \e Camera (see the
ManipulatedCameraFrame | | \note When the ManipulatedFrame is used to move a \e Camera (see the
ManipulatedCameraFrame | |
| class documentation), after zooming on a small region of your scene,
the camera may translate | | class documentation), after zooming on a small region of your scene,
the camera may translate | |
|
| too fast. For a camera, it is the Camera::revolveAroundPoint() that
exactly matches the mouse | | too fast. For a camera, it is the Camera::pivotPoint() that exactly
matches the mouse | |
| displacement. Hence, instead of changing the translationSensitivity(
), solve the problem by | | displacement. Hence, instead of changing the translationSensitivity(
), solve the problem by | |
|
| (temporarily) setting the Camera::revolveAroundPoint() to a point on
the zoomed region (see the | | (temporarily) setting the Camera::pivotPoint() to a point on the zoo
med region (see the | |
| QGLViewer::RAP_FROM_PIXEL mouse binding in the <a href="../mouse.htm
l">mouse page</a>). | | QGLViewer::RAP_FROM_PIXEL mouse binding in the <a href="../mouse.htm
l">mouse page</a>). | |
| | | | |
| See also setTranslationSensitivity(), rotationSensitivity(), spinnin
gSensitivity() and | | See also setTranslationSensitivity(), rotationSensitivity(), spinnin
gSensitivity() and | |
| wheelSensitivity(). */ | | wheelSensitivity(). */ | |
|
| float translationSensitivity() const { return transSensitivity_; } | | float translationSensitivity() const { return translationSensitivity
_; } | |
| /*! Returns the minimum mouse speed required (at button release) to
make the ManipulatedFrame | | /*! Returns the minimum mouse speed required (at button release) to
make the ManipulatedFrame | |
| spin(). | | spin(). | |
| | | | |
| See spin(), spinningQuaternion() and startSpinning() for details. | | See spin(), spinningQuaternion() and startSpinning() for details. | |
| | | | |
| Mouse speed is expressed in pixels per milliseconds. Default value i
s 0.3 (300 pixels per | | Mouse speed is expressed in pixels per milliseconds. Default value i
s 0.3 (300 pixels per | |
| second). Use setSpinningSensitivity() to tune this value. A higher v
alue will make spinning more | | second). Use setSpinningSensitivity() to tune this value. A higher v
alue will make spinning more | |
| difficult (a value of 100.0 forbids spinning in practice). | | difficult (a value of 100.0 forbids spinning in practice). | |
| | | | |
| See also setSpinningSensitivity(), translationSensitivity(), rotatio
nSensitivity() and | | See also setSpinningSensitivity(), translationSensitivity(), rotatio
nSensitivity() and | |
| wheelSensitivity(). */ | | wheelSensitivity(). */ | |
| float spinningSensitivity() const { return spinningSensitivity_; } | | float spinningSensitivity() const { return spinningSensitivity_; } | |
|
| | | | |
| | | /*! Returns the zoom sensitivity. | |
| | | | |
| | | Default value is 1.0. A higher value will make the zoom faster. | |
| | | Use a negative value to invert the zoom in and out directions. | |
| | | | |
| | | See also setZoomSensitivity(), translationSensitivity(), rotationSen | |
| | | sitivity() wheelSensitivity() | |
| | | and spinningSensitivity(). */ | |
| | | float zoomSensitivity() const { return zoomSensitivity_; } | |
| /*! Returns the mouse wheel sensitivity. | | /*! Returns the mouse wheel sensitivity. | |
| | | | |
| Default value is 1.0. A higher value will make the wheel action more
efficient (usually meaning | | Default value is 1.0. A higher value will make the wheel action more
efficient (usually meaning | |
| a faster zoom). Use a negative value to invert the zoom in and out d
irections. | | a faster zoom). Use a negative value to invert the zoom in and out d
irections. | |
| | | | |
|
| See also setWheelSensitivity(), translationSensitivity(), rotationSe | | See also setWheelSensitivity(), translationSensitivity(), rotationSe | |
| nsitivity() and | | nsitivity() zoomSensitivity() | |
| spinningSensitivity(). */ | | and spinningSensitivity(). */ | |
| float wheelSensitivity() const { return wheelSensitivity_; } | | float wheelSensitivity() const { return wheelSensitivity_; } | |
| //@} | | //@} | |
| | | | |
| /*! @name Spinning */ | | /*! @name Spinning */ | |
| //@{ | | //@{ | |
| public: | | public: | |
| /*! Returns \c true when the ManipulatedFrame is spinning. | | /*! Returns \c true when the ManipulatedFrame is spinning. | |
| | | | |
| During spinning, spin() rotates the ManipulatedFrame by its spinning
Quaternion() at a frequency | | During spinning, spin() rotates the ManipulatedFrame by its spinning
Quaternion() at a frequency | |
| defined when the ManipulatedFrame startSpinning(). | | defined when the ManipulatedFrame startSpinning(). | |
| | | | |
| skipping to change at line 283 | | skipping to change at line 295 | |
| protected: | | protected: | |
| Quaternion deformedBallQuaternion(int x, int y, float cx, float cy,
const Camera* const camera); | | Quaternion deformedBallQuaternion(int x, int y, float cx, float cy,
const Camera* const camera); | |
| | | | |
| QGLViewer::MouseAction action_; | | QGLViewer::MouseAction action_; | |
| Constraint* previousConstraint_; // When manipulation is without Con
traint. | | Constraint* previousConstraint_; // When manipulation is without Con
traint. | |
| | | | |
| virtual void startAction(int ma, bool withConstraint=true); // int i
s really a QGLViewer::MouseAction | | virtual void startAction(int ma, bool withConstraint=true); // int i
s really a QGLViewer::MouseAction | |
| void computeMouseSpeed(const QMouseEvent* const e); | | void computeMouseSpeed(const QMouseEvent* const e); | |
| int mouseOriginalDirection(const QMouseEvent* const e); | | int mouseOriginalDirection(const QMouseEvent* const e); | |
| | | | |
|
| | | /*! Returns a screen scaled delta from event's position to prevPos_, | |
| | | along the | |
| | | X or Y direction, whichever has the largest magnitude. */ | |
| | | float deltaWithPrevPos(QMouseEvent* const event, Camera* const camer | |
| | | a) const; | |
| | | /*! Returns a normalized wheel delta, proportionnal to wheelSensitiv | |
| | | ity(). */ | |
| | | float wheelDelta(const QWheelEvent* event) const; | |
| | | | |
| // Previous mouse position (used for incremental updates) and mouse
press position. | | // Previous mouse position (used for incremental updates) and mouse
press position. | |
| QPoint prevPos_, pressPos_; | | QPoint prevPos_, pressPos_; | |
|
| | | | |
| | | private: | |
| | | void zoom(float delta, const Camera * const camera); | |
| | | | |
| #endif // DOXYGEN | | #endif // DOXYGEN | |
| | | | |
| private: | | private: | |
| // Sensitivity | | // Sensitivity | |
|
| float rotSensitivity_; | | float rotationSensitivity_; | |
| float transSensitivity_; | | float translationSensitivity_; | |
| float spinningSensitivity_; | | float spinningSensitivity_; | |
| float wheelSensitivity_; | | float wheelSensitivity_; | |
|
| | | float zoomSensitivity_; | |
| | | | |
| // Mouse speed and spinning | | // Mouse speed and spinning | |
| QTime last_move_time; | | QTime last_move_time; | |
| float mouseSpeed_; | | float mouseSpeed_; | |
| int delay_; | | int delay_; | |
| bool isSpinning_; | | bool isSpinning_; | |
| QTimer spinningTimer_; | | QTimer spinningTimer_; | |
| Quaternion spinningQuaternion_; | | Quaternion spinningQuaternion_; | |
| | | | |
| // Whether the SCREEN_TRANS direction (horizontal or vertical) is fi
xed or not. | | // Whether the SCREEN_TRANS direction (horizontal or vertical) is fi
xed or not. | |
| | | | |
End of changes. 14 change blocks. |
| 12 lines changed or deleted | | 40 lines changed or added | |
|
| qglviewer.h | | qglviewer.h | |
| /**************************************************************************
** | | /**************************************************************************
** | |
| | | | |
| Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | | Copyright (C) 2002-2013 Gilles Debunne. All rights reserved. | |
| | | | |
|
| This file is part of the QGLViewer library version 2.5.1. | | This file is part of the QGLViewer library version 2.5.2. | |
| | | | |
| http://www.libqglviewer.com - contact@libqglviewer.com | | http://www.libqglviewer.com - contact@libqglviewer.com | |
| | | | |
| This file may be used under the terms of the GNU General Public License | | This file may be used under the terms of the GNU General Public License | |
| versions 2.0 or 3.0 as published by the Free Software Foundation and | | versions 2.0 or 3.0 as published by the Free Software Foundation and | |
| appearing in the LICENSE file included in the packaging of this file. | | appearing in the LICENSE file included in the packaging of this file. | |
| In addition, as a special exception, Gilles Debunne gives you certain | | In addition, as a special exception, Gilles Debunne gives you certain | |
| additional rights, described in the file GPL_EXCEPTION in this package. | | additional rights, described in the file GPL_EXCEPTION in this package. | |
| | | | |
| libQGLViewer uses dual licensing. Commercial/proprietary software must | | libQGLViewer uses dual licensing. Commercial/proprietary software must | |
| | | | |
| skipping to change at line 211 | | skipping to change at line 211 | |
| Default value is 1.0. This method is equivalent to camera()->sceneRa
dius(). See | | Default value is 1.0. This method is equivalent to camera()->sceneRa
dius(). See | |
| setSceneRadius(). */ | | setSceneRadius(). */ | |
| float sceneRadius() const { return camera()->sceneRadius(); } | | float sceneRadius() const { return camera()->sceneRadius(); } | |
| /*! Returns the scene center, defined in world coordinates. | | /*! Returns the scene center, defined in world coordinates. | |
| | | | |
| See sceneRadius() for details. | | See sceneRadius() for details. | |
| | | | |
| Default value is (0,0,0). Simply a wrapper for camera()->sceneCenter
(). Set using | | Default value is (0,0,0). Simply a wrapper for camera()->sceneCenter
(). Set using | |
| setSceneCenter(). | | setSceneCenter(). | |
| | | | |
|
| Do not mismatch this value (that only depends on the scene) with the
qglviewer::Camera::revolveAroundPoint(). */ | | Do not mismatch this value (that only depends on the scene) with the
qglviewer::Camera::pivotPoint(). */ | |
| qglviewer::Vec sceneCenter() const { return camera()->sceneCenter();
} | | qglviewer::Vec sceneCenter() const { return camera()->sceneCenter();
} | |
| | | | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| /*! Sets the sceneRadius(). | | /*! Sets the sceneRadius(). | |
| | | | |
| The camera() qglviewer::Camera::flySpeed() is set to 1% of t
his value by this method. Simple | | The camera() qglviewer::Camera::flySpeed() is set to 1% of t
his value by this method. Simple | |
| wrapper around camera()->setSceneRadius(). */ | | wrapper around camera()->setSceneRadius(). */ | |
| virtual void setSceneRadius(float radius) { camera()->setSceneRadius
(radius); } | | virtual void setSceneRadius(float radius) { camera()->setSceneRadius
(radius); } | |
| | | | |
| /*! Sets the sceneCenter(), defined in world coordinates. | | /*! Sets the sceneCenter(), defined in world coordinates. | |
| | | | |
|
| \attention The qglviewer::Camera::revolveAroundPoint() is se
t to the sceneCenter() value by this | | \attention The qglviewer::Camera::pivotPoint() is set to the
sceneCenter() value by this | |
| method. */ | | method. */ | |
| virtual void setSceneCenter(const qglviewer::Vec& center) { camera()
->setSceneCenter(center); } | | virtual void setSceneCenter(const qglviewer::Vec& center) { camera()
->setSceneCenter(center); } | |
| | | | |
| /*! Convenient way to call setSceneCenter() and setSceneRadius() fro
m a (world axis aligned) bounding box of the scene. | | /*! Convenient way to call setSceneCenter() and setSceneRadius() fro
m a (world axis aligned) bounding box of the scene. | |
| | | | |
| This is equivalent to: | | This is equivalent to: | |
| \code | | \code | |
| setSceneCenter((min+max) / 2.0); | | setSceneCenter((min+max) / 2.0); | |
| setSceneRadius((max-min).norm() / 2.0); | | setSceneRadius((max-min).norm() / 2.0); | |
| \endcode */ | | \endcode */ | |
| | | | |
| skipping to change at line 357 | | skipping to change at line 357 | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| void setFullScreen(bool fullScreen=true); | | void setFullScreen(bool fullScreen=true); | |
| void setStereoDisplay(bool stereo=true); | | void setStereoDisplay(bool stereo=true); | |
| /*! Toggles the state of isFullScreen(). See also setFullScreen(). *
/ | | /*! Toggles the state of isFullScreen(). See also setFullScreen(). *
/ | |
| void toggleFullScreen() { setFullScreen(!isFullScreen()); } | | void toggleFullScreen() { setFullScreen(!isFullScreen()); } | |
| /*! Toggles the state of displaysInStereo(). See setStereoDisplay().
*/ | | /*! Toggles the state of displaysInStereo(). See setStereoDisplay().
*/ | |
| void toggleStereoDisplay() { setStereoDisplay(!stereo_); } | | void toggleStereoDisplay() { setStereoDisplay(!stereo_); } | |
| void toggleCameraMode(); | | void toggleCameraMode(); | |
| | | | |
| private: | | private: | |
|
| bool cameraIsInRevolveMode() const; | | bool cameraIsInRotateMode() const; | |
| //@} | | //@} | |
| | | | |
| /*! @name Display methods */ | | /*! @name Display methods */ | |
| //@{ | | //@{ | |
| public: | | public: | |
| static void drawArrow(float length=1.0f, float radius=-1.0f, int nbS
ubdivisions=12); | | static void drawArrow(float length=1.0f, float radius=-1.0f, int nbS
ubdivisions=12); | |
| static void drawArrow(const qglviewer::Vec& from, const qglviewer::V
ec& to, float radius=-1.0f, int nbSubdivisions=12); | | static void drawArrow(const qglviewer::Vec& from, const qglviewer::V
ec& to, float radius=-1.0f, int nbSubdivisions=12); | |
| static void drawAxis(float length=1.0f); | | static void drawAxis(float length=1.0f); | |
| static void drawGrid(float size=1.0f, int nbSubdivisions=10); | | static void drawGrid(float size=1.0f, int nbSubdivisions=10); | |
| | | | |
| | | | |
| skipping to change at line 888 | | skipping to change at line 888 | |
| selected entity. | | selected entity. | |
| | | | |
| The default implementation is empty. Overload this method if needed,
and use selectedName() to | | The default implementation is empty. Overload this method if needed,
and use selectedName() to | |
| retrieve the selected entity name (returns -1 if no object was selec
ted). See the <a | | retrieve the selected entity name (returns -1 if no object was selec
ted). See the <a | |
| href="../examples/select.html">select example</a> for an illustratio
n. */ | | href="../examples/select.html">select example</a> for an illustratio
n. */ | |
| virtual void postSelection(const QPoint& point) { Q_UNUSED(point); } | | virtual void postSelection(const QPoint& point) { Q_UNUSED(point); } | |
| //@} | | //@} | |
| | | | |
| /*! @name Keyboard customization */ | | /*! @name Keyboard customization */ | |
| //@{ | | //@{ | |
|
| protected: | | public: | |
| /*! Defines the different actions that can be associated with a keyb
oard shortcut using | | /*! Defines the different actions that can be associated with a keyb
oard shortcut using | |
| setShortcut(). | | setShortcut(). | |
| | | | |
| See the <a href="../keyboard.html">keyboard page</a> for details. */ | | See the <a href="../keyboard.html">keyboard page</a> for details. */ | |
| enum KeyboardAction { DRAW_AXIS, DRAW_GRID, DISPLAY_FPS, ENABLE_TEXT
, EXIT_VIEWER, | | enum KeyboardAction { DRAW_AXIS, DRAW_GRID, DISPLAY_FPS, ENABLE_TEXT
, EXIT_VIEWER, | |
| SAVE_SCREENSHOT, CAMERA_MO
DE, FULL_SCREEN, STEREO, ANIMATION, HELP, EDIT_CAMERA, | | SAVE_SCREENSHOT, CAMERA_MO
DE, FULL_SCREEN, STEREO, ANIMATION, HELP, EDIT_CAMERA, | |
| MOVE_CAMERA_LEFT, MOVE_CAM
ERA_RIGHT, MOVE_CAMERA_UP, MOVE_CAMERA_DOWN, | | MOVE_CAMERA_LEFT, MOVE_CAM
ERA_RIGHT, MOVE_CAMERA_UP, MOVE_CAMERA_DOWN, | |
| INCREASE_FLYSPEED, DECREAS
E_FLYSPEED, SNAPSHOT_TO_CLIPBOARD }; | | INCREASE_FLYSPEED, DECREAS
E_FLYSPEED, SNAPSHOT_TO_CLIPBOARD }; | |
|
| public: | | | |
| unsigned int shortcut(KeyboardAction action) const; | | unsigned int shortcut(KeyboardAction action) const; | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| // QGLViewer 1.x | | // QGLViewer 1.x | |
| int keyboardAccelerator(KeyboardAction action) const; | | int keyboardAccelerator(KeyboardAction action) const; | |
| Qt::Key keyFrameKey(int index) const; | | Qt::Key keyFrameKey(int index) const; | |
| Qt::KeyboardModifiers playKeyFramePathStateKey() const; | | Qt::KeyboardModifiers playKeyFramePathStateKey() const; | |
| // QGLViewer 2.0 without Qt4 support | | // QGLViewer 2.0 without Qt4 support | |
| Qt::KeyboardModifiers addKeyFrameStateKey() const; | | Qt::KeyboardModifiers addKeyFrameStateKey() const; | |
| Qt::KeyboardModifiers playPathStateKey() const; | | Qt::KeyboardModifiers playPathStateKey() const; | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 980 | | skipping to change at line 980 | |
| MouseAction mouseAction(Qt::Key key, Qt::KeyboardModifiers modifiers
, Qt::MouseButton button) const; | | MouseAction mouseAction(Qt::Key key, Qt::KeyboardModifiers modifiers
, Qt::MouseButton button) const; | |
| int mouseHandler(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::M
ouseButton button) const; | | int mouseHandler(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::M
ouseButton button) const; | |
| | | | |
| void getMouseActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint, | | void getMouseActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint, | |
| Qt::Key& key, Qt:
:KeyboardModifiers& modifiers, Qt::MouseButton& button) const; | | Qt::Key& key, Qt:
:KeyboardModifiers& modifiers, Qt::MouseButton& button) const; | |
| | | | |
| ClickAction clickAction(Qt::Key key, Qt::KeyboardModifiers modifiers
, Qt::MouseButton button, | | ClickAction clickAction(Qt::Key key, Qt::KeyboardModifiers modifiers
, Qt::MouseButton button, | |
| bool doubleClick=fal
se, Qt::MouseButtons buttonsBefore=Qt::NoButton) const; | | bool doubleClick=fal
se, Qt::MouseButtons buttonsBefore=Qt::NoButton) const; | |
| | | | |
| void getClickActionBinding(ClickAction action, Qt::Key& key, Qt::Key
boardModifiers& modifiers, | | void getClickActionBinding(ClickAction action, Qt::Key& key, Qt::Key
boardModifiers& modifiers, | |
|
| Qt::MouseButton& bu
tton, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const; | | Qt::MouseButton&
button, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const; | |
| | | | |
| MouseAction wheelAction(Qt::Key key, Qt::KeyboardModifiers modifiers
) const; | | MouseAction wheelAction(Qt::Key key, Qt::KeyboardModifiers modifiers
) const; | |
| int wheelHandler(Qt::Key key, Qt::KeyboardModifiers modifiers) const
; | | int wheelHandler(Qt::Key key, Qt::KeyboardModifiers modifiers) const
; | |
| | | | |
| void getWheelActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint, | | void getWheelActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint, | |
| Qt::Key& key, Qt:
:KeyboardModifiers& modifiers) const; | | Qt::Key& key, Qt:
:KeyboardModifiers& modifiers) const; | |
| | | | |
| public Q_SLOTS: | | public Q_SLOTS: | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| void setMouseBinding(int state, MouseHandler handler, MouseAction ac
tion, bool withConstraint=true); | | void setMouseBinding(int state, MouseHandler handler, MouseAction ac
tion, bool withConstraint=true); | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|