![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
Window OpenCV Mouse base class. More...
#include <WinCvMouse.h>
Public Member Functions | |
| WinCvMouse () | |
| Default contructor. | |
| virtual | ~WinCvMouse () |
| Destructor. | |
| void | bind (Win *pWin) |
| Bind the mouse to the given window. More... | |
| void | unbind () |
| Unbind the mouse instance from the currently bound window. | |
| int | getCurrentEvent () |
| Get the current mouse event. More... | |
| void | setCurrentEvent (int nEvent) |
| Set the current mouse event. More... | |
| void | enableMouseDrag () |
| Enable mouse drag operations. | |
| void | disableMouseDrag () |
| Disable mouse drag operations. | |
| CvPoint | getMousePoint () |
| Get the most recently recorded mouse position. More... | |
Static Protected Member Functions | |
| static void | onMouse (int event, int x, int y, int flags, void *param) |
| Mouse event callback handler. More... | |
Protected Attributes | |
| Win * | m_pWin |
| mouse actions are bound to this windo | |
| int | m_nCurrentEvent |
| current (user) menu event | |
| CvPoint | m_ptMouse |
| mouse point | |
| bool | m_bDrag |
| enable mouse drag operation | |
| bool | m_bDragState |
| [not] within drag operation | |
Window OpenCV Mouse base class.
This class supports mouse operations on an OpenCV widget region of the window.
Definition at line 81 of file WinCvMouse.h.
| void WinCvMouse::bind | ( | Win * | pWin | ) |
Bind the mouse to the given window.
Any previously bound mouse instance is unbound. This mouse state is reset.
| pWin | Pointer to binding window. |
Definition at line 103 of file WinCvMouse.cxx.
References rnr::nopoint(), and rnr::UIEventNone.
|
inline |
Get the current mouse event.
Definition at line 114 of file WinCvMouse.h.
References m_nCurrentEvent.
|
inline |
Get the most recently recorded mouse position.
Definition at line 152 of file WinCvMouse.h.
References m_ptMouse.
|
staticprotected |
Mouse event callback handler.
| event | Mouse event. |
| x | Window mouse x coordinate. A value of -1 indicates out-of-region event. |
| y | Window mouse y coordinate. A value of -1 indicates out-of-region event. |
| flags | Extra flags |
| param | Application specific parameter (this). |
Definition at line 129 of file WinCvMouse.cxx.
References m_bDrag, m_bDragState, m_nCurrentEvent, m_ptMouse, rnr::UIEventClick, rnr::UIEventDragEnd, rnr::UIEventDragging, rnr::UIEventDragStart, and rnr::UIEventNone.
|
inline |
Set the current mouse event.
| nEvent | Event unique identifier. |
Definition at line 124 of file WinCvMouse.h.
References m_nCurrentEvent.