ROOT  6.06/09
Reference Guide
main.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Matthias Kretz <kretz@kde.org>
3 
4  Permission to use, copy, modify, and distribute this software
5  and its documentation for any purpose and without fee is hereby
6  granted, provided that the above copyright notice appear in all
7  copies and that both that the copyright notice and this
8  permission notice and warranty disclaimer appear in supporting
9  documentation, and that the name of the author not be used in
10  advertising or publicity pertaining to distribution of the
11  software without specific, written prior permission.
12 
13  The author disclaim all warranties with regard to this
14  software, including all implied warranties of merchantability
15  and fitness. In no event shall the author be liable for any
16  special, indirect or consequential damages or any damages
17  whatsoever resulting from loss of use, data or profits, whether
18  in an action of contract, negligence or other tortious action,
19  arising out of or in connection with the use or performance of
20  this software.
21 
22 */
23 
24 #ifndef MAIN_H
25 #define MAIN_H
26 
27 #include <QImage>
28 #include <QMouseEvent>
29 #include <QPaintEvent>
30 #include <QResizeEvent>
31 #include <QWheelEvent>
32 #include <QWidget>
33 
34 #include "mandel.h"
35 
36 class MainWindow : public QWidget
37 {
38  Q_OBJECT
39  public:
40  MainWindow(QWidget *parent = 0);
41 
42  protected:
43  void paintEvent(QPaintEvent *);
44  void resizeEvent(QResizeEvent *);
45  void mousePressEvent(QMouseEvent *);
46  void mouseMoveEvent(QMouseEvent *);
47  void mouseReleaseEvent(QMouseEvent *);
48  void wheelEvent(QWheelEvent *);
49 
50  private slots:
51  void vcImage(const QImage &, quint64);
52  void scalarImage(const QImage &, quint64);
53 
54  private:
55  void recreateImage();
56  void updateTitle();
57 
58  float m_x; // left
59  float m_y; // top
60  float m_scale;
61  QImage m_img1;
62  QImage m_img2;
63  QRect m_rect1;
64  QRect m_rect2;
65  QPoint m_dragStart;
66  QPoint m_dragDelta;
67 
69 
72 };
73 #endif // MAIN_H
QRect m_rect2
Definition: main.h:64
Mandel< ScalarImpl > m_mandelScalar
Definition: main.h:71
void resizeEvent(QResizeEvent *)
Definition: main.cpp:127
void updateTitle()
Definition: main.cpp:73
float m_y
Definition: main.h:59
QImage m_img2
Definition: main.h:62
Mandel< VcImpl > m_mandelVc
Definition: main.h:70
QPoint m_dragDelta
Definition: main.h:66
float m_x
Definition: main.h:58
float m_cycles2
Definition: main.h:68
void mouseMoveEvent(QMouseEvent *)
Definition: main.cpp:92
MainWindow(QWidget *parent=0)
Definition: main.cpp:30
void wheelEvent(QWheelEvent *)
Definition: main.cpp:108
QRect m_rect1
Definition: main.h:63
float m_cycles1
Definition: main.h:68
void recreateImage()
Definition: main.cpp:145
void mousePressEvent(QMouseEvent *)
Definition: main.cpp:87
void vcImage(const QImage &, quint64)
Definition: main.cpp:50
void scalarImage(const QImage &, quint64)
Definition: main.cpp:63
void mouseReleaseEvent(QMouseEvent *)
Definition: main.cpp:98
QImage m_img1
Definition: main.h:61
QPoint m_dragStart
Definition: main.h:65
float m_scale
Definition: main.h:60
void paintEvent(QPaintEvent *)
Definition: main.cpp:78