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.0. This file is part of the QGLViewer library version 2.5.1.
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
purchase a libQGLViewer Commercial License. purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_CAMERA_H #ifndef QGLVIEWER_CAMERA_H
#define QGLVIEWER_CAMERA_H #define QGLVIEWER_CAMERA_H
#include "manipulatedCameraFrame.h"
#include "keyFrameInterpolator.h" #include "keyFrameInterpolator.h"
class QGLViewer;
namespace qglviewer { namespace qglviewer {
class ManipulatedCameraFrame;
/*! \brief A perspective or orthographic camera. /*! \brief A perspective or orthographic camera.
\class Camera camera.h QGLViewer/camera.h \class Camera camera.h QGLViewer/camera.h
A Camera defines some intrinsic parameters (fieldOfView(), position(), vi ewDirection(), A Camera defines some intrinsic parameters (fieldOfView(), position(), vi ewDirection(),
upVector()...) and useful positioning tools that ease its placement (show EntireScene(), upVector()...) and useful positioning tools that ease its placement (show EntireScene(),
fitSphere(), lookAt()...). It exports its associated OpenGL projection an d modelview matrices and fitSphere(), lookAt()...). It exports its associated OpenGL projection an d modelview matrices and
can interactively be modified using the mouse. can interactively be modified using the mouse.
<h3>Mouse manipulation</h3> <h3>Mouse manipulation</h3>
skipping to change at line 106 skipping to change at line 109
/*! 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()...) take this Type into acc ount. */
enum Type { PERSPECTIVE, ORTHOGRAPHIC }; enum Type { PERSPECTIVE, ORTHOGRAPHIC };
/*! @name Position and orientation */ /*! @name Position and orientation */
//@{ //@{
public: public:
/*! Returns the Camera position (the eye), defined in the world coor Vec position() const;
dinate system. Vec upVector() const;
Vec viewDirection() const;
Use setPosition() to set the Camera position. Other convenient metho Vec rightVector() const;
ds are showEntireScene() or Quaternion orientation() const;
fitSphere(). Actually returns \c frame()->position().
This position corresponds to the projection center of a Camera::PERS
PECTIVE Camera. It is not
located in the image plane, which is at a zNear() distance ahead. */
Vec position() const { return frame()->position(); }
/*! Returns the normalized up vector of the Camera, defined in the w
orld coordinate system.
Set using setUpVector() or setOrientation(). It is orthogonal to vie
wDirection() and to
rightVector().
It corresponds to the Y axis of the associated frame() (actually ret
urns
frame()->inverseTransformOf(Vec(0.0, 1.0, 0.0)) ). */
Vec upVector() const
{
return frame()->inverseTransformOf(Vec(0.0, 1.0, 0.0));
}
/*! Returns the normalized view direction of the Camera, defined in
the world coordinate system.
Change this value using setViewDirection(), lookAt() or setOrientati
on(). It is orthogonal to
upVector() and to rightVector().
This corresponds to the negative Z axis of the frame() ( frame()->in
verseTransformOf(Vec(0.0,
0.0, -1.0)) ). */
Vec viewDirection() const { return frame()->inverseTransformOf(Vec(0
.0, 0.0, -1.0)); }
/*! Returns the normalized right vector of the Camera, defined in th
e world coordinate system.
This vector lies in the Camera horizontal plane, directed along the
X axis (orthogonal to
upVector() and to viewDirection()). Set using setUpVector(), lookAt(
) or setOrientation().
Simply returns frame()->inverseTransformOf(Vec(1.0, 0.0, 0.0)). */
Vec rightVector() const
{
return frame()->inverseTransformOf(Vec(1.0, 0.0, 0.0));
}
/*! Returns the Camera orientation, defined in the world coordinate
system.
Actually returns \c frame()->orientation(). Use setOrientation(), se
tUpVector() or lookAt() to
set the Camera orientation. */
Quaternion orientation() const { return frame()->orientation(); }
void setFromModelViewMatrix(const GLdouble* const modelViewMatrix); void setFromModelViewMatrix(const GLdouble* const modelViewMatrix);
void setFromProjectionMatrix(const float matrix[12]); void setFromProjectionMatrix(const float matrix[12]);
public Q_SLOTS: public Q_SLOTS:
/*! Sets the Camera position() (the eye), defined in the world coord void setPosition(const Vec& pos);
inate system. */
void setPosition(const Vec& pos) { frame()->setPosition(pos); }
void setOrientation(const Quaternion& q); void setOrientation(const Quaternion& q);
void setOrientation(float theta, float phi); void setOrientation(float theta, float phi);
void setUpVector(const Vec& up, bool noMove=true); void setUpVector(const Vec& up, bool noMove=true);
void setViewDirection(const Vec& direction); void setViewDirection(const Vec& direction);
//@} //@}
/*! @name Positioning tools */ /*! @name Positioning tools */
//@{ //@{
public Q_SLOTS: public Q_SLOTS:
void lookAt(const Vec& target); void lookAt(const Vec& target);
skipping to change at line 348 skipping to change at line 310
void setSceneBoundingBox(const Vec& min, const Vec& max); void setSceneBoundingBox(const Vec& min, const Vec& max);
//@} //@}
/*! @name Revolve Around Point */ /*! @name Revolve Around Point */
//@{ //@{
public Q_SLOTS: public Q_SLOTS:
void setRevolveAroundPoint(const Vec& rap); void setRevolveAroundPoint(const Vec& rap);
bool setRevolveAroundPointFromPixel(const QPoint& pixel); bool setRevolveAroundPointFromPixel(const QPoint& pixel);
public: public:
/*! The point the Camera revolves around with the QGLViewer::ROTATE Vec revolveAroundPoint() const;
mouse binding. Defined in world coordinate system.
Default value is the sceneCenter().
\attention setSceneCenter() changes this value. */
Vec revolveAroundPoint() const { return frame()->revolveAroundPoint(
); }
//@} //@}
/*! @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 416 skipping to change at line 373
//@{ //@{
#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;
//@} //@}
/*! @name World to Camera coordinate systems conversions */ /*! @name World to Camera coordinate systems conversions */
//@{ //@{
public: public:
/*! Returns the Camera frame coordinates of a point \p src defined i Vec cameraCoordinatesOf(const Vec& src) const;
n world coordinates. Vec worldCoordinatesOf(const Vec& src) const;
worldCoordinatesOf() performs the inverse transformation.
Note that the point coordinates are simply converted in a different
coordinate system. They are
not projected on screen. Use projectedCoordinatesOf() for that. */
Vec cameraCoordinatesOf(const Vec& src) const { return frame()->coor
dinatesOf(src); }
/*! Returns the world coordinates of the point whose position \p src
is defined in the Camera
coordinate system.
cameraCoordinatesOf() performs the inverse transformation. */
Vec worldCoordinatesOf(const Vec& src) const { return frame()->inver
seCoordinatesOf(src); }
void getCameraCoordinatesOf(const float src[3], float res[3]) const; void getCameraCoordinatesOf(const float src[3], float res[3]) const;
void getWorldCoordinatesOf(const float src[3], float res[3]) const; void getWorldCoordinatesOf(const float src[3], float res[3]) const;
//@} //@}
/*! @name 2D screen to 3D world coordinate systems conversions */ /*! @name 2D screen to 3D world coordinate systems conversions */
//@{ //@{
public: public:
Vec projectedCoordinatesOf(const Vec& src, const Frame* frame=NULL) const; Vec projectedCoordinatesOf(const Vec& src, const Frame* frame=NULL) const;
Vec unprojectedCoordinatesOf(const Vec& src, const Frame* frame=NULL ) const; Vec unprojectedCoordinatesOf(const Vec& src, const Frame* frame=NULL ) const;
void getProjectedCoordinatesOf(const float src[3], float res[3], con st Frame* frame=NULL) const; void getProjectedCoordinatesOf(const float src[3], float res[3], con st Frame* frame=NULL) const;
void getUnprojectedCoordinatesOf(const float src[3], float res[3], c onst Frame* frame=NULL) const; void getUnprojectedCoordinatesOf(const float src[3], float res[3], c onst Frame* frame=NULL) const;
void convertClickToLine(const QPoint& pixel, Vec& orig, Vec& dir) co nst; void convertClickToLine(const QPoint& pixel, Vec& orig, Vec& dir) co nst;
Vec pointUnderPixel(const QPoint& pixel, bool& found) const; Vec pointUnderPixel(const QPoint& pixel, bool& found) const;
//@} //@}
/*! @name Fly speed */ /*! @name Fly speed */
//@{ //@{
public: public:
/*! Returns the fly speed of the Camera. float flySpeed() const;
Simply returns frame()->flySpeed(). See the ManipulatedCameraFrame::
flySpeed() documentation.
This value is only meaningful when the MouseAction bindings is QGLVi
ewer::MOVE_FORWARD or
QGLViewer::MOVE_BACKWARD.
Set to 1% of the sceneRadius() by setSceneRadius(). See also setFlyS
peed(). */
float flySpeed() const { return frame()->flySpeed(); }
public Q_SLOTS: public Q_SLOTS:
/*! Sets the Camera flySpeed(). void setFlySpeed(float speed);
\attention This value is modified by setSceneRadius(). */
void setFlySpeed(float speed) { frame()->setFlySpeed(speed); }
//@} //@}
/*! @name Stereo parameters */ /*! @name Stereo parameters */
//@{ //@{
public: public:
/*! Returns the user's inter-ocular distance (in meters). Default va lue is 0.062m, which fits most people. /*! Returns the user's inter-ocular distance (in meters). Default va lue is 0.062m, which fits most people.
loadProjectionMatrixStereo() uses this value to define the Camera of fset and frustum. See loadProjectionMatrixStereo() uses this value to define the Camera of fset and frustum. See
setIODistance(). */ setIODistance(). */
float IODistance() const { return IODistance_; } float IODistance() const { return IODistance_; }
 End of changes. 10 change blocks. 
105 lines changed or deleted 16 lines changed or added


 config.h   config.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.0. This file is part of the QGLViewer library version 2.5.1.
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 31 skipping to change at line 31
*************************************************************************** **/ *************************************************************************** **/
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// libQGLViewer configuration file // // libQGLViewer configuration file //
// Modify these settings according to your local configuration // // Modify these settings according to your local configuration //
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
#ifndef QGLVIEWER_CONFIG_H #ifndef QGLVIEWER_CONFIG_H
#define QGLVIEWER_CONFIG_H #define QGLVIEWER_CONFIG_H
#define QGLVIEWER_VERSION 0x020500 #define QGLVIEWER_VERSION 0x020501
// Needed for Qt < 4 (?) // Needed for Qt < 4 (?)
#ifndef QT_CLEAN_NAMESPACE #ifndef QT_CLEAN_NAMESPACE
# define QT_CLEAN_NAMESPACE # define QT_CLEAN_NAMESPACE
#endif #endif
// Get QT_VERSION and other Qt flags // Get QT_VERSION and other Qt flags
#include <qglobal.h> #include <qglobal.h>
#if QT_VERSION < 0x030000 #if QT_VERSION < 0x040000
# ifdef _OS_WIN32_ Error : libQGLViewer requires a minimum Qt version of 4.0
# define Q_OS_WIN32
# endif
#endif #endif
// Win 32 DLL export macros // Win 32 DLL export macros
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
# ifndef M_PI # ifndef M_PI
# define M_PI 3.14159265358979323846f # define M_PI 3.14159265358979323846f
# endif # endif
# ifndef QGLVIEWER_STATIC # ifndef QGLVIEWER_STATIC
# ifdef CREATE_QGLVIEWER_DLL # ifdef CREATE_QGLVIEWER_DLL
# if QT_VERSION >= 0x040500 # if QT_VERSION >= 0x040500
skipping to change at line 79 skipping to change at line 77
# pragma warning( disable : 4786 ) // identifier truncated to 255 in brows er information (Visual 6). # pragma warning( disable : 4786 ) // identifier truncated to 255 in brows er information (Visual 6).
# endif # endif
#endif // Q_OS_WIN32 #endif // Q_OS_WIN32
// For other architectures, this macro is empty // For other architectures, this macro is empty
#ifndef QGLVIEWER_EXPORT #ifndef QGLVIEWER_EXPORT
# define QGLVIEWER_EXPORT # define QGLVIEWER_EXPORT
#endif #endif
// OpenGL includes - Included here and hence shared by all the files that n eed OpenGL headers. // OpenGL includes - Included here and hence shared by all the files that n eed OpenGL headers.
#if QT_VERSION >= 0x040000
# include <QGLWidget> # include <QGLWidget>
#else
# include <qgl.h>
#endif
// GLU was removed from Qt in version 4.8 // GLU was removed from Qt in version 4.8
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
# include <OpenGL/glu.h> # include <OpenGL/glu.h>
#else #else
# include <GL/glu.h> # include <GL/glu.h>
#endif #endif
// Old Qt versions require GLUT for text rendering
#define QGLVIEWER_QT_VERSION_WITHOUT_GLUT 0x030100
#if QT_VERSION < QGLVIEWER_QT_VERSION_WITHOUT_GLUT
# ifdef Q_OS_MAC
# include <GLUT/glut.h>
# else
# ifdef Q_OS_WIN32
# include <glut.h>
# else
# include <GL/glut.h>
# endif
# endif
#endif
// Container classes interfaces changed a lot in Qt. // Container classes interfaces changed a lot in Qt.
// Compatibility patches are all grouped here. // Compatibility patches are all grouped here.
#if QT_VERSION >= 0x040000 #include <QList>
# include <QList> #include <QVector>
# include <QVector>
#else
# define qMax(a,b) QMAX(a,b)
# include <qptrlist.h>
# include <qvaluevector.h>
#endif
// Support for the no_keywords CONFIG option on previous Qt versions
#if QT_VERSION < 0x040400
# define Q_SLOTS slots
# define Q_SIGNALS signals
# define Q_EMIT emit
#endif
// For deprecated methods // For deprecated methods
// #define __WHERE__ "In file "<<__FILE__<<", line "<<__LINE__<<": " // #define __WHERE__ "In file "<<__FILE__<<", line "<<__LINE__<<": "
// #define orientationAxisAngle(x,y,z,a) { std::cout << __WHERE__ << "getOr ientationAxisAngle()." << std::endl; exit(0); } // #define orientationAxisAngle(x,y,z,a) { std::cout << __WHERE__ << "getOr ientationAxisAngle()." << std::endl; exit(0); }
// Patch for gcc version <= 2.95. Seems to no longer be needed with recent Qt versions. // Patch for gcc version <= 2.95. Seems to no longer be needed with recent Qt versions.
// Uncomment these lines if you have error message dealing with operator << on QStrings // Uncomment these lines if you have error message dealing with operator << on QStrings
// #if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ < 3) && (_ _GNUC_MINOR__ < 96) // #if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ < 3) && (_ _GNUC_MINOR__ < 96)
// # include <iostream> // # include <iostream>
// # include <qstring.h> // # include <qstring.h>
 End of changes. 7 change blocks. 
39 lines changed or deleted 6 lines changed or added


 constraint.h   constraint.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.0. This file is part of the QGLViewer library version 2.5.1.
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
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 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.0. This file is part of the QGLViewer library version 2.5.1.
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
purchase a libQGLViewer Commercial License. purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#include "config.h" #include "config.h"
#if QT_VERSION >= 0x040000 #include <QDomElement>
# include <QDomElement> #include <QString>
# include <QString> #include <QStringList>
# include <QStringList> #include <QColor>
# include <QColor>
#else
# include <qapplication.h>
# include <qdom.h>
# include <qstring.h>
# include <qstringlist.h>
# include <qcolor.h>
#endif
#include <math.h> #include <math.h>
#ifndef DOXYGEN #ifndef DOXYGEN
// QDomElement loading with syntax checking. // QDomElement loading with syntax checking.
class DomUtils class DomUtils
{ {
private: private:
static void warning(const QString& message) static void warning(const QString& message)
{ {
#if QT_VERSION >= 0x040000
qWarning("%s", message.toLatin1().constData()); qWarning("%s", message.toLatin1().constData());
#else
qWarning("%s", message.latin1());
#endif
} }
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);
skipping to change at line 128 skipping to change at line 116
warning("\""+attribute+"\" attribute missing in init ialization of \""+e.tagName()+"\". Setting value to "+QString::number(value )+"."); 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 QT_VERSION >= 0x040000
if (s.toLower() == QString("true")) if (s.toLower() == QString("true"))
#else
if (s.lower() == QString("true"))
#endif
value = true; value = true;
#if QT_VERSION >= 0x040000
else if (s.toLower() == QString("false")) else if (s.toLower() == QString("false"))
#else
else if (s.lower() == QString("false"))
#endif
value = false; value = false;
else else
{ {
warning("Bad boolean syntax for attribute \" "+attribute+"\" in initialization of \""+e.tagName()+"\" (should be \"true\ " or \"false\")."); warning("Bad boolean syntax for attribute \" "+attribute+"\" in initialization of \""+e.tagName()+"\" (should be \"true\ " or \"false\").");
warning("Setting value to "+(value?QString(" true."):QString("false."))); warning("Setting value to "+(value?QString(" true."):QString("false.")));
} }
} }
else else
warning("\""+attribute+"\" attribute missing in init ialization of \""+e.tagName()+"\". Setting value to "+(value?QString("true. "):QString("false."))); warning("\""+attribute+"\" attribute missing in init ialization of \""+e.tagName()+"\". Setting value to "+(value?QString("true. "):QString("false.")));
return value; return value;
skipping to change at line 165 skipping to change at line 145
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)
{ {
int color[3]; int color[3];
QStringList attribute; QStringList attribute;
attribute << "red" << "green" << "blue"; attribute << "red" << "green" << "blue";
#if QT_VERSION >= 0x040000
for (int i=0; i<attribute.count(); ++i) for (int i=0; i<attribute.count(); ++i)
#else
for (unsigned int i=0; i<attribute.count(); ++i)
#endif
color[i] = DomUtils::intFromDom(e, attribute[i], 0); color[i] = DomUtils::intFromDom(e, attribute[i], 0);
return QColor(color[0], color[1], color[2]); return QColor(color[0], color[1], color[2]);
} }
}; };
#endif // DOXYGEN #endif // DOXYGEN
 End of changes. 10 change blocks. 
29 lines changed or deleted 5 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.0. This file is part of the QGLViewer library version 2.5.1.
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
purchase a libQGLViewer Commercial License. purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_FRAME_H #ifndef QGLVIEWER_FRAME_H
#define QGLVIEWER_FRAME_H #define QGLVIEWER_FRAME_H
#if QT_VERSION >= 0x040000 #include <QObject>
# include <QObject> #include <QString>
# include <QString>
#else
# include <qobject.h>
# include <qstring.h>
#endif
#include "constraint.h" #include "constraint.h"
// #include "GL/gl.h" is now included in config.h for ease of configuration // #include "GL/gl.h" is now included in config.h for ease of configuration
namespace qglviewer { namespace qglviewer {
/*! \brief The Frame class represents a coordinate system, defined by a pos ition and an /*! \brief The Frame class represents a coordinate system, defined by a pos ition and an
orientation. \class Frame frame.h QGLViewer/frame.h orientation. \class Frame frame.h QGLViewer/frame.h
A Frame is a 3D coordinate system, represented by a position() and an ori entation(). The order of A Frame is a 3D coordinate system, represented by a position() and an ori entation(). The order of
these transformations is important: the Frame is first translated \e and \e then rotated around these transformations is important: the Frame is first translated \e and \e then rotated around
 End of changes. 2 change blocks. 
8 lines changed or deleted 3 lines changed or added


 keyFrameInterpolator.h   keyFrameInterpolator.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.0. This file is part of the QGLViewer library version 2.5.1.
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
purchase a libQGLViewer Commercial License. purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_KEY_FRAME_INTERPOLATOR_H #ifndef QGLVIEWER_KEY_FRAME_INTERPOLATOR_H
#define QGLVIEWER_KEY_FRAME_INTERPOLATOR_H #define QGLVIEWER_KEY_FRAME_INTERPOLATOR_H
#if QT_VERSION > 0x040000 #include <QObject>
# include <QObject> #include <QTimer>
# include <QTimer>
#else
# include <qobject.h>
# include <qtimer.h>
#endif
#include "quaternion.h" #include "quaternion.h"
// Not actually needed, but some bad compilers (Microsoft VS6) complain. // Not actually needed, but some bad compilers (Microsoft VS6) complain.
#include "frame.h" #include "frame.h"
// If you compiler complains about incomplete type, uncomment the next line // If you compiler complains about incomplete type, uncomment the next line
// #include "frame.h" // #include "frame.h"
// and comment "class Frame;" 3 lines below // and comment "class Frame;" 3 lines below
namespace qglviewer { namespace qglviewer {
skipping to change at line 332 skipping to change at line 327
void computeTangent(const KeyFrame* const prev, const KeyFra me* const next); void computeTangent(const KeyFrame* const prev, const KeyFra me* const next);
private: private:
Vec p_, tgP_; Vec p_, tgP_;
Quaternion q_, tgQ_; Quaternion q_, tgQ_;
float time_; float time_;
const Frame* const frame_; const Frame* const frame_;
}; };
#endif #endif
// K e y F r a m e s // K e y F r a m e s
#if QT_VERSION >= 0x040000
mutable QList<KeyFrame*> keyFrame_; mutable QList<KeyFrame*> keyFrame_;
QMutableListIterator<KeyFrame*>* currentFrame_[4]; QMutableListIterator<KeyFrame*>* currentFrame_[4];
QList<Frame> path_; QList<Frame> path_;
#else
mutable QPtrList<KeyFrame> keyFrame_;
// 4 succesive frames. interpolationTime_ is between index 1 and 2.
QPtrListIterator<KeyFrame>* currentFrame_[4];
# if QT_VERSION >= 0x030000
// Cached path computed values (for drawPath()).
QValueVector<Frame> path_;
# else
QVector<Frame> path_;
# endif
#endif
// A s s o c i a t e d f r a m e // A s s o c i a t e d f r a m e
Frame* frame_; Frame* frame_;
// R h y t h m // R h y t h m
QTimer timer_; QTimer timer_;
int period_; int period_;
float interpolationTime_; float interpolationTime_;
float interpolationSpeed_; float interpolationSpeed_;
bool interpolationStarted_; bool interpolationStarted_;
 End of changes. 4 change blocks. 
20 lines changed or deleted 3 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.0. This file is part of the QGLViewer library version 2.5.1.
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
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 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.0. This file is part of the QGLViewer library version 2.5.1.
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 28 skipping to change at line 28
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_MANIPULATED_FRAME_H #ifndef QGLVIEWER_MANIPULATED_FRAME_H
#define QGLVIEWER_MANIPULATED_FRAME_H #define QGLVIEWER_MANIPULATED_FRAME_H
#include "frame.h" #include "frame.h"
#include "mouseGrabber.h" #include "mouseGrabber.h"
#include "qglviewer.h"
#if QT_VERSION >= 0x040000 #include <QString>
# include <QString> #include <QTimer>
# include <QTimer> #include <QDateTime>
# include <QDateTime>
#else
# include <qstring.h>
# include <qtimer.h>
# include <qdatetime.h>
#endif
namespace qglviewer { namespace qglviewer {
/*! \brief A ManipulatedFrame is a Frame that can be rotated and translated using the mouse. /*! \brief A ManipulatedFrame is a Frame that can be rotated and translated using the mouse.
\class ManipulatedFrame manipulatedFrame.h QGLViewer/manipulatedFrame.h \class ManipulatedFrame manipulatedFrame.h QGLViewer/manipulatedFrame.h
It converts the mouse motion into a translation and an orientation update s. A ManipulatedFrame is It converts the mouse motion into a translation and an orientation update s. A ManipulatedFrame is
used to move an object in the scene. Combined with object selection, its MouseGrabber properties used to move an object in the scene. Combined with object selection, its MouseGrabber properties
and a dynamic update of the scene, the ManipulatedFrame introduces a grea t reactivity in your and a dynamic update of the scene, the ManipulatedFrame introduces a grea t reactivity in your
applications. applications.
skipping to change at line 252 skipping to change at line 247
virtual void mouseMoveEvent (QMouseEvent* const event, Camera* const camera); virtual void mouseMoveEvent (QMouseEvent* const event, Camera* const camera);
virtual void mouseReleaseEvent (QMouseEvent* const event, Camera* const camera); virtual void mouseReleaseEvent (QMouseEvent* const event, Camera* const camera);
virtual void mouseDoubleClickEvent(QMouseEvent* const event, Camera* const camera); virtual void mouseDoubleClickEvent(QMouseEvent* const event, Camera* const camera);
virtual void wheelEvent (QWheelEvent* const event, Camera* const camera); virtual void wheelEvent (QWheelEvent* const event, Camera* const camera);
//@} //@}
public: public:
/*! @name Current state */ /*! @name Current state */
//@{ //@{
bool isManipulated() const; bool isManipulated() const;
/*! Returns the \c MouseAction currently applied to this Manipulated
Frame.
Will return QGLViewer::NO_MOUSE_ACTION unless a mouse button is be
ing pressed
and has been bound to this QGLViewer::MouseHandler.
The binding between mouse buttons and key modifiers and MouseAction
is set using
QGLViewer::setMouseBinding(Qt::Key key, Qt::KeyboardModifiers modif
iers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bo
ol withConstraint).
*/
QGLViewer::MouseAction currentMouseAction() const { return action_;
}
//@} //@}
/*! @name MouseGrabber implementation */ /*! @name MouseGrabber implementation */
//@{ //@{
public: public:
virtual void checkIfGrabsMouse(int x, int y, const Camera* const cam era); virtual void checkIfGrabsMouse(int x, int y, const Camera* const cam era);
//@} //@}
/*! @name XML representation */ /*! @name XML representation */
//@{ //@{
public: public:
virtual QDomElement domElement(const QString& name, QDomDocument& do cument) const; virtual QDomElement domElement(const QString& name, QDomDocument& do cument) const;
public Q_SLOTS: public Q_SLOTS:
virtual void initFromDOMElement(const QDomElement& element); virtual void initFromDOMElement(const QDomElement& element);
//@} //@}
#ifndef DOXYGEN #ifndef DOXYGEN
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);
int action_; // Should be a QGLViewer::MouseAction, but include loop 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);
// 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_;
#endif // DOXYGEN #endif // DOXYGEN
 End of changes. 5 change blocks. 
11 lines changed or deleted 21 lines changed or added


 mouseGrabber.h   mouseGrabber.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.0. This file is part of the QGLViewer library version 2.5.1.
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 28 skipping to change at line 28
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_MOUSE_GRABBER_H #ifndef QGLVIEWER_MOUSE_GRABBER_H
#define QGLVIEWER_MOUSE_GRABBER_H #define QGLVIEWER_MOUSE_GRABBER_H
#include "config.h" #include "config.h"
#if QT_VERSION >= 0x040000 #include <QEvent>
# include <QEvent>
#else
# include <qevent.h>
#endif
class QGLViewer; class QGLViewer;
namespace qglviewer { namespace qglviewer {
class Camera; class Camera;
/*! \brief Abstract class for objects that grab mouse focus in a QGLViewer. /*! \brief Abstract class for objects that grab mouse focus in a QGLViewer.
\class MouseGrabber mouseGrabber.h QGLViewer/mouseGrabber.h \class MouseGrabber mouseGrabber.h QGLViewer/mouseGrabber.h
MouseGrabber are objects which react to the mouse cursor, usually when it hovers over them. This MouseGrabber are objects which react to the mouse cursor, usually when it hovers over them. This
skipping to change at line 143 skipping to change at line 139
\nosubgrouping */ \nosubgrouping */
class QGLVIEWER_EXPORT MouseGrabber class QGLVIEWER_EXPORT MouseGrabber
{ {
#ifndef DOXYGEN #ifndef DOXYGEN
friend class ::QGLViewer; friend class ::QGLViewer;
#endif #endif
public: public:
MouseGrabber(); MouseGrabber();
/*! Virtual destructor. Removes the MouseGrabber from the MouseGrabb erPool(). */ /*! Virtual destructor. Removes the MouseGrabber from the MouseGrabb erPool(). */
#if QT_VERSION >= 0x040000
virtual ~MouseGrabber() { MouseGrabber::MouseGrabberPool_.removeAll( this); } virtual ~MouseGrabber() { MouseGrabber::MouseGrabberPool_.removeAll( this); }
#else
virtual ~MouseGrabber() { MouseGrabber::MouseGrabberPool_.removeRef(
this); }
#endif
/*! @name Mouse grabbing detection */ /*! @name Mouse grabbing detection */
//@{ //@{
public: public:
/*! Pure virtual method, called by the QGLViewers before they test i f the MouseGrabber /*! Pure virtual method, called by the QGLViewers before they test i f the MouseGrabber
grabsMouse(). Should setGrabsMouse() according to the mouse positi on. grabsMouse(). Should setGrabsMouse() according to the mouse positi on.
This is the core method of the MouseGrabber. It has to be overloaded in your derived class. This is the core method of the MouseGrabber. It has to be overloaded in your derived class.
Its goal is to update the grabsMouse() flag according to the mouse a nd MouseGrabber current Its goal is to update the grabsMouse() flag according to the mouse a nd MouseGrabber current
positions, using setGrabsMouse(). positions, using setGrabsMouse().
skipping to change at line 206 skipping to change at line 198
public: public:
/*! Returns a list containing pointers to all the active MouseGrabbe rs. /*! Returns a list containing pointers to all the active MouseGrabbe rs.
Used by the QGLViewer to parse all the MouseGrabbers and to check if any of them grabsMouse() Used by the QGLViewer to parse all the MouseGrabbers and to check if any of them grabsMouse()
using checkIfGrabsMouse(). using checkIfGrabsMouse().
You should not have to directly use this list. Use removeFromMouseGr abberPool() and You should not have to directly use this list. Use removeFromMouseGr abberPool() and
addInMouseGrabberPool() to modify this list. addInMouseGrabberPool() to modify this list.
\attention This method returns a \c QPtrList<MouseGrabber> with Qt 3 and a \c QList<MouseGrabber> with Qt 2. */ \attention This method returns a \c QPtrList<MouseGrabber> with Qt 3 and a \c QList<MouseGrabber> with Qt 2. */
#if QT_VERSION >= 0x040000
static const QList<MouseGrabber*>& MouseGrabberPool() { return Mouse Grabber::MouseGrabberPool_; } static const QList<MouseGrabber*>& MouseGrabberPool() { return Mouse Grabber::MouseGrabberPool_; }
#else
# if QT_VERSION >= 0x030000
static const QPtrList<MouseGrabber>& MouseGrabberPool() { return Mou
seGrabber::MouseGrabberPool_; }
# else
static const QList<MouseGrabber>& MouseGrabberPool() { return MouseG
rabber::MouseGrabberPool_; }
# endif
#endif
/*! Returns \c true if the MouseGrabber is currently in the MouseGra bberPool() list. /*! Returns \c true if the MouseGrabber is currently in the MouseGra bberPool() list.
Default value is \c true. When set to \c false using removeFromMouse GrabberPool(), the Default value is \c true. When set to \c false using removeFromMouse GrabberPool(), the
QGLViewers no longer checkIfGrabsMouse() on this MouseGrabber. Use a ddInMouseGrabberPool() to QGLViewers no longer checkIfGrabsMouse() on this MouseGrabber. Use a ddInMouseGrabberPool() to
insert it back. */ insert it back. */
#if QT_VERSION >= 0x040000
bool isInMouseGrabberPool() const { return MouseGrabber::MouseGrabbe rPool_.contains(const_cast<MouseGrabber*>(this)); } bool isInMouseGrabberPool() const { return MouseGrabber::MouseGrabbe rPool_.contains(const_cast<MouseGrabber*>(this)); }
#else
bool isInMouseGrabberPool() const { return MouseGrabber::MouseGrabbe
rPool_.findRef(this) != -1; }
#endif
void addInMouseGrabberPool(); void addInMouseGrabberPool();
void removeFromMouseGrabberPool(); void removeFromMouseGrabberPool();
void clearMouseGrabberPool(bool autoDelete=false); void clearMouseGrabberPool(bool autoDelete=false);
//@} //@}
/*! @name Mouse event handlers */ /*! @name Mouse event handlers */
//@{ //@{
protected: protected:
/*! Callback method called when the MouseGrabber grabsMouse() and a mouse button is pressed. /*! Callback method called when the MouseGrabber grabsMouse() and a mouse button is pressed.
skipping to change at line 248 skipping to change at line 228
accordingly and mouseReleaseEvent() (called when the mouse button is released) will terminate accordingly and mouseReleaseEvent() (called when the mouse button is released) will terminate
this action. this action.
Use the \p event QMouseEvent::state() and QMouseEvent::button() to t est the keyboard Use the \p event QMouseEvent::state() and QMouseEvent::button() to t est the keyboard
and button state and possibly change the MouseGrabber behavior accor dingly. and button state and possibly change the MouseGrabber behavior accor dingly.
See the <a href="#_details">detailed description section</a> and the <a See the <a href="#_details">detailed description section</a> and the <a
href="../examples/mouseGrabber.html">mouseGrabber example</a> for ex amples. href="../examples/mouseGrabber.html">mouseGrabber example</a> for ex amples.
See the \c QGLWidget::mousePressEvent() and the \c QMouseEvent docum entations for details. */ See the \c QGLWidget::mousePressEvent() and the \c QMouseEvent docum entations for details. */
virtual void mousePressEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event) Q_UNUSED(camera) } virtual void mousePressEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event); Q_UNUSED(camera); }
/*! Callback method called when the MouseGrabber grabsMouse() and a mouse button is double clicked. /*! Callback method called when the MouseGrabber grabsMouse() and a mouse button is double clicked.
See the \c QGLWidget::mouseDoubleClickEvent() and the \c QMouseEvent documentations for details. */ See the \c QGLWidget::mouseDoubleClickEvent() and the \c QMouseEvent documentations for details. */
virtual void mouseDoubleClickEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event) Q_UNUSED(camera) } virtual void mouseDoubleClickEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event); Q_UNUSED(camera); }
/*! Mouse release event callback method. See mousePressEvent(). */ /*! Mouse release event callback method. See mousePressEvent(). */
virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* con st camera) { Q_UNUSED(event) Q_UNUSED(camera) } virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* con st camera) { Q_UNUSED(event); Q_UNUSED(camera); }
/*! Callback method called when the MouseGrabber grabsMouse() and th e mouse is moved while a /*! Callback method called when the MouseGrabber grabsMouse() and th e mouse is moved while a
button is pressed. button is pressed.
This method will typically update the state of the MouseGrabber from the mouse displacement. See This method will typically update the state of the MouseGrabber from the mouse displacement. See
the mousePressEvent() documentation for details. */ the mousePressEvent() documentation for details. */
virtual void mouseMoveEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event) Q_UNUSED(camera) } virtual void mouseMoveEvent(QMouseEvent* const event, Camera* const camera) { Q_UNUSED(event); Q_UNUSED(camera); }
/*! Callback method called when the MouseGrabber grabsMouse() and th e mouse wheel is used. /*! Callback method called when the MouseGrabber grabsMouse() and th e mouse wheel is used.
See the \c QGLWidget::wheelEvent() and the \c QWheelEvent documentat ions for details. */ See the \c QGLWidget::wheelEvent() and the \c QWheelEvent documentat ions for details. */
virtual void wheelEvent(QWheelEvent* const event, Camera* const came ra) { Q_UNUSED(event) Q_UNUSED(camera) } virtual void wheelEvent(QWheelEvent* const event, Camera* const came ra) { Q_UNUSED(event); Q_UNUSED(camera); }
//@} //@}
private: private:
// Copy constructor and opertor= are declared private and undefined // Copy constructor and opertor= are declared private and undefined
// Prevents everyone from trying to use them // Prevents everyone from trying to use them
MouseGrabber(const MouseGrabber&); MouseGrabber(const MouseGrabber&);
MouseGrabber& operator=(const MouseGrabber&); MouseGrabber& operator=(const MouseGrabber&);
bool grabsMouse_; bool grabsMouse_;
// Q G L V i e w e r p o o l // Q G L V i e w e r p o o l
#if QT_VERSION >= 0x040000
static QList<MouseGrabber*> MouseGrabberPool_; static QList<MouseGrabber*> MouseGrabberPool_;
#else
static QPtrList<MouseGrabber> MouseGrabberPool_;
#endif
}; };
} // namespace qglviewer } // namespace qglviewer
#endif // QGLVIEWER_MOUSE_GRABBER_H #endif // QGLVIEWER_MOUSE_GRABBER_H
 End of changes. 15 change blocks. 
35 lines changed or deleted 7 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.0. This file is part of the QGLViewer library version 2.5.1.
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 28 skipping to change at line 28
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_QGLVIEWER_H #ifndef QGLVIEWER_QGLVIEWER_H
#define QGLVIEWER_QGLVIEWER_H #define QGLVIEWER_QGLVIEWER_H
#include "camera.h" #include "camera.h"
#if QT_VERSION >= 0x040000 #include <QMap>
# include <QMap> #include <QClipboard>
# include <QClipboard> #include <QTime>
#else
# include <qmap.h>
# include <qclipboard.h>
#endif
class QTabWidget; class QTabWidget;
namespace qglviewer { namespace qglviewer {
class MouseGrabber; class MouseGrabber;
class ManipulatedFrame;
class ManipulatedCameraFrame;
} }
#if QT_VERSION < 0x040000
# define Qt::KeyboardModifiers Qt::ButtonState
# define Qt::MouseButtons Qt::ButtonState
# define Qt::WindowFlags Qt::WFlags
#endif
/*! \brief A versatile 3D OpenGL viewer based on QGLWidget. /*! \brief A versatile 3D OpenGL viewer based on QGLWidget.
\class QGLViewer qglviewer.h QGLViewer/qglviewer.h \class QGLViewer qglviewer.h QGLViewer/qglviewer.h
It features many classical viewer functionalities, such as a camera trackba ll, manipulated objects, It features many classical viewer functionalities, such as a camera trackba ll, manipulated objects,
snapshot saving and much <a href="../features.html">more</a>. Its main goal is to ease the development snapshot saving and much <a href="../features.html">more</a>. Its main goal is to ease the development
of new 3D applications. of new 3D applications.
New users should read the <a href="../introduction.html">introduction page< /a> to get familiar with New users should read the <a href="../introduction.html">introduction page< /a> to get familiar with
important notions such as sceneRadius(), sceneCenter() and the world coordi nate system. Try the important notions such as sceneRadius(), sceneCenter() and the world coordi nate system. Try the
numerous simple <a href="../examples/index.html">examples</a> to discover t he possibilities and numerous simple <a href="../examples/index.html">examples</a> to discover t he possibilities and
skipping to change at line 77 skipping to change at line 69
complete implementation. complete implementation.
\nosubgrouping */ \nosubgrouping */
class QGLVIEWER_EXPORT QGLViewer : public QGLWidget class QGLVIEWER_EXPORT QGLViewer : public QGLWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
// Complete implementation is provided so that the constructor is de fined with QT3_SUPPORT when .h is included. // Complete implementation is provided so that the constructor is de fined with QT3_SUPPORT when .h is included.
// (Would not be available otherwise since lib is compiled without Q T3_SUPPORT). // (Would not be available otherwise since lib is compiled without Q T3_SUPPORT).
#if QT_VERSION < 0x040000 || defined QT3_SUPPORT #ifdef QT3_SUPPORT
explicit QGLViewer(QWidget* parent=NULL, const char* name=0, const Q GLWidget* shareWidget=0, Qt::WindowFlags flags=0) explicit QGLViewer(QWidget* parent=NULL, const char* name=0, const Q GLWidget* shareWidget=0, Qt::WindowFlags flags=0)
: QGLWidget(parent, name, shareWidget, flags) : QGLWidget(parent, name, shareWidget, flags)
{ defaultConstructor(); } { defaultConstructor(); }
explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const char* name=0, const QGLWidget* shareWidget=0,Qt::WindowFlags flags=0) explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const char* name=0, const QGLWidget* shareWidget=0,Qt::WindowFlags flags=0)
: QGLWidget(format, parent, name, shareWidget, flags) : QGLWidget(format, parent, name, shareWidget, flags)
{ defaultConstructor(); } { defaultConstructor(); }
QGLViewer(QGLContext* context, QWidget* parent, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0) QGLViewer(QGLContext* context, QWidget* parent, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0)
# if QT_VERSION >= 0x030200
: QGLWidget(context, parent, name, shareWidget, flags) { : QGLWidget(context, parent, name, shareWidget, flags) {
# else
// MOC_SKIP_BEGIN
: QGLWidget(parent, name, shareWidget, flags) {
Q_UNUSED(context);
// MOC_SKIP_END
# endif
defaultConstructor(); } defaultConstructor(); }
#else #else
explicit QGLViewer(QWidget* parent=0, const QGLWidget* shareWidget=0 , Qt::WindowFlags flags=0); explicit QGLViewer(QWidget* parent=0, const QGLWidget* shareWidget=0 , Qt::WindowFlags flags=0);
explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGL Widget* shareWidget=0, Qt::WindowFlags flags=0); explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGL Widget* shareWidget=0, Qt::WindowFlags flags=0);
explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0); explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0);
#endif #endif
virtual ~QGLViewer(); virtual ~QGLViewer();
skipping to change at line 452 skipping to change at line 437
bool autoBufferSwap() const; bool autoBufferSwap() const;
protected Q_SLOTS: protected Q_SLOTS:
/*! Sets the autoBufferSwap() value. */ /*! Sets the autoBufferSwap() value. */
void setAutoBufferSwap(bool on); void setAutoBufferSwap(bool on);
//@} //@}
#endif #endif
/*! @name Snapshots */ /*! @name Snapshots */
//@{ //@{
public: public:
#if QT_VERSION < 0x030000
virtual QImage grabFrameBuffer(bool withAlpha=false);
#endif
/*! Returns the snapshot file name used by saveSnapshot(). /*! Returns the snapshot file name used by saveSnapshot().
This value is used in \p automatic mode (see saveSnapshot()). A dial og is otherwise popped-up to This value is used in \p automatic mode (see saveSnapshot()). A dial og is otherwise popped-up to
set it. set it.
You can also directly provide a file name using saveSnapshot(const Q String&, bool). You can also directly provide a file name using saveSnapshot(const Q String&, bool).
If the file name is relative, the current working directory at the m oment of the method call is If the file name is relative, the current working directory at the m oment of the method call is
used. Set using setSnapshotFileName(). */ used. Set using setSnapshotFileName(). */
const QString& snapshotFileName() const { return snapshotFileName_; } const QString& snapshotFileName() const { return snapshotFileName_; }
skipping to change at line 567 skipping to change at line 549
\endcode \endcode
will guarantee that this text will be properly displayed on arbitrar y sized snapshots. will guarantee that this text will be properly displayed on arbitrar y sized snapshots.
Note that this method is not needed if you use drawText() which alre ady calls it internally. */ Note that this method is not needed if you use drawText() which alre ady calls it internally. */
QFont scaledFont(const QFont& font) const { QFont scaledFont(const QFont& font) const {
if (tileRegion_ == NULL) if (tileRegion_ == NULL)
return font; return font;
else { else {
QFont f(font); QFont f(font);
if (f.pixelSize() == -1) if (f.pixelSize() == -1)
#if QT_VERSION >= 0x040000
f.setPointSizeF(f.pointSizeF() * tileRegion_ ->textScale); f.setPointSizeF(f.pointSizeF() * tileRegion_ ->textScale);
#else
f.setPointSizeFloat(f.pointSizeFloat() * til
eRegion_->textScale);
#endif
else else
f.setPixelSize(f.pixelSize() * tileRegion_-> textScale); f.setPixelSize(f.pixelSize() * tileRegion_-> textScale);
return f; return f;
} }
} }
//@} //@}
/*! @name Buffer to texture */ /*! @name Buffer to texture */
//@{ //@{
public: public:
skipping to change at line 808 skipping to change at line 786
/*! @name Mouse, keyboard and event handlers */ /*! @name Mouse, keyboard and event handlers */
//@{ //@{
protected: protected:
virtual void mousePressEvent(QMouseEvent *); virtual void mousePressEvent(QMouseEvent *);
virtual void mouseMoveEvent(QMouseEvent *); virtual void mouseMoveEvent(QMouseEvent *);
virtual void mouseReleaseEvent(QMouseEvent *); virtual void mouseReleaseEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *); virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void wheelEvent(QWheelEvent *); virtual void wheelEvent(QWheelEvent *);
virtual void keyPressEvent(QKeyEvent *); virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual void timerEvent(QTimerEvent *); virtual void timerEvent(QTimerEvent *);
virtual void closeEvent(QCloseEvent *); virtual void closeEvent(QCloseEvent *);
//@} //@}
/*! @name Object selection */ /*! @name Object selection */
//@{ //@{
public: public:
/*! Returns the name (an integer value) of the entity that was last selected by select(). This /*! Returns the name (an integer value) of the entity that was last selected by select(). This
value is set by endSelection(). See the select() documentation for d etails. value is set by endSelection(). See the select() documentation for d etails.
skipping to change at line 955 skipping to change at line 934
virtual void setPlayKeyFramePathStateKey(int buttonState); virtual void setPlayKeyFramePathStateKey(int buttonState);
// QGLViewer 2.0 without Qt4 support // QGLViewer 2.0 without Qt4 support
virtual void setPlayPathStateKey(int buttonState); virtual void setPlayPathStateKey(int buttonState);
virtual void setAddKeyFrameStateKey(int buttonState); virtual void setAddKeyFrameStateKey(int buttonState);
#endif #endif
virtual void setPathKey(int key, int index = 0); virtual void setPathKey(int key, int index = 0);
virtual void setPlayPathKeyboardModifiers(Qt::KeyboardModifiers modi fiers); virtual void setPlayPathKeyboardModifiers(Qt::KeyboardModifiers modi fiers);
virtual void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers m odifiers); virtual void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers m odifiers);
//@} //@}
public:
/*! @name Mouse customization */ /*! @name Mouse customization */
//@{ //@{
protected:
/*! Defines the different mouse handlers: camera() or manipulatedFra me(). /*! Defines the different mouse handlers: camera() or manipulatedFra me().
Used by setMouseBinding(), setMouseBinding(int, ClickAction, bool, i Used by setMouseBinding(), setMouseBinding(Qt::KeyboardModifiers mod
nt) and setWheelBinding() to ifiers, Qt::MouseButtons, ClickAction, bool, int)
define which handler receives the mouse events. */ and setWheelBinding() to define which handler receives the mouse eve
nts. */
enum MouseHandler { CAMERA, FRAME }; enum MouseHandler { CAMERA, FRAME };
/*! Defines the possible actions that can be binded to a mouse click using /*! Defines the possible actions that can be binded to a mouse click using
setMouseBinding(int,ClickAction,bool,int). setMouseBinding(Qt::KeyboardModifiers, Qt::MouseButtons, ClickAction , bool, int).
See the <a href="../mouse.html">mouse page</a> for details. */ See the <a href="../mouse.html">mouse page</a> for details. */
enum ClickAction { NO_CLICK_ACTION, ZOOM_ON_PIXEL, ZOOM_TO_FIT, SELE CT, RAP_FROM_PIXEL, RAP_IS_CENTER, enum ClickAction { NO_CLICK_ACTION, ZOOM_ON_PIXEL, ZOOM_TO_FIT, SELE CT, RAP_FROM_PIXEL, RAP_IS_CENTER,
CENTER_FRAME, CENTER_SCENE, SHOW_ ENTIRE_SCENE, ALIGN_FRAME, ALIGN_CAMERA }; CENTER_FRAME, CENTER_SCENE, SHOW_ ENTIRE_SCENE, ALIGN_FRAME, ALIGN_CAMERA };
#ifndef DOXYGEN /*! Defines the possible actions that can be binded to a mouse actio
// So that it can be used in ManipulatedFrame and ManipulatedCameraF n (a click, followed by a
rame.
public:
#endif
/*! Defines the possible actions that can be binded to a mouse motio
n (a click, followed by a
mouse displacement). mouse displacement).
These actions may be binded to the camera() or to the manipulatedFra me() (see QGLViewer::MouseHandler) using These actions may be binded to the camera() or to the manipulatedFra me() (see QGLViewer::MouseHandler) using
setMouseBinding(). */ setMouseBinding(). */
enum MouseAction { NO_MOUSE_ACTION, enum MouseAction { NO_MOUSE_ACTION,
ROTATE, ZOOM, TRANSLATE, ROTATE, ZOOM, TRANSLATE,
MOVE_FORWARD, LOOK_AROUND, MOVE_B ACKWARD, MOVE_FORWARD, LOOK_AROUND, MOVE_B ACKWARD,
SCREEN_ROTATE, ROLL, DRIVE, SCREEN_ROTATE, ROLL, DRIVE,
SCREEN_TRANSLATE, ZOOM_ON_REGION }; SCREEN_TRANSLATE, ZOOM_ON_REGION };
#ifdef DOXYGEN
public:
#endif
#ifndef DOXYGEN #ifndef DOXYGEN
MouseAction mouseAction(int state) const; MouseAction mouseAction(int state) const;
int mouseHandler(int state) const; int mouseHandler(int state) const;
int mouseButtonState(MouseHandler handler, MouseAction action, bool withConstraint=true) const; int mouseButtonState(MouseHandler handler, MouseAction action, bool withConstraint=true) const;
ClickAction clickAction(int state, bool doubleClick, Qt::MouseButton s buttonsBefore) const; ClickAction clickAction(int state, bool doubleClick, Qt::MouseButton s buttonsBefore) const;
void getClickButtonState(ClickAction action, int& state, bool& doubl eClick, Qt::MouseButtons& buttonsBefore) const; void getClickButtonState(ClickAction action, int& state, bool& doubl eClick, Qt::MouseButtons& buttonsBefore) const;
int wheelButtonState(MouseHandler handler, MouseAction action, bool withConstraint=true) const;
#endif #endif
MouseAction mouseAction(Qt::KeyboardModifiers modifiers, Qt::MouseBu
ttons buttons) const;
int mouseHandler(Qt::KeyboardModifiers modifiers, Qt::MouseButtons b
uttons) const;
ClickAction clickAction(Qt::KeyboardModifiers modifiers, Qt::MouseBu
ttons buttons, bool doubleClick, Qt::MouseButtons buttonsBefore) const;
Qt::MouseButtons mouseButtons(MouseHandler handler, MouseAction acti
on, bool withConstraint=true) const;
Qt::KeyboardModifiers keyboardModifiers(MouseHandler handler, MouseA
ction action, bool withConstraint=true) const;
void getClickActionState(ClickAction action, Qt::KeyboardModifiers&
modifiers, Qt::MouseButtons& buttons, bool& doubleClick, Qt::MouseButtons&
buttonsBefore) const;
MouseAction wheelAction(Qt::KeyboardModifiers modifiers) const; MouseAction mouseAction(Qt::Key key, Qt::KeyboardModifiers modifiers
int wheelHandler(Qt::KeyboardModifiers modifiers) const; , Qt::MouseButton button) const;
int wheelButtonState(MouseHandler handler, MouseAction action, bool int mouseHandler(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::M
withConstraint=true) const; ouseButton button) const;
void getMouseActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint,
Qt::Key& key, Qt:
:KeyboardModifiers& modifiers, Qt::MouseButton& button) const;
ClickAction clickAction(Qt::Key key, Qt::KeyboardModifiers modifiers
, Qt::MouseButton button,
bool doubleClick=fal
se, Qt::MouseButtons buttonsBefore=Qt::NoButton) const;
void getClickActionBinding(ClickAction action, Qt::Key& key, Qt::Key
boardModifiers& modifiers,
Qt::MouseButton& bu
tton, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const;
MouseAction wheelAction(Qt::Key key, Qt::KeyboardModifiers modifiers
) const;
int wheelHandler(Qt::Key key, Qt::KeyboardModifiers modifiers) const
;
void getWheelActionBinding(MouseHandler handler, MouseAction action,
bool withConstraint,
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);
void setMouseBinding(int state, ClickAction action, bool doubleClick =false, Qt::MouseButtons buttonsBefore=Qt::NoButton); void setMouseBinding(int state, ClickAction action, bool doubleClick =false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
void setMouseBindingDescription(int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton); void setMouseBindingDescription(int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
#endif #endif
void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButto
ns buttons, MouseHandler handler, MouseAction action, bool withConstraint=t
rue);
void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButto
ns buttons, ClickAction action, bool doubleClick=false, Qt::MouseButtons bu
ttonsBefore=Qt::NoButton);
void setMouseBindingDescription(Qt::KeyboardModifiers modifiers, Qt:
:MouseButtons buttons, QString description, bool doubleClick=false, Qt::Mou
seButtons buttonsBefore=Qt::NoButton);
void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButto
n buttons, MouseHandler handler, MouseAction action, bool withConstraint=tr
ue);
void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButto
n button, ClickAction action, bool doubleClick=false, Qt::MouseButtons butt
onsBefore=Qt::NoButton);
void setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler h andler, MouseAction action, bool withConstraint=true); void setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler h andler, MouseAction action, bool withConstraint=true);
void setHandlerKeyboardModifiers(MouseHandler handler, Qt::KeyboardM void setMouseBindingDescription(Qt::KeyboardModifiers modifiers, Qt:
odifiers modifiers); :MouseButton button, QString description, bool doubleClick=false, Qt::Mouse
Buttons buttonsBefore=Qt::NoButton);
void setMouseBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, Q
t::MouseButton buttons, MouseHandler handler, MouseAction action, bool with
Constraint=true);
void setMouseBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, Q
t::MouseButton button, ClickAction action, bool doubleClick=false, Qt::Mous
eButtons buttonsBefore=Qt::NoButton);
void setWheelBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, M
ouseHandler handler, MouseAction action, bool withConstraint=true);
void setMouseBindingDescription(Qt::Key key, Qt::KeyboardModifiers m
odifiers, Qt::MouseButton button, QString description, bool doubleClick=fal
se, Qt::MouseButtons buttonsBefore=Qt::NoButton);
void clearMouseBindings(); void clearMouseBindings();
#ifndef DOXYGEN #ifndef DOXYGEN
MouseAction wheelAction(Qt::KeyboardModifiers modifiers) const;
int wheelHandler(Qt::KeyboardModifiers modifiers) const;
void setHandlerKeyboardModifiers(MouseHandler handler, Qt::KeyboardM
odifiers modifiers);
void setHandlerStateKey(MouseHandler handler, int buttonState); void setHandlerStateKey(MouseHandler handler, int buttonState);
void setMouseStateKey(MouseHandler handler, int buttonState); void setMouseStateKey(MouseHandler handler, int buttonState);
#endif #endif
private: private:
static QString mouseActionString(QGLViewer::MouseAction ma); static QString mouseActionString(QGLViewer::MouseAction ma);
static QString clickActionString(QGLViewer::ClickAction ca); static QString clickActionString(QGLViewer::ClickAction ca);
//@} //@}
/*! @name State persistence */ /*! @name State persistence */
skipping to change at line 1081 skipping to change at line 1069
Note that this list may contain \c NULL pointers if the asso ciated viewer has been deleted. Note that this list may contain \c NULL pointers if the asso ciated viewer has been deleted.
Can be useful to apply a method or to connect a signal to all the vi ewers: Can be useful to apply a method or to connect a signal to all the vi ewers:
\code \code
foreach (QGLViewer* viewer, QGLViewer::QGLViewerPool()) foreach (QGLViewer* viewer, QGLViewer::QGLViewerPool())
connect(myObject, SIGNAL(IHaveChangedSignal()), viewer, SLOT(updat e())); connect(myObject, SIGNAL(IHaveChangedSignal()), viewer, SLOT(updat e()));
\endcode \endcode
\attention With Qt version 3, this method returns a \c QPtrList inst ead. Use a \c QPtrListIterator \attention With Qt version 3, this method returns a \c QPtrList inst ead. Use a \c QPtrListIterator
to iterate on the list instead.*/ to iterate on the list instead.*/
#if QT_VERSION >= 0x040000
static const QList<QGLViewer*>& QGLViewerPool() { return QGLViewer:: QGLViewerPool_; } static const QList<QGLViewer*>& QGLViewerPool() { return QGLViewer:: QGLViewerPool_; }
#else
static const QPtrList<QGLViewer>& QGLViewerPool() { return QGLViewer
::QGLViewerPool_; }
#endif
/*! Returns the index of the QGLViewer \p viewer in the QGLViewerPoo l(). This index in unique and /*! Returns the index of the QGLViewer \p viewer in the QGLViewerPoo l(). This index in unique and
can be used to identify the different created QGLViewers (see stateF ileName() for an application can be used to identify the different created QGLViewers (see stateF ileName() for an application
example). example).
When a QGLViewer is deleted, the QGLViewers' indexes are preserved a nd NULL is set for that index. When a QGLViewer is deleted, the QGLViewers' indexes are preserved a nd NULL is set for that index.
When a QGLViewer is created, it is placed in the first avail able position in that list. When a QGLViewer is created, it is placed in the first avail able position in that list.
Returns -1 if the QGLViewer could not be found (which should not be possible). */ Returns -1 if the QGLViewer could not be found (which should not be possible). */
#if QT_VERSION >= 0x040000
static int QGLViewerIndex(const QGLViewer* const viewer) { return QG LViewer::QGLViewerPool_.indexOf(const_cast<QGLViewer*>(viewer)); } static int QGLViewerIndex(const QGLViewer* const viewer) { return QG LViewer::QGLViewerPool_.indexOf(const_cast<QGLViewer*>(viewer)); }
#else
static int QGLViewerIndex(const QGLViewer* const viewer) { return QG
LViewer::QGLViewerPool_.findRef(viewer); }
#endif
//@} //@}
#ifndef DOXYGEN #ifndef DOXYGEN
/*! @name Visual hints */ /*! @name Visual hints */
//@{ //@{
public: public:
virtual void setVisualHintsMask(int mask, int delay = 2000); virtual void setVisualHintsMask(int mask, int delay = 2000);
virtual void drawVisualHints(); virtual void drawVisualHints();
public Q_SLOTS: public Q_SLOTS:
skipping to change at line 1212 skipping to change at line 1192
// M o u s e a c t i o n s // M o u s e a c t i o n s
struct MouseActionPrivate { struct MouseActionPrivate {
MouseHandler handler; MouseHandler handler;
MouseAction action; MouseAction action;
bool withConstraint; bool withConstraint;
}; };
// M o u s e b i n d i n g s // M o u s e b i n d i n g s
struct MouseBindingPrivate { struct MouseBindingPrivate {
const Qt::KeyboardModifiers modifiers; const Qt::KeyboardModifiers modifiers;
const Qt::MouseButtons buttons; const Qt::MouseButton button;
const Qt::Key key;
MouseBindingPrivate(Qt::KeyboardModifiers m, Qt::MouseButton MouseBindingPrivate(Qt::KeyboardModifiers m, Qt::MouseButton
s b) b, Qt::Key k)
: modifiers(m), buttons(b) {} : modifiers(m), button(b), key(k) {}
// This sort order is used in mouseString() to display sorte d mouse bindings // This sort order is used in mouseString() to display sorte d mouse bindings
bool operator<(const MouseBindingPrivate& mbp) const bool operator<(const MouseBindingPrivate& mbp) const
{ {
if (key != mbp.key)
return key < mbp.key;
if (modifiers != mbp.modifiers) if (modifiers != mbp.modifiers)
return modifiers < mbp.modifiers; return modifiers < mbp.modifiers;
else return button < mbp.button;
return buttons < mbp.buttons; }
};
// W h e e l b i n d i n g s
struct WheelBindingPrivate {
const Qt::KeyboardModifiers modifiers;
const Qt::Key key;
WheelBindingPrivate(Qt::KeyboardModifiers m, Qt::Key k)
: modifiers(m), key(k) {}
// This sort order is used in mouseString() to display sorte
d wheel bindings
bool operator<(const WheelBindingPrivate& wbp) const
{
if (key != wbp.key)
return key < wbp.key;
return modifiers < wbp.modifiers;
} }
}; };
// C l i c k b i n d i n g s // C l i c k b i n d i n g s
struct ClickBindingPrivate { struct ClickBindingPrivate {
const Qt::KeyboardModifiers modifiers; const Qt::KeyboardModifiers modifiers;
const Qt::MouseButtons buttons; const Qt::MouseButton button;
const bool doubleClick; const bool doubleClick;
const Qt::MouseButtons buttonsBefore; // only defined when d oubleClick is true const Qt::MouseButtons buttonsBefore; // only defined when d oubleClick is true
const Qt::Key key;
ClickBindingPrivate(Qt::KeyboardModifiers m, Qt::MouseButton ClickBindingPrivate(Qt::KeyboardModifiers m, Qt::MouseButton
s b, bool dc, Qt::MouseButtons bb) b, bool dc, Qt::MouseButtons bb, Qt::Key k)
: modifiers(m), buttons(b), doubleClick(dc), buttons : modifiers(m), button(b), doubleClick(dc), buttonsB
Before(bb) {} efore(bb), key(k) {}
// This sort order is used in mouseString() to display sorte d mouse bindings // This sort order is used in mouseString() to display sorte d mouse bindings
bool operator<(const ClickBindingPrivate& cbp) const bool operator<(const ClickBindingPrivate& cbp) const
{ {
if (key != cbp.key)
return key < cbp.key;
if (buttonsBefore != cbp.buttonsBefore) if (buttonsBefore != cbp.buttonsBefore)
return buttonsBefore < cbp.buttonsBefore; return buttonsBefore < cbp.buttonsBefore;
else if (modifiers != cbp.modifiers)
if (modifiers != cbp.modifiers) return modifiers < cbp.modifiers;
return modifiers < cbp.modifiers; if (button != cbp.button)
else return button < cbp.button;
if (buttons != cbp.buttons) return doubleClick != cbp.doubleClick;
return buttons < cbp.buttons
;
else
return !doubleClick && cbp.d
oubleClick;
} }
}; };
#endif #endif
static QString formatClickActionPrivate(ClickBindingPrivate cbp); static QString formatClickActionPrivate(ClickBindingPrivate cbp);
static bool isValidShortcutKey(int key);
QMap<ClickBindingPrivate, QString> mouseDescription_; QMap<ClickBindingPrivate, QString> mouseDescription_;
void setDefaultMouseBindings(); void setDefaultMouseBindings();
void performClickAction(ClickAction ca, const QMouseEvent* const e); void performClickAction(ClickAction ca, const QMouseEvent* const e);
QMap<MouseBindingPrivate, MouseActionPrivate> mouseBinding_; QMap<MouseBindingPrivate, MouseActionPrivate> mouseBinding_;
QMap<Qt::KeyboardModifiers, MouseActionPrivate> wheelBinding_; QMap<WheelBindingPrivate, MouseActionPrivate> wheelBinding_;
QMap<ClickBindingPrivate, ClickAction> clickBinding_; QMap<ClickBindingPrivate, ClickAction> clickBinding_;
Qt::Key currentlyPressedKey_;
// S n a p s h o t s // S n a p s h o t s
void initializeSnapshotFormats(); void initializeSnapshotFormats();
QImage frameBufferSnapshot(); QImage frameBufferSnapshot();
QString snapshotFileName_, snapshotFormat_; QString snapshotFileName_, snapshotFormat_;
int snapshotCounter_, snapshotQuality_; int snapshotCounter_, snapshotQuality_;
TileRegion* tileRegion_; TileRegion* tileRegion_;
// Q G L V i e w e r p o o l // Q G L V i e w e r p o o l
#if QT_VERSION >= 0x040000
static QList<QGLViewer*> QGLViewerPool_; static QList<QGLViewer*> QGLViewerPool_;
#else
static QPtrList<QGLViewer> QGLViewerPool_;
#endif
// S t a t e F i l e // S t a t e F i l e
QString stateFileName_; QString stateFileName_;
// H e l p w i n d o w // H e l p w i n d o w
QTabWidget* helpWidget_; QTabWidget* helpWidget_;
}; };
#endif // QGLVIEWER_QGLVIEWER_H #endif // QGLVIEWER_QGLVIEWER_H
 End of changes. 43 change blocks. 
112 lines changed or deleted 116 lines changed or added


 quaternion.h   quaternion.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.0. This file is part of the QGLViewer library version 2.5.1.
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
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 vec.h   vec.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.0. This file is part of the QGLViewer library version 2.5.1.
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 29 skipping to change at line 29
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*************************************************************************** **/ *************************************************************************** **/
#ifndef QGLVIEWER_VEC_H #ifndef QGLVIEWER_VEC_H
#define QGLVIEWER_VEC_H #define QGLVIEWER_VEC_H
#include <math.h> #include <math.h>
#include <iostream> #include <iostream>
#if QT_VERSION >= 0x040000
# include <QDomElement> # include <QDomElement>
#else
# include <qdom.h>
#endif
// Included by all files as vec.h is at the end of the include hierarchy // Included by all files as vec.h is at the end of the include hierarchy
#include "config.h" // Specific configuration options. #include "config.h" // Specific configuration options.
namespace qglviewer { namespace qglviewer {
/*! \brief The Vec class represents 3D positions and 3D vectors. /*! \brief The Vec class represents 3D positions and 3D vectors.
\class Vec vec.h QGLViewer/vec.h \class Vec vec.h QGLViewer/vec.h
Vec is used as a parameter and return type by many methods of the library . It provides classical Vec is used as a parameter and return type by many methods of the library . It provides classical
 End of changes. 3 change blocks. 
5 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/