00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // Copyright (C) 2003-2010 by the IPLT authors 00006 // 00007 // This library is free software; you can redistribute it and/or modify it under 00008 // the terms of the GNU Lesser General Public License as published by the Free 00009 // Software Foundation; either version 3.0 of the License, or (at your option) 00010 // any later version. 00011 // This library is distributed in the hope that it will be useful, but WITHOUT 00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00014 // details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public License 00017 // along with this library; if not, write to the Free Software Foundation, Inc., 00018 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 //------------------------------------------------------------------------------ 00020 00021 /* 00022 Authors: Ansgar Philippsen, Andreas Schenk 00023 */ 00024 00025 #ifndef IMG_GUI_DATAVIEWER_INFO_PANEL_H_ 00026 #define IMG_GUI_DATAVIEWER_INFO_PANEL_H_ 00027 00028 00029 #include <ost/img/data_types.hh> 00030 #include <ost/img/extent.hh> 00031 #include <ost/img/image_fw.hh> 00032 00033 #include <ost/gui/module_config.hh> 00034 00035 #include <QWidget> 00036 #include <QLabel> 00037 #include <QMenu> 00038 namespace ost { namespace img { namespace gui { 00039 00040 class DLLEXPORT_OST_GUI InfoPanelLabel: public QLabel 00041 { 00042 Q_OBJECT; 00043 public: 00044 InfoPanelLabel(const QString& t="", QWidget* parent=0); 00045 }; 00046 00047 class InfoPanel: public QWidget 00048 { 00049 Q_OBJECT; 00050 public: 00051 InfoPanel(QWidget* parent); 00052 void SetImageInfo(const ConstData& data); 00053 void SetMousePoint(const geom::Vec2& point, Real val); 00054 void SetClickPoint(const geom::Vec2& point, Real val); 00055 void SetMousePoint(const geom::Vec2& point, Complex val); 00056 void SetClickPoint(const geom::Vec2& point, Complex val); 00057 void ClearClickPosition(); 00058 00059 public slots: 00060 void SetSelection(const Extent& e); 00061 void ClearSelection(); 00062 private: 00063 void UpdateMouseAndDistances(const geom::Vec2& point); 00064 void UpdateClick(const geom::Vec2& point); 00065 InfoPanelLabel* image_extent_; 00066 InfoPanelLabel* image_size_; 00067 InfoPanelLabel* image_sampling_; 00068 InfoPanelLabel* image_type_; 00069 InfoPanelLabel* mouse_xy_; 00070 InfoPanelLabel* mouse_val_; 00071 InfoPanelLabel* click_xy_; 00072 InfoPanelLabel* click_val_; 00073 InfoPanelLabel* selection_xy_; 00074 InfoPanelLabel* size_xy_; 00075 InfoPanelLabel* distance_; 00076 QMenu* popupmenu_; 00077 bool amp_pha_; 00078 geom::Vec2 click_; 00079 }; 00080 00081 }}} //ns 00082 00083 #endif