|
OpenWalnut
1.2.5
|
Class to handle events with a pick. More...
#include <WPickHandler.h>
Inheritance diagram for WPickHandler:Public Member Functions | |
| WPickHandler () | |
| Constructor that initalizes members with sensible defaults. | |
| WPickHandler (std::string viewerName) | |
| Constructor that initalizes members with sensible defaults and sets the name of the viewer. | |
| bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) |
| Deals with the events found by the osg. | |
| virtual void | pick (osgViewer::View *view, const osgGA::GUIEventAdapter &ea) |
| Send a pick signal with the pick information as string. | |
| virtual void | unpick () |
| Send a pick signal with the string "unpick". | |
| WPickInfo | getHitResult () |
| Gives information about the picked object. | |
| boost::signals2::signal1< void, WPickInfo > * | getPickSignal () |
| returns the m_pickSignal to for registering to it. | |
| void | setPaintMode (int mode) |
| setter for paint mode | |
Protected Member Functions | |
| virtual | ~WPickHandler () |
| Virtual destructor needed because of virtual function. | |
Protected Attributes | |
| WPickInfo | m_hitResult |
| Textual representation of the result of a pick. | |
| WPickInfo | m_startPick |
| indicates what was first picked. Should be "" after unpick. | |
| bool | m_shift |
| is shift pressed? | |
| bool | m_ctrl |
| is ctrl pressed? | |
| std::string | m_viewerName |
| which viewer sends the signal | |
| int | m_paintMode |
| the paint mode | |
| WPickInfo::WMouseButton | m_mouseButton |
| stores mouse button that initiated the pick | |
Private Member Functions | |
| void | updatePickInfoModifierKeys (WPickInfo *pickInfo) |
| Sets the current modifiers to the provided pickInfo. | |
Private Attributes | |
| boost::signals2::signal1< void, WPickInfo > | m_pickSignal |
| One can register to this signal to receive pick events. | |
Class to handle events with a pick.
The handler ignores any geometry whose name starts with an underscore ("_").
Definition at line 57 of file WPickHandler.h.
| WPickHandler::WPickHandler | ( | ) |
Constructor that initalizes members with sensible defaults.
Definition at line 35 of file WPickHandler.cpp.
|
explicit |
Constructor that initalizes members with sensible defaults and sets the name of the viewer.
| viewerName | name of the viewer |
Definition at line 46 of file WPickHandler.cpp.
|
protectedvirtual |
Virtual destructor needed because of virtual function.
This desctructor is protected to avoid accidentally deleting a instance of WPickHandler. 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 57 of file WPickHandler.cpp.
| WPickInfo WPickHandler::getHitResult | ( | ) |
Gives information about the picked object.
Definition at line 61 of file WPickHandler.cpp.
References m_hitResult.
| boost::signals2::signal1< void, WPickInfo > * WPickHandler::getPickSignal | ( | ) |
returns the m_pickSignal to for registering to it.
Definition at line 66 of file WPickHandler.cpp.
References m_pickSignal.
| bool WPickHandler::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 71 of file WPickHandler.cpp.
References m_ctrl, m_mouseButton, m_paintMode, m_shift, pick(), and unpick().
|
virtual |
Send a pick signal with the pick information as string.
| view | the view in which we pick. |
| ea | Event class for storing Keyboard, mouse and window events. |
Definition at line 180 of file WPickHandler.cpp.
References getHitResult(), WPickInfo::getModifierKey(), WPickInfo::getName(), WPickInfo::getPickNormal(), WPickInfo::getPickPosition(), m_ctrl, m_hitResult, m_mouseButton, m_paintMode, m_pickSignal, m_startPick, m_viewerName, and updatePickInfoModifierKeys().
Referenced by handle().
| void WPickHandler::setPaintMode | ( | int | mode | ) |
setter for paint mode
| mode | the paint mode |
Definition at line 311 of file WPickHandler.cpp.
References m_paintMode.
|
virtual |
Send a pick signal with the string "unpick".
Definition at line 143 of file WPickHandler.cpp.
References getHitResult(), m_hitResult, m_pickSignal, m_startPick, and m_viewerName.
Referenced by handle().
|
private |
Sets the current modifiers to the provided pickInfo.
| pickInfo | This pickInfo will be updated. |
Definition at line 167 of file WPickHandler.cpp.
References m_ctrl, m_shift, and WPickInfo::setModifierKey().
Referenced by pick().
|
protected |
is ctrl pressed?
Definition at line 127 of file WPickHandler.h.
Referenced by handle(), pick(), and updatePickInfoModifierKeys().
|
protected |
Textual representation of the result of a pick.
Definition at line 124 of file WPickHandler.h.
Referenced by getHitResult(), pick(), and unpick().
|
protected |
stores mouse button that initiated the pick
Definition at line 130 of file WPickHandler.h.
|
protected |
the paint mode
Definition at line 129 of file WPickHandler.h.
Referenced by handle(), pick(), and setPaintMode().
|
private |
One can register to this signal to receive pick events.
Definition at line 141 of file WPickHandler.h.
Referenced by getPickSignal(), pick(), and unpick().
|
protected |
is shift pressed?
Definition at line 126 of file WPickHandler.h.
Referenced by handle(), and updatePickInfoModifierKeys().
|
protected |
indicates what was first picked. Should be "" after unpick.
Definition at line 125 of file WPickHandler.h.
|
protected |
which viewer sends the signal
Definition at line 128 of file WPickHandler.h.
1.8.1