Documentation


mouseEvent.h

Go to the documentation of this file.
00001 
00002 //                            mouseEvent.h                                    //
00004 
00005 #ifndef ANIMAL_MOUSE_EVENT_H
00006 #define ANIMAL_MOUSE_EVENT_H
00007 
00008 #include <animal/vec3.h>
00009 
00010 #include "event.h"
00011 
00012 namespace animal{
00013 
00015 class MouseEvent : public Event
00016 {
00017 public:
00019   MouseEvent(TypeInt type, int x, int y, ButtonStateInt button, ButtonStateInt state, Vec3 origine , Vec3 direction)
00020   : Event(type, state)
00021   , _accepted(false)
00022   , _x(x)
00023   , _y(y)
00024   , _button(button)
00025   , _pickingOrigine(origine)
00026   , _pickingDirection(direction)
00027   {}
00028   
00030   virtual ~MouseEvent(){}
00031   
00033   int x() const { return _x; }
00034   
00036   int y() const { return _y; }
00037   
00039   ButtonStateInt button() { return _button; }
00040   
00042   bool isAccepted() const{ return _accepted; }
00043   
00045   void accept() { _accepted = true; }
00046   
00048   void ignore() { _accepted = false; }
00049   
00051   Vec3 pickingOrigine()
00052   {
00053     return _pickingOrigine;
00054   }
00055   
00057   Vec3 pickingDirection()
00058   {
00059     return _pickingDirection;
00060   }
00061   
00062 protected :
00063   bool _accepted;
00064   int _x;
00065   int _y;
00066   ButtonStateInt _button;
00067   Vec3 _pickingOrigine;
00068   Vec3 _pickingDirection;
00069   
00070 };
00071 
00072 }// animal
00073 
00074 #endif

Generated on Thu Dec 23 13:52:26 2004 by doxygen 1.3.6