Skip to content

Commit adb3e49

Browse files
committed
Version 2.1.
1 parent 3f3bf82 commit adb3e49

27 files changed

+1065
-167
lines changed

DFTFringe.pro

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ SOURCES += main.cpp\
111111
myplotpicker.cpp \
112112
testplotclass.cpp \
113113
rmsplot.cpp \
114-
regionedittools.cpp
114+
regionedittools.cpp \
115+
reportdlg.cpp \
116+
videosetupdlg.cpp
115117
punwrap.cpp
116118

117119
HEADERS += mainwindow.h \
@@ -206,7 +208,9 @@ HEADERS += mainwindow.h \
206208
myplotpicker.h \
207209
testplotclass.h \
208210
rmsplot.h \
209-
regionedittools.h
211+
regionedittools.h \
212+
reportdlg.h \
213+
videosetupdlg.h
210214
FORMS += mainwindow.ui \
211215
dfttools.ui \
212216
dftarea.ui \
@@ -266,7 +270,9 @@ FORMS += mainwindow.ui \
266270
astigstatsdlg.ui \
267271
averagewavefrontfilesdlg.ui \
268272
wavefrontfilterdlg.ui \
269-
regionedittools.ui
273+
regionedittools.ui \
274+
reportdlg.ui \
275+
videosetupdlg.ui
270276

271277
win32 {
272278
CONFIG( debug, debug|release ) {
@@ -304,7 +310,7 @@ RC_FILE = DFTFringe.rc
304310
QMAKE_CXXFLAGS += -std=c++11
305311

306312
# The application version
307-
VERSION = 2.0
313+
VERSION = 2.1
308314

309315
# Define the preprocessor macro to get the application version in our application.
310316
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

RevisionHistory.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,15 @@
132132
<li>Fixed rotation issues and center hole issues.</li>
133133
<li>Added width and height of wavefront to contour plot title.</li>
134134
<li>Added width and height values to status bar when wavefront is selected.</li>
135+
</ul></ul>
136+
<ul><li>Version 2.1</li>
137+
<ul><li>Fixed problems created by 2.0 when rotating, averaging, and writing wavefronts</li>
138+
<li>Added save 3d image and 3d Video creation</li>
139+
<li>Added options to report and added astig polar value to report</li>
140+
<li>Made contour settings also apply to the show all contours function.</li>
141+
<li>Imporved offset values for Ronchi and Foucault simulations.</li>
142+
<li>Corrected size of simulated interferogram to match requested size.</li>
143+
<li>Changed gaussian blur to not cross mirror outline thus better preserving the edge of the mirror</li>
144+
135145
</ul></ul>
136146
<ul>

circleoutline.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,33 @@ CircleOutline::CircleOutline()
5151
}
5252

5353
CircleOutline::~CircleOutline(){}
54+
bool CircleOutline::isInside(double x, double y, int offset)
55+
{
56+
double x1,y1;
57+
x1 = (x+.5) - m_center.x();
58+
y1 = (y+.5) - m_center.y();
59+
return (sqrt(x1 * x1 + y1 * y1) <= (m_radius-offset));
60+
}
61+
62+
void fillCircle(cv::Mat &m, double cx, double cy, double rad, void* color){
63+
//Size size = m.size();
64+
size_t step = m.step;
65+
int pix_size = (int)m.elemSize();
66+
uchar* ptr = m.ptr();
67+
68+
#define ICV_PUT_POINT( ptr, x ) \
69+
memcpy( ptr + (x)*pix_size, color, pix_size );
70+
71+
for (int y = 0; y < m.rows; ++y){
72+
uchar *tptr0 = ptr + y * step;
73+
for (int x = 0; x < m.cols; ++x){
74+
double dx = (double)(x - cx)/(rad);
75+
double dy = (double)(y - cy)/(rad);
76+
if (sqrt(dx * dx + dy * dy) <= 1.)
77+
ICV_PUT_POINT(tptr0, x);
78+
}
79+
}
80+
}
5481

5582
bool CircleOutline::isInside(QPointF& p, int offset)
5683
{

circleoutline.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
#include "gplus.h"
2424
#include <QVector>
2525
#include <QPointF>
26-
26+
#include <opencv/cv.h>
27+
void fillCircle(cv::Mat &m, double cx, double cy, double rad, void *color);
2728
class CircleOutline: public boundary
2829
{
2930
public:
@@ -33,6 +34,7 @@ class CircleOutline: public boundary
3334
virtual ~CircleOutline();
3435
void draw(QPainter& painter, double scale, double scale2 = -1.);
3536
bool isInside(QPointF& p , int offset = 0);
37+
bool isInside(double x, double y, int offset=0);
3638
void enlarge(int del);
3739
void translate(QPointF del);
3840
void scale(double factor);

contourplot.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ void ContourPlot::setSurface(wavefront * wf) {
225225
applyZeroOffset(false);
226226

227227
setZRange();
228-
229-
230-
231228
QwtScaleWidget *rightAxis = axisWidget( QwtPlot::yRight );
232229
rightAxis->setTitle(tr( "wavefront error at 550nm") );
233230
rightAxis->setColorBarEnabled( true );
@@ -260,10 +257,13 @@ void ContourPlot::setSurface(wavefront * wf) {
260257
//resize(QSize(width()-1,height()-1));
261258
//resize(QSize(width()+1,height()+1));
262259
}
263-
260+
double ContourPlot::m_waveRange;
261+
bool ContourPlot::m_useMiddleOffset = true;
262+
int ContourPlot::m_colorMapNdx = 0;
263+
QString ContourPlot::m_zRangeMode("Auto");
264+
double ContourPlot::m_zOffset = 0.;
264265
ContourPlot::ContourPlot( QWidget *parent, ContourTools *tools, bool minimal ):
265-
QwtPlot( parent ),m_wf(0),m_tools(tools), m_useMiddleOffset(true),m_colorMapNdx(0)
266-
,m_zRangeMode("Auto"), m_autoInterval(false),m_minimal(minimal),m_contourPen(Qt::white)
266+
QwtPlot( parent ),m_wf(0),m_tools(tools), m_autoInterval(false),m_minimal(minimal),m_contourPen(Qt::white)
267267
{
268268
d_spectrogram = new QwtPlotSpectrogram();
269269
QSettings settings;

contourplot.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class ContourPlot: public QwtPlot
4444

4545
wavefront* m_wf;
4646
ContourTools *m_tools;
47-
bool m_useMiddleOffset;
48-
int m_colorMapNdx;
49-
double m_zOffset;
50-
double m_waveRange;
47+
static bool m_useMiddleOffset;
48+
static int m_colorMapNdx;
49+
static double m_zOffset;
50+
static double m_waveRange;
5151
double contourRange;
52-
QString m_zRangeMode;
52+
static QString m_zRangeMode;
5353
ContourPlot(QWidget * = NULL, ContourTools *tools = 0, bool minimal = false);
5454
void setSurface(wavefront * mat);
5555
void applyZeroOffset(bool useMiddle);

foucaultview.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ void foucaultView::on_makePb_clicked()
141141

142142
double pixels_per_thou = .001 / pixwidth;
143143

144-
qDebug()<<"fouc" << pixels_per_thou << pixwidth << pad << size;
145144
double slitWidthHalf = pixels_per_thou * ui->slitWidthSb->value() * 1000 * ((ui->useMM->isChecked()) ? 1./25.4 : 1.);
146145
if (slitWidthHalf < .75){
147146
QString msg = QString().sprintf("warning the slit width of %6.5lf may too small. Using one pixel slit instead", ui->slitWidthSb->value());
@@ -388,7 +387,8 @@ void foucaultView::on_rocOffsetSlider_valueChanged(int value)
388387

389388
}
390389
inline double foucaultView::getStep(){
391-
return (ui->autoStepSize->isChecked())? round(100. * ((ui->useMM->isChecked()) ? 25.4 * m_sag/40. : m_sag/40.))/100. : ui->rocStepSize->value();
390+
return (ui->autoStepSize->isChecked())? round(1000. * ((ui->useMM->isChecked()) ? 25.4 * m_sag/5. : m_sag/5.))/1000. :
391+
ui->rocStepSize->value();
392392
}
393393

394394
void foucaultView::on_clearCenterCb_clicked()
@@ -402,6 +402,9 @@ void foucaultView::on_autoStepSize_clicked(bool checked)
402402
ui->rocStepSize->setEnabled(!checked);
403403

404404
double step = getStep();
405+
ui->rocStepSize->setValue(step);
406+
407+
405408
for (int i = 0; i< 17; ++i){
406409
double val = (i - 8) * step * 5;
407410
findChild<QLabel *>(QString().sprintf("l%d",i))->setText(QString::number(val));

glwidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ GLWidget::GLWidget(QWidget *parent, ContourTools* tools, surfaceAnalysisTools* s
4444
m_flip_y_view(false),
4545
m_flip_x_view(false)
4646
{
47+
m_spinRate = 5;
4748
QSettings set;
4849
m_background = QColor(set.value("oglBackground", "black").toString());
4950
//====== Initial lighting params
@@ -89,13 +90,19 @@ GLWidget::GLWidget(QWidget *parent, ContourTools* tools, surfaceAnalysisTools* s
8990
connect(m_tools, SIGNAL(newDisplayErrorRange(double,double)),
9091
this, SLOT(setMinMaxValues(double,double)));
9192
connect(tools, SIGNAL(contourColorRangeChanged(QString)), SLOT(contourColorRangeChanged(QString)));
93+
connect(&aniTimer, SIGNAL(timeout()),this, SLOT(updateAni()));
9294
}
9395

9496
GLWidget::~GLWidget()
9597
{
9698
makeCurrent();
9799
}
98100

101+
void GLWidget::updateAni(){
102+
setYRotation(yRot + m_spinRate);
103+
aniTimer.start(10);
104+
}
105+
99106
void GLWidget::setBackground(QColor c){
100107
m_background = c;
101108
QSettings set;

glwidget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "surfaceanalysistools.h"
3131
#include "surfacepropertiesdlg.h"
3232
#define RADIUS 400
33+
#include <Qtimer>
3334
class CQuad
3435
{
3536
public:
@@ -76,9 +77,12 @@ class GLWidget : public QGLWidget
7677
int m_blue;
7778
QCheckBox FillCB;
7879
QColor m_background;
80+
QTimer aniTimer;
7981
void setBackground(QColor c);
82+
int m_spinRate;
8083

8184
public slots:
85+
void updateAni();
8286
void setXRotation(int angle);
8387
void setYRotation(int angle);
8488
void setZRotation(int angle);

igramarea.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ void IgramArea::DrawSimIgram(void){
152152
return;
153153
QApplication::setOverrideCursor(Qt::WaitCursor);
154154
//m_demo->hide();
155-
int wx = dlg.size;
155+
int border = 20;
156+
int wx = dlg.size + 2 * border;
156157
double xcen = (double)(wx-1)/2.;
157158
double ycen = (double)(wx-1)/2.;
158-
int border = 20;
159+
159160
double rad = xcen-border;
160161
cv::Mat simgram = makeSurfaceFromZerns(border, true);
161162
//cv::imshow("igram", simgram);

0 commit comments

Comments
 (0)