Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
imageviewer.h
Go to the documentation of this file.
1 #ifndef IMAGEVIEWER_H
2 #define IMAGEVIEWER_H
3 
4 #include "displayformat.h"
5 #include "graphicsscene.h"
6 #include "viewerinterface.h"
7 #include <QTime>
8 #include <QWidget>
9 #include <array>
10 
11 class ImageWidget;
12 class QGridLayout;
13 class QGraphicsScene;
14 class Controller;
15 
16 class ImageViewer : public QWidget, public ViewerInterface {
17  Q_OBJECT
18  std::array< ImageWidget*, 4 > views;
19  QGridLayout *layout;
20  Controller *m_controller;
21  bool dragging;
22  QTime timer;
23 
24  void getNewLayout( );
25 
26 public:
27  explicit ImageViewer( QWidget *parent = 0 );
28  ~ImageViewer( );
29 
30  void setViewBgColor( const QColor &color );
31  bool eventFilter( QObject *obj, QEvent *evt );
32  GraphicsScene* getScene( size_t axis );
33  void setController( Controller *value );
34  Controller* controller( ) const;
35 
36 signals:
37  void mouseReleased( QPointF pt, Qt::MouseButtons buttons, size_t axis );
38  void mouseClicked( QPointF pt, Qt::MouseButtons buttons, size_t axis );
39  void mouseDragged( QPointF pt, Qt::MouseButtons buttons, size_t axis );
40  void mouseMoved( QPointF pt, size_t axis );
41  void dropImage( const QString &filePath );
42  void dropFolder( const QString &folderPath );
43 
44 private slots:
45  void updateViews( );
46  void changeImage( );
47 
48  void setLayoutType( Layout layout );
49  void setViewMode( Views view );
50 
51  void setGridLayout( );
52  void setHorizontalLayout( );
53  void setVerticalLayout( );
54 
55  void hideViews( );
56  void showViews( );
57 
58  void sliceChanged( size_t axis, size_t slice );
59 
60  /* QWidget interface */
61 protected:
62  void resizeEvent( QResizeEvent* );
63 };
64 
65 #endif /* IMAGEVIEWER_H */
void mouseClicked(QPointF pt, Qt::MouseButtons buttons, size_t axis)
void mouseReleased(QPointF pt, Qt::MouseButtons buttons, size_t axis)
bool eventFilter(QObject *obj, QEvent *evt)
ImageViewer(QWidget *parent=0)
Definition: imageviewer.cpp:15
void setViewBgColor(const QColor &color)
Definition: imageviewer.cpp:39
Views
Definition: displayformat.h:11
void dropImage(const QString &filePath)
Controller * controller() const
Definition: imageviewer.cpp:63
void mouseDragged(QPointF pt, Qt::MouseButtons buttons, size_t axis)
void dropFolder(const QString &folderPath)
The Controller class is one of the most important classes of the User Interface, and is responsible t...
Definition: controller.h:17
GraphicsScene * getScene(size_t axis)
void resizeEvent(QResizeEvent *)
Layout
Definition: displayformat.h:10
void mouseMoved(QPointF pt, size_t axis)
void setController(Controller *value)
Definition: imageviewer.cpp:45