OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
info_panel.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 /*
22  Authors: Ansgar Philippsen, Andreas Schenk
23 */
24 
25 #ifndef IMG_GUI_DATAVIEWER_INFO_PANEL_H_
26 #define IMG_GUI_DATAVIEWER_INFO_PANEL_H_
27 
28 
29 #include <ost/img/data_types.hh>
30 #include <ost/img/extent.hh>
31 #include <ost/img/image_fw.hh>
32 
33 #include <ost/gui/module_config.hh>
34 
35 #include <QWidget>
36 #include <QLabel>
37 #include <QMenu>
38 namespace ost { namespace img { namespace gui {
39 
40 class DLLEXPORT_OST_GUI InfoPanelLabel: public QLabel
41 {
42  Q_OBJECT;
43 public:
44  InfoPanelLabel(const QString& t="", QWidget* parent=0);
45 };
46 
47 class InfoPanel: public QWidget
48 {
49  Q_OBJECT;
50 public:
51  InfoPanel(QWidget* parent);
52  void SetImageInfo(const ConstData& data);
53  void SetMousePoint(const geom::Vec2& point, Real val);
54  void SetClickPoint(const geom::Vec2& point, Real val);
55  void SetMousePoint(const geom::Vec2& point, Complex val);
56  void SetClickPoint(const geom::Vec2& point, Complex val);
57  void ClearClickPosition();
58 
59 public slots:
60  void SetSelection(const Extent& e);
61  void ClearSelection();
62 private:
63  void UpdateMouseAndDistances(const geom::Vec2& point);
64  void UpdateClick(const geom::Vec2& point);
65  InfoPanelLabel* image_extent_;
66  InfoPanelLabel* image_size_;
67  InfoPanelLabel* image_sampling_;
68  InfoPanelLabel* image_type_;
69  InfoPanelLabel* mouse_xy_;
70  InfoPanelLabel* mouse_val_;
71  InfoPanelLabel* click_xy_;
72  InfoPanelLabel* click_val_;
73  InfoPanelLabel* selection_xy_;
74  InfoPanelLabel* size_xy_;
75  InfoPanelLabel* distance_;
76  QMenu* popupmenu_;
77  bool amp_pha_;
78  geom::Vec2 click_;
79 };
80 
81 }}} //ns
82 
83 #endif
void SetImageInfo(const ConstData &data)
float Real
Definition: base.hh:44
std::complex< Real > Complex
Definition: base.hh:51
void SetMousePoint(const geom::Vec2 &point, Real val)
#define DLLEXPORT_OST_GUI
Abstract base class for read-only data.
Definition: data.hh:70
void SetClickPoint(const geom::Vec2 &point, Real val)
Defines lower and upper valid indices.
Definition: extent.hh:60
void SetSelection(const Extent &e)
InfoPanel(QWidget *parent)