00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef IMG_POINTLIST_OVERLAY_BASE_HH
00027 #define IMG_POINTLIST_OVERLAY_BASE_HH
00028
00029
00030
00031 #include <ost/img/point.hh>
00032
00033 #include <ost/img/point.hh>
00034 #include <ost/gui/module_config.hh>
00035 #include <ost/gui/data_viewer/overlay_base.hh>
00036
00037 #include "strategies_fw.hh"
00038
00039 #include <QColor>
00040 #include <QAction>
00041 #include <QDialog>
00042 #include <QLineEdit>
00043 #include <QColorDialog>
00044 #include <QPushButton>
00045 #include <QVBoxLayout>
00046
00047
00048 namespace ost { namespace img { namespace gui {
00049
00050 class DLLEXPORT_OST_GUI PointlistOverlayBaseSettings: public QDialog
00051 {
00052 Q_OBJECT;
00053 public:
00054 PointlistOverlayBaseSettings(const QColor& ac, const QColor& pc, int ssiz, int sstr, QWidget* p);
00055
00056 public slots:
00057 void OnActiveColor();
00058 void OnPassiveColor();
00059 void OnSymbolSize(int v);
00060 void OnSymbolStrength(int v);
00061
00062 public:
00063 QColor active_color;
00064 QColor passive_color;
00065 int symbol_size;
00066 int symbol_strength;
00067
00068 protected:
00069
00070 QVBoxLayout* main_layout_;
00071 QPushButton* active_color_b_;
00072 QPushButton* passive_color_b_;
00073 };
00074
00075 class DLLEXPORT_OST_GUI PointlistOverlayBase: public Overlay
00076 {
00077 Q_OBJECT;
00078 public:
00079 PointlistOverlayBase(const String& name);
00080
00081
00082 virtual void OnDraw(QPainter& pnt, DataViewerPanel* dvp, bool is_active) {};
00083 virtual void OnMenuEvent(QAction* e);
00084 virtual QMenu* GetMenu();
00085
00086
00087 virtual void DrawPointList(QPainter& pnt, DataViewerPanel* dvp, const QColor& col ,const std::vector<QPoint>& pointlist);
00088 virtual void DrawVariableSizePointList(QPainter& pnt, DataViewerPanel* dvp, const QColor& col ,const std::vector<std::pair<QPoint,double> >& pointlist);
00089
00090
00091 unsigned int GetSymbolSize() const;
00092 void SetSymbolSize(unsigned int symbolsize);
00093 unsigned int GetSymbolShape() const;
00094 void SetSymbolShape(unsigned int symbolshape);
00095 bool GetCrosshair() const;
00096 void SetCrosshair(bool flag);
00097 void SetActiveColor(const QColor& col);
00098 void SetPassiveColor(const QColor& col);
00099 private:
00100
00101 template <class StrategyClass>
00102 void ReplaceStrategy();
00103
00104 protected:
00105 SymbolDrawingStrategyPtr strategy_;
00106 QColor active_color_;
00107 QColor passive_color_;
00108 unsigned int symbolsize_;
00109 unsigned int symbolstrength_;
00110 QMenu* menu_;
00111
00112 QAction* a_sq_;
00113 QAction* a_ci_;
00114 QAction* a_cr_;
00115 QAction* a_settings_;
00116
00117 void SetProps(PointlistOverlayBaseSettings* props);
00118 };
00119
00120 }}}
00121
00122
00123 #endif