25 #ifndef IMG_GUI_OVERLAY_MANAGER_HH
26 #define IMG_GUI_OVERLAY_MANAGER_HH
44 namespace ost {
namespace img {
namespace gui {
46 class DataViewerPanel;
52 ov(),id(0),visible(
true),locked(
false) {}
54 OverlayInfo(
const OverlayPtr& o,
int i,
bool v):
55 ov(o), id(i), visible(v),locked(
false) {}
63 typedef std::vector<OverlayInfo> OverlayList;
65 typedef std::list<OverlayManagerObserver*> ObserverList;
134 OverlayList ov_list_;
139 ObserverList obs_list_;
141 OverlayList::iterator find_ov(
int id);
142 OverlayList::iterator find_ov(
const String& name);
143 OverlayList::iterator find_ov(
OverlayPtr anoverlay);
void SetOverlayLock(const String &name, bool visible)
lock/unlock overlay by name
int AddOverlay(const OverlayPtr &ov, bool make_active=true)
add overlay, returning a unique id
String GetOverlayName(int id)
void DeleteOverlay(int id)
delete overlay by id
bool IsLocked(const String &name)
void DeleteActiveOverlay()
void SetOverlayVisibility(int id, bool visible)
show/hide overlay by id
int GetOverlayId(const String &name)
OverlayPtr GetActiveOverlay() const
return currently active overlay
void ActivateOverlay(const String &name)
activate overlay by name
void SetOverlayLock(int id, bool visible)
lock/unlock overlay by id
void Attach(OverlayManagerObserver *obs)
attach an observer to this manager
OverlayPtr RetrieveOverlay(int id)
retrieve overlay by id
OverlayPtr RetrieveOverlay(const String &name)
retrieve overlay by name
bool IsVisible(const String &name)
OverlayManager(QWidget *ref=0)
bool OnMouseEvent(QMouseEvent *e, DataViewerPanel *dvp, const QPoint &lastmouse) const
void Detach(OverlayManagerObserver *obs)
detach an observer from this manager
std::vector< int > GetIDList() const
return list with all current overlay ids
void SetOverlayVisibility(const String &name, bool visible)
show/hide overlay by name
void DeleteOverlay(const String &name)
delete overlay by name
void OnDraw(QPainter &pnt, DataViewerPanel *dvp) const
bool IsActive(const String &name)
void ActivateOverlay(int id)
activate overlay by id
bool OnKeyEvent(QKeyEvent *e, DataViewerPanel *dvp) const
Abstract observer base class for the OverlayManager.
#define DLLEXPORT_OST_GUI
boost::shared_ptr< Overlay > OverlayPtr