00001 00042 #ifndef AIMAINWINDOW_HPP 00043 #define AIMAINWINDOW_HPP 00044 00045 #include <QMainWindow> 00046 #include <QtScript> 00047 #include <QScriptEngineDebugger> 00048 00049 #include "../aimenubar/aimenubar.hpp" 00050 #include "../aiviewerarea/aiviewerarea.hpp" 00051 #include "../aitoolbar/aitoolbar.hpp" 00052 #include "../aistatusbar/aistatusbar.hpp" 00053 #include "../aiconfig/aiconfig.hpp" 00054 #include "../aigenerator/aithread.hpp" 00055 #include "../aiabout/aiabout.hpp" 00056 #include "../aihelp/aihelp.hpp" 00057 #include "../aiundodialog/aiundodialog.hpp" 00058 00059 namespace AiFractals 00060 { 00067 class AiMainWindow : public QMainWindow 00068 { 00069 Q_OBJECT 00070 00071 public: 00072 00076 AiMainWindow(); 00077 00081 ~AiMainWindow(); 00082 00083 private slots: 00087 void checkedToolbox(); 00088 00092 void showToolbox(bool show); 00093 00097 void fileOpen(); 00098 00102 void fileSave(); 00103 00107 void fileSaveAs(); 00108 00112 void filePrint(); 00113 00117 void fileClear(); 00118 00122 void fileQuit(); 00123 00127 void zoomZoomIn(); 00128 00132 void zoomZoomOut(); 00133 00137 void zoomFitInWindow(); 00138 00142 void zoomFitToWindow(); 00143 00147 void zoom1600p(); 00148 00152 void zoom800p(); 00153 00157 void zoom400p(); 00158 00162 void zoom200p(); 00163 00167 void zoom100p(); 00168 00172 void zoom50p(); 00173 00177 void zoom25p(); 00178 00182 void zoom12_5p(); 00183 00187 void zoom6_25p(); 00188 00189 //~ Image 00193 void imageHorizontalMirror(); 00194 00198 void imageVerticalMirror(); 00199 00203 void imageRotation90(); 00204 00208 void imageRotationNigative90(); 00209 00213 void imageRotation180(); 00214 00215 //~ Generator 00219 void genRun(); 00220 00224 void genStop(); 00225 00229 void genThreadsNumbers(); 00230 00234 void genChooseFractal(); 00235 00239 void complexZone(); 00240 00244 void serialize(); 00245 00249 void deserialize(); 00250 00251 //~ Help 00255 void helpHelp(); 00256 00260 void helpAbout(); 00261 00266 void toolsZoomArea(bool enable); 00267 00272 void toolsRotation(int value); 00273 00277 void refreshItems(); 00278 00283 void currentIndexChanged ( int index ); 00284 00288 void debugFractal(); 00289 00294 void currentThreads(int thread); 00295 00300 void firstCompositionMode( int val ); 00301 00306 void othersCompositionMode( int val ); 00307 00311 void runGenerator(); 00312 00316 void stopGenerator(); 00317 00322 void completed( AiGenerator::AiZone * zone ); 00323 00329 void snapshot( AiGenerator::AiZone * zone ); 00330 00338 void zoneZooming ( int startx, int starty, int endx, int endy ); 00339 00344 void enabledChilds(bool e); 00345 00349 void undo(); 00350 00351 private: 00355 AiConfig * m_config; 00356 00360 AiToolBar * m_toolbar; 00361 00365 AiMenuBar * m_menuBar; 00366 00370 AiStatusBar * m_statusbar; 00371 00375 AiViewerArea * m_view ; 00376 00380 AiUndoDialog * m_undoDialog; 00384 QString m_saveFile; 00385 00389 int m_selectedFractalIndex; 00390 00394 int m_currentThreadsNumber; 00395 00399 int m_startedThreads; 00400 00404 QPainter::CompositionMode m_firstCompositionModeIndex; 00405 00409 QPainter::CompositionMode m_othersCompositionModeIndex; 00410 00414 QVector<AiGenerator::AiThread *> m_threads; 00415 00420 QPainter::CompositionMode forgeCompositionMode( int index ); 00421 00425 QVector<QImage> m_storage; 00426 00430 double m_viewX; 00431 00435 double m_viewY; 00436 00440 double m_zoom; 00441 00446 bool m_serialize; 00447 }; 00448 } 00449 #endif // AIMAINWINDOW_HPP