quaternion_demo.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_QUATERNION_DEMO_H
11 #define EIGEN_QUATERNION_DEMO_H
12 
13 #include "gpuhelper.h"
14 #include "camera.h"
15 #include "trackball.h"
16 #include <map>
17 #include <QTimer>
18 #include <QtGui/QApplication>
19 #include <QtOpenGL/QGLWidget>
20 #include <QtGui/QMainWindow>
21 
22 class RenderingWidget : public QGLWidget
23 {
24  Q_OBJECT
25 
26  typedef std::map<float,Frame> TimeLine;
28  Frame lerpFrame(float t);
29 
31  bool mAnimate;
32  float m_alpha;
33 
34  enum TrackMode {
37  };
38 
39  enum NavMode {
42  };
43 
44  enum LerpMode {
47  };
48 
49  enum RotationMode {
52  };
53 
59  Vector2i mMouseCoords;
61 
62  QTimer m_timer;
63 
64  void setupCamera();
65 
66  std::vector<Vector3f> mVertices;
67  std::vector<Vector3f> mNormals;
68  std::vector<int> mIndices;
69 
70  protected slots:
71 
72  virtual void animate(void);
73  virtual void drawScene(void);
74 
75  virtual void grabFrame(void);
76  virtual void stopAnimation();
77 
78  virtual void setNavMode(int);
79  virtual void setLerpMode(int);
80  virtual void setRotationMode(int);
81  virtual void resetCamera();
82 
83  protected:
84 
85  virtual void initializeGL();
86  virtual void resizeGL(int width, int height);
87  virtual void paintGL();
88 
89  //--------------------------------------------------------------------------------
90  virtual void mousePressEvent(QMouseEvent * e);
91  virtual void mouseReleaseEvent(QMouseEvent * e);
92  virtual void mouseMoveEvent(QMouseEvent * e);
93  virtual void keyPressEvent(QKeyEvent * e);
94  //--------------------------------------------------------------------------------
95 
96  public:
98 
101 
103 };
104 
105 class QuaternionDemo : public QMainWindow
106 {
107  Q_OBJECT
108  public:
109  QuaternionDemo();
110  protected:
112 };
113 
114 #endif // EIGEN_QUATERNION_DEMO_H
RenderingWidget::m_timeline
TimeLine m_timeline
Definition: quaternion_demo.h:27
QuaternionDemo
Definition: quaternion_demo.h:105
RenderingWidget::mIndices
std::vector< int > mIndices
Definition: quaternion_demo.h:68
RenderingWidget::LerpMode
LerpMode
Definition: quaternion_demo.h:44
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RenderingWidget::RenderingWidget
EIGEN_MAKE_ALIGNED_OPERATOR_NEW RenderingWidget()
Definition: quaternion_demo.cpp:197
RenderingWidget::LerpEulerAngles
@ LerpEulerAngles
Definition: quaternion_demo.h:46
Camera
Definition: camera.h:36
RenderingWidget::mVertices
std::vector< Vector3f > mVertices
Definition: quaternion_demo.h:66
RenderingWidget::mNormals
std::vector< Vector3f > mNormals
Definition: quaternion_demo.h:67
RenderingWidget::mNavMode
NavMode mNavMode
Definition: quaternion_demo.h:56
RenderingWidget::m_alpha
float m_alpha
Definition: quaternion_demo.h:32
QuaternionDemo::QuaternionDemo
QuaternionDemo()
Definition: quaternion_demo.cpp:624
RenderingWidget::TM_LOCAL_ROTATE
@ TM_LOCAL_ROTATE
Definition: quaternion_demo.h:36
RenderingWidget::LerpQuaternion
@ LerpQuaternion
Definition: quaternion_demo.h:45
RenderingWidget::resizeGL
virtual void resizeGL(int width, int height)
Definition: quaternion_demo.cpp:490
RenderingWidget::mTrackball
Trackball mTrackball
Definition: quaternion_demo.h:60
Frame
Definition: camera.h:17
Trackball
Definition: trackball.h:17
trackball.h
RenderingWidget::mMouseCoords
Vector2i mMouseCoords
Definition: quaternion_demo.h:59
RenderingWidget::mRotationMode
RotationMode mRotationMode
Definition: quaternion_demo.h:58
RenderingWidget::m_timer
QTimer m_timer
Definition: quaternion_demo.h:62
RenderingWidget::lerpFrame
Frame lerpFrame(float t)
RenderingWidget::resetCamera
virtual void resetCamera()
Definition: quaternion_demo.cpp:510
RenderingWidget::setNavMode
virtual void setNavMode(int)
Definition: quaternion_demo.cpp:495
RenderingWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *e)
Definition: quaternion_demo.cpp:312
RenderingWidget::TimeLine
std::map< float, Frame > TimeLine
Definition: quaternion_demo.h:26
RenderingWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *e)
Definition: quaternion_demo.cpp:395
RenderingWidget::setLerpMode
virtual void setLerpMode(int)
Definition: quaternion_demo.cpp:500
RenderingWidget::~RenderingWidget
~RenderingWidget()
Definition: quaternion_demo.h:100
RenderingWidget::grabFrame
virtual void grabFrame(void)
Definition: quaternion_demo.cpp:210
RenderingWidget::RotationMode
RotationMode
Definition: quaternion_demo.h:49
RenderingWidget::animate
virtual void animate(void)
Definition: quaternion_demo.cpp:269
RenderingWidget::mLerpMode
LerpMode mLerpMode
Definition: quaternion_demo.h:57
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Memory.h:841
RenderingWidget::NavTurnAround
@ NavTurnAround
Definition: quaternion_demo.h:40
RenderingWidget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Definition: quaternion_demo.cpp:363
RenderingWidget::mCamera
Camera mCamera
Definition: quaternion_demo.h:54
RenderingWidget::mInitFrame
Frame mInitFrame
Definition: quaternion_demo.h:30
RenderingWidget::TM_NO_TRACK
@ TM_NO_TRACK
Definition: quaternion_demo.h:35
camera.h
QuaternionDemo::mRenderingWidget
RenderingWidget * mRenderingWidget
Definition: quaternion_demo.h:111
RenderingWidget::setupCamera
void setupCamera()
RenderingWidget::NavFly
@ NavFly
Definition: quaternion_demo.h:41
RenderingWidget::mCurrentTrackingMode
TrackMode mCurrentTrackingMode
Definition: quaternion_demo.h:55
RenderingWidget::TM_ROTATE_AROUND
@ TM_ROTATE_AROUND
Definition: quaternion_demo.h:35
RenderingWidget::TM_FLY_PAN
@ TM_FLY_PAN
Definition: quaternion_demo.h:36
RenderingWidget::RotationStandard
@ RotationStandard
Definition: quaternion_demo.h:51
RenderingWidget::initializeGL
virtual void initializeGL()
Definition: quaternion_demo.cpp:477
RenderingWidget
Definition: quaternion_demo.h:22
RenderingWidget::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: quaternion_demo.cpp:401
RenderingWidget::TrackMode
TrackMode
Definition: quaternion_demo.h:34
RenderingWidget::setRotationMode
virtual void setRotationMode(int)
Definition: quaternion_demo.cpp:505
RenderingWidget::drawScene
virtual void drawScene(void)
Definition: quaternion_demo.cpp:228
RenderingWidget::TM_ZOOM
@ TM_ZOOM
Definition: quaternion_demo.h:35
RenderingWidget::NavMode
NavMode
Definition: quaternion_demo.h:39
gpuhelper.h
align_3::t
Point2 t(10, 10)
RenderingWidget::TM_FLY_Z
@ TM_FLY_Z
Definition: quaternion_demo.h:36
RenderingWidget::paintGL
virtual void paintGL()
Definition: quaternion_demo.cpp:457
RenderingWidget::mAnimate
bool mAnimate
Definition: quaternion_demo.h:31
RenderingWidget::stopAnimation
virtual void stopAnimation()
Definition: quaternion_demo.cpp:355
RenderingWidget::createNavigationControlWidget
QWidget * createNavigationControlWidget()
Definition: quaternion_demo.cpp:551
RenderingWidget::RotationStable
@ RotationStable
Definition: quaternion_demo.h:50


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:13:02