00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00024 #ifndef H__APP_H
00025 #define H__APP_H
00026
00027 #include <QtGui/QWidget>
00028 #include <QtGui/QImage>
00029 #include <QtGui/QProgressBar>
00030 #include <QtGui/QMainWindow>
00031 #include <QtGui/QPushButton>
00032 #include <QtGui/QSpinBox>
00033 #include <QtGui/QComboBox>
00034 #include <QtGui/QCheckBox>
00035 #include <QtGui/QSlider>
00036 #include <QtGui/QLineEdit>
00037 #include <QtGui/QStatusBar>
00038
00039 #include "colormaker.h"
00040 #include "fractale.h"
00041 #include "zoomableimage.h"
00042 #include "networkinput.h"
00043 #include "triplex.h"
00044
00051 class App : public QMainWindow{
00052 Q_OBJECT
00053
00054 public:
00055 App(QWidget *parent = 0);
00056 ~App();
00057
00058
00059 signals:
00060 void processFinishing(int newValue);
00061
00062 public slots :
00063
00064 void s_colorate_darkBody();
00065 void s_colorate_gray();
00066 void s_colorate_full();
00067 void s_generate();
00068 void s_zoom(int, int);
00069 void s_unzoom(int, int);
00070 void s_render();
00071 void s_changeFractale(int);
00072 void s_displayPointsAleatoires(bool);
00073 void s_enableNetwork(bool);
00074 void s_deleteLastNetwork();
00075 void s_addNetwork();
00076 void s_receiveMessageFromNetwork(QString&);
00077
00078 void s_run_dynamic_coloration();
00079 void s_displayRealCoordinates(int, int);
00080 void s_saveConfig();
00081 void s_loadConfig();
00082
00083 void save();
00084 void about();
00085
00086 void setMaxValue(long i){
00087 maxValue = i;
00088 }
00089 void myEmitProcess(int i){
00090 emit processFinishing(i);
00091 }
00092
00093 private:
00094
00095 QImage *coloredImage, *calculatedImage;
00096 QVector<QVector<int> > threeDrendering;
00097 QVector<QVector<triplex> > normalMap;
00098
00099
00100 ZoomableImage *renderingImage;
00101
00102
00103 QProgressBar *bar;
00104 QPushButton *calculateButton;
00105 QSpinBox *iterations;
00106 QComboBox *sizes, *fractalType;
00107
00108
00109 QPushButton *darkBodyBtn, *grayBtn, *fullBtn;
00110 QCheckBox *showAnimation;
00111 QWidget *colorationWidget;
00112 QRectF currentWindow;
00113 QList<QPushButton*> colorationButtons;
00114
00115 QMap<QString, fractale*> pluginFractales;
00116
00117
00118 QDockWidget *dockColoration;
00119 QDockWidget *windowDock;
00120 QDockWidget *iterationsDock;
00121
00122
00123 QRadioButton *parPixel, *parPointsAleatoires;
00124 QSpinBox *aleatoiresPoints;
00125
00126
00127 void createActions();
00128 void createMenu();
00129 void setCurrentWindow(QRectF&);
00130 QAction *saveAct, *quitAct, *aboutAct, *saveConfigAct, *loadConfigAct;
00131
00132
00133 QList<NetworkInput*> networkAddresses;
00134 QVBoxLayout *vbnetworkDock;
00135 QPushButton *addNetwork;
00136 QPushButton *clearNetwork;
00137 QCheckBox *useNetwork;
00138 bool isNetworkUsed;
00139
00140 QSize currentSize;
00141
00146 QStringList palettesListe;
00147 long maxValue;
00148
00149 void applyStyle();
00150 void buildUI();
00151 void connectSignals();
00152 void collectVectorialPalets();
00153 void collectPluginFractales();
00154 QStringList collectNetworkAgents();
00155 void setNetworkList(QList<QString>&);
00156 void enableColorationButtons(bool);
00157
00158 void colorate(colorMaker&);
00159 void generateStartFractaleWindows();
00160 void generateFractale(fractale&);
00161 void generateBuddhaBrot();
00162 void generateHexaMandelBrot();
00163 void generateMandelBrot();
00164 void generateNewton();
00165 void generateTricorn();
00166 void generateSharingan();
00167 void generateBateauEnFeu();
00168 void generatePlugged(QString&);
00169 void generateJulia(std::complex<float>);
00170 void generateMandel3D();
00171
00172 void runLightning();
00173
00174
00175 QLineEdit *windowX1, *windowY1, *windowX2, *windowY2;
00176
00177
00178 QStatusBar *statusBar;
00179 QLabel *statusBarLabel;
00180 };
00181
00182 #endif