OpenStructure
Public Member Functions | Protected Attributes
MaskOverlay Class Reference

#include <mask_overlay.hh>

Inherits 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 ()
 
- Public Member Functions inherited from Overlay
 Overlay (const String &name)
 
void SetName (const String &name)
 
String GetName () const
 
virtual void OnMenuEvent (QAction *e)
 

Protected Attributes

std::vector< geom::Polygon2polygons_
 
QMenu * menu_
 
int active_
 
bool add_mode_
 
geom::Polygon2 new_poly_
 
geom::Vec2 old_mouse_pos_
 
geom::Vec2 shift_
 

Additional Inherited Members

- Public Slots inherited from Overlay
void OnMenuEventSlot (QAction *e)
 
- Signals inherited from Overlay
void SettingsChanged ()
 
void InfoTextChanged (const QString &t)
 

Detailed Description

Definition at line 42 of file mask_overlay.hh.

Constructor & Destructor Documentation

◆ MaskOverlay() [1/2]

◆ MaskOverlay() [2/2]

MaskOverlay ( const MaskPtr m)

Member Function Documentation

◆ ApplyShiftToMask()

void ApplyShiftToMask ( )

◆ ClearMask()

void ClearMask ( )

◆ ClearShift()

void ClearShift ( )
inline

Definition at line 57 of file mask_overlay.hh.

◆ GetMask()

MaskPtr GetMask ( ) const

◆ GetMenu()

virtual QMenu* GetMenu ( )
virtual

return overlay specific pulldown menu

Reimplemented from Overlay.

◆ GetShift()

geom::Vec2 GetShift ( )
inline

Definition at line 58 of file mask_overlay.hh.

◆ OnDraw()

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.

◆ OnKeyEvent()

virtual bool OnKeyEvent ( QKeyEvent *  e,
DataViewerPanel dvp 
)
virtual

key event handler

see comments for the mouse events

Reimplemented from Overlay.

◆ OnMouseEvent()

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.

◆ SetMask()

void SetMask ( const MaskPtr m)

◆ SetShift()

void SetShift ( geom::Vec2  shift)

Field Documentation

◆ active_

int active_
protected

Definition at line 65 of file mask_overlay.hh.

◆ add_mode_

bool add_mode_
protected

Definition at line 66 of file mask_overlay.hh.

◆ menu_

QMenu* menu_
protected

Definition at line 64 of file mask_overlay.hh.

◆ new_poly_

geom::Polygon2 new_poly_
protected

Definition at line 67 of file mask_overlay.hh.

◆ old_mouse_pos_

geom::Vec2 old_mouse_pos_
protected

Definition at line 68 of file mask_overlay.hh.

◆ polygons_

std::vector<geom::Polygon2> polygons_
protected

Definition at line 63 of file mask_overlay.hh.

◆ shift_

geom::Vec2 shift_
protected

Definition at line 69 of file mask_overlay.hh.


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