25 #ifndef WMOUSELOCATIONHANDLER_H
26 #define WMOUSELOCATIONHANDLER_H
31 #include <boost/signals2/signal.hpp>
33 #include <osgViewer/View>
35 #include "../common/math/linearAlgebra/WVectorFixed.h"
63 bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );
78 std::pair< float, float > pixelCoords ) :
This class holds the information about the mouse pointer location in a certain viewe.
WMouseLocationInfo(std::string viewerName, std::pair< float, float > pixelCoords)
Initializing members.
std::string m_viewerName
name of the viewer
WMouseLocationInfo()
Default initializing members.
std::pair< float, float > m_pixelCoords
Pixel coordinates of the mouse.
WVector2d getPixel() const
Obtain the mouse location in pixel coordinates.
Class to handle providing information about pixel position of mouse.
WMouseLocationHandler()
Constructor that initalizes members with sensible defaults.
boost::signals2::signal< void(WMouseLocationInfo) > m_locationSignal
One can register to this signal to receive location events.
WMouseLocationInfo m_mouseLocation
Representation of mouse location.
std::string m_viewerName
which viewer sends the signal
WMouseLocationInfo getLocationInfo()
Gives information about the mouse location.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deals with the events found by the osg.
boost::signals2::signal< void(WMouseLocationInfo) > * getLocationSignal()
virtual ~WMouseLocationHandler()
Virtual destructor needed because of virtual function.