OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
argand.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-2011 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 OST_GUI_ARGAND_H
26 #define OST_GUI_ARGAND_H
27 
28 
29 #include <ost/base.hh>
30 #include <ost/img/data.hh>
31 #include <ost/img/data_observer.hh>
32 #include <ost/img/extent.hh>
33 
34 #include <ost/gui/module_config.hh>
35 
36 #include <QWidget>
37 #include <QPixmap>
38 namespace ost { namespace img { namespace gui {
39 
40 class DLLEXPORT_OST_GUI Argand: public QWidget, public DataObserver
41 {
42  Q_OBJECT;
43 public:
44  Argand(const ImageHandle& data, QWidget* p);
45  ~Argand();
46 
47  // QWidget interface
48  virtual void paintEvent(QPaintEvent* e);
49  virtual void resizeEvent(QResizeEvent* e);
50 
51  public slots:
52  void SetCurrentPixel(const Point& p);
53  void SetExtent(const Extent& e);
54  void ClearExtent();
55 
56  public:
57  virtual void ObserverUpdate();
58  virtual void ObserverUpdate(const Extent& e);
59  virtual void ObserverUpdate(const Point& p);
60  virtual void ObserverRelease();
61 
62 private:
63  Extent extent_;
64  Point current_;
65  bool has_data_;
66  bool data_changed_;
67  QPixmap* buffer_;
68  Real sf_;
69 
70  void update_buffer();
71 };
72 
73 }}} //ns
74 
75 #endif
float Real
Definition: base.hh:44
#define DLLEXPORT_OST_GUI
Defines lower and upper valid indices.
Definition: extent.hh:60
Abstract base class of data observer.
Manage shared instances of images.
class encapsulating 1D to 3D point
Definition: point.hh:43