GlutViewer.h
Go to the documentation of this file.
1 #ifndef _GLUTVIEWER_H_
2 #define _GLUTVIEWER_H_
3 
4 #include <cxcore.h>
5 
6 #ifdef WIN32
7  #include <windows.h>
8  #include <GL/gl.h>
9  #include <GL/glu.h>
10  #include <glut.h>
11 #else
12  #include <GL/gl.h>
13  #include <GL/glu.h>
14  #include <GL/glut.h>
15 #endif
16 
17 class Drawable
18 {
19 public:
20  Drawable(double _scale=1, double _r=1, double _g=1, double _b=1);
21 
22  void SetScale(double _scale);
23  void SetColor(double _r=1, double _g=1, double _b=1);
24 
25  virtual void Draw();
26  virtual void DrawAxis(double scale, double color[3]);
27 
28  void SetGLMatTraQuat(double *tra, double *quat, bool flip=false);
29  void SetGLMatTraRod(double *tra, double *rod);
30 
31  double scale;
32  double color[3];
33  double gl_mat[16];
34 
35 protected:
36  double ax_len;
37 };
38 
39 namespace GlutViewer
40 {
41  void Draw();
42  void Exit();
43  void Start(int argc, char** argv, int w, int h, float r=300.0);
44  void Reshape(int w, int h);
45 
46  void DrawableClear();
47  void DrawableAdd(Drawable* item);
48 
49  void DrawVr();
50  void DrawAr();
51  void DrawFloor();
52  void DrawContent();
53  void DrawAxis(float scale);
54  void Mouse(int button, int state, int x, int y);
55  void Motion(int x, int y);
56  void SetGlProjectionMatrix(double p[16]);
57  void SetGlModelviewMatrix(double p[16]);
58  void KeyCallback(int key, int x, int y);
59 
60  void SetVideo(const IplImage* _image);
61  void DrawVideo();
62 
63  double GetXOffset();
64  double GetYOffset();
65 }
66 
67 #endif
void DrawVr()
Definition: GlutViewer.cpp:340
void Mouse(int button, int state, int x, int y)
Definition: GlutViewer.cpp:253
void SetGLMatTraRod(double *tra, double *rod)
Definition: GlutViewer.cpp:105
Drawable(double _scale=1, double _r=1, double _g=1, double _b=1)
Definition: GlutViewer.cpp:10
double gl_mat[16]
Definition: GlutViewer.h:33
void DrawFloor()
Definition: GlutViewer.cpp:238
TFSIMD_FORCE_INLINE const tfScalar & y() const
void DrawAr()
Definition: GlutViewer.cpp:368
void KeyCallback(int key, int x, int y)
Definition: GlutViewer.cpp:197
void SetColor(double _r=1, double _g=1, double _b=1)
Definition: GlutViewer.cpp:19
double GetYOffset()
Definition: GlutViewer.cpp:222
void SetGlProjectionMatrix(double p[16])
Definition: GlutViewer.cpp:388
virtual void Draw()
Definition: GlutViewer.cpp:25
void SetGlModelviewMatrix(double p[16])
Definition: GlutViewer.cpp:392
void DrawContent()
Definition: GlutViewer.cpp:330
void Start(int argc, char **argv, int w, int h, float r=300.0)
Definition: GlutViewer.cpp:227
void DrawableClear()
Definition: GlutViewer.cpp:416
void DrawableAdd(Drawable *item)
Definition: GlutViewer.cpp:421
double color[3]
Definition: GlutViewer.h:32
TFSIMD_FORCE_INLINE const tfScalar & x() const
double GetXOffset()
Definition: GlutViewer.cpp:217
void SetGLMatTraQuat(double *tra, double *quat, bool flip=false)
Definition: GlutViewer.cpp:77
virtual void DrawAxis(double scale, double color[3])
Definition: GlutViewer.cpp:33
TFSIMD_FORCE_INLINE const tfScalar & w() const
void Reshape(int w, int h)
Definition: GlutViewer.cpp:396
void SetVideo(const IplImage *_image)
Definition: GlutViewer.cpp:428
void SetScale(double _scale)
Definition: GlutViewer.cpp:15
void Exit()
Definition: GlutViewer.cpp:411
double ax_len
Definition: GlutViewer.h:36
double scale
Definition: GlutViewer.h:31
r
void DrawVideo()
Definition: GlutViewer.cpp:433
void Motion(int x, int y)
Definition: GlutViewer.cpp:277


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Mon Jun 10 2019 12:47:04