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;
27  TimeLine m_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 * mRenderingWidget
virtual void mouseMoveEvent(QMouseEvent *e)
virtual void drawScene(void)
std::map< float, Frame > TimeLine
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Memory.h:841
virtual void mousePressEvent(QMouseEvent *e)
virtual void grabFrame(void)
QWidget * createNavigationControlWidget()
virtual void keyPressEvent(QKeyEvent *e)
std::vector< int > mIndices
RotationMode mRotationMode
virtual void mouseReleaseEvent(QMouseEvent *e)
virtual void resetCamera()
std::vector< Vector3f > mVertices
virtual void setNavMode(int)
virtual void stopAnimation()
virtual void setRotationMode(int)
virtual void initializeGL()
virtual void setLerpMode(int)
Vector2i mMouseCoords
virtual void animate(void)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
TrackMode mCurrentTrackingMode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW RenderingWidget()
std::vector< Vector3f > mNormals
virtual void paintGL()
Definition: camera.h:17
Frame lerpFrame(float t)
Definition: camera.h:36
Point2 t(10, 10)
Trackball mTrackball
virtual void resizeGL(int width, int height)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:29