Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WorldRotAxisInt.H

Go to the documentation of this file.
00001 
00011 #ifndef WORLDROTAXISINT_H
00012 #define WORLDROTAXISINT_H
00013 
00014 // gluebase includes
00015 #define OUTSIDE_GLUE_CORE
00016 #include <fsa/fsa.H>
00017 #include <dev/dev6d.H>
00018 #include <dev/room6d.H>
00019 #include <dev/buttons.H>
00020 #include <config/config.H>
00021 #include <mlib/points.H>
00022 
00023 // DrawObj includes
00024 #include "DrawObj.H"
00025 #include "glwrap.H"
00026 
00027 class WorldRotAxisDrawObj : public DrawObj
00028 {
00029  public:
00030 
00031   WorldRotAxisDrawObj() : DrawObj("WorldRotAxis_drawobj") {
00032     _afMatAmbient[0] = _afMatAmbient[1] = _afMatAmbient[2] = 0.2f;
00033     _afMatAmbient[3] = 1.0f;
00034     _afMatDiffuse[0] = 1.0f;
00035     _afMatDiffuse[2] = _afMatDiffuse[3] = 0.0f;
00036     _afMatSpecular[0] = _afMatSpecular[1] = _afMatSpecular[2] = _afMatSpecular[3] = 1.0f;
00037     _afMatShininess[0] = 50.0f;
00038   }
00039   virtual ~WorldRotAxisDrawObj() {}
00040 
00041   void contextInit();
00042   void draw();
00043 
00044   void setEndPoints(const Wpt& pos0, const Wpt& pos1) {
00045     _pos0 = pos0;
00046     _pos1 = pos1;
00047   }
00048 
00049  protected:
00050   
00051   // display list for the sphere
00052   isGlContextData<GLuint> _nSphere;
00053   Wpt _pos0, _pos1;
00054 
00055   float _afMatAmbient[4];
00056   float _afMatDiffuse[4];
00057   float _afMatSpecular[4];
00058   float _afMatShininess[1];  
00059 };
00060 
00061 class WorldRotAxisInt : public Interactor<WorldRotAxisInt>
00062 {
00063  public:
00064   
00065   WorldRotAxisInt();
00066   virtual ~WorldRotAxisInt();
00067 
00068   void setRotationAngle(float fAngle) { _fAngle = fAngle; }
00069 
00070  protected:
00071 
00072   WorldRotAxisDrawObj* _pWRADrawObj;
00073 
00074   void axis_on(cEVENTbtnptr &evt, STATE *&);
00075   void axis_off(cEVENTbtnptr &evt, STATE *&);
00076   void axis_motion(cEVENTroom6dptr &evt, STATE *&);
00077 
00078   EVENTroom6dptr _axis6dof;
00079   EVENTbtnptr    _axisbtnon;
00080   EVENTbtnptr    _axisbtnoff;  
00081   
00082   STATE _definingAxis;
00083 
00084   float _fAngle;
00085   int _firstMotion;
00086   int _rotation;
00087   Wpt _pos0, _pos1;
00088 };
00089 
00090 #endif // WORLDROTAXISINT_H

Generated on Mon Sep 15 16:27:56 2003 for inspace by doxygen1.2.18