#include <mask_overlay.hh>
Inherits ost::img::gui::Overlay.
Public Member Functions | |
MaskOverlay () | |
MaskOverlay (const MaskPtr &m) | |
virtual bool | OnMouseEvent (QMouseEvent *e, DataViewerPanel *dvp, const QPoint &lastmouse) |
virtual bool | OnKeyEvent (QKeyEvent *e, DataViewerPanel *dvp) |
virtual void | OnDraw (QPainter &pnt, DataViewerPanel *dvp, bool is_active) |
virtual QMenu * | GetMenu () |
MaskPtr | GetMask () const |
void | SetMask (const MaskPtr &m) |
void | ClearMask () |
void | ClearShift () |
geom::Vec2 | GetShift () |
void | SetShift (geom::Vec2 shift) |
void | ApplyShiftToMask () |
Protected Attributes | |
std::vector< geom::Polygon2 > | polygons_ |
QMenu * | menu_ |
int | active_ |
bool | add_mode_ |
geom::Polygon2 | new_poly_ |
geom::Vec2 | old_mouse_pos_ |
geom::Vec2 | shift_ |
Definition at line 42 of file mask_overlay.hh.
MaskOverlay | ( | ) |
MaskOverlay | ( | const MaskPtr & | m | ) |
void ApplyShiftToMask | ( | ) |
void ClearMask | ( | ) |
void ClearShift | ( | ) | [inline] |
Definition at line 57 of file mask_overlay.hh.
MaskPtr GetMask | ( | ) | const |
virtual QMenu* GetMenu | ( | ) | [virtual] |
return overlay specific pulldown menu
Reimplemented from Overlay.
geom::Vec2 GetShift | ( | ) | [inline] |
Definition at line 58 of file mask_overlay.hh.
virtual void OnDraw | ( | QPainter & | pnt, | |
DataViewerPanel * | dvp, | |||
bool | is_active | |||
) | [virtual] |
call when redrawing is necessary
params: the drawing context, the parent data viewer, as well as a flag to indicate wether this overlay is currently active
Reimplemented from Overlay.
virtual bool OnKeyEvent | ( | QKeyEvent * | e, | |
DataViewerPanel * | dvp | |||
) | [virtual] |
virtual bool OnMouseEvent | ( | QMouseEvent * | e, | |
DataViewerPanel * | dvp, | |||
const QPoint & | lastmouse | |||
) | [virtual] |
mouse event handler
if an overlay is active, it receives the mouse events. if it handles the event for itself, it should return true, otherwise false should be returned to give the data viewer a chance to handle the event for itself
Reimplemented from Overlay.
void SetMask | ( | const MaskPtr & | m | ) |
void SetShift | ( | geom::Vec2 | shift | ) |
int active_ [protected] |
Definition at line 65 of file mask_overlay.hh.
bool add_mode_ [protected] |
Definition at line 66 of file mask_overlay.hh.
QMenu* menu_ [protected] |
Definition at line 64 of file mask_overlay.hh.
geom::Polygon2 new_poly_ [protected] |
Definition at line 67 of file mask_overlay.hh.
geom::Vec2 old_mouse_pos_ [protected] |
Definition at line 68 of file mask_overlay.hh.
std::vector<geom::Polygon2> polygons_ [protected] |
Definition at line 63 of file mask_overlay.hh.
geom::Vec2 shift_ [protected] |
Definition at line 69 of file mask_overlay.hh.