GlutViewer.h
Go to the documentation of this file.
00001 #ifndef _GLUTVIEWER_H_
00002 #define _GLUTVIEWER_H_
00003 
00004 #include <cxcore.h>
00005 
00006 #ifdef WIN32
00007     #include <windows.h>
00008     #include <GL/gl.h>
00009     #include <GL/glu.h>
00010     #include <glut.h>
00011 #else
00012     #include <GL/gl.h>
00013     #include <GL/glu.h>
00014     #include <GL/glut.h>
00015 #endif
00016 
00017 class Drawable
00018 {
00019 public:
00020         Drawable(double _scale=1, double _r=1, double _g=1, double _b=1);
00021 
00022         void SetScale(double _scale);
00023         void SetColor(double _r=1, double _g=1, double _b=1);
00024         
00025         virtual void Draw();
00026         virtual void DrawAxis(double scale, double color[3]);
00027         
00028         void SetGLMatTraQuat(double *tra, double *quat, bool flip=false);
00029         void SetGLMatTraRod(double *tra, double *rod);
00030 
00031         double scale;
00032         double color[3];
00033         double gl_mat[16];
00034 
00035 protected:
00036         double ax_len;
00037 };
00038 
00039 namespace GlutViewer
00040 {
00041         void Draw();
00042         void Exit();
00043         void Start(int argc, char** argv, int w, int h, float r=300.0);
00044         void Reshape(int w, int h);
00045 
00046         void DrawableClear();
00047         void DrawableAdd(Drawable* item);
00048 
00049         void DrawVr();
00050         void DrawAr();
00051         void DrawFloor();
00052         void DrawContent();
00053         void DrawAxis(float scale);
00054         void Mouse(int button, int state, int x, int y);
00055         void Motion(int x, int y);
00056         void SetGlProjectionMatrix(double p[16]);
00057         void SetGlModelviewMatrix(double p[16]);
00058         void KeyCallback(int key, int x, int y);
00059 
00060         void SetVideo(const IplImage* _image);
00061         void DrawVideo();
00062 
00063         double GetXOffset();
00064         double GetYOffset();
00065 }
00066 
00067 #endif


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Feb 16 2017 03:23:02