Skip to content

Commit 583b611

Browse files
authored
Merge pull request #220 from atsju/JST/slicingKISS
refactor to simplify and avoid slicing risk
2 parents 00fa9fd + 66be3d3 commit 583b611

File tree

11 files changed

+212
-341
lines changed

11 files changed

+212
-341
lines changed

Circleoutline.h

Lines changed: 19 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -18,82 +18,34 @@
1818
#ifndef CIRCLEOUTLINE_H
1919
#define CIRCLEOUTLINE_H
2020

21-
22-
#include "boundary.h"
23-
#include "gplus.h"
24-
#include <QVector>
21+
#include <QJsonObject>
22+
#include <QPainter>
2523
#include <QPointF>
24+
#include <QVector>
2625
#include <opencv2/opencv.hpp>
27-
#include <QJsonObject>
28-
void fillCircle(cv::Mat &m, double cx, double cy, double rad, void *color);
29-
class CircleOutline: public boundary
30-
{
31-
public:
32-
CircleOutline();
33-
CircleOutline(QPointF center, double rad);
34-
CircleOutline(QPointF p1, QPointF p2);
35-
CircleOutline(const QJsonObject &obj);
36-
void toJson(QJsonObject &obj);
3726

38-
virtual ~CircleOutline();
39-
void draw(QPainter& painter, double scale, double scale2 = -1.);
40-
bool isInside(QPointF& p , int offset = 0);
41-
bool isInside(double x, double y, int offset=0);
42-
void enlarge(int del);
43-
void translate(QPointF del);
44-
void scale(double factor);
45-
QVector<QPointF> makeCircleofPoints(int cnt);
46-
bool isValid();
47-
QPointF m_center;
48-
double m_radius;
49-
gPlus m_p1;
50-
gPlus m_p2;
51-
protected:
27+
void fillCircle(cv::Mat &m, double cx, double cy, double rad, void *color);
5228

53-
private:
54-
};
29+
class CircleOutline {
30+
public:
31+
CircleOutline();
32+
CircleOutline(QPointF center, double rad);
33+
CircleOutline(QPointF p1, QPointF p2);
34+
CircleOutline(const QJsonObject &obj);
35+
~CircleOutline() = default;
5536

56-
class ellipseOutline: public boundary
57-
{
58-
public:
59-
ellipseOutline();
60-
ellipseOutline(QPointF center, double minorAxis, double majorAxis);
61-
ellipseOutline(QPointF left, QPointF right, double ecc);
62-
bool isInside(QPointF& p , int offset = 0);
63-
void enlarge(int del);
6437
void translate(QPointF del);
6538
void scale(double factor);
66-
67-
6839
bool isValid();
69-
QPointF m_center;
70-
double m_minor;
71-
double m_major;
72-
double m_left;
73-
double m_right;
74-
double e;
75-
gPlus m_p1;
76-
gPlus m_p2;
77-
};
78-
79-
class rectangleOutline: public boundary
80-
{
81-
public:
82-
rectangleOutline();
83-
rectangleOutline(QPointF upperLeft, QPointF lowerRight);
84-
bool isInside(QPointF& p , int offset = 0);
40+
void draw(QPainter &painter, double scale, double scale2 = -1.);
41+
QVector<QPointF> makeCircleofPoints(int cnt);
8542
void enlarge(int del);
86-
void translate(QPointF del);
87-
void scale(double factor);
88-
bool isValid();
89-
QPointF m_upperLeft;
90-
QPointF m_lowerRight;
91-
gPlus m_p1;
92-
gPlus m_p2;
93-
};
94-
QDataStream & operator<<(QDataStream & stream, const ellipseOutline &outline);
95-
QDataStream & operator<<(QDataStream & stream, const CircleOutline &outline);
96-
QDataStream & operator<<(QDataStream & stream, const rectangleOutline &outline);
43+
void toJson(QJsonObject &obj);
9744

45+
QPointF m_center;
46+
double m_radius;
47+
QPointF m_p1;
48+
QPointF m_p2;
49+
};
9850

9951
#endif // CIRCLEOUTLINE_H

DFTFringe.pro

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ SOURCES += SingleApplication/singleapplication.cpp \
181181
filteroutlinesdlg.cpp \
182182
foucaultview.cpp \
183183
generatetargetdlg.cpp \
184-
gplus.cpp \
185184
graphicsutilities.cpp \
186185
helpdlg.cpp \
187186
hotkeysdlg.cpp \
@@ -282,7 +281,6 @@ HEADERS += bezier/bezier.h \
282281
averagewavefrontfilesdlg.h \
283282
batchigramwizard.h \
284283
bathastigdlg.h \
285-
boundary.h \
286284
camcalibrationreviewdlg.h \
287285
cameracalibwizard.h \
288286
camwizardpage1.h \
@@ -308,7 +306,6 @@ HEADERS += bezier/bezier.h \
308306
filteroutlinesdlg.h \
309307
foucaultview.h \
310308
generatetargetdlg.h \
311-
gplus.h \
312309
graphicsutilities.h \
313310
helpdlg.h \
314311
hotkeysdlg.h \

DFTFringe_Dale.pro

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ SOURCES += main.cpp \
3838
mainwindow.cpp \
3939
igramarea.cpp \
4040
circleoutline.cpp \
41-
gplus.cpp \
4241
graphicsutilities.cpp \
4342
dfttools.cpp \
4443
dftarea.cpp \
@@ -160,7 +159,6 @@ HEADERS += mainwindow.h \
160159
edgeplot.h \
161160
IgramArea.h \
162161
circleoutline.h \
163-
gplus.h \
164162
graphicsutilities.h \
165163
dfttools.h \
166164
dftarea.h \
@@ -243,7 +241,6 @@ HEADERS += mainwindow.h \
243241
unwraperrorsview.h \
244242
lensdialog.h \
245243
messagereceiver.h \
246-
boundary.h \
247244
myutils.h \
248245
pixelstats.h \
249246
utils.h \

DFTFringe_QT5.pro

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ SOURCES += SingleApplication/singleapplication.cpp \
180180
filteroutlinesdlg.cpp \
181181
foucaultview.cpp \
182182
generatetargetdlg.cpp \
183-
gplus.cpp \
184183
graphicsutilities.cpp \
185184
helpdlg.cpp \
186185
hotkeysdlg.cpp \
@@ -281,7 +280,6 @@ HEADERS += bezier/bezier.h \
281280
averagewavefrontfilesdlg.h \
282281
batchigramwizard.h \
283282
bathastigdlg.h \
284-
boundary.h \
285283
camcalibrationreviewdlg.h \
286284
cameracalibwizard.h \
287285
camwizardpage1.h \
@@ -307,7 +305,6 @@ HEADERS += bezier/bezier.h \
307305
filteroutlinesdlg.h \
308306
foucaultview.h \
309307
generatetargetdlg.h \
310-
gplus.h \
311308
graphicsutilities.h \
312309
helpdlg.h \
313310
hotkeysdlg.h \

boundary.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)