OpenWalnut  1.5.0dev
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
WMouseLocationHandler Class Reference

Class to handle providing information about pixel position of mouse. More...

#include <WMouseLocationHandler.h>

+ Inheritance diagram for WMouseLocationHandler:
+ Collaboration diagram for WMouseLocationHandler:

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...
 

Detailed Description

Class to handle providing information about pixel position of mouse.

Definition at line 41 of file WMouseLocationHandler.h.

Constructor & Destructor Documentation

◆ WMouseLocationHandler() [1/2]

WMouseLocationHandler::WMouseLocationHandler ( )

Constructor that initalizes members with sensible defaults.

Definition at line 31 of file WMouseLocationHandler.cpp.

◆ WMouseLocationHandler() [2/2]

WMouseLocationHandler::WMouseLocationHandler ( std::string  viewerName)
explicit

Constructor that initalizes members with sensible defaults and sets the name of the viewer.

Parameters
viewerNamename of the viewer

Definition at line 37 of file WMouseLocationHandler.cpp.

◆ ~WMouseLocationHandler()

WMouseLocationHandler::~WMouseLocationHandler ( )
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.

Member Function Documentation

◆ getLocationInfo()

WMouseLocationHandler::WMouseLocationInfo WMouseLocationHandler::getLocationInfo ( )

Gives information about the mouse location.

Returns
info the location information

Definition at line 65 of file WMouseLocationHandler.cpp.

References m_mouseLocation.

Referenced by handle().

+ Here is the caller graph for this function:

◆ getLocationSignal()

boost::signals2::signal< void(WMouseLocationHandler::WMouseLocationInfo) > * WMouseLocationHandler::getLocationSignal ( )
Returns
the m_locationSignal to for registering to it.

Definition at line 47 of file WMouseLocationHandler.cpp.

References m_locationSignal.

◆ handle()

bool WMouseLocationHandler::handle ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  aa 
)

Deals with the events found by the osg.

Parameters
eaEvent class for storing Keyboard, mouse and window events.
aaInterface by which GUIEventHandlers may request actions of the GUI system
Returns
true if the event was handled.

Definition at line 52 of file WMouseLocationHandler.cpp.

References getLocationInfo(), m_locationSignal, m_mouseLocation, and m_viewerName.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_locationSignal

boost::signals2::signal< void( WMouseLocationInfo ) > WMouseLocationHandler::m_locationSignal
private

One can register to this signal to receive location events.

Definition at line 134 of file WMouseLocationHandler.h.

Referenced by getLocationSignal(), and handle().

◆ m_mouseLocation

WMouseLocationInfo WMouseLocationHandler::m_mouseLocation
private

Representation of mouse location.

Definition at line 136 of file WMouseLocationHandler.h.

Referenced by getLocationInfo(), and handle().

◆ m_viewerName

std::string WMouseLocationHandler::m_viewerName
private

which viewer sends the signal

Definition at line 137 of file WMouseLocationHandler.h.

Referenced by handle().


The documentation for this class was generated from the following files: