00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MAINWINDOW_H_
00022 #define _MAINWINDOW_H_
00023
00024 #include "ui_mainwindow.h"
00025
00026 #include "gui/pixmapviewer.h"
00027 #include "gui/parameterswidget.h"
00028 #include "gui/optionswidget.h"
00029 #include "gui/palettewidget.h"
00030
00031 #include "core/fractal.h"
00032 #include "core/palette.h"
00033
00034 #include "core/fractals/sequences/mandelbrot.h"
00035 #include "core/fractals/pointsgenerators/imagepointsgenerator.h"
00036 #include "core/fractals/pointsgenerators/randompointsgenerator.h"
00037 #include "core/fractals/pointsgenerators/testpointsgenerator.h"
00038 #include "core/fractals/accumulators/centeraccumulator.h"
00039 #include "core/fractals/accumulators/sequenceaccumulator.h"
00040
00041 #include "core/fractals/fractal_thread.h"
00042 #include "core/fractals/fractal_mt.h"
00043 #include "core/fractals/fractal_gl.h"
00044
00045 #include <QtCore/QTime>
00046 #include <QtCore/QTimer>
00047 #include <QtCore/QTranslator>
00048 #include <QtGui/QPushButton>
00049 #include <QtGui/QProgressBar>
00050 #include <QtGui/QFileDialog>
00051 #include <QtGui/QMessageBox>
00052
00056 class MainWindow : public QMainWindow
00057 {
00058 Q_OBJECT
00059
00060 private:
00061 Ui::MainWindowClass ui;
00062
00063 QWidget* m_main_widget;
00064 QVBoxLayout* m_layout;
00065
00066
00067 PixmapViewer* m_pixmap_viewer;
00068
00069
00070 ParametersWidget* m_parameters_widget;
00071 OptionsWidget* m_options_widget;
00072 PaletteWidget* m_palette_widget;
00073
00074
00075
00076 QStatusBar* m_status_bar;
00077 QLabel *m_fractal_type_label, *m_image_size_label, *m_image_scale_label;
00078
00079
00080 QPushButton* m_compute_button, *m_stop_button;
00081 QProgressBar* m_compute_progressBar;
00082 QHBoxLayout* m_compute_layout;
00083
00084
00085 QTranslator *m_translator, *m_global_translator;
00086
00087 QString m_directory;
00088
00089 bool m_current_fractal_use_shaders , m_computing_fractal_use_shaders;
00090 QString m_current_fractal_type , m_computing_fractal_type;
00091 Fractal* m_current_fractal , * m_computing_fractal;
00092
00093 QTime m_time;
00094 QTimer* m_timer;
00095
00096 public:
00102 MainWindow( QWidget* _parent = 0, Qt::WFlags _flags = 0 );
00106 ~MainWindow();
00107
00108 protected:
00109 void changeEvent( QEvent* _event );
00110
00111 private:
00112 bool allocFractal( Fractal*& _fractal, const FractalParameters& _fractal_parameters, const QString& _fractal_type, const bool _use_shaders = false, const unsigned int _thread_count = 4 );
00113 void showErrorFile( const QFile& _file );
00114
00115 private slots:
00116 void computeClicked();
00120 void computeFractal();
00124 void stopFractal();
00125 void finishFractal();
00130 void setFractalImage( const Palette& _palette );
00135 void updateFractalImage( const Palette& _palette );
00136 void updateProgress();
00137
00138 void imageChanged( const QPixmap& _pixmap );
00139 void imageScaleChanged( qreal _scale_factor );
00140 void imageSelected( QPointF _select_start, QPointF _select_end );
00141
00142 void about();
00143 void aboutQt();
00147 void setLanguageFr();
00151 void setLanguageEn();
00152
00156 void load();
00160 void save();
00164 void saveToImage();
00165
00166 };
00167
00168 #endif // _MAINWINDOW_H_