Skip to content

Commit

Permalink
#36 & #37 resolved, base for #48 created
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrussmill committed Jun 26, 2019
1 parent 089fb47 commit 03f0347
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 234 deletions.
217 changes: 0 additions & 217 deletions histogramwindow.ui

This file was deleted.

12 changes: 2 additions & 10 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@
#include "filtermenu.h"
#include "temperaturemenu.h"
#include "transformmenu.h"
#include "colorslicemenu.h"
//#include "colorslicemenu.h"
#include "bufferwrappersqcv.h"
#include "imagewidget.h"
#include <QWidget>
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <QFileInfo>
#include <QThread>
#include <QDebug>
#include <QDir>
#include <QString>
#include <QImage>
#include <QMutex>
#include <QRect>
#include <QAction>
#include <QStackedWidget>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/core/ocl.hpp>
Expand Down Expand Up @@ -112,6 +107,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
connect(transformMenu_m, SIGNAL(updateStatus(QString)), ui->statusBar, SLOT(showMessage(QString)));
connect(transformMenu_m, SIGNAL(giveImageROI(QRect)), ui->imageWidget, SLOT(setRectRegionSelected(QRect)));
connect(transformMenu_m, SIGNAL(setGetCoordinateMode(uint)), ui->imageWidget, SLOT(setRetrieveCoordinateMode(uint)));
connect(transformMenu_m, SIGNAL(displayMaster()), this, SLOT(cancelPreview()));
connect(this, SIGNAL(setDefaultTracking(bool)), transformMenu_m, SLOT(setMenuTracking(bool)));
connect(this, SIGNAL(distributeImageBufferAddresses(const cv::Mat*, cv::Mat*)), transformMenu_m, SLOT(initializeSliders()));
connect(this, SIGNAL(distributeImageBufferAddresses(const cv::Mat*, cv::Mat*)), transformMenu_m, SLOT(receiveImageAddresses(const cv::Mat*, cv::Mat*)));
Expand All @@ -131,10 +127,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),

MainWindow::~MainWindow()
{
//end worker thread once event loop finishes
workerThread.quit();
workerThread.wait();

//delete heap data not a child of mainwindow
delete ui;
}
Expand Down
6 changes: 2 additions & 4 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <QMainWindow>
#include <opencv2/core.hpp>
#include <QThread>
#include <QMutex>
#include <QDir>
class QImage;
Expand All @@ -12,7 +11,7 @@ class AdjustMenu;
class FilterMenu;
class TemperatureMenu;
class TransformMenu;
class ColorSliceMenu;
//class ColorSliceMenu;

namespace Ui {
class MainWindow;
Expand All @@ -21,7 +20,6 @@ class MainWindow;
class MainWindow : public QMainWindow
{
Q_OBJECT
QThread workerThread; //get rid of this

public:
explicit MainWindow(QWidget *parent = 0);
Expand Down Expand Up @@ -58,7 +56,7 @@ private slots:
FilterMenu *filterMenu_m;
TemperatureMenu *temperatureMenu_m;
TransformMenu *transformMenu_m;
ColorSliceMenu *colorSliceMenu_m;
//ColorSliceMenu *colorSliceMenu_m;
};

#endif // MAINWINDOW_H
3 changes: 2 additions & 1 deletion qcvTouchUp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SOURCES += \
mousewheeleatereventfilter.cpp \
bufferwrappersqcv.cpp \
filtermenu.cpp \
savedialog.cpp \
temperaturemenu.cpp \
transformmenu.cpp \
signalsuppressor.cpp \
Expand All @@ -53,6 +54,7 @@ HEADERS += \
mousewheeleatereventfilter.h \
bufferwrappersqcv.h \
filtermenu.h \
savedialog.h \
temperaturemenu.h \
transformmenu.h \
signalsuppressor.h \
Expand All @@ -66,7 +68,6 @@ HEADERS += \

FORMS += \
mainwindow.ui \
histogramwindow.ui \
adjustmenu.ui \
filtermenu.ui \
temperaturemenu.ui \
Expand Down
6 changes: 6 additions & 0 deletions savedialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "savedialog.h"

SaveDialog::SaveDialog(QWidget *parent) : QFileDialog(parent)
{
//add another constructor
}
17 changes: 17 additions & 0 deletions savedialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef SAVEDIALOG_H
#define SAVEDIALOG_H

#include <QFileDialog>

class SaveDialog : public QFileDialog
{
Q_OBJECT
public:
explicit SaveDialog(QWidget *parent = nullptr);

signals:

public slots:
};

#endif // SAVEDIALOG_H
5 changes: 3 additions & 2 deletions transformmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ void TransformMenu::performImageScalePreview()
//emit performImageScale(QRect(0,0, ui->spinBox_ScaleWidth->value(), ui->spinBox_ScaleHeight->value()));
}

//Sets the sample image based on the menu item selected.
//Sets the sample image based on the menu item selected, and signals the displaying object to reset the image shown.
void TransformMenu::changeSampleImage(bool detected)
{
//check so only enabled button is called
if(detected)
{
if(ui->radioButton_CropEnable->isChecked())
Expand All @@ -424,8 +425,8 @@ void TransformMenu::changeSampleImage(bool detected)
ui->label_SampleImage->setPixmap(QPixmap::fromImage(QImage(":/img/icons/transformMenu/scale.png")));
else if(ui->radioButton_RotateEnable->isChecked())
ui->label_SampleImage->setPixmap(QPixmap::fromImage(QImage(":/img/icons/transformMenu/rotate.png")));
emit displayMaster();
}

}

/* This method determines when the worker thread should be created or destroyed so
Expand Down
1 change: 1 addition & 0 deletions transformmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public slots:
void cancelRoiSelection();
void setAutoCropOnRotate(bool);
void performImageScale(QRect size);
void displayMaster();

protected:
const cv::Mat *masterImage_m;
Expand Down

0 comments on commit 03f0347

Please sign in to comment.