manipulatedCameraFrame.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  Copyright (C) 2002-2014 Gilles Debunne. All rights reserved.
4 
5  This file is part of the QGLViewer library version 2.6.3.
6 
7  http://www.libqglviewer.com - contact@libqglviewer.com
8 
9  This file may be used under the terms of the GNU General Public License
10  versions 2.0 or 3.0 as published by the Free Software Foundation and
11  appearing in the LICENSE file included in the packaging of this file.
12  In addition, as a special exception, Gilles Debunne gives you certain
13  additional rights, described in the file GPL_EXCEPTION in this package.
14 
15  libQGLViewer uses dual licensing. Commercial/proprietary software must
16  purchase a libQGLViewer Commercial License.
17 
18  This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
19  WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 
21 *****************************************************************************/
22 
23 #ifndef QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
24 #define QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
25 
26 #include "manipulatedFrame.h"
27 
28 namespace qglviewer {
48 {
49 #ifndef DOXYGEN
50  friend class Camera;
51  friend class ::QGLViewer;
52 #endif
53 
54  Q_OBJECT
55 
56 public:
60 
62  ManipulatedCameraFrame& operator=(const ManipulatedCameraFrame& mcf);
63 
66 public:
75  Vec pivotPoint() const { return pivotPoint_; }
77  void setPivotPoint(const Vec& point) { pivotPoint_ = point; }
78 
79 #ifndef DOXYGEN
80  Vec revolveAroundPoint() const { qWarning("revolveAroundPoint() is deprecated, use pivotPoint() instead"); return pivotPoint(); }
81  void setRevolveArountPoint(const Vec& point) { qWarning("setRevolveAroundPoint() is deprecated, use setPivotPoint() instead"); setPivotPoint(point); }
82 #endif
83 
84 
87 public:
106  bool rotatesAroundUpVector() const { return rotatesAroundUpVector_; }
110  void setRotatesAroundUpVector(bool constrained) { rotatesAroundUpVector_ = constrained; }
111 
120  bool zoomsOnPivotPoint() const { return zoomsOnPivotPoint_; }
124  void setZoomsOnPivotPoint(bool enabled) { zoomsOnPivotPoint_ = enabled; }
125 
126 private:
127 #ifndef DOXYGEN
128  void zoom(qreal delta, const Camera * const camera);
129 #endif
130 
131 
134 public Q_SLOTS:
139  void setFlySpeed(qreal speed) { flySpeed_ = speed; }
140 
145  void setSceneUpVector(const Vec& up) { sceneUpVector_ = up; }
146 
147 public:
156  qreal flySpeed() const { return flySpeed_; }
157 
171  Vec sceneUpVector() const { return sceneUpVector_; }
172 
173 #ifndef DOXYGEN
174  Vec flyUpVector() const;
175  void setFlyUpVector(const Vec& up);
176 #endif
177 
178 
181 protected:
182  virtual void mouseReleaseEvent(QMouseEvent* const event, Camera* const camera);
183  virtual void mouseMoveEvent (QMouseEvent* const event, Camera* const camera);
184  virtual void wheelEvent (QWheelEvent* const event, Camera* const camera);
186 
189 protected Q_SLOTS:
190  virtual void spin();
192 
195 public:
196  virtual QDomElement domElement(const QString& name, QDomDocument& document) const;
197 public Q_SLOTS:
198  virtual void initFromDOMElement(const QDomElement& element);
200 
201 #ifndef DOXYGEN
202 protected:
203  virtual void startAction(int ma, bool withConstraint=true); // int is really a QGLViewer::MouseAction
204 #endif
205 
206 private Q_SLOTS:
207  virtual void flyUpdate();
208 
209 private:
210  void updateSceneUpVector();
211  Quaternion turnQuaternion(int x, const Camera* const camera);
212  Quaternion pitchYawQuaternion(int x, int y, const Camera* const camera);
213 
214 private:
215  // Fly mode data
216  qreal flySpeed_;
217  qreal driveSpeed_;
219  QTimer flyTimer_;
220 
222  // Inverse the direction of an horizontal mouse motion. Depends on the projected
223  // screen orientation of the vertical axis when the mouse button is pressed.
225 
227 
229 };
230 
231 } // namespace qglviewer
232 
233 #endif // QGLVIEWER_MANIPULATED_CAMERA_FRAME_H
The ManipulatedCameraFrame class represents a ManipulatedFrame with Camera specific mouse bindings...
A ManipulatedFrame is a Frame that can be rotated and translated using the mouse. ...
void setRevolveArountPoint(const Vec &point)
void setRotatesAroundUpVector(bool constrained)
#define QGLVIEWER_EXPORT
The Vec class represents 3D positions and 3D vectors.
Definition: vec.h:65
A perspective or orthographic camera.
Definition: camera.h:84
The Quaternion class represents 3D rotations and orientations.
Definition: quaternion.h:66


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Wed Jun 5 2019 19:26:39