OpenWalnut
1.5.0dev
|
Class to handle providing information about pixel position of mouse. More...
#include <WMouseLocationHandler.h>
Classes | |
class | WMouseLocationInfo |
This class holds the information about the mouse pointer location in a certain viewe. More... | |
Public Member Functions | |
WMouseLocationHandler () | |
Constructor that initalizes members with sensible defaults. More... | |
WMouseLocationHandler (std::string viewerName) | |
Constructor that initalizes members with sensible defaults and sets the name of the viewer. More... | |
bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) |
Deals with the events found by the osg. More... | |
boost::signals2::signal< void(WMouseLocationInfo) > * | getLocationSignal () |
WMouseLocationInfo | getLocationInfo () |
Gives information about the mouse location. More... | |
Protected Member Functions | |
virtual | ~WMouseLocationHandler () |
Virtual destructor needed because of virtual function. More... | |
Private Attributes | |
boost::signals2::signal< void(WMouseLocationInfo) > | m_locationSignal |
One can register to this signal to receive location events. More... | |
WMouseLocationInfo | m_mouseLocation |
Representation of mouse location. More... | |
std::string | m_viewerName |
which viewer sends the signal More... | |
Class to handle providing information about pixel position of mouse.
Definition at line 41 of file WMouseLocationHandler.h.
WMouseLocationHandler::WMouseLocationHandler | ( | ) |
Constructor that initalizes members with sensible defaults.
Definition at line 31 of file WMouseLocationHandler.cpp.
|
explicit |
Constructor that initalizes members with sensible defaults and sets the name of the viewer.
viewerName | name of the viewer |
Definition at line 37 of file WMouseLocationHandler.cpp.
|
protectedvirtual |
Virtual destructor needed because of virtual function.
This desctructor is protected to avoid accidentally deleting an instance of WMouseLocationHandler. This follows the philosophy of OSG to avoid problems in multithreaded environments, since these pointers are used deep in the OSG where a deletion could cause a segfault.
Definition at line 43 of file WMouseLocationHandler.cpp.
WMouseLocationHandler::WMouseLocationInfo WMouseLocationHandler::getLocationInfo | ( | ) |
Gives information about the mouse location.
Definition at line 65 of file WMouseLocationHandler.cpp.
References m_mouseLocation.
Referenced by handle().
boost::signals2::signal< void(WMouseLocationHandler::WMouseLocationInfo) > * WMouseLocationHandler::getLocationSignal | ( | ) |
Definition at line 47 of file WMouseLocationHandler.cpp.
References m_locationSignal.
bool WMouseLocationHandler::handle | ( | const osgGA::GUIEventAdapter & | ea, |
osgGA::GUIActionAdapter & | aa | ||
) |
Deals with the events found by the osg.
ea | Event class for storing Keyboard, mouse and window events. |
aa | Interface by which GUIEventHandlers may request actions of the GUI system |
Definition at line 52 of file WMouseLocationHandler.cpp.
References getLocationInfo(), m_locationSignal, m_mouseLocation, and m_viewerName.
|
private |
One can register to this signal to receive location events.
Definition at line 134 of file WMouseLocationHandler.h.
Referenced by getLocationSignal(), and handle().
|
private |
Representation of mouse location.
Definition at line 136 of file WMouseLocationHandler.h.
Referenced by getLocationInfo(), and handle().
|
private |
which viewer sends the signal
Definition at line 137 of file WMouseLocationHandler.h.
Referenced by handle().