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 #ifndef IMG_GUI_DATA_VIEWER_H
00026 #define IMG_GUI_DATA_VIEWER_H
00027
00028 #include <map>
00029
00030 #include <ost/base.hh>
00031 #include <ost/img/data.hh>
00032 #include <ost/img/data_observer.hh>
00033 #include <ost/img/alg/norm.hh>
00034
00035 #include <ost/gui/main_window.hh>
00036
00037 #include "overlay_base_fw.hh"
00038 #include "overlay_manager_fw.hh"
00039 #include "overlay_manager_gui.hh"
00040 #include "argand.hh"
00041 #include "info_panel.hh"
00042 #include "fft_panel.hh"
00043 #include <ost/gui/module_config.hh>
00044
00045
00046 class QLabel;
00047
00048 namespace ost {
00049
00050 namespace gui {
00051 class GostyApp;
00052 }
00053
00054 namespace img { namespace gui {
00055
00056
00057 class DataViewerPanel;
00058
00060 class DLLEXPORT_OST_GUI DataViewer: public ost::gui::MainWindow
00061 {
00062 Q_OBJECT;
00063
00064 friend class ost::gui::GostyApp;
00065
00066 public:
00067 virtual ~DataViewer();
00068
00070 void SetData(const Data& data);
00071
00073 NormalizerPtr GetNormalizer() const;
00074
00076 void Renormalize();
00077
00078 void Recenter();
00079
00081 Extent GetSelection() const;
00082
00084 void SetName(const String& name);
00085
00087 int AddOverlay(const OverlayPtr& ov, bool make_active=true);
00088
00090 void ClearOverlays();
00091
00093 OverlayManagerPtr GetOverlayManager() const;
00094
00096 virtual void OnPanelMouseEvent(QMouseEvent* e);
00097
00099 void SetAntialiasing(bool f);
00100
00102 virtual bool eventFilter(QObject * object, QEvent *event);
00103
00104
00105 public slots:
00107 void UpdateView();
00108
00109 void OnSlabChange(int slab);
00110 void OnZoomChange(int zoomlevel);
00111
00112 protected:
00114 DataViewer(QWidget* p, const Data& data, const QString& name="");
00115
00116 private:
00117
00118 DataViewer(const DataViewer& v);
00119
00120 DataViewer& operator=(const DataViewer& v) {return *this;}
00121
00122 QString name_;
00123 DataViewerPanel* panel_;
00124
00125 OverlayManagerPtr ov_manager_;
00126 OverlayManagerGUI* ov_manager_gui_;
00127
00128 InfoPanel* info_;
00129 Argand* argand_;
00130 FFTPanel* fft_;
00131
00132 QLabel* zoomlabel_;
00133 QLabel* slablabel_;
00134 QPoint lastmouse_;
00135
00136 void build(const Data& data);
00137
00138 void build_menu();
00139 };
00140
00141 }}}
00142
00143 #endif