#include <mouse.h>

Public Types | |
| enum | MouseButton { LeftButton, MiddleButton, RightButton } |
| Mouse buttons. More... | |
| typedef std::list < dtCore::RefPtr < MouseListener > > | MouseListenerList |
| The list of mouse listeners. | |
Public Member Functions | |
| Mouse (const std::string &name="mouse") | |
| Constructor. | |
| Mouse (dtCore::View *view, const std::string &name="mouse") | |
| Constructor. | |
| void | GetPosition (float &x, float &y) const |
| Gets the current mouse position. | |
| osg::Vec2 | GetPosition () const |
| void | SetPosition (float x, float y) |
| Sets the current mouse position. | |
| void | SetPosition (const osg::Vec2 &xy) |
| bool | GetButtonState (MouseButton button) const |
| Gets the state of the specified mouse button. | |
| void | AddMouseListener (MouseListener *mouseListener) |
| Pushes a listener to the back of its list. | |
| void | InsertMouseListener (const MouseListenerList::value_type &pos, MouseListener *ml) |
| Inserts the listener into the list at a position BEFORE pos. | |
| void | RemoveMouseListener (MouseListener *mouseListener) |
| Removes a listener for mouse events. | |
| virtual bool | MouseScroll (osgGA::GUIEventAdapter::ScrollingMotion sm) |
| For injecting mouse scroll events. | |
| virtual bool | MouseMotion (float x, float y) |
| For injecting mouse drag events. | |
| virtual bool | PassiveMouseMotion (float x, float y) |
| For injecting passive mouse motion events. | |
| virtual bool | ButtonDown (float x, float y, MouseButton button) |
| For injecting button press events. | |
| virtual bool | DoubleButtonDown (float x, float y, MouseButton button) |
| For injecting double button press events. | |
| virtual bool | ButtonUp (float x, float y, MouseButton button) |
| For injecting button release events. | |
| const MouseListenerList & | GetListeners () const |
| |
| bool | GetHasFocus () |
| |
| dtCore::View * | GetView () |
| |
| const dtCore::View * | GetView () const |
| |
Protected Member Functions | |
| virtual | ~Mouse () |
| Destructor. | |
| void | SetView (dtCore::View *view) |
| define the mOsgViewerView | |
Protected Attributes | |
| MouseListenerList | mMouseListeners |
| The container of observers. | |
| osg::observer_ptr< dtCore::View > | mView |
| needed to control the cursor on the window. | |
Friends | |
| class | KeyboardMouseHandler |
| typedef std::list<dtCore::RefPtr<MouseListener> > dtCore::Mouse::MouseListenerList |
The list of mouse listeners.
| Mouse::~Mouse | ( | ) | [protected, virtual] |
Destructor.
| Mouse::Mouse | ( | const std::string & | name = "mouse" |
) |
Constructor.
| name | the instance name |
| Mouse::Mouse | ( | dtCore::View * | view, | |
| const std::string & | name = "mouse" | |||
| ) |
Constructor.
| view | owner of this instance | |
| name | the instance name |
| void Mouse::GetPosition | ( | float & | x, | |
| float & | y | |||
| ) | const |
Gets the current mouse position.
| x | a reference to the location in which to store the x coordinate | |
| y | a reference to the location in which to store the y coordinate |
| osg::Vec2 Mouse::GetPosition | ( | ) | const |
| void Mouse::SetPosition | ( | float | x, | |
| float | y | |||
| ) |
Sets the current mouse position.
| x | the new x coordinate | |
| y | the new y coordinate |
| void Mouse::SetPosition | ( | const osg::Vec2 & | xy | ) |
| bool Mouse::GetButtonState | ( | MouseButton | button | ) | const |
Gets the state of the specified mouse button.
| button | the button to check |
| void Mouse::AddMouseListener | ( | MouseListener * | mouseListener | ) |
Pushes a listener to the back of its list.
| mouseListener | the listener to add |
| void Mouse::InsertMouseListener | ( | const MouseListenerList::value_type & | pos, | |
| MouseListener * | ml | |||
| ) |
Inserts the listener into the list at a position BEFORE pos.
| void Mouse::RemoveMouseListener | ( | MouseListener * | mouseListener | ) |
Removes a listener for mouse events.
| mouseListener | the listener to remove |
| bool Mouse::MouseScroll | ( | osgGA::GUIEventAdapter::ScrollingMotion | sm | ) | [virtual] |
For injecting mouse scroll events.
| sm | the scroll type |
| bool Mouse::MouseMotion | ( | float | x, | |
| float | y | |||
| ) | [virtual] |
For injecting mouse drag events.
| x | the x coordinate | |
| y | the y coordinate |
| bool Mouse::PassiveMouseMotion | ( | float | x, | |
| float | y | |||
| ) | [virtual] |
For injecting passive mouse motion events.
| x | the x coordinate | |
| y | the y coordinate |
| bool Mouse::ButtonDown | ( | float | x, | |
| float | y, | |||
| MouseButton | button | |||
| ) | [virtual] |
For injecting button press events.
| x | the x coordinate | |
| y | the y coordinate | |
| button | the button identifier |
| bool Mouse::DoubleButtonDown | ( | float | x, | |
| float | y, | |||
| MouseButton | button | |||
| ) | [virtual] |
For injecting double button press events.
| x | the x coordinate | |
| y | the y coordinate | |
| button | the button identifier |
| bool Mouse::ButtonUp | ( | float | x, | |
| float | y, | |||
| MouseButton | button | |||
| ) | [virtual] |
For injecting button release events.
| x | the x coordinate | |
| y | the y coordinate | |
| button | the button identifier |
| const MouseListenerList& dtCore::Mouse::GetListeners | ( | ) | const [inline] |
| bool Mouse::GetHasFocus | ( | ) |
| dtCore::View* dtCore::Mouse::GetView | ( | ) | [inline] |
| const dtCore::View* dtCore::Mouse::GetView | ( | ) | const [inline] |
| void dtCore::Mouse::SetView | ( | dtCore::View * | view | ) | [inline, protected] |
define the mOsgViewerView
friend class KeyboardMouseHandler [friend] |
MouseListenerList dtCore::Mouse::mMouseListeners [protected] |
The container of observers.
osg::observer_ptr<dtCore::View> dtCore::Mouse::mView [protected] |
needed to control the cursor on the window.