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

DefaultCursor.H

Go to the documentation of this file.
00001 
00010 #ifndef DEFAULTCURSOR_H
00011 #define DEFAULTCURSOR_H
00012 
00013 
00014 // Gluebase includes
00015 #define OUTSIDE_GLUE_CORE
00016 #include <fsa/fsa.H>
00017 #include <dev/room6d.H>
00018 #include <config/config.H>
00019 
00020 #include "Cursor.H"
00021 #include "ISMeshObj.H"
00022 #include "DrawMgr.H"
00023 #include "ISModeler.H"
00024 #include "DrawPoint.H"
00025 
00026 class DefaultCursor : public Cursor, public Interactor<DefaultCursor>
00027 {
00028 public:
00029   
00030   DefaultCursor() : Cursor(), Interactor<DefaultCursor>("DefaultCursor") 
00031   {
00032     addDrawObj(new DrawPoint(Wpt(0,0,0),Color::white));
00033     
00034     // setup a FSA to call motion whenever the device moves
00035     _tracker = new EVENTroom6d(CONFIGval("DEFAULT_CURSOR_6DOF","",false));
00036     _entry += Arc(this, Gd(_tracker), &DefaultCursor::motion);
00037     EVENTmgr::add_handler(new FSA(&_entry));
00038   }
00039 
00040   DefaultCursor(DrawObj *d) : Cursor(), Interactor<DefaultCursor>("DefaultCursor") 
00041   {
00042     addDrawObj(d);
00043     
00044     // setup a FSA to call motion whenever the device moves
00045     _tracker = new EVENTroom6d(CONFIGval("DEFAULT_CURSOR_6DOF","",false));
00046     _entry += Arc(this, Gd(_tracker), &DefaultCursor::motion);
00047     EVENTmgr::add_handler(new FSA(&_entry));
00048   }
00049 
00050 
00051 
00052   virtual ~DefaultCursor() {}
00053 
00054   void motion(cEVENTroom6dptr &evt, STATE *&) {
00055     moveTo(evt->cur());
00056   }
00057 
00058 
00059 protected:
00060   
00061   EVENTroom6dptr _tracker;
00062 
00063 };
00064 
00065 
00066 #endif

Generated on Thu Jul 8 15:19:28 2004 for inspace by doxygen 1.3.4