Image Component Library (ICL)
|
Provided by interface MouseGrabber. More...
#include <MouseEvent.h>
Public Member Functions | |
MouseEvent (const utils::Point &widgetPos, const utils::Point &imagePos, const utils::Point32f &imagePos32f, const utils::Point32f &relImagePos, const bool downMask[3], const std::vector< double > &color, const utils::Point &wheelDelta, MouseEventType type, ICLWidget *widget) | |
constructor with given parameters More... | |
MouseEvent () | |
Create an empty mouse event. More... | |
int | getWidgetX () const |
returns event's x coordinate wrt. widget frame More... | |
int | getWidgetY () const |
returns event's y coordinate wrt. widget frame More... | |
const utils::Point & | getWidgetPos () const |
returns event's location wrt. widget frame More... | |
int | getX () const |
returns event's x coordinate wrt. image frame More... | |
int | getY () const |
returns event's y coordinate wrt. image frame More... | |
const utils::Point & | getPos () const |
returns event's location wrt. image frame More... | |
float | getX32f () const |
returns event's x coordinate wrt. image frame More... | |
float | getY32f () const |
returns event's y coordinate wrt. image frame More... | |
const utils::Point32f & | getPos32f () const |
returns event's location wrt. image frame More... | |
const utils::Point & | getWheelDelta () const |
wheel delta (x: horizontal wheel, y: vertical wheel (common)) More... | |
float | getRelX () const |
returns event's relative x coordinate wrt. image frame More... | |
float | getRelY () const |
returns event's relative y coordinate wrt. image frame More... | |
const utils::Point32f | getRelPos () const |
returns event's relative location wrt. image frame More... | |
const std::vector< double > & | getColor () const |
returns clicked pixels color (or a zero length vector, if there was no pixel) More... | |
bool | hitImage () const |
returns if the widget's image was hit (and a color is available) More... | |
std::vector< bool > | getDownMask () const |
returns the downmask in order [left, middle, right]- button More... | |
bool | isLeft () const |
convenience function for left button More... | |
bool | isMiddle () const |
convenience function for middle button More... | |
bool | isRight () const |
convenience function for right button More... | |
bool | isLeftOnly () const |
convenience function for left button More... | |
bool | isMiddleOnly () const |
convenience function for middle button More... | |
bool | isRightOnly () const |
convenience function for right button More... | |
const MouseEventType | getType () const |
returns the event type More... | |
bool | isMoveEvent () const |
convenience function for special event type More... | |
bool | isDragEvent () const |
convenience function for special event type More... | |
bool | isPressEvent () const |
convenience function for special event type More... | |
bool | isReleaseEvent () const |
convenience function for special event type More... | |
bool | isEnterEvent () const |
convenience function for special event type More... | |
bool | isLeaveEvent () const |
convenience function for special event type More... | |
bool | isWheelEvent () const |
convenience function for special event type More... | |
ICLWidget * | getWidget () const |
returns the ICLWidget, which produced this event More... | |
int | getKeyboardModifiers () const |
returns all active keyboard modifiers (ored) More... | |
bool | isModifierActive (KeyboardModifier m) const |
returns whether a certain modifier is currently active More... | |
MouseEvent | remapEvent (const utils::Point32f &imagePos) const |
creates a new MouseEvent instance with a different image position More... | |
Private Attributes | |
utils::Point | m_widgetPos |
event location in widget coordinates More... | |
utils::Point | m_imagePos |
event location in image coordinates (common) More... | |
utils::Point32f | m_imagePos32f |
event location in image coordinates in float More... | |
utils::Point32f | m_relImagePos |
relative image coordinates More... | |
utils::Point | m_wheelDelta |
wheel delta (x: horizontal wheel, y: vertical wheel) More... | |
bool | m_downMask [3] |
button downMask More... | |
std::vector< double > | m_color |
clicked color More... | |
ICLWidget * | m_widget |
ICLWidget where the event occured. More... | |
MouseEventType | m_type |
Type of this event (press, release, move, ...) More... | |
int | m_keyboardModifiers |
ored list of active keyboard modifiers More... | |
Provided by interface MouseGrabber.
Most commonly, mouse events are processed wrt. the current image coordinate frame of the ICLWidget where the mouse event occurs. So, getX(), getY() and getPos() return the pixel coordinate of a mouse event. If mouse interaction shall be visualized, this coordinates can directly be passed to the drawing functions of ICLDrawWidget's.
icl::qt::MouseEvent::MouseEvent | ( | const utils::Point & | widgetPos, |
const utils::Point & | imagePos, | ||
const utils::Point32f & | imagePos32f, | ||
const utils::Point32f & | relImagePos, | ||
const bool | downMask[3], | ||
const std::vector< double > & | color, | ||
const utils::Point & | wheelDelta, | ||
MouseEventType | type, | ||
ICLWidget * | widget | ||
) |
constructor with given parameters
icl::qt::MouseEvent::MouseEvent | ( | ) |
Create an empty mouse event.
|
inline |
returns clicked pixels color (or a zero length vector, if there was no pixel)
|
inline |
returns the downmask in order [left, middle, right]- button
|
inline |
returns all active keyboard modifiers (ored)
A certain KeyboardModifier m can be checked for presence by
or by using the isModifierActive(KeyboardModifier) method directly.
|
inline |
returns event's location wrt. image frame
|
inline |
returns event's location wrt. image frame
|
inline |
returns event's relative location wrt. image frame
|
inline |
returns event's relative x coordinate wrt. image frame
|
inline |
returns event's relative y coordinate wrt. image frame
|
inline |
returns the event type
|
inline |
wheel delta (x: horizontal wheel, y: vertical wheel (common))
We use the unit of Qt's QWheelEvent's delta:
A positive delta value means that the wheel was rotated forward (for y) and to the right (for x)
|
inline |
returns the ICLWidget, which produced this event
|
inline |
returns event's location wrt. widget frame
|
inline |
returns event's x coordinate wrt. widget frame
|
inline |
returns event's y coordinate wrt. widget frame
|
inline |
returns event's x coordinate wrt. image frame
|
inline |
returns event's x coordinate wrt. image frame
|
inline |
returns event's y coordinate wrt. image frame
|
inline |
returns event's y coordinate wrt. image frame
|
inline |
returns if the widget's image was hit (and a color is available)
|
inline |
convenience function for special event type
|
inline |
convenience function for special event type
|
inline |
convenience function for special event type
|
inline |
convenience function for left button
|
inline |
convenience function for left button
|
inline |
convenience function for middle button
|
inline |
convenience function for middle button
|
inline |
returns whether a certain modifier is currently active
|
inline |
convenience function for special event type
|
inline |
convenience function for special event type
|
inline |
convenience function for special event type
|
inline |
convenience function for right button
|
inline |
convenience function for right button
|
inline |
convenience function for special event type
|
inline |
creates a new MouseEvent instance with a different image position
This method can be used to simulate normal mouse-events, acutally received from another source, such as an 3D component
|
private |
clicked color
|
private |
button downMask
|
private |
event location in image coordinates (common)
|
private |
event location in image coordinates in float
|
private |
ored list of active keyboard modifiers
|
private |
relative image coordinates
|
private |
Type of this event (press, release, move, ...)
|
private |
wheel delta (x: horizontal wheel, y: vertical wheel)
|
private |
event location in widget coordinates