Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dftcolormap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

****************************************************************************/
#include "dftcolormap.h"
#include <QDebug>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <QDebug>

QList<colorStop> dftColorMap::userStops;

void dftColorMap::setUserStops(QList<colorStop> &stops) {
Expand Down
4 changes: 2 additions & 2 deletions intensityplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <qwt_scale_draw.h>
#include "opencv2/opencv.hpp"

#define PITORAD M_PI/180.
#define DEGTORAD M_PI/180.
static double i_angle;

class iSurfaceData: public QwtSyntheticPointData
Expand Down Expand Up @@ -154,7 +154,7 @@ intensityPlot::intensityPlot(QWidget *parent):


void intensityPlot::angleChanged(double a){
i_angle = (a * PITORAD - M_PI_2);
i_angle = (a * DEGTORAD - M_PI_2);
replot();
}

Expand Down
26 changes: 13 additions & 13 deletions profileplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ extern double outputLambda;
#include <fstream>
#include <cmath>
#include "percentcorrectiondlg.h"
#define PITORAD M_PI/180.;
double g_angle = 270. * PITORAD; //start at 90 deg (pointing east)
#define DEGTORAD M_PI/180.;
double g_angle = 270. * DEGTORAD; //start at 90 deg (pointing east)
double y_offset = 0.;


Expand All @@ -76,7 +76,7 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools):
m_defocus_mode = false;
m_plot = new QwtPlot(this);
new profilePlotPicker(m_plot);
type = 0;
type = ProfileType::SHOW_ONE;
QHBoxLayout * l1 = new QHBoxLayout();
QVBoxLayout *v1 = new QVBoxLayout();
showNmCB = new QCheckBox("Show in Nanometers",this);
Expand Down Expand Up @@ -237,18 +237,18 @@ void ProfilePlot::showSurface(bool flag){
}

void ProfilePlot::showOne(){
type = 0;
type = ProfileType::SHOW_ONE;
m_pcdlg->close();
populate();
m_plot->replot();
}
void ProfilePlot::show16(){
type = 1;
type = ProfileType::SHOW_16;
populate();
m_plot->replot();
}
void ProfilePlot::showAll(){
type = 2;
type = ProfileType::SHOW_ALL;
m_pcdlg->close();
populate();
m_plot->replot();
Expand Down Expand Up @@ -282,12 +282,12 @@ void ProfilePlot::newDisplayErrorRange(double min, double max){
void ProfilePlot::angleChanged(double a){
if (m_wf == 0)
return;
g_angle = a * PITORAD;
g_angle = a * DEGTORAD;

if (type == 2 || type == 0)
if (type == ProfileType::SHOW_ONE || type == ProfileType::SHOW_ALL)
populate();
m_plot->replot();
emit profileAngleChanged(M_2_PI - g_angle +M_PI/4.);
emit profileAngleChanged(M_PI_2 - g_angle);
}
void ProfilePlot::wheelEvent(QWheelEvent *event)
{
Expand Down Expand Up @@ -442,7 +442,7 @@ QPolygonF ProfilePlot::createProfile(double units, wavefront *wf, bool allowOffs
//else points << QPointF(radx,0.0);
}

if (m_showSlopeError && ((type==1) || (type == 0) || (type == 2))){
if (m_showSlopeError){
double arcsecLimit = (slopeLimitArcSec/3600) * M_PI/180;
double xDel = points[0].x() - points[1].x();
double hDelLimit =m_showNm * m_showSurface * ((outputLambda/m_wf->lambda)*fabs(xDel * tan(arcsecLimit)) /(outputLambda * 1.e-6));
Expand Down Expand Up @@ -563,7 +563,7 @@ void ProfilePlot::populate()


switch (type) {
case 0:{ // show one
case ProfileType::SHOW_ONE:{
QStringList path = wfs->at(0)->name.split("/");
QString name;
int l = path.length();
Expand All @@ -585,7 +585,7 @@ void ProfilePlot::populate()
break;
}

case 1: { // show 16 diameters
case ProfileType::SHOW_16: {

surfaceAnalysisTools *saTools = surfaceAnalysisTools::get_Instance();
QList<int> list = saTools->SelectedWaveFronts();
Expand Down Expand Up @@ -660,7 +660,7 @@ void ProfilePlot::populate()

break;
}
case 2:{ // show each wave front
case ProfileType::SHOW_ALL:{

m_plot->insertLegend( new QwtLegend() , QwtPlot::BottomLegend);
surfaceAnalysisTools *saTools = surfaceAnalysisTools::get_Instance();
Expand Down
8 changes: 6 additions & 2 deletions profileplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ProfilePlot : public QWidget
QRadioButton *OneOnly;
QRadioButton *Show16;
QRadioButton *ShowAll;
int type;
double m_showSurface;
double m_showNm;
bool zoomed;
Expand Down Expand Up @@ -91,6 +90,11 @@ public slots:
void make_correction_graph();
//QPolygonF createZernProfile(wavefront *wf);
private:
enum class ProfileType {
SHOW_ONE = 0,
SHOW_16 = 1,
SHOW_ALL = 2
};

void updateGradient();
bool dragging;
Expand All @@ -101,8 +105,8 @@ public slots:
QPushButton *showPercentCorrection;
QDoubleSpinBox *slopeLimitSB;
double m_defocusValue;
ProfileType type;

private:
Ui::ProfilePlot *ui;
bool m_defocus_mode;
cv::Mat_<double> m_defocus_wavefront;
Expand Down
6 changes: 5 additions & 1 deletion psiphasedisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#include <qpainter.h>
#include <QScreen>
#include <QDebug>
#define M_PI 3.14159265358979323846

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

PSIphaseDisplay::PSIphaseDisplay(QVector<double> phases,QWidget *parent) :
QDialog(parent),
ui(new Ui::PSIphaseDisplay),m_useRadians(false)
Expand Down
Loading