//////////////////////////////////////////////////////////////////////////////// /** * \file mainwindow.h * \version v1.0 * \author Ing. Dominik Malcik */ //////////////////////////////////////////////////////////////////////////////// #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include // openCV #include "opencv/cv.h" #include "opencvprocessor.h" #include "tableformat.h" // singleton #include "project.h" class QLabel; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: static const QString APPL_NAME; static const int TABLE_BITMAPS = 0; static const int TABLE_LAYERS = 1; static const int DEF_SLIDER_VALUE = 20; explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: // File menu void on_actionNew_Project_triggered(); void on_actionOpen_Project_triggered(); void on_actionSave_Project_triggered(); void on_actionOpen_Image_triggered(); void on_actionClose_Project_Image_triggered(); void on_actionExit_triggered(); void on_actionSave_Project_As_triggered(); // Tools menu void on_actionZoom_in_25_triggered(); void on_actionZoom_out_25_triggered(); void on_actionFit_in_Window_triggered(); void on_actionOriginal_Size_triggered(); // Tools menu > analyza void on_actionAnalyze_edges_triggered(); void on_actionHough_triggered(); void on_actionThreshold_triggered(); void on_actionAnalyze_Colors_triggered(); void on_rSlider_valueChanged(int value); void on_gSlider_valueChanged(int value); void on_bSlider_valueChanged(int value); // Help menu void on_actionHelp_triggered(); void on_actionAbout_microAnalyzer_triggered(); // Layers buttons void on_pushButton_2_clicked(); // add ANALYSING void on_pushButton_clicked(); // show only ANALYSING void on_pushButton_3_clicked(); // delete ANALYSING void on_pushButton_4_clicked(); // delete IMPORTED // Additional slots void on_imageDial_actionTriggered(int action); void openProject_slot(); void reloadImagesList(); void reloadLayersList(); void graphicsClicked(int xPos, int yPos); void on_bitmapTableView_activated(QModelIndex index); // Wizard - singleton instance void invertOpenedDialog_slot(); void on_actionHistogram_triggered(); private: Ui::MainWindow *ui; void menuChangeAvailability(bool setting, bool sliders = false); void imageResizer(double resizeCoeff); void onOpenNew_dialReset(); bool importImage(QString &imageFileName, bool addToVector); void saveProjectToDest(QString projectFileName_withPath, bool removeSubDirs); QString saveAnalysingImageToDir(QString origFN, QString dstDir, QString ext, QString addition, int number); bool deleteDialog(QString layerType); void actualizeGraphicsView(QImage * toShow); void actualizeFrameColor(); // tableView indexes (imported / analysing) std::vector getImportedIndexes (); std::vector getAnalysingIndexes (); std::vector getSelectedIndexes (QModelIndexList indexes); void makeColorAnalyzeStep(); void makeCvFunction(int number, int param); int getIntDialog(); void closeThisProject(); void initStageAndValues(); void resetSlidersValues(); void closeEvent(QCloseEvent *event); bool saveAskDialog(); void openProject(QString projectFileName); TableFormat * reloadTableList(int tableSpec); std::vector importedIndexes; std::vector analysingIndexes; QImage visibleImage; QRgb actualColor; QGraphicsView * imageView; int lastDialValue; bool openedNewProjDialog; TableFormat *bitmapLayersTBL; TableFormat *vectorLayersTBL; bool histogramBtn; }; #endif // MAINWINDOW_H