/usr/include/QGLViewer/manipulatedCameraFrame.h is in libqglviewer-dev-common 2.3.4-4.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | /****************************************************************************
Copyright (C) 2002-2008 Gilles Debunne. All rights reserved.
This file is part of the QGLViewer library version 2.3.4.
http://www.libqglviewer.com - contact@libqglviewer.com
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
appearing in the LICENSE file included in the packaging of this file.
In addition, as a special exception, Gilles Debunne gives you certain
additional rights, described in the file GPL_EXCEPTION in this package.
libQGLViewer uses dual licensing. Commercial/proprietary software must
purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/
#ifndef QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
#define QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
#include "manipulatedFrame.h"
namespace qglviewer {
/*! \brief The ManipulatedCameraFrame class represents a ManipulatedFrame with Camera specific mouse bindings.
\class ManipulatedCameraFrame manipulatedCameraFrame.h QGLViewer/manipulatedCameraFrame.h
A ManipulatedCameraFrame is a specialization of a ManipulatedFrame, designed to be set as the
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
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 corresponds to the
associated Camera::revolveAroundPoint().
A ManipulatedCameraFrame can also "fly" in the scene. It basically moves forward, and turns
according to the mouse motion. See flySpeed(), flyUpVector() and the QGLViewer::MOVE_FORWARD and
QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction.
See the <a href="../mouse.html">mouse page</a> for a description of the possible actions that can
be performed using the mouse and their bindings.
\nosubgrouping */
class QGLVIEWER_EXPORT ManipulatedCameraFrame : public ManipulatedFrame
{
#ifndef DOXYGEN
friend class Camera;
friend class ::QGLViewer;
#endif
Q_OBJECT
public:
ManipulatedCameraFrame();
/*! Virtual destructor. Empty. */
virtual ~ManipulatedCameraFrame() {};
ManipulatedCameraFrame(const ManipulatedCameraFrame& mcf);
ManipulatedCameraFrame& operator=(const ManipulatedCameraFrame& mcf);
/*! @name Revolve around point */
//@{
public:
/*! Returns the point the ManipulatedCameraFrame revolves around when rotated.
It is defined in the world coordinate system. Default value is (0,0,0).
When the ManipulatedCameraFrame is associated to a Camera, Camera::revolveAroundPoint() also
returns this value. This point can interactively be changed using the mouse (see
QGLViewer::RAP_FROM_PIXEL and QGLViewer::RAP_IS_CENTER in the <a href="../mouse.html">mouse
page</a>). */
Vec revolveAroundPoint() const { return revolveAroundPoint_; }
/*! Sets the revolveAroundPoint(), defined in the world coordinate system. */
void setRevolveAroundPoint(const Vec& revolveAroundPoint) { revolveAroundPoint_ = revolveAroundPoint; }
//@}
/*! @name Fly parameters */
//@{
public slots:
/*! Sets the flySpeed(), defined in OpenGL units.
Default value is 0.0, but it is modified according to the QGLViewer::sceneRadius() when the
ManipulatedCameraFrame is set as the Camera::frame(). */
void setFlySpeed(float speed) { flySpeed_ = speed; };
/*! Sets the flyUpVector(), defined in the world coordinate system.
Default value is (0,1,0), but it is updated by the Camera when set as its Camera::frame(). Use
Camera::setUpVector() instead in that case. */
void setFlyUpVector(const Vec& up) { flyUpVector_ = up; };
public:
/*! Returns the fly speed, expressed in OpenGL units.
It corresponds to the incremental displacement that is periodically applied to the
ManipulatedCameraFrame position when a QGLViewer::MOVE_FORWARD or QGLViewer::MOVE_BACKWARD
QGLViewer::MouseAction is proceeded.
\attention When the ManipulatedCameraFrame is set as the Camera::frame(), this value is set
according to the QGLViewer::sceneRadius() by QGLViewer::setSceneRadius(). */
float flySpeed() const { return flySpeed_; };
/*! Returns the up vector used in fly mode, expressed in the world coordinate system.
Fly mode corresponds to the QGLViewer::MOVE_FORWARD and QGLViewer::MOVE_BACKWARD
QGLViewer::MouseAction bindings. In these modes, horizontal displacements of the mouse rotate
the ManipulatedCameraFrame around this vector. Vertical displacements rotate always around the
Camera \c X axis.
Default value is (0,1,0), but it is updated by the Camera when set as its Camera::frame().
Camera::setOrientation() and Camera::setUpVector()) modify this value and should be used
instead. */
Vec flyUpVector() const { return flyUpVector_; };
//@}
/*! @name Mouse event handlers */
//@{
protected:
virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* const camera);
virtual void mouseMoveEvent (QMouseEvent* const event, Camera* const camera);
virtual void wheelEvent (QWheelEvent* const event, Camera* const camera);
//@}
/*! @name Spinning */
//@{
protected slots:
virtual void spin();
//@}
/*! @name XML representation */
//@{
public:
virtual QDomElement domElement(const QString& name, QDomDocument& document) const;
public slots:
virtual void initFromDOMElement(const QDomElement& element);
//@}
#ifndef DOXYGEN
protected:
virtual void startAction(int ma, bool withConstraint=true); // int is really a QGLViewer::MouseAction
#endif
private slots:
virtual void flyUpdate();
private:
void updateFlyUpVector();
Quaternion turnQuaternion(int x, const Camera* const camera);
Quaternion pitchYawQuaternion(int x, int y, const Camera* const camera);
private:
// Fly mode data
float flySpeed_;
float driveSpeed_;
Vec flyUpVector_;
QTimer flyTimer_;
Vec revolveAroundPoint_;
};
} // namespace qglviewer
#endif // QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
|