diff --git a/IgramArea.h b/IgramArea.h index 715332d0..6fa49701 100644 --- a/IgramArea.h +++ b/IgramArea.h @@ -85,7 +85,7 @@ class outlinePair{ public: QImage m_image; CircleOutline m_outline; - outlinePair(QImage img, CircleOutline outline): m_image(img), m_outline(outline){} + outlinePair(const QImage &img, const CircleOutline &outline): m_image(img), m_outline(outline){} }; class undoStack { @@ -94,7 +94,7 @@ class undoStack { public: undoStack(){}; - void push(QImage img, CircleOutline outline); + void push(const QImage &img, const CircleOutline &outline); outlinePair current(){return m_stack.back();}; outlinePair undo(); outlinePair redo(); @@ -142,8 +142,8 @@ class IgramArea : public QWidget CircleOutline m_center; void hideOutline(bool checked); bool m_hideOutlines; - void loadOutlineFileOldV6(QString filename); - void loadOutlineFile(QString filename); + void loadOutlineFileOldV6(const QString &filename); + void loadOutlineFile(const QString &filename); void undo(); void redo(); void writeOutlinesOldV6(QString fileName); @@ -152,7 +152,7 @@ class IgramArea : public QWidget void shiftoutline(QPointF p); void setZoomMode(zoomMode mode); void showAliasDialog(); - cv::Mat igramToGray(cv::Mat roi); + cv::Mat igramToGray(const cv::Mat &roi); cv::Mat qImageToMat(QImage &roi); private slots: void aperatureChanged(); @@ -160,7 +160,7 @@ public slots: void gammaChanged(bool, double); void generateSimIgram(); void clearImage(); - void dftReady(QImage img); + void dftReady(const QImage &img); void outlineTimerTimeout(); void shiftUp(); void shiftDown(); @@ -168,7 +168,7 @@ public slots: void shiftLeft(); void zoomIn(); void zoomOut(); - void igramOutlineParmsChanged(outlineParms parms); + void igramOutlineParmsChanged(const outlineParms &parms); void increase( int i = 1); void decrease(); void zoomFull(); @@ -218,8 +218,8 @@ public slots: double leftMargin; double searchOutlineScale; - cv::Point2d findBestOutsideOutline(cv::Mat gray, int start, int end, int step, int *radius, int pass); - cv::Point2d findBestCenterOutline(cv::Mat gray, int start, int end, int step, int *radius, bool useExisting); + cv::Point2d findBestOutsideOutline(const cv::Mat &gray, int start, int end, int step, int *radius, int pass); + cv::Point2d findBestCenterOutline(const cv::Mat &gray, int start, int end, int step, int *radius, bool useExisting); QString m_outlineMsg; double m_edgeMaskWidth; void saveRegions(); diff --git a/arbitrarywavwidget.cpp b/arbitrarywavwidget.cpp index c38fdfe3..aa806e0f 100644 --- a/arbitrarywavwidget.cpp +++ b/arbitrarywavwidget.cpp @@ -54,7 +54,7 @@ ArbitraryWavWidget::~ArbitraryWavWidget(){ pts.empty(); } -bool comparePoints(const QPointF &a, const QPointF &b) { +bool comparePoints(QPointF a, QPointF b) { return a.x() < b.x(); } diff --git a/astigpolargraph.h b/astigpolargraph.h index edf1605a..cb181d92 100644 --- a/astigpolargraph.h +++ b/astigpolargraph.h @@ -25,7 +25,7 @@ class astigSample{ QString m_name; double m_xastig; double m_yastig; - astigSample(QString name, double xastig, double yastig): m_name(name), m_xastig(xastig), m_yastig(yastig){}; + astigSample(const QString &name, double xastig, double yastig): m_name(name), m_xastig(xastig), m_yastig(yastig){}; }; class astigPolargraph : public QDialog diff --git a/astigscatterplot.cpp b/astigscatterplot.cpp index 706056ee..2e2a8ab8 100644 --- a/astigscatterplot.cpp +++ b/astigscatterplot.cpp @@ -46,12 +46,12 @@ astigScatterPlot::astigScatterPlot(QWidget *parent):QwtPlot( parent ),m_max(.3) replot(); } -void astigScatterPlot::selectedwave(QString m){ +void astigScatterPlot::selectedwave(const QString &m){ emit waveSeleted(m); } -void astigScatterPlot::addValue(QString name, QPointF p){ +void astigScatterPlot::addValue(const QString &name, QPointF p){ QwtPlotMarker *m = new QwtPlotMarker(name); if (fabs(p.x()) > m_max) m_max = fabs(p.x()); diff --git a/astigscatterplot.h b/astigscatterplot.h index 237e0639..7c90f31e 100644 --- a/astigscatterplot.h +++ b/astigscatterplot.h @@ -17,11 +17,11 @@ class astigScatterPlot : public QwtPlot double m_max; public: astigScatterPlot(QWidget *parent = 0); - void addValue(QString name, QPointF p); + void addValue(const QString &name, QPointF p); signals: void waveSeleted(QString m); public slots: - void selectedwave(QString); + void selectedwave(const QString&); }; #endif // ASTIGSCATTERPLOT_H diff --git a/astigstatsdlg.cpp b/astigstatsdlg.cpp index 4cbf1bef..6ba75c09 100644 --- a/astigstatsdlg.cpp +++ b/astigstatsdlg.cpp @@ -110,7 +110,7 @@ class CustomPlotPicker : public QwtPlotPicker { : QwtPlotPicker(xAxis, yAxis, QwtPicker::NoRubberBand, QwtPicker::AlwaysOn, canvas) { } - void addTooltipToPoint(const QPointF &point, const QString &tooltip){ + void addTooltipToPoint(QPointF point, const QString &tooltip){ tooltips_.emplace_back(point, tooltip); } @@ -138,7 +138,7 @@ class CustomPlotPicker : public QwtPlotPicker { }; -astigStatsDlg::astigStatsDlg(QVector wavefronts, QWidget *parent) : +astigStatsDlg::astigStatsDlg(const QVector &wavefronts, QWidget *parent) : QDialog(parent), ui(new Ui::astigStatsDlg), m_wavefronts(wavefronts), editor(0), PDFMode(false), distributionWindow(0), runningAvgN(20), showSamples(false), @@ -181,7 +181,7 @@ class measure{ public: QString name; QPointF p; - measure(QString n, QPointF _p):name(n),p(_p){}; + measure(const QString &n, QPointF _p):name(n),p(_p){}; measure(){}; }; @@ -480,7 +480,7 @@ void astigStatsDlg::plot(){ ui->mPlot->replot(); } -void astigStatsDlg::showItem(QVariant item, bool on, int /*ndx*/){ +void astigStatsDlg::showItem(const QVariant &item, bool on, int /*ndx*/){ qDebug() << "item " << item; QwtPlotItem *t = qvariant_cast(item); t->setVisible(on); diff --git a/astigstatsdlg.h b/astigstatsdlg.h index 081fe34d..3e79eef7 100644 --- a/astigstatsdlg.h +++ b/astigstatsdlg.h @@ -24,7 +24,7 @@ class astigStatsDlg : public QDialog Q_OBJECT public: - explicit astigStatsDlg( QVector wavefronts,QWidget *parent = 0); + explicit astigStatsDlg( const QVector &wavefronts,QWidget *parent = 0); ~astigStatsDlg(); void plot(); private slots: @@ -41,7 +41,7 @@ private slots: void on_clearPb_clicked(); void on_onlyAverages_clicked(); - void showItem(QVariant item, bool on, int ndx); + void showItem(const QVariant &item, bool on, int ndx); void on_savePB_clicked(); void showSamplesChanged(bool); diff --git a/averagewavefrontfilesdlg.cpp b/averagewavefrontfilesdlg.cpp index c565936a..02343704 100644 --- a/averagewavefrontfilesdlg.cpp +++ b/averagewavefrontfilesdlg.cpp @@ -10,7 +10,7 @@ #include void showData(const std::string &txt, cv::Mat mat, bool useLog); -averageWaveFrontFilesDlg::averageWaveFrontFilesDlg(QStringList list, SurfaceManager *m, QWidget *parent) : +averageWaveFrontFilesDlg::averageWaveFrontFilesDlg(const QStringList &list, SurfaceManager *m, QWidget *parent) : QDialog(parent), ui(new Ui::averageWaveFrontFilesDlg) { diff --git a/averagewavefrontfilesdlg.h b/averagewavefrontfilesdlg.h index 521c900a..4e977752 100644 --- a/averagewavefrontfilesdlg.h +++ b/averagewavefrontfilesdlg.h @@ -16,7 +16,7 @@ class averageWaveFrontFilesDlg : public QDialog SurfaceManager *sm; public: - explicit averageWaveFrontFilesDlg(QStringList list, SurfaceManager *sm, QWidget *parent = 0); + explicit averageWaveFrontFilesDlg(const QStringList &list, SurfaceManager *sm, QWidget *parent = 0); ~averageWaveFrontFilesDlg(); wavefront *average; signals: diff --git a/batchigramwizard.cpp b/batchigramwizard.cpp index 1a7d24cc..50268b49 100644 --- a/batchigramwizard.cpp +++ b/batchigramwizard.cpp @@ -27,7 +27,7 @@ QString batchIgramWizard::reviewFileName; QCheckBox *batchIgramWizard::autoOutlineCenter = 0; QCheckBox *batchIgramWizard::autoOutlineOutside = 0; -batchIgramWizard::batchIgramWizard(QStringList files, QWidget *parent, Qt::WindowFlags flags) : +batchIgramWizard::batchIgramWizard(const QStringList &files, QWidget *parent, Qt::WindowFlags flags) : QWizard(parent, flags), ui(new Ui::batchIgramWizard) { @@ -88,7 +88,7 @@ void batchIntro::eraseItem() } } -void batchIntro::showContextMenu(const QPoint &pos) +void batchIntro::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = filesList->mapToGlobal(pos); @@ -257,7 +257,7 @@ bool batchIntro::shouldFilterWavefront(double rms){ return (filterWavefront && rms > filterRms); } -void batchIgramWizard::addAstig(QString name, QPointF value){ +void batchIgramWizard::addAstig(const QString &name, QPointF value){ introPage->astigPlot->addValue(name,value); } @@ -267,7 +267,7 @@ void batchIgramWizard::progressValue(int min, int max, int value){ introPage->pgrBar->setValue(value); } -void batchIgramWizard::addRms(QString name, QPointF p){ +void batchIgramWizard::addRms(const QString &name, QPointF p){ introPage->m_rmsPlot->addValue(name,p); } diff --git a/batchigramwizard.h b/batchigramwizard.h index faafc80a..97367ee1 100644 --- a/batchigramwizard.h +++ b/batchigramwizard.h @@ -40,12 +40,12 @@ class batchIgramWizard : public QWizard static QCheckBox *autoOutlineOutside; static QCheckBox *autoOutlineCenter; - explicit batchIgramWizard(QStringList files, QWidget *parent = 0 , Qt::WindowFlags flags = Qt::Widget); + explicit batchIgramWizard(const QStringList &files, QWidget *parent = 0 , Qt::WindowFlags flags = Qt::Widget); ~batchIgramWizard(); void listReady(QStringList list); - void addAstig(QString name, QPointF value); - void addRms(QString name, QPointF p); + void addAstig(const QString &name, QPointF value); + void addRms(const QString &name, QPointF p); void progressValue(int min, int max, int value); void select(int n); void showPlots(bool flags); @@ -82,7 +82,7 @@ class batchIntro : public QWizardPage public slots: void processBatch(); void addFiles(); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void eraseItem(); void showPlots(bool flags); void on_filter(bool); diff --git a/camcalibrationreviewdlg.cpp b/camcalibrationreviewdlg.cpp index e72bf5fc..8a39b378 100644 --- a/camcalibrationreviewdlg.cpp +++ b/camcalibrationreviewdlg.cpp @@ -1,8 +1,8 @@ #include "camcalibrationreviewdlg.h" #include "ui_camcalibrationreviewdlg.h" #include -CamCalibrationReviewDlg::CamCalibrationReviewDlg(std::vector images, std::vector keypoints, - std::vector corrected, QWidget *parent) : +CamCalibrationReviewDlg::CamCalibrationReviewDlg(const std::vector &images, const std::vector &keypoints, + const std::vector &corrected, QWidget *parent) : QDialog(parent), m_ndx(0), m_images(images), m_keypoints(keypoints), m_corrected(corrected), ui(new Ui::CamCalibrationReviewDlg), m_overlay(false), m_viewType(0) diff --git a/camcalibrationreviewdlg.h b/camcalibrationreviewdlg.h index c306065f..14f66c18 100644 --- a/camcalibrationreviewdlg.h +++ b/camcalibrationreviewdlg.h @@ -14,7 +14,7 @@ class CamCalibrationReviewDlg : public QDialog Q_OBJECT public: - explicit CamCalibrationReviewDlg( std::vector images, std::vector keypoints, std::vector corrected,QWidget *parent = 0); + explicit CamCalibrationReviewDlg( const std::vector &images, const std::vector &keypoints, const std::vector &corrected,QWidget *parent = 0); ~CamCalibrationReviewDlg(); virtual void resizeEvent( QResizeEvent * ); private slots: diff --git a/camwizardpage1.cpp b/camwizardpage1.cpp index 09191a0d..8a1b8920 100644 --- a/camwizardpage1.cpp +++ b/camwizardpage1.cpp @@ -108,7 +108,7 @@ double computeReprojectionErrors( const std::vector >& return std::sqrt(totalErr/totalPoints); } bool CamWizardPage1::runCalibration( cv::Size& imageSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs, - std::vector > imagePoints, std::vector& rvecs, std::vector& tvecs, + const std::vector > &imagePoints, std::vector& rvecs, std::vector& tvecs, std::vector& reprojErrs, double& totalAvgErr) { @@ -150,7 +150,7 @@ void CamWizardPage1::eraseItem() } } -void CamWizardPage1::showContextMenu(const QPoint &pos) +void CamWizardPage1::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = ui->listWidget->mapToGlobal(pos); @@ -162,7 +162,7 @@ void CamWizardPage1::showContextMenu(const QPoint &pos) myMenu.exec(globalPos); } -bool CamWizardPage1::runCalibrationAndSave(cv::Size imageSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs,std::vector > imagePoints ) +bool CamWizardPage1::runCalibrationAndSave(cv::Size imageSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs,const std::vector > &imagePoints ) { std::vector rvecs, tvecs; std::vector reprojErrs; diff --git a/camwizardpage1.h b/camwizardpage1.h index 91e0eb19..55cd4e67 100644 --- a/camwizardpage1.h +++ b/camwizardpage1.h @@ -22,17 +22,17 @@ class CamWizardPage1 : public QWizardPage ~CamWizardPage1(); QStringList fileList; bool runCalibration(cv::Size& imageSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs, - std::vector > imagePoints, std::vector& rvecs, std::vector& tvecs, + const std::vector > &imagePoints, std::vector& rvecs, std::vector& tvecs, std::vector& reprojErrs, double& totalAvgErr); bool runCalibrationAndSave(cv::Size imageSize, cv::Mat& cameraMatrix, - cv::Mat& distCoeffs,std::vector > imagePoints ); + cv::Mat& distCoeffs,const std::vector > &imagePoints ); Ui::CamWizardPage1 *ui; cv::Mat m_coeffs; private slots: void on_compute_clicked(); void on_pushButton_clicked(); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void eraseItem(); void on_saveParams_clicked(); void on_rows_valueChanged(int arg1); diff --git a/colorchanneldisplay.cpp b/colorchanneldisplay.cpp index 5a3769a5..af910f76 100644 --- a/colorchanneldisplay.cpp +++ b/colorchanneldisplay.cpp @@ -34,7 +34,7 @@ ColorChannelDisplay::~ColorChannelDisplay() { delete ui; } -void ColorChannelDisplay::setImage(cv::Mat imgMat){ +void ColorChannelDisplay::setImage(const cv::Mat &imgMat){ for (int channel = 0; channel < 3; ++channel){ cv::Mat planes[4]; diff --git a/colorchanneldisplay.h b/colorchanneldisplay.h index 5923fb05..55cd70ce 100644 --- a/colorchanneldisplay.h +++ b/colorchanneldisplay.h @@ -33,7 +33,7 @@ class ColorChannelDisplay : public QDialog public: explicit ColorChannelDisplay(QWidget *parent = 0); ~ColorChannelDisplay(); - void setImage(cv::Mat imgMat); + void setImage(const cv::Mat &imgMat); private: Ui::ColorChannelDisplay *ui; diff --git a/colormapviewerdlg.cpp b/colormapviewerdlg.cpp index a5a2552f..6fab068f 100644 --- a/colormapviewerdlg.cpp +++ b/colormapviewerdlg.cpp @@ -45,7 +45,7 @@ colorMapViewerDlg::colorMapViewerDlg(QWidget *parent) : } -void colorMapViewerDlg::genList(QString path){ +void colorMapViewerDlg::genList(const QString &path){ QStringList nameFilter("*.cmp"); QDir directory(path); QStringList cmpFiles = directory.entryList(nameFilter); diff --git a/colormapviewerdlg.h b/colormapviewerdlg.h index 790fe770..5373b221 100644 --- a/colormapviewerdlg.h +++ b/colormapviewerdlg.h @@ -34,7 +34,7 @@ class colorMapViewerDlg : public QDialog ~colorMapViewerDlg(); QString m_selection; -void genList(QString path); +void genList(const QString &path); private slots: void on_browsePb_clicked(); diff --git a/contourplot.cpp b/contourplot.cpp index 5496829d..0016741d 100644 --- a/contourplot.cpp +++ b/contourplot.cpp @@ -378,7 +378,7 @@ void ContourPlot::ruler(){ } } -void ContourPlot::selected(const QPointF& pos){ +void ContourPlot::selected(QPointF pos){ if (m_wf==0) return; diff --git a/contourplot.h b/contourplot.h index 350b7d38..56409e76 100644 --- a/contourplot.h +++ b/contourplot.h @@ -86,10 +86,10 @@ class ContourPlot: public QwtPlot void setMinMaxValues(double,double); void setWaveRange(double); void newContourRange(double); - void sigPointSelected(const QPointF&); + void sigPointSelected(QPointF ); public Q_SLOTS: - void selected(const QPointF& pos); + void selected(QPointF pos); public Q_SLOTS: diff --git a/contourview.cpp b/contourview.cpp index 436c7a0e..ed52bd3c 100644 --- a/contourview.cpp +++ b/contourview.cpp @@ -68,7 +68,7 @@ void contourView::setSurface(wavefront *wf){ ps->setData(wf); } -void contourView::showContextMenu(const QPoint &pos) +void contourView::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = mapToGlobal(pos); diff --git a/contourview.h b/contourview.h index 06d2132f..42a6a51f 100644 --- a/contourview.h +++ b/contourview.h @@ -44,7 +44,7 @@ class contourView : public QWidget void zoomMe(bool); private slots: void on_doubleSpinBox_valueChanged(double arg1); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void on_pushButton_pressed(); void zoom(); diff --git a/counterrotationdlg.cpp b/counterrotationdlg.cpp index 0e9a21a8..51cc41b5 100644 --- a/counterrotationdlg.cpp +++ b/counterrotationdlg.cpp @@ -18,7 +18,7 @@ #include "counterrotationdlg.h" #include "ui_counterrotationdlg.h" -CounterRotationDlg::CounterRotationDlg(QString fn, double rot, bool dir, QWidget *parent) : +CounterRotationDlg::CounterRotationDlg(const QString &fn, double rot, bool dir, QWidget *parent) : QDialog(parent), ui(new Ui::CounterRotationDlg) { diff --git a/counterrotationdlg.h b/counterrotationdlg.h index 19d5fb11..731cb382 100644 --- a/counterrotationdlg.h +++ b/counterrotationdlg.h @@ -29,7 +29,7 @@ class CounterRotationDlg : public QDialog Q_OBJECT public: - explicit CounterRotationDlg( QString fn, double rot, bool dir, QWidget *parent = 0); + explicit CounterRotationDlg( const QString &fn, double rot, bool dir, QWidget *parent = 0); ~CounterRotationDlg(); QString getRotation(); void setCCW(bool); diff --git a/dftarea.cpp b/dftarea.cpp index bd024da9..232db75c 100644 --- a/dftarea.cpp +++ b/dftarea.cpp @@ -33,7 +33,7 @@ using namespace cv; -cv::Mat makeMask(CircleOutline outside, CircleOutline center, cv::Mat data, +cv::Mat makeMask(const CircleOutline &outside, const CircleOutline ¢er, const cv::Mat &data, QVector > poly){ int width = data.cols; int height = data.rows; @@ -389,7 +389,7 @@ void shiftDFT(cv::Mat &magI){ tmp.copyTo(q2); } -void showData(const std::string& txt, cv::Mat mat, bool useLog){ +void showData(const std::string& txt, const cv::Mat &mat, bool useLog){ cv::Mat tmp = mat.clone(); if (useLog){ @@ -405,7 +405,7 @@ void showData(const std::string& txt, cv::Mat mat, bool useLog){ } -QImage showMag(cv::Mat complexI, bool show, const char* title, bool doLog, double gamma){ +QImage showMag(const cv::Mat &complexI, bool show, const char* title, bool doLog, double gamma){ // compute the magnitude and switch to logarithmic scale // => log(1 + sqrt(Re(DFT(I))^2 + Im(DFT(I))^2)) Mat planes[2]; @@ -544,7 +544,7 @@ void DFTArea::paintEvent(QPaintEvent *) double *g_qmap; class comp_qual { public: - int operator() (const int &p1, const int &p2) { + int operator() (int p1, int p2) { return (g_qmap[p1] < g_qmap[p2]); } }; @@ -1053,7 +1053,7 @@ void DFTArea::makeSurface(){ QApplication::restoreOverrideCursor(); success = true; } -void DFTArea::newIgram(QImage){ +void DFTArea::newIgram(const QImage&){ doDFT(); } void DFTArea::mouseReleaseEvent(QMouseEvent *) @@ -1110,7 +1110,7 @@ void DFTArea::showResizedDlg(){ } } -void dumpMat(cv::Mat m, QString title = ""){ +void dumpMat(cv::Mat m, const QString &title = ""){ qDebug() << "\r" << title << m.rows <<"X" << m.cols; for (int r = 0; r < m.rows; ++r){ QString msg; @@ -1350,7 +1350,7 @@ arma::mat zpmCxx(double rho, double theta, int maxorder) { */ #include "outlinedialog.h" -void DFTArea::doPSIstep4(cv::Mat images, QVector phases){ +void DFTArea::doPSIstep4(const cv::Mat &images, QVector phases){ emit statusBarUpdate("computing surface from interferograms.",1); m_outlineComplete = false; diff --git a/dftarea.h b/dftarea.h index 4d439a9b..cd2c3370 100644 --- a/dftarea.h +++ b/dftarea.h @@ -29,8 +29,8 @@ #include "psi_dlg.h" #include "psiphasedisplay.h" -extern void showData(const std::string& txt, cv::Mat mat, bool useLog = false); -extern QImage showMag(cv::Mat complexI, bool show = false, const char *title = "FFT", bool doLog = true, double gamma = 0); +extern void showData(const std::string& txt, const cv::Mat &mat, bool useLog = false); +extern QImage showMag(const cv::Mat &complexI, bool show = false, const char *title = "FFT", bool doLog = true, double gamma = 0); extern void shiftDFT(cv::Mat &magI); @@ -67,7 +67,7 @@ public slots: void doPSIstep1(); bool doPSIstep2(); void doPSIstep3(); - void doPSIstep4(cv::Mat images, QVector phases); + void doPSIstep4(const cv::Mat &images, QVector phases); void doPSITilt(); void doDFT(); void dftSizeChanged(const QString&); @@ -75,7 +75,7 @@ public slots: void setChannel(const QString&); void dftCenterFilter(double v); void makeSurface(); - void newIgram(QImage); + void newIgram(const QImage&); void gamma(int); void showResizedDlg(); void outlineDoneSig(); diff --git a/dftthumb.cpp b/dftthumb.cpp index c1683059..48c67d72 100644 --- a/dftthumb.cpp +++ b/dftthumb.cpp @@ -27,7 +27,7 @@ dftThumb::dftThumb(QWidget *parent) : //ui->label->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ); } -void dftThumb::setImage(QImage img){ +void dftThumb::setImage(const QImage &img){ m_img = img.scaled(300, 300, Qt::KeepAspectRatio);; ui->label->setPixmap(QPixmap::fromImage(m_img));//.scaled(labelSize, Qt::KeepAspectRatio))); diff --git a/dftthumb.h b/dftthumb.h index f92e8341..99f5f192 100644 --- a/dftthumb.h +++ b/dftthumb.h @@ -31,7 +31,7 @@ class dftThumb : public QDialog public: explicit dftThumb(QWidget *parent = 0); ~dftThumb(); -void setImage(QImage img); +void setImage(const QImage &img); private: Ui::dftThumb *ui; double scale; diff --git a/dfttools.cpp b/dfttools.cpp index b57022e0..d9c19684 100644 --- a/dfttools.cpp +++ b/dfttools.cpp @@ -38,7 +38,7 @@ DFTTools::~DFTTools() { delete ui; } -void DFTTools::imageSize(QString txt){ +void DFTTools::imageSize(const QString &txt){ ui->imageSize->setText(txt); } diff --git a/dfttools.h b/dfttools.h index 4a4a404a..6bf9c853 100644 --- a/dfttools.h +++ b/dfttools.h @@ -32,7 +32,7 @@ class DFTTools : public QDockWidget explicit DFTTools(QWidget *parent = 0); void connectTo(QWidget *view); bool wasPressed; - void imageSize(QString txt); + void imageSize(const QString &txt); void setDFTSize(int val); ~DFTTools(); signals: diff --git a/foucaultview.cpp b/foucaultview.cpp index e4f56b3a..5aa9b57a 100644 --- a/foucaultview.cpp +++ b/foucaultview.cpp @@ -52,7 +52,7 @@ foucaultView::~foucaultView() delete ui; spdlog::get("logger")->trace("foucaultView::~foucaultView"); } -QString getSaveFileName(QString type){ +QString getSaveFileName(const QString &type){ QSettings settings; QString path = settings.value("lastPath","").toString(); @@ -65,7 +65,7 @@ QString getSaveFileName(QString type){ return fileName; } -void foucaultView::showContextMenu(const QPoint &pos) +void foucaultView::showContextMenu(QPoint pos) { // Handle global position diff --git a/foucaultview.h b/foucaultview.h index c52afe92..446f7064 100644 --- a/foucaultview.h +++ b/foucaultview.h @@ -28,7 +28,7 @@ public slots: QImage *render(); private slots: - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void on_gammaSb_valueChanged(double arg1); diff --git a/helpdlg.cpp b/helpdlg.cpp index a03cae59..3f4e9669 100644 --- a/helpdlg.cpp +++ b/helpdlg.cpp @@ -29,6 +29,6 @@ HelpDlg::~HelpDlg() { delete ui; } -void HelpDlg::setHelpText(QString txt){ +void HelpDlg::setHelpText(const QString &txt){ ui->textEdit->setHtml(txt); } diff --git a/helpdlg.h b/helpdlg.h index c72b90c6..f2d02912 100644 --- a/helpdlg.h +++ b/helpdlg.h @@ -31,7 +31,7 @@ class HelpDlg : public QDialog public: explicit HelpDlg(QWidget *parent = 0); - void setHelpText(QString txt); + void setHelpText(const QString &txt); ~HelpDlg(); private: diff --git a/igramarea.cpp b/igramarea.cpp index fbf16668..86c37727 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -55,7 +55,7 @@ void undoStack::clear() { m_redo.clear(); } -void undoStack::push(QImage img, CircleOutline outline){ +void undoStack::push(const QImage &img, const CircleOutline &outline){ m_redo.clear(); m_stack.push_back(outlinePair(img,outline)); @@ -81,7 +81,7 @@ double distance(QPointF p1, QPointF p2) return qSqrt((p1.x() - p2.x())*(p1.x() - p2.x()) + (p1.y() - p2.y())*(p1.y() - p2.y())); } -QImage cvMatToImage(cv::Mat out){ +QImage cvMatToImage(const cv::Mat &out){ return QImage((uchar*)out.data, out.cols, out.rows,out.step1() ,QImage::Format_RGB888).copy(); } IgramArea::IgramArea(QWidget *parent, void *mw) @@ -277,7 +277,7 @@ cv::Mat IgramArea::qImageToMat(QImage &img){ return iMat; } -cv::Mat IgramArea::igramToGray(cv::Mat roi){ +cv::Mat IgramArea::igramToGray(const cv::Mat &roi){ // split image into three color planes cv::Mat planes[4]; @@ -321,7 +321,7 @@ cv::Mat IgramArea::igramToGray(cv::Mat roi){ return gray; } -cv::Mat toSobel(cv::Mat roi){ +cv::Mat toSobel(const cv::Mat &roi){ /// Generate grad_x and grad_y cv::Mat grad_x, grad_y, grad; @@ -345,7 +345,7 @@ cv::Mat toSobel(cv::Mat roi){ //cv::waitKey(1); return grad; } -cv::Point2d IgramArea::findBestCenterOutline(cv::Mat gray, int start, int end,int step, int *radius, bool useExisting){ +cv::Point2d IgramArea::findBestCenterOutline(const cv::Mat &gray, int start, int end,int step, int *radius, bool useExisting){ double cx = m_outside.m_center.x() * searchOutlineScale; double cy = m_outside.m_center.y() * searchOutlineScale; @@ -436,7 +436,7 @@ cv::Point2d IgramArea::findBestCenterOutline(cv::Mat gray, int start, int end,in return bestc; } -cv::Point2d IgramArea::findBestOutsideOutline(cv::Mat gray, int start, int end,int step, int *radius, int pass){ +cv::Point2d IgramArea::findBestOutsideOutline(const cv::Mat &gray, int start, int end,int step, int *radius, int pass){ QSettings set; bool showDebug = set.value("DebugShowOutlining", false).toBool(); double cx = gray.cols/2.; @@ -2082,7 +2082,7 @@ void IgramArea::crop() { emit upateColorChannels(qImageToMat(igramColor)); } -void IgramArea::dftReady(QImage img){ +void IgramArea::dftReady(const QImage &img){ m_dftThumb->setImage(img); m_dftThumb->show(); QRect r = m_dftThumb->geometry(); @@ -2117,7 +2117,7 @@ void IgramArea::CenterOutlineActive(bool checked){ update(); } -void IgramArea::loadOutlineFile(QString fileName){ +void IgramArea::loadOutlineFile(const QString &fileName){ QFile loadFile(fileName); if (!loadFile.open(QIODevice::ReadOnly)) { @@ -2172,7 +2172,7 @@ void IgramArea::loadOutlineFile(QString fileName){ } } -void IgramArea::loadOutlineFileOldV6(QString fileName){ +void IgramArea::loadOutlineFileOldV6(const QString &fileName){ std::ifstream file(fileName.toStdString().c_str()); std::ifstream::pos_type fsize = file.tellg(); @@ -2520,7 +2520,7 @@ void IgramArea::hideOutline(bool checked){ m_hideOutlines = checked; drawBoundary(); } -void IgramArea::igramOutlineParmsChanged(outlineParms parms){ +void IgramArea::igramOutlineParmsChanged(const outlineParms &parms){ edgePenWidth = parms.edgeW; centerPenWidth = parms.centerW; edgePenColor = parms.edgeC; diff --git a/igramintensity.cpp b/igramintensity.cpp index a6d4c659..c074fc0b 100644 --- a/igramintensity.cpp +++ b/igramintensity.cpp @@ -35,7 +35,7 @@ igramIntensity::~igramIntensity() { delete ui; } -void igramIntensity::setIgram(cv::Mat img){ +void igramIntensity::setIgram(const cv::Mat &img){ ui->plot->setSurface(img); diff --git a/igramintensity.h b/igramintensity.h index 24638a66..0849bfdf 100644 --- a/igramintensity.h +++ b/igramintensity.h @@ -32,7 +32,7 @@ class igramIntensity : public QDialog public: explicit igramIntensity(QWidget *parent = 0); ~igramIntensity(); - void setIgram(cv::Mat img); + void setIgram(const cv::Mat &img); private slots: void on_showRed_clicked(bool checked); diff --git a/imagehisto.cpp b/imagehisto.cpp index 0ad220b0..d63bd316 100644 --- a/imagehisto.cpp +++ b/imagehisto.cpp @@ -71,7 +71,7 @@ static void updateBrightnessContrast( int /*arg*/, void* ) -imageHisto::imageHisto( Mat im) +imageHisto::imageHisto( const Mat &im) { image = im; namedWindow("image", 0); diff --git a/imagehisto.h b/imagehisto.h index 23f23dc3..09449690 100644 --- a/imagehisto.h +++ b/imagehisto.h @@ -23,7 +23,7 @@ class imageHisto { public: - imageHisto(cv::Mat im); + imageHisto(const cv::Mat &im); }; diff --git a/intensityplot.cpp b/intensityplot.cpp index ccd94deb..e2d51f96 100644 --- a/intensityplot.cpp +++ b/intensityplot.cpp @@ -50,7 +50,7 @@ class iSurfaceData: public QwtSyntheticPointData public: cv::Mat m_plane; int m_rad; - iSurfaceData(cv::Mat plane): + iSurfaceData(const cv::Mat &plane): QwtSyntheticPointData( plane.cols ), m_plane(plane), m_rad(plane.cols/2) { @@ -159,7 +159,7 @@ void intensityPlot::angleChanged(double a){ -void intensityPlot::setSurface(cv::Mat imgMat){ +void intensityPlot::setSurface(const cv::Mat &imgMat){ m_img = imgMat; split(imgMat,planes); diff --git a/intensityplot.h b/intensityplot.h index 9a92917f..1e6f4937 100644 --- a/intensityplot.h +++ b/intensityplot.h @@ -27,7 +27,7 @@ Q_OBJECT public: intensityPlot(QWidget *parent = NULL); virtual ~intensityPlot() {} - void setSurface(cv::Mat imgMat); + void setSurface(const cv::Mat &imgMat); virtual void resizeEvent( QResizeEvent * ); void showRed(bool); void showBlue(bool); diff --git a/jitteroutlinedlg.cpp b/jitteroutlinedlg.cpp index 62dc3623..e707a14d 100644 --- a/jitteroutlinedlg.cpp +++ b/jitteroutlinedlg.cpp @@ -24,7 +24,7 @@ jitterOutlineDlg::~jitterOutlineDlg() { delete ui; } -void jitterOutlineDlg::status(QString status){ +void jitterOutlineDlg::status(const QString &status){ ui->status->setText(status); } diff --git a/jitteroutlinedlg.h b/jitteroutlinedlg.h index f1292f80..bab1b186 100644 --- a/jitteroutlinedlg.h +++ b/jitteroutlinedlg.h @@ -23,7 +23,7 @@ class jitterOutlineDlg : public QDialog int getStart(); int getEnd(); int getType(); - void status(QString status); + void status(const QString &status); private slots: diff --git a/mainwindow.cpp b/mainwindow.cpp index d80c1c55..9ad4bb0e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -159,7 +159,7 @@ MainWindow::MainWindow(QWidget *parent) : m_profilePlot = new ProfilePlot(review->s2,m_contourTools); connect(m_profilePlot, SIGNAL(zoomMe(bool)), this, SLOT(zoomProfile(bool))); connect(m_profilePlot, SIGNAL(profileAngleChanged(double)), m_contourView->getPlot(), SLOT(drawProfileLine(double))); - connect(m_contourView->getPlot() , SIGNAL(sigPointSelected(const QPointF&)), m_profilePlot, SLOT(contourPointSelected(const QPointF&))); + connect(m_contourView->getPlot() , SIGNAL(sigPointSelected(QPointF)), m_profilePlot, SLOT(contourPointSelected(QPointF))); m_mirrorDlg = mirrorDlg::get_Instance(); review->s2->addWidget(review->s1); review->s2->addWidget(m_profilePlot); @@ -296,7 +296,7 @@ void MainWindow::importIgram() { } -int showmem(QString t); +int showmem(const QString &t); void MainWindow::openWaveFrontonInit(QStringList args){ QProgressDialog pd(" Loading wavefronts in progress.", "Cancel", 0, 100); pd.setRange(0, args.size()); @@ -627,7 +627,7 @@ void MainWindow::selectDftTab(){ ui->tabWidget->setCurrentIndex(1); } -void MainWindow::updateChannels(cv::Mat img){ +void MainWindow::updateChannels(const cv::Mat &img){ if (m_showChannels){ @@ -740,7 +740,7 @@ void MainWindow::on_actionSave_Wavefront_triggered() { m_surfaceManager->SaveWavefronts(false); } -void MainWindow::showMessage(QString msg, int id){ +void MainWindow::showMessage(const QString &msg, int id){ switch(id){ case 1: @@ -809,7 +809,7 @@ void MainWindow::on_showChannels_clicked(bool checked) else m_colorChannels->close(); } -void MainWindow::imageSize(QString txt){ +void MainWindow::imageSize(const QString &txt){ ui->igramSize->setText(txt); } @@ -823,7 +823,7 @@ void MainWindow::on_showIntensity_clicked(bool checked) else m_intensityPlot->close(); } -void MainWindow::newMirrorDlgPath(QString path){ +void MainWindow::newMirrorDlgPath(const QString &path){ QFileInfo info(path); QSettings settings; settings.setValue("lastPath",info.path()); diff --git a/mainwindow.h b/mainwindow.h index 13021de9..5e13be61 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -82,7 +82,7 @@ class MainWindow : public QMainWindow public slots: void enableShiftButtons(bool enable); - void showMessage(QString, int id); + void showMessage(const QString&, int id); void diameterChanged(double); void rocChanged(double); void batchProcess(QStringList fileList); @@ -97,7 +97,7 @@ public slots: void zoomContour(bool flag); void zoomOgl(); void zoomProfile(bool flag); - void imageSize(QString txt); + void imageSize(const QString &txt); void skipBatchItem(); int getCurrentTab(); void setTab(int ndx); @@ -107,7 +107,7 @@ public slots: void messageResult(int); void gammaChanged(bool, double); private slots: - void updateChannels(cv::Mat); + void updateChannels(const cv::Mat&); void openRecentFile(); void on_actionLoad_Interferogram_triggered(); void on_pushButton_5_clicked(); @@ -119,7 +119,7 @@ private slots: void on_shiftDown_clicked(); void on_shiftRight_clicked(); void selectDftTab(); - void newMirrorDlgPath(QString path); + void newMirrorDlgPath(const QString &path); void on_actionRead_WaveFront_triggered(); void on_actionPreferences_triggered(); diff --git a/metricsdisplay.cpp b/metricsdisplay.cpp index eed37584..772b3fcf 100644 --- a/metricsdisplay.cpp +++ b/metricsdisplay.cpp @@ -119,6 +119,6 @@ void metricsDisplay::on_sphericalPb_pressed() } emit recomputeZerns(); } -void metricsDisplay::setZernTitle(QString title){ +void metricsDisplay::setZernTitle(const QString &title){ ui->zernTitle->setText(title); } diff --git a/metricsdisplay.h b/metricsdisplay.h index 1a280894..0b990a37 100644 --- a/metricsdisplay.h +++ b/metricsdisplay.h @@ -44,7 +44,7 @@ class metricsDisplay : public QDockWidget void setName(QString name); void setWavePerFringe(double val, double lambda); void setOutputLambda(double val); - void setZernTitle(QString title); + void setZernTitle(const QString &title); private: bool shouldEnableAll; public slots: diff --git a/mirrordlg.cpp b/mirrordlg.cpp index b5038108..0b8f0adb 100644 --- a/mirrordlg.cpp +++ b/mirrordlg.cpp @@ -143,7 +143,7 @@ double mirrorDlg::getMinorAxis(){ bool mirrorDlg::isEllipse(){ return m_outlineShape == ELLIPSE; } -void mirrorDlg::saveJson(QString fileName){ +void mirrorDlg::saveJson(const QString &fileName){ QJsonObject jDoc, jMirror,jIgram, jEllipse, jAnnulus; jDoc["name"] = m_name; jDoc["show units in mm"] = mm; @@ -556,7 +556,7 @@ void mirrorDlg::on_obs_textChanged(const QString &arg1) obs = ((mm) ? 1: 25.4) * arg1.toDouble(); } -void mirrorDlg::newLambda(QString v){ +void mirrorDlg::newLambda(const QString &v){ ui->lambda->setText(v); } diff --git a/mirrordlg.h b/mirrordlg.h index 860ddb5a..d05aa072 100644 --- a/mirrordlg.h +++ b/mirrordlg.h @@ -62,7 +62,7 @@ class mirrorDlg : public QDialog bool shouldFlipH(); static QString getProjectPath(); bool m_obsChanged; - void newLambda(QString v); + void newLambda(const QString &v); double getMinorAxis(); bool m_majorHorizontal; double m_verticalAxis; @@ -136,7 +136,7 @@ private slots: Ui::mirrorDlg *ui; bool m_aperatureReductionValueChanged; QTimer spacingChangeTimer; - void saveJson(QString fileName); + void saveJson(const QString &fileName); void enableAnnular(bool enable); }; diff --git a/myplotpicker.cpp b/myplotpicker.cpp index d091d6de..16e872e2 100644 --- a/myplotpicker.cpp +++ b/myplotpicker.cpp @@ -55,13 +55,13 @@ bool myPlotPicker::eventFilter( QObject *object, QEvent *event ) return QObject::eventFilter( object, event ); } -void myPlotPicker::select(const QPointF &p){ +void myPlotPicker::select(QPointF p){ QString s = find(p); if (s == "") return; emit mySelected(s); } -QString myPlotPicker::find(const QPointF &p)const{ +QString myPlotPicker::find(QPointF p)const{ QString s(""); const QwtScaleMap xMap = m_plot->canvasMap(2); diff --git a/myplotpicker.h b/myplotpicker.h index 3be301a8..01304c64 100644 --- a/myplotpicker.h +++ b/myplotpicker.h @@ -14,11 +14,11 @@ class myPlotPicker : public QwtPlotPicker explicit myPlotPicker( QwtPlot * plot); bool eventFilter( QObject *, QEvent * ); virtual QwtText trackerTextF( const QPointF &pos ) const; - void select(const QPointF &p); - QString find(const QPointF &p)const; + void select(QPointF p); + QString find(QPointF p)const; QwtPlot *m_plot; signals: - void mySelected(const QString); + void mySelected(const QString&); public slots: }; diff --git a/nullvariationdlg.cpp b/nullvariationdlg.cpp index a6af78ea..20726d91 100644 --- a/nullvariationdlg.cpp +++ b/nullvariationdlg.cpp @@ -95,12 +95,12 @@ void nullVariationDlg::on_useMm_clicked(bool checked) on_useInch_clicked(!checked); } -void nullVariationDlg::on_roc_textChanged(const QString ) +void nullVariationDlg::on_roc_textChanged(const QString &) { calculate(); } -void nullVariationDlg::on_diameter_textChanged(const QString) +void nullVariationDlg::on_diameter_textChanged(const QString&) { calculate(); } @@ -120,7 +120,7 @@ void nullVariationDlg::on_diameterDelta_valueChanged(double val) } #include #include -QMap histo(const QList data, int bins){ +QMap histo(const QList &data, int bins){ auto minma = std::minmax_element( data.begin(), data.end()); double range = *minma.second - *minma.first; double histInterval = range/bins; diff --git a/nullvariationdlg.h b/nullvariationdlg.h index 1803be0b..2db8cf83 100644 --- a/nullvariationdlg.h +++ b/nullvariationdlg.h @@ -25,9 +25,9 @@ private slots: void on_useMm_clicked(bool checked); - void on_roc_textChanged(const QString); + void on_roc_textChanged(const QString&); - void on_diameter_textChanged(const QString ); + void on_diameter_textChanged(const QString &); void on_rocDelta_valueChanged(double val); diff --git a/oglview.cpp b/oglview.cpp index 3393e06b..ca4df6c6 100644 --- a/oglview.cpp +++ b/oglview.cpp @@ -105,7 +105,7 @@ OGLView::~OGLView(){ delete m_surface; } -void OGLView::showContextMenu(const QPoint &pos) +void OGLView::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = mapToGlobal(pos); diff --git a/oglview.h b/oglview.h index 018a85c6..3d5dad65 100644 --- a/oglview.h +++ b/oglview.h @@ -56,7 +56,7 @@ public slots: void saveImage(); void showSelected(); void enableFullScreen(); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); }; diff --git a/outlinedialog.cpp b/outlinedialog.cpp index 625e941b..4858d3de 100644 --- a/outlinedialog.cpp +++ b/outlinedialog.cpp @@ -100,7 +100,7 @@ outlineDialog::~outlineDialog() } -void outlineDialog::updateDisplay(cv::Mat img){ +void outlineDialog::updateDisplay(const cv::Mat &img){ QImage tmp = QImage((uchar*)img.data, img.cols, @@ -112,7 +112,7 @@ void outlineDialog::updateDisplay(cv::Mat img){ Qt::KeepAspectRatio)); } -void outlineDialog::setImage(cv::Mat img){ +void outlineDialog::setImage(const cv::Mat &img){ cv::Mat tmp; img.convertTo(tmp, CV_8UC1); cv::cvtColor(tmp,m_igram, cv::COLOR_GRAY2RGB); diff --git a/outlinedialog.h b/outlinedialog.h index a3a6c5be..86fa97ef 100644 --- a/outlinedialog.h +++ b/outlinedialog.h @@ -27,9 +27,9 @@ class outlineDialog : public QDialog ~outlineDialog(); double m_x, m_y, m_rad; cv::Mat img; - void setImage(cv::Mat img); + void setImage(const cv::Mat &img); void updateOutline(); - void updateDisplay(cv::Mat img); + void updateDisplay(const cv::Mat &img); private slots: diff --git a/outlinestatsdlg.cpp b/outlinestatsdlg.cpp index d94e76da..47b3f226 100644 --- a/outlinestatsdlg.cpp +++ b/outlinestatsdlg.cpp @@ -97,7 +97,7 @@ QVector radiusHisto(const QVector& dataQVect, double *minRad, int & return h; } -outlineStatsDlg::outlineStatsDlg(QStringList names, QWidget *parent) : +outlineStatsDlg::outlineStatsDlg(const QStringList &names, QWidget *parent) : QDialog(parent), m_names(names), ui(new Ui::outlineStatsDlg) { diff --git a/outlinestatsdlg.h b/outlinestatsdlg.h index ac563680..99a37877 100644 --- a/outlinestatsdlg.h +++ b/outlinestatsdlg.h @@ -13,7 +13,7 @@ class outlineStatsDlg : public QDialog Q_OBJECT public: - explicit outlineStatsDlg(QStringList names, QWidget *parent = 0); + explicit outlineStatsDlg(const QStringList &names, QWidget *parent = 0); ~outlineStatsDlg(); QStringList m_names; QVector xvals; diff --git a/percentCorrectionSurface.h b/percentCorrectionSurface.h index 6b62d489..3e60d43c 100644 --- a/percentCorrectionSurface.h +++ b/percentCorrectionSurface.h @@ -10,7 +10,7 @@ class surfaceData { std::vector zernvalues; QString m_name; - surfaceData( double igramlambda, QColor pen, std::vector zernvalues, QString name): igramlambda(igramlambda), + surfaceData( double igramlambda, QColor pen, const std::vector &zernvalues, const QString &name): igramlambda(igramlambda), penColor(pen), zernvalues(zernvalues){ m_name = name;}; } ; #endif // PERCENTCORRECTIONSURFACE_H diff --git a/percentcorrectiondlg.cpp b/percentcorrectiondlg.cpp index db01e98f..f079c3eb 100644 --- a/percentcorrectiondlg.cpp +++ b/percentcorrectiondlg.cpp @@ -162,7 +162,7 @@ void percentCorrectionDlg::updateZoneTable(){ ui->percentTable->setColumnCount(m_zoneCenters.size()); ui->percentTable->blockSignals(false); } -QJsonDocument percentCorrectionDlg::loadZonesFromJson(QString str){ +QJsonDocument percentCorrectionDlg::loadZonesFromJson(const QString &str){ QJsonParseError jsonError; QJsonDocument jsonDoc = QJsonDocument::fromJson(str.toUtf8(), &jsonError); QJsonObject jsonData=jsonDoc.object(); @@ -284,13 +284,13 @@ double percentCorrectionDlg::getZernSurface( double RoC, double /*MirrorRad*/, s } // profile from profile plot with null removed -void percentCorrectionDlg::setProfile(QPolygonF profile){ +void percentCorrectionDlg::setProfile(const QPolygonF &profile){ m_avg = profile; } // will use zernike values to compute two surface points x+- .01x away from x // then compute normal slope from that. -double percentCorrectionDlg::getnormalSlope(double RoC, double radius, std::vector Zernikes, double x, double null = 0, bool useAvg = false){ +double percentCorrectionDlg::getnormalSlope(double RoC, double radius, const std::vector &Zernikes, double x, double null = 0, bool useAvg = false){ double num1 = x / 100.0; double surface1 = getZernSurface(RoC, radius, Zernikes, x - num1, null,useAvg); // problem with zonendx (the delta is not same as zonendx) @@ -304,7 +304,7 @@ double percentCorrectionDlg::getnormalSlope(double RoC, double radius, std::vect // y = mx + b // b = y - mx -double percentCorrectionDlg::GetActualKE(double RoC, double MirrorRad, std::vector Zernikes, double x, double null, bool use_avg) +double percentCorrectionDlg::GetActualKE(double RoC, double MirrorRad, const std::vector &Zernikes, double x, double null, bool use_avg) { double slope = getnormalSlope(RoC, MirrorRad, Zernikes, x, null, use_avg); diff --git a/percentcorrectiondlg.h b/percentcorrectiondlg.h index 70412afe..c1ef915d 100644 --- a/percentcorrectiondlg.h +++ b/percentcorrectiondlg.h @@ -49,7 +49,7 @@ class percentCorrectionDlg : public QDialog QVector surfs; QPolygonF makePercentages(surfaceData *); - double getnormalSlope(double RoC, double radius, std::vector Zernikes, double x, double null, bool use_avg); + double getnormalSlope(double RoC, double radius, const std::vector &Zernikes, double x, double null, bool use_avg); double getZernSurface( double RoC, double MirrorRad, std::vector Zernikes, double x, double null, bool useavg); double GetActualKE(double RoC, double MirrorRad, std::vector Zernikes, double x); @@ -73,13 +73,13 @@ class percentCorrectionDlg : public QDialog ~percentCorrectionDlg(); std::vector m_zerns; void setData(QVector< surfaceData *> ); - void setProfile(QPolygonF profile); + void setProfile(const QPolygonF &profile); void plot(); void plotProfile(); void plotSlope(); void updateZoneTable(); - QJsonDocument loadZonesFromJson(QString str); - double GetActualKE(double RoC, double MirrorRad, std::vector Zernikes, double x, double nulll, bool use_avg); + QJsonDocument loadZonesFromJson(const QString &str); + double GetActualKE(double RoC, double MirrorRad, const std::vector &Zernikes, double x, double nulll, bool use_avg); QList generateZoneCenters(double radius, int number_of_zones, bool makenew = true); private slots: void on_percentTable_itemChanged(QTableWidgetItem *item); diff --git a/pixelstats.cpp b/pixelstats.cpp index e6a4102f..efe5e31e 100644 --- a/pixelstats.cpp +++ b/pixelstats.cpp @@ -124,7 +124,7 @@ bool CanvasPicker::eventFilter( QObject *object, QEvent *event ) // Select the point at a position. If there is no point // deselect the selected point -void CanvasPicker::select( const QPoint &pos ) +void CanvasPicker::select( QPoint pos ) { QwtPlotMarker *mark = NULL; double dist = 10e10; @@ -180,7 +180,7 @@ void CanvasPicker::select( const QPoint &pos ) // Move the selected point -void CanvasPicker::move( const QPoint &pos ) +void CanvasPicker::move( QPoint pos ) { if ( !d_selectedMarker ) return; diff --git a/pixelstats.h b/pixelstats.h index fe5d9b6e..cea5a505 100644 --- a/pixelstats.h +++ b/pixelstats.h @@ -56,8 +56,8 @@ class CanvasPicker: public QObject void markerMoved(); private: - void select( const QPoint & ); - void move( const QPoint & ); + void select( QPoint ); + void move( QPoint ); void release(); void shiftCurveCursor(); diff --git a/profileplot.cpp b/profileplot.cpp index 63634108..e32e4833 100644 --- a/profileplot.cpp +++ b/profileplot.cpp @@ -253,7 +253,7 @@ void ProfilePlot::showAll(){ populate(); m_plot->replot(); } -void ProfilePlot::zeroOffsetChanged(QString s){ +void ProfilePlot::zeroOffsetChanged(const QString &s){ if (offsetType == s) return; double mul = m_showNm * m_showSurface; @@ -318,7 +318,7 @@ void ProfilePlot::setSurface(wavefront * wf){ m_plot->replot(); } -void ProfilePlot::setDefocusWaveFront( cv::Mat_ wf){ +void ProfilePlot::setDefocusWaveFront( const cv::Mat_ &wf){ m_defocus_wavefront = wf.clone(); } @@ -757,7 +757,7 @@ void ProfilePlot::zoom(){ emit zoomMe(zoomed); } -void ProfilePlot::showContextMenu(const QPoint &pos) +void ProfilePlot::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = mapToGlobal(pos); @@ -783,7 +783,7 @@ void ProfilePlot::resizeEvent( QResizeEvent *) wfs = wf; } -void ProfilePlot::contourPointSelected(const QPointF &pos){ +void ProfilePlot::contourPointSelected(QPointF pos){ if (m_wf == 0) return; double delx = pos.x() - m_wf->data.rows/2; diff --git a/profileplot.h b/profileplot.h index bc12bb9d..d9f28ba4 100644 --- a/profileplot.h +++ b/profileplot.h @@ -64,7 +64,7 @@ class ProfilePlot : public QWidget double slopeLimitArcSec; void setDefocusValue(double val); - void setDefocusWaveFront( cv::Mat_ wf); + void setDefocusWaveFront( const cv::Mat_ &wf); signals: void zoomMe(bool); void profileAngleChanged(const double ang); @@ -74,17 +74,17 @@ public slots: void setWavefronts(QVector *wf); void angleChanged(double a); void newDisplayErrorRange(double min, double max); - void zeroOffsetChanged(QString); + void zeroOffsetChanged(const QString&); void showOne(); void show16(); void showAll(); void showNm(bool); void showSurface(bool); void zoom(); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void showSlope(bool); void slopeLimit(double); - void contourPointSelected(const QPointF &pos); + void contourPointSelected(QPointF pos); void populate(); void showCorrection(); void make_correction_graph(); diff --git a/profileplotpicker.cpp b/profileplotpicker.cpp index ccd7b293..ce68e902 100644 --- a/profileplotpicker.cpp +++ b/profileplotpicker.cpp @@ -97,7 +97,7 @@ bool profilePlotPicker::eventFilter( QObject *object, QEvent *event ) // Select the point at a position. If there is no point // deselect the selected point -void profilePlotPicker::select( const QPoint &pos ) +void profilePlotPicker::select( QPoint pos ) { QwtPlotCurve *curve = NULL; double dist = 10e10; @@ -129,7 +129,7 @@ void profilePlotPicker::select( const QPoint &pos ) // Move the selected point -void profilePlotPicker::move( const QPoint &pos ) +void profilePlotPicker::move( QPoint pos ) { qDebug() << "move pos" << pos; if ( !d_selectedCurve ) diff --git a/profileplotpicker.h b/profileplotpicker.h index 4c9aa5ef..54bb7aeb 100644 --- a/profileplotpicker.h +++ b/profileplotpicker.h @@ -20,8 +20,8 @@ class profilePlotPicker: public QObject private: - void select( const QPoint & ); - void move( const QPoint & ); + void select( QPoint ); + void move( QPoint ); void moveBy( int dx, int dy ); void release(); diff --git a/psfplot.cpp b/psfplot.cpp index 4aba939f..bfd4e5ca 100644 --- a/psfplot.cpp +++ b/psfplot.cpp @@ -55,7 +55,7 @@ void psfPlot::clear(){ } -void psfPlot::setData(cv::Mat wf, QString label, QPen color, bool doLog){ +void psfPlot::setData(cv::Mat wf, const QString &label, const QPen &color, bool doLog){ int nx = wf.cols/2; QwtPlotCurve *curve1 = new QwtPlotCurve(label); QPolygonF points1; diff --git a/psfplot.h b/psfplot.h index db39bd0d..3a31d62c 100644 --- a/psfplot.h +++ b/psfplot.h @@ -36,7 +36,7 @@ class psfPlot : public QwtPlot public: explicit psfPlot(QWidget *parent = 0); ~psfPlot(); - void setData(cv::Mat wf, QString label, QPen color, bool doLog); + void setData(cv::Mat wf, const QString &label, const QPen &color, bool doLog); void clear(); private: diff --git a/psiphasedisplay.cpp b/psiphasedisplay.cpp index 13bb435f..c6456ca6 100644 --- a/psiphasedisplay.cpp +++ b/psiphasedisplay.cpp @@ -12,7 +12,7 @@ #define M_PI 3.14159265358979323846 #endif -PSIphaseDisplay::PSIphaseDisplay(QVector phases,QWidget *parent) : +PSIphaseDisplay::PSIphaseDisplay(const QVector &phases,QWidget *parent) : QDialog(parent), ui(new Ui::PSIphaseDisplay),m_useRadians(false) { @@ -30,7 +30,7 @@ PSIphaseDisplay::~PSIphaseDisplay() void PSIphaseDisplay::useRadians(bool /*use*/){ // TODO PSIphaseDisplay doesn't take into account m_useRadians from psi_dlg (JST 2023/07/11) } -void PSIphaseDisplay::setPhases(QVector phases, int iteration, double sdp){ +void PSIphaseDisplay::setPhases(const QVector &phases, int iteration, double sdp){ plot(phases, iteration, sdp); } void PSIphaseDisplay::plot(QVector phases, int iteration, double sdp){ diff --git a/psiphasedisplay.h b/psiphasedisplay.h index 659a97a3..b00769e4 100644 --- a/psiphasedisplay.h +++ b/psiphasedisplay.h @@ -13,9 +13,9 @@ class PSIphaseDisplay : public QDialog Q_OBJECT public: - explicit PSIphaseDisplay( QVector phases, QWidget *parent = 0); + explicit PSIphaseDisplay( const QVector &phases, QWidget *parent = 0); ~PSIphaseDisplay(); - void setPhases(QVector phases, int iteration, double sdp); + void setPhases(const QVector &phases, int iteration, double sdp); void useRadians(bool use); private: Ui::PSIphaseDisplay *ui; diff --git a/punwrap.cpp b/punwrap.cpp index c1d30069..14a5c38d 100644 --- a/punwrap.cpp +++ b/punwrap.cpp @@ -275,7 +275,7 @@ class comp_qual { public: - int operator() (const qual &p1, const qual &p2) + int operator() (qual p1, qual p2) { return (p1.m_q < p2.m_q); } diff --git a/regionedittools.cpp b/regionedittools.cpp index fe151b37..47758a72 100644 --- a/regionedittools.cpp +++ b/regionedittools.cpp @@ -38,7 +38,7 @@ void regionEditTools::on_line_clicked(bool /*checked*/) m_doFreeform = false; } -void regionEditTools::addRegion(QString text){ +void regionEditTools::addRegion(const QString &text){ ui->listWidget->addItem(text); } diff --git a/regionedittools.h b/regionedittools.h index 1ad04d77..04e32946 100644 --- a/regionedittools.h +++ b/regionedittools.h @@ -17,7 +17,7 @@ class regionEditTools : public QDockWidget bool m_doLine; bool m_doFreeform; int currentNdx; - void addRegion(QString text); + void addRegion(const QString &text); void deleteRegion(int r); void clear(); signals: diff --git a/rejectedwavefrontsdlg.cpp b/rejectedwavefrontsdlg.cpp index d272f677..33b755cd 100644 --- a/rejectedwavefrontsdlg.cpp +++ b/rejectedwavefrontsdlg.cpp @@ -1,7 +1,7 @@ #include "rejectedwavefrontsdlg.h" #include "ui_rejectedwavefrontsdlg.h" -rejectedWavefrontsDlg::rejectedWavefrontsDlg(QStringList list, QWidget *parent) : +rejectedWavefrontsDlg::rejectedWavefrontsDlg(const QStringList &list, QWidget *parent) : QDialog(parent), ui(new Ui::rejectedWavefrontsDlg) { diff --git a/rejectedwavefrontsdlg.h b/rejectedwavefrontsdlg.h index d6e58e47..70d7c2ae 100644 --- a/rejectedwavefrontsdlg.h +++ b/rejectedwavefrontsdlg.h @@ -12,7 +12,7 @@ class rejectedWavefrontsDlg : public QDialog Q_OBJECT public: - explicit rejectedWavefrontsDlg(QStringList list, QWidget *parent = 0); + explicit rejectedWavefrontsDlg(const QStringList &list, QWidget *parent = 0); ~rejectedWavefrontsDlg(); private: diff --git a/renamewavefrontdlg.cpp b/renamewavefrontdlg.cpp index ba271709..f4694107 100644 --- a/renamewavefrontdlg.cpp +++ b/renamewavefrontdlg.cpp @@ -18,7 +18,7 @@ #include "renamewavefrontdlg.h" #include "ui_renamewavefrontdlg.h" -renameWavefrontDlg::renameWavefrontDlg(QString name, QWidget *parent) : +renameWavefrontDlg::renameWavefrontDlg(const QString &name, QWidget *parent) : QDialog(parent), ui(new Ui::renameWavefrontDlg) { diff --git a/renamewavefrontdlg.h b/renamewavefrontdlg.h index bae723bd..74ad77df 100644 --- a/renamewavefrontdlg.h +++ b/renamewavefrontdlg.h @@ -29,7 +29,7 @@ class renameWavefrontDlg : public QDialog Q_OBJECT public: - explicit renameWavefrontDlg(QString name, QWidget *parent = 0); + explicit renameWavefrontDlg(const QString &name, QWidget *parent = 0); ~renameWavefrontDlg(); QString name(); diff --git a/rmsplot.cpp b/rmsplot.cpp index 1b19f933..d442e1ba 100644 --- a/rmsplot.cpp +++ b/rmsplot.cpp @@ -34,10 +34,10 @@ rmsPlot::rmsPlot(QWidget *parent):QwtPlot( parent ),m_max(.3) m_max = 0; replot(); } -void rmsPlot::selectedwave(QString m){ +void rmsPlot::selectedwave(const QString &m){ emit waveSeleted(m); } -void rmsPlot::addValue(QString name, QPointF p){ +void rmsPlot::addValue(const QString &name, QPointF p){ QwtPlotMarker *m = new QwtPlotMarker(name); if (p.y() > m_max) m_max = p.y(); diff --git a/rmsplot.h b/rmsplot.h index 8cd5a84d..3af66da9 100644 --- a/rmsplot.h +++ b/rmsplot.h @@ -21,9 +21,9 @@ class rmsPlot : public QwtPlot explicit rmsPlot(QWidget *parent = 0); public: - void addValue(QString name, QPointF p); + void addValue(const QString &name, QPointF p); private slots: - void selectedwave(QString m); + void selectedwave(const QString &m); signals: void waveSeleted(QString); }; diff --git a/rotationdlg.cpp b/rotationdlg.cpp index d1a3add0..325458ae 100644 --- a/rotationdlg.cpp +++ b/rotationdlg.cpp @@ -20,7 +20,7 @@ #include #include -RotationDlg::RotationDlg( QList list, QWidget *parent) : +RotationDlg::RotationDlg( const QList &list, QWidget *parent) : QDialog(parent), ui(new Ui::RotationDlg), list(list) { diff --git a/rotationdlg.h b/rotationdlg.h index 087c2b1c..702af068 100644 --- a/rotationdlg.h +++ b/rotationdlg.h @@ -29,7 +29,7 @@ class RotationDlg : public QDialog Q_OBJECT public: - explicit RotationDlg( QList list, QWidget *parent = 0); + explicit RotationDlg( const QList &list, QWidget *parent = 0); ~RotationDlg(); signals: diff --git a/savewavedlg.cpp b/savewavedlg.cpp index 1f9945d8..400d46ed 100644 --- a/savewavedlg.cpp +++ b/savewavedlg.cpp @@ -18,7 +18,7 @@ #include "savewavedlg.h" #include "ui_savewavedlg.h" #include -SaveWaveDlg::SaveWaveDlg(QString lastPath, QWidget *parent) : +SaveWaveDlg::SaveWaveDlg(const QString &lastPath, QWidget *parent) : QDialog(parent),lastPath(lastPath), ui(new Ui::SaveWaveDlg) { diff --git a/savewavedlg.h b/savewavedlg.h index 4c057b1b..b39205fc 100644 --- a/savewavedlg.h +++ b/savewavedlg.h @@ -29,7 +29,7 @@ class SaveWaveDlg : public QDialog Q_OBJECT public: - explicit SaveWaveDlg(QString lastPath, QWidget *parent = 0); + explicit SaveWaveDlg(const QString &lastPath, QWidget *parent = 0); ~SaveWaveDlg(); QString fileName; QString lastPath; diff --git a/settingsigram.cpp b/settingsigram.cpp index f6b54ee9..528df00b 100644 --- a/settingsigram.cpp +++ b/settingsigram.cpp @@ -184,7 +184,7 @@ void settingsIGram::eraseItem() lensesModel->removeRow(currentNdx.row()); saveLensData(); } -void settingsIGram::showContextMenu(const QPoint &pos) +void settingsIGram::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = ui->lenseTableView->mapToGlobal(pos); @@ -205,7 +205,7 @@ void settingsIGram::saveLensData(){ set.setValue("Lenses", v.join("\n")); } -void settingsIGram::updateLenses(QString str){ +void settingsIGram::updateLenses(const QString &str){ m_lensData.push_back(str.split(",")); saveLensData(); lensesModel->insertRow(m_lensData.size() -2); diff --git a/settingsigram.h b/settingsigram.h index 0e5557d8..af079994 100644 --- a/settingsigram.h +++ b/settingsigram.h @@ -48,7 +48,7 @@ class settingsIGram : public QDialog bool m_removeDistortion; bool m_autoSaveOutline; QStringList m_lenseParms; - void updateLenses(QString str); + void updateLenses(const QString &str); signals: void igramLinesChanged(outlineParms); private slots: @@ -67,7 +67,7 @@ private slots: void eraseItem(); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void on_lenseTableView_clicked(const QModelIndex &index); diff --git a/showaliasdlg.cpp b/showaliasdlg.cpp index d54535eb..e338ff1e 100644 --- a/showaliasdlg.cpp +++ b/showaliasdlg.cpp @@ -39,7 +39,7 @@ class ImageViewer : public QWidget { } public: - void setImage(cv::Mat mat){ + void setImage(const cv::Mat &mat){ cv::Mat rgb; cv::cvtColor(mat,rgb, cv::COLOR_GRAY2RGB); QImage img= QImage((uchar*) rgb.data, rgb.cols, rgb.rows, rgb.step, diff --git a/simigramdlg.cpp b/simigramdlg.cpp index fe7ef874..ac3567e2 100644 --- a/simigramdlg.cpp +++ b/simigramdlg.cpp @@ -205,7 +205,7 @@ simIgramDlg *simIgramDlg::get_instance(){ double simIgramDlg::getObs(){ return ui->obsPercent->value(); } -void simIgramDlg::setNewTerms(std::vector terms){ +void simIgramDlg::setNewTerms(const std::vector &terms){ zernikes = terms; tableModel->setValues(&zernikes); diff --git a/simigramdlg.h b/simigramdlg.h index 7ed6d30c..ce0ceebb 100644 --- a/simigramdlg.h +++ b/simigramdlg.h @@ -69,7 +69,7 @@ class simIgramDlg : public QDialog bool doCorrection; std::vector zernikes; std::vector enables; - void setNewTerms(std::vector terms); + void setNewTerms(const std::vector &terms); double getObs(); bool m_doEdge; diff --git a/simulationsview.cpp b/simulationsview.cpp index 625beb3b..5e1e555c 100644 --- a/simulationsview.cpp +++ b/simulationsview.cpp @@ -159,7 +159,7 @@ void SimulationsView::saveImage(QString fileName){ svImage.save(fileName); } -void SimulationsView::showContextMenu(const QPoint &pos) +void SimulationsView::showContextMenu(QPoint pos) { // Handle global position @@ -455,7 +455,7 @@ void etoxplusy(cv::Mat data) } } } -void SimulationsView::mtf(cv::Mat star, QString txt, QColor color){ +void SimulationsView::mtf(const cv::Mat &star, const QString &txt, QColor color){ cv::Mat planes[2]; cv::Mat mtfIn, mtfOut, mtfMag; split(star,planes); @@ -517,7 +517,7 @@ int stalkWidth; #include #include using namespace cv; -cv::Mat make_obstructionMask(cv::Mat mask){ +cv::Mat make_obstructionMask(const cv::Mat &mask){ //return; cv::Mat out = mask.clone(); int s = mask.size[0]; @@ -533,7 +533,7 @@ cv::Mat make_obstructionMask(cv::Mat mask){ //3D psf -void SimulationsView::make3DPsf(cv::Mat surface){ +void SimulationsView::make3DPsf(const cv::Mat &surface){ int nx = surface.size[0]; int start = nx/2 - nx/4; diff --git a/simulationsview.h b/simulationsview.h index 91e30d89..8daaba0a 100644 --- a/simulationsview.h +++ b/simulationsview.h @@ -60,10 +60,10 @@ class SimulationsView : public QWidget double dX; // pupil sample size based on mirror size in wave front. double dF; // psf sample size; - void mtf(cv::Mat magPsf, QString txt, QColor color); + void mtf(const cv::Mat &magPsf, const QString &txt, QColor color); void initMTFPlot(); - void make3DPsf(cv::Mat surface); + void make3DPsf(const cv::Mat &surface); public slots: void on_MakePB_clicked(); private slots: @@ -76,7 +76,7 @@ private slots: void on_FFTSizeSB_valueChanged(int val); - void showContextMenu(const QPoint &pos); + void showContextMenu(QPoint pos); void saveImage(QString fn = ""); diff --git a/standastigwizard.cpp b/standastigwizard.cpp index c99d8ca0..44a8e416 100644 --- a/standastigwizard.cpp +++ b/standastigwizard.cpp @@ -168,7 +168,7 @@ void define_input::deleteSelected(){ void define_input::changeRotation(){ } -void define_input::showContextMenu(const QPoint &pos) +void define_input::showContextMenu(QPoint pos) { // Handle global position QPoint globalPos = listDisplay->mapToGlobal(pos); diff --git a/standastigwizard.h b/standastigwizard.h index 7201e950..347f2041 100644 --- a/standastigwizard.h +++ b/standastigwizard.h @@ -77,7 +77,7 @@ class rotationDef { public: QString fname; double angle; - rotationDef(QString name, double angle) : + rotationDef(const QString &name, double angle) : fname(name), angle(angle){}; }; @@ -119,7 +119,7 @@ private slots: void browse(); void deleteSelected(); void setBasePath(); - void showContextMenu(const QPoint &pdos); + void showContextMenu(QPoint pdos); void changeRotation(); signals: void computeStandAstig(define_input *,QList); diff --git a/statsview.cpp b/statsview.cpp index 2efcdc20..bc19e68a 100644 --- a/statsview.cpp +++ b/statsview.cpp @@ -216,7 +216,7 @@ void statsView::on_saveImg_clicked() image.save( fName, QFileInfo( fName ).suffix().toLatin1() ); } -QString statsView::title(QString dir){ +QString statsView::title(const QString &dir){ QString title = m_sm->m_wavefronts[0]->name; title = title.left(title.lastIndexOf("/")); diff --git a/statsview.h b/statsview.h index dd2e86d4..f86d4817 100644 --- a/statsview.h +++ b/statsview.h @@ -25,7 +25,7 @@ class statsView : public QDialog QWidget *w1,*w2,*w3; ~statsView(); void replot(); - QString title(QString dir); + QString title(const QString &dir); void getWavefronts(); void sresize(); diff --git a/subtractwavefronatsdlg.cpp b/subtractwavefronatsdlg.cpp index 55eae374..850dbac1 100644 --- a/subtractwavefronatsdlg.cpp +++ b/subtractwavefronatsdlg.cpp @@ -18,7 +18,7 @@ #include "subtractwavefronatsdlg.h" #include "ui_subtractwavefronatsdlg.h" -subtractWavefronatsDlg::subtractWavefronatsDlg(QList list, QWidget *parent) : +subtractWavefronatsDlg::subtractWavefronatsDlg(const QList &list, QWidget *parent) : QDialog(parent), ui(new Ui::subtractWavefronatsDlg) { diff --git a/subtractwavefronatsdlg.h b/subtractwavefronatsdlg.h index 3206722b..9b75d0f0 100644 --- a/subtractwavefronatsdlg.h +++ b/subtractwavefronatsdlg.h @@ -29,7 +29,7 @@ class subtractWavefronatsDlg : public QDialog Q_OBJECT public: - explicit subtractWavefronatsDlg(QList list, QWidget *parent = 0); + explicit subtractWavefronatsDlg(const QList &list, QWidget *parent = 0); ~subtractWavefronatsDlg(); int getSelected(); bool use_null; diff --git a/surfaceanalysistools.cpp b/surfaceanalysistools.cpp index 4fcea51b..76c11646 100644 --- a/surfaceanalysistools.cpp +++ b/surfaceanalysistools.cpp @@ -66,7 +66,7 @@ void surfaceAnalysisTools::enableControls(bool flag){ } -void surfaceAnalysisTools::setBlurText(QString txt){ +void surfaceAnalysisTools::setBlurText(const QString &txt){ ui->blurMm->setText(txt); } @@ -156,7 +156,7 @@ void surfaceAnalysisTools::on_wavefrontList_clicked(const QModelIndex &index) } // this is "right click" on windows -void surfaceAnalysisTools::on_wavefrontList_customContextMenuRequested(const QPoint &pos) +void surfaceAnalysisTools::on_wavefrontList_customContextMenuRequested(QPoint pos) { QListWidgetItem *item = ui->wavefrontList->itemAt(pos); if (item == 0) @@ -243,11 +243,11 @@ void surfaceAnalysisTools::on_SelectNonePB_clicked() { ui->wavefrontList->selectionModel()->reset(); } -void surfaceAnalysisTools::nameChanged(int ndx, QString newname){ +void surfaceAnalysisTools::nameChanged(int ndx, const QString &newname){ ui->wavefrontList->item(ndx)->setText(newname); } -void surfaceAnalysisTools::nameChanged(QString old, QString newname){ +void surfaceAnalysisTools::nameChanged(const QString &old, const QString &newname){ // first look for full length name match QList ql = ui->wavefrontList->findItems(old,Qt::MatchExactly); diff --git a/surfaceanalysistools.h b/surfaceanalysistools.h index 8b823c81..75692884 100644 --- a/surfaceanalysistools.h +++ b/surfaceanalysistools.h @@ -47,8 +47,8 @@ class surfaceAnalysisTools : public QDockWidget bool m_useDefocus; double m_defocus; double m_defocusInmm; - void setBlurText(QString txt); - void nameChanged(int, QString); + void setBlurText(const QString &txt); + void nameChanged(int, const QString&); void select(int item); signals: @@ -73,7 +73,7 @@ public slots: void currentNdxChanged(int); void deleteWaveFront(int); void defocusTimerDone(); - void nameChanged(QString, QString); + void nameChanged(const QString&, const QString&); void defocusControlChanged(double); void enableControls(bool); private slots: @@ -83,7 +83,7 @@ private slots: void on_wavefrontList_activated(const QModelIndex &index); void on_wavefrontList_clicked(const QModelIndex &index); - void on_wavefrontList_customContextMenuRequested(const QPoint &pos); + void on_wavefrontList_customContextMenuRequested(QPoint pos); void on_blurCB_clicked(bool checked); diff --git a/surfacemanager.cpp b/surfacemanager.cpp index 738df583..9bcb05b0 100644 --- a/surfacemanager.cpp +++ b/surfacemanager.cpp @@ -256,7 +256,7 @@ class wftNameScaleDraw: public QwtScaleDraw public: QVector names; int currentNdx; - wftNameScaleDraw(QVector nameList, int nx) + wftNameScaleDraw(const QVector &nameList, int nx) { names = nameList; currentNdx = nx; @@ -302,7 +302,7 @@ class ZernScaleDraw: public QwtScaleDraw { public: QVector m_names; - ZernScaleDraw(QVector names) + ZernScaleDraw(const QVector &names) { m_names = names; @@ -686,7 +686,7 @@ void SurfaceManager::makeMask(wavefront *wf, bool useInsideCircle){ showData("surface manager mask",mask); } -void SurfaceManager::wftNameChanged(int ndx, QString name){ +void SurfaceManager::wftNameChanged(int ndx, const QString &name){ m_wavefronts[ndx]->name = name; } @@ -905,7 +905,7 @@ void SurfaceManager::computeZerns() m_waveFrontTimer->start(500); } -void SurfaceManager::writeWavefront(QString fname, wavefront *wf, bool saveNulled){ +void SurfaceManager::writeWavefront(const QString &fname, wavefront *wf, bool saveNulled){ std::ofstream file((fname.toStdString().c_str())); if (!file.is_open()) { @@ -1029,7 +1029,7 @@ void SurfaceManager::SaveWavefronts(bool saveNulled){ } void SurfaceManager::createSurfaceFromPhaseMap(cv::Mat phase, CircleOutline outside, CircleOutline center, - QString name, QVector > polyArea){ + const QString &name, QVector > polyArea){ wavefront *wf; @@ -1087,7 +1087,7 @@ void SurfaceManager::createSurfaceFromPhaseMap(cv::Mat phase, CircleOutline outs emit showTab(2); } -wavefront * SurfaceManager::readWaveFront(QString fileName){ +wavefront * SurfaceManager::readWaveFront(const QString &fileName){ std::ifstream file(fileName.toStdString().c_str()); if (!file) { QString b = "Can not read file " + fileName + " " +strerror(errno); @@ -1383,7 +1383,7 @@ void SurfaceManager::previous(){ sendSurface(m_wavefronts[m_currentNdx]); } -QVector histo(const std::vector data, int bins, double min, double max){ +QVector histo(const std::vector &data, int bins, double min, double max){ QVector h(bins, 0); double interval = (max - min)/bins; for (unsigned int i = 0; i < data.size(); ++i){ @@ -1627,7 +1627,7 @@ void SurfaceManager::averageComplete(wavefront *wf){ m_surfaceTools->select(m_currentNdx); } -void SurfaceManager::averageWavefrontFiles(QStringList files){ +void SurfaceManager::averageWavefrontFiles(const QStringList &files){ averageWaveFrontFilesDlg dlg(files, this); connect(&dlg, SIGNAL(averageComplete(wavefront*)), this, SLOT(averageComplete(wavefront *))); if (dlg.exec()){ @@ -1807,7 +1807,7 @@ void SurfaceManager::subtractWavefronts(){ } } -void SurfaceManager::transfrom(QList list){ +void SurfaceManager::transfrom(const QList &list){ RotationDlg dlg(list); connect(&dlg, SIGNAL(rotateTheseSig(double, QList)), this, SLOT(rotateThese( double, QList))); dlg.exec(); @@ -1885,7 +1885,7 @@ void SurfaceManager::inspectWavefront(){ #include -void plotlineThruAstigs(QwtPlot *plt, cv::Mat xastig, cv::Mat yastig, QListlist){ +void plotlineThruAstigs(QwtPlot *plt, cv::Mat xastig, cv::Mat yastig, const QList&list){ QList tmplist = list; QList values; @@ -2770,7 +2770,7 @@ void SurfaceManager::showAllContours(){ w->show(); QApplication::restoreOverrideCursor(); } -void showImage(QImage img, QString title){ +void showImage(const QImage &img, const QString &title){ QLabel *myLabel = new QLabel; myLabel->setPixmap(QPixmap::fromImage(img.scaled(1000,1000))); myLabel->setWindowTitle(title); @@ -3216,7 +3216,7 @@ void SurfaceManager::flipHorizontal(){ } QApplication::restoreOverrideCursor(); } -bool QPointFLessThan(const QPointF &p1, const QPointF & p2){ +bool QPointFLessThan(QPointF p1, QPointF p2){ return p1.x() < p2.x(); } diff --git a/surfacemanager.h b/surfacemanager.h index c1182160..d4cf1cc7 100644 --- a/surfacemanager.h +++ b/surfacemanager.h @@ -70,14 +70,14 @@ class SurfaceManager : public QObject void processSmoothing(); void saveAllWaveFrontStats(); void SaveWavefronts(bool saveNulled); - void writeWavefront(QString fname, wavefront *wf, bool saveNulled); + void writeWavefront(const QString &fname, wavefront *wf, bool saveNulled); void useDemoWaveFront(); void showUnwrap(); void initWaveFrontLoad(); - void averageWavefrontFiles(QStringList files); + void averageWavefrontFiles(const QStringList &files); void downSizeWf(wavefront *wf); void process(int wavefront_index, SurfaceManager *sm); - wavefront *readWaveFront(QString fileName); + wavefront *readWaveFront(const QString &fileName); inline wavefront *getCurrent(){ if (m_wavefronts.size() == 0) return 0; @@ -160,7 +160,7 @@ private slots: void backGroundUpdate(); void deleteWaveFronts(QList list); void average(QList list); - void transfrom(QList list); + void transfrom(const QList &list); void filter(); void saveAllContours(); void enableTools(); @@ -179,10 +179,10 @@ private slots: public slots: void rotateThese(double angle, QList list); void createSurfaceFromPhaseMap(cv::Mat phase, CircleOutline outside, - CircleOutline center, QString name, + CircleOutline center, const QString &name, QVector > polyArea= QVector >()); void invert(QList list); - void wftNameChanged(int, QString); + void wftNameChanged(int, const QString&); void showAllContours(); void computeStandAstig(define_input *wizPage, QList); void ObstructionChanged(); diff --git a/utilil.cpp b/utilil.cpp index bb774742..0a2fa633 100644 --- a/utilil.cpp +++ b/utilil.cpp @@ -5,7 +5,7 @@ #define WIDTH 12 #define DIV 1048576ull -long showmem(QString /*title*/){ +long showmem(const QString & /*title*/){ //qDebug () << title; MEMORYSTATUSEX statex; @@ -28,5 +28,5 @@ long showmem(QString /*title*/){ return statex.ullAvailVirtual/DIV; } #else -int showmem(QString){return 1000;} +int showmem(const QString&){return 1000;} #endif diff --git a/utils.h b/utils.h index 0b0c124b..900f0d47 100644 --- a/utils.h +++ b/utils.h @@ -1,5 +1,5 @@ #ifndef UTILS_H #define UTILS_H -int showmem(QString title = ""); +int showmem(const QString &title = ""); extern double outputLambda; #endif // UTILS_H diff --git a/videosetupdlg.cpp b/videosetupdlg.cpp index 2368d70b..8c50b589 100644 --- a/videosetupdlg.cpp +++ b/videosetupdlg.cpp @@ -1,7 +1,7 @@ #include "videosetupdlg.h" #include "ui_videosetupdlg.h" #include -videoSetupDlg::videoSetupDlg(QImage img, QWidget *parent) : +videoSetupDlg::videoSetupDlg(const QImage &img, QWidget *parent) : QDialog(parent), ui(new Ui::videoSetupDlg) { diff --git a/videosetupdlg.h b/videosetupdlg.h index c2ef18a7..dee37456 100644 --- a/videosetupdlg.h +++ b/videosetupdlg.h @@ -13,7 +13,7 @@ class videoSetupDlg : public QDialog Q_OBJECT public: - explicit videoSetupDlg(QImage img, QWidget *parent = 0); + explicit videoSetupDlg(const QImage &img, QWidget *parent = 0); ~videoSetupDlg(); QImage m_img; int fps(); diff --git a/wavefrontfilterdlg.cpp b/wavefrontfilterdlg.cpp index b6a135f6..cfa82797 100644 --- a/wavefrontfilterdlg.cpp +++ b/wavefrontfilterdlg.cpp @@ -24,7 +24,7 @@ wavefrontFilterDlg::~wavefrontFilterDlg() { delete ui; } -void wavefrontFilterDlg::waveSelected(QString w){ +void wavefrontFilterDlg::waveSelected(const QString &w){ emit waveWasSelected(w); } void wavefrontFilterDlg::setRemoveFileMode(){ @@ -46,10 +46,10 @@ void wavefrontFilterDlg::on_rmsValue_valueChanged(double arg1) QSettings set; set.setValue("filterRMS", arg1); } -void wavefrontFilterDlg::addAstigValue(QString name, QPointF value){ +void wavefrontFilterDlg::addAstigValue(const QString &name, QPointF value){ ui->astigPlot->addValue(name,value); } -void wavefrontFilterDlg::addRMSValue(QString name, QPointF value){ +void wavefrontFilterDlg::addRMSValue(const QString &name, QPointF value){ ui->rmSPlot->addValue(name, value); } void wavefrontFilterDlg::plot(){ diff --git a/wavefrontfilterdlg.h b/wavefrontfilterdlg.h index b0c4ec19..925152dd 100644 --- a/wavefrontfilterdlg.h +++ b/wavefrontfilterdlg.h @@ -17,15 +17,15 @@ class wavefrontFilterDlg : public QDialog bool shouldFilterWavefront(); bool shouldFilterFile(); double rms(); - void addRMSValue(QString name, QPointF value ); - void addAstigValue(QString name, QPointF value); + void addRMSValue(const QString &name, QPointF value ); + void addAstigValue(const QString &name, QPointF value); void plot(); void setRemoveFileMode(); signals: void waveWasSelected(QString m); private slots: void on_rmsValue_valueChanged(double arg1); - void waveSelected(QString m); + void waveSelected(const QString &m); void on_beepEnable_clicked(bool checked); void on_remove_clicked(bool checked); diff --git a/wavefrontloader.cpp b/wavefrontloader.cpp index 1216a918..5a0101bc 100644 --- a/wavefrontloader.cpp +++ b/wavefrontloader.cpp @@ -27,7 +27,7 @@ waveFrontLoader::waveFrontLoader(QObject *parent) : connect(this, SIGNAL(currentWavefront(QString)), pd, SLOT(setLabelText(QString))); } -void waveFrontLoader::addWavefront(QString filename){ +void waveFrontLoader::addWavefront(const QString &filename){ mutex.lock(); m_list << filename; mutex.unlock(); @@ -38,7 +38,7 @@ void waveFrontLoader::cancel(){ qDebug() << "trying to cancel"; } -void waveFrontLoader::loadx(QStringList list, SurfaceManager *sm){ +void waveFrontLoader::loadx(const QStringList &list, SurfaceManager *sm){ m_list = list; loadx(sm); } diff --git a/wavefrontloader.h b/wavefrontloader.h index 4599037a..dc0474d1 100644 --- a/wavefrontloader.h +++ b/wavefrontloader.h @@ -29,7 +29,7 @@ class waveFrontLoader : public QObject Q_OBJECT public: explicit waveFrontLoader(QObject *parent = 0); - void addWavefront(QString filename); + void addWavefront(const QString &filename); bool done; signals: void status(int); @@ -42,7 +42,7 @@ class waveFrontLoader : public QObject public slots: void loadx(SurfaceManager *sm); - void loadx(QStringList list, SurfaceManager *sm); + void loadx(const QStringList &list, SurfaceManager *sm); void cancel(); diff --git a/wftstats.cpp b/wftstats.cpp index 70dbca64..c09305be 100644 --- a/wftstats.cpp +++ b/wftstats.cpp @@ -77,7 +77,7 @@ class ZernScaleDraw: public QwtScaleDraw { public: QVector m_names; - ZernScaleDraw(QVector names) + ZernScaleDraw(const QVector &names) { m_names = names; @@ -182,7 +182,7 @@ void wftStats::computeZernStats( int ndx){ } } -QVector histoz(const std::vector data, int bins, double min, double max){ +QVector histoz(const std::vector &data, int bins, double min, double max){ QVector h(bins, 0); double interval = (max - min)/bins; for (unsigned int i = 0; i < data.size(); ++i){ @@ -233,7 +233,7 @@ void wftStats::computeWftStats( QVector wavefronts, int ndx){ } double histInterval ; -QVector histox(const std::vector data, int bins){ +QVector histox(const std::vector &data, int bins){ QVector h(bins, 0); for (unsigned int i = 0; i < data.size(); ++i){ diff --git a/zernikedlg.cpp b/zernikedlg.cpp index 752b8b2a..b95416b4 100644 --- a/zernikedlg.cpp +++ b/zernikedlg.cpp @@ -38,7 +38,7 @@ ZernTableModel::ZernTableModel(QObject *parent, std::vector *enables, bool } -void ZernTableModel::setValues(std::vector vals, bool nulled){ +void ZernTableModel::setValues(const std::vector &vals, bool nulled){ m_nulled = nulled; values = vals; m_enables->resize(vals.size(),true); diff --git a/zernikedlg.h b/zernikedlg.h index f4e78c72..c636aa21 100644 --- a/zernikedlg.h +++ b/zernikedlg.h @@ -43,7 +43,7 @@ class ZernTableModel : public QAbstractTableModel int columnCount(const QModelIndex &parent = QModelIndex()) const; void resizeRows(const int rowCnt); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - void setValues(std::vector vals, bool nulled); + void setValues(const std::vector &vals, bool nulled); bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); Qt::ItemFlags flags(const QModelIndex & index) const ; QVariant headerData(int section, Qt::Orientation orientation, int role) const; diff --git a/zernikeprocess.cpp b/zernikeprocess.cpp index f2f558ef..d6ea4a52 100644 --- a/zernikeprocess.cpp +++ b/zernikeprocess.cpp @@ -1212,7 +1212,7 @@ std::vector zernikeProcess::ZernFitWavefront(wavefront &wf){ } //debug routine to see what is matrix values. -void dumpArma(arma::mat mm, QString title, QVector colHeading, QVector RowLable){ +void dumpArma(const arma::mat &mm, const QString &title, QVector colHeading, QVector RowLable){ arma::mat theMat = mm; QString transposed(" "); diff --git a/zernikeprocess.h b/zernikeprocess.h index 44433a96..f01d570f 100644 --- a/zernikeprocess.h +++ b/zernikeprocess.h @@ -32,7 +32,7 @@ extern std::vector zernEnables; //void gauss_jordan(int n, double* Am, double* Bm); -void dumpArma(arma::mat mm, QString title = "", +void dumpArma(const arma::mat &mm, const QString &title = "", QVector colHeading = QVector(0), QVector RowLable = QVector(0));