|
1 | | -/****************************************************************************** |
2 | | -** |
3 | | -** Copyright 2016 Dale Eason |
4 | | -** This file is part of DFTFringe |
5 | | -** is free software: you can redistribute it and/or modify |
6 | | -** it under the terms of the GNU General Public License as published by |
7 | | -** the Free Software Foundation version 3 of the License |
8 | | -
|
9 | | -** DFTFringe is distributed in the hope that it will be useful, |
10 | | -** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | | -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | | -** GNU General Public License for more details. |
13 | | -** |
14 | | -** You should have received a copy of the GNU General Public License |
15 | | -** along with DFTFringe. If not, see <http://www.gnu.org/licenses/>. |
16 | | -
|
17 | | -****************************************************************************/ |
18 | | -#ifndef CIRCLEOUTLINE_H |
19 | | -#define CIRCLEOUTLINE_H |
20 | | - |
21 | | - |
22 | | -#include "boundary.h" |
23 | | -#include "gplus.h" |
24 | | -#include <QVector> |
25 | | -#include <QPointF> |
| 1 | +/****************************************************************************** |
| 2 | +** |
| 3 | +** Copyright 2016 Dale Eason |
| 4 | +** This file is part of DFTFringe |
| 5 | +** is free software: you can redistribute it and/or modify |
| 6 | +** it under the terms of the GNU General Public License as published by |
| 7 | +** the Free Software Foundation version 3 of the License |
| 8 | +
|
| 9 | +** DFTFringe is distributed in the hope that it will be useful, |
| 10 | +** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +** GNU General Public License for more details. |
| 13 | +** |
| 14 | +** You should have received a copy of the GNU General Public License |
| 15 | +** along with DFTFringe. If not, see <http://www.gnu.org/licenses/>. |
| 16 | +
|
| 17 | +****************************************************************************/ |
| 18 | +#ifndef CIRCLEOUTLINE_H |
| 19 | +#define CIRCLEOUTLINE_H |
| 20 | + |
| 21 | + |
| 22 | +#include "boundary.h" |
| 23 | +#include "gplus.h" |
| 24 | +#include <QVector> |
| 25 | +#include <QPointF> |
26 | 26 | #include <opencv2/opencv.hpp> |
27 | | -void fillCircle(cv::Mat &m, double cx, double cy, double rad, void *color); |
28 | | -class CircleOutline: public boundary |
29 | | -{ |
30 | | - public: |
31 | | - CircleOutline(); |
32 | | - CircleOutline(QPointF center, double rad); |
33 | | - CircleOutline(QPointF p1, QPointF p2); |
34 | | - virtual ~CircleOutline(); |
35 | | - void draw(QPainter& painter, double scale, double scale2 = -1.); |
36 | | - bool isInside(QPointF& p , int offset = 0); |
37 | | - bool isInside(double x, double y, int offset=0); |
38 | | - void enlarge(int del); |
39 | | - void translate(QPointF del); |
40 | | - void scale(double factor); |
41 | | - QVector<QPointF> makeCircleofPoints(int cnt); |
42 | | - bool isValid(); |
43 | | - QPointF m_center; |
44 | | - double m_radius; |
45 | | - gPlus m_p1; |
46 | | - gPlus m_p2; |
47 | | - protected: |
48 | | - |
49 | | - private: |
50 | | -}; |
51 | | - |
52 | | -class ellipseOutline: public boundary |
53 | | -{ |
54 | | -public: |
55 | | - ellipseOutline(); |
56 | | - ellipseOutline(QPointF center, double minorAxis, double majorAxis); |
57 | | - ellipseOutline(QPointF left, QPointF right, double ecc); |
58 | | - void draw(QPainter& painter, double scale); |
59 | | - bool isInside(QPointF& p , int offset = 0); |
60 | | - void enlarge(int del); |
61 | | - void translate(QPointF del); |
62 | | - void scale(double factor); |
63 | | - |
64 | | - |
65 | | - bool isValid(); |
66 | | - QPointF m_center; |
67 | | - double m_minor; |
68 | | - double m_major; |
69 | | - double m_left; |
70 | | - double m_right; |
71 | | - double e; |
72 | | - gPlus m_p1; |
73 | | - gPlus m_p2; |
74 | | -}; |
75 | | - |
76 | | -class rectangleOutline: public boundary |
77 | | -{ |
78 | | -public: |
79 | | - rectangleOutline(); |
80 | | - rectangleOutline(QPointF upperLeft, QPointF lowerRight); |
81 | | - void draw(QPainter& painter, double scale); |
82 | | - bool isInside(QPointF& p , int offset = 0); |
83 | | - void enlarge(int del); |
84 | | - void translate(QPointF del); |
85 | | - void scale(double factor); |
86 | | - bool isValid(); |
87 | | - QPointF m_upperLeft; |
88 | | - QPointF m_lowerRight; |
89 | | - gPlus m_p1; |
90 | | - gPlus m_p2; |
91 | | -}; |
92 | | -QDataStream & operator<<(QDataStream & stream, const ellipseOutline &outline); |
93 | | -QDataStream & operator<<(QDataStream & stream, const CircleOutline &outline); |
94 | | -QDataStream & operator<<(QDataStream & stream, const rectangleOutline &outline); |
95 | | - |
96 | | - |
97 | | -#endif // CIRCLEOUTLINE_H |
| 27 | +void fillCircle(cv::Mat &m, double cx, double cy, double rad, void *color); |
| 28 | +class CircleOutline: public boundary |
| 29 | +{ |
| 30 | + public: |
| 31 | + CircleOutline(); |
| 32 | + CircleOutline(QPointF center, double rad); |
| 33 | + CircleOutline(QPointF p1, QPointF p2); |
| 34 | + virtual ~CircleOutline(); |
| 35 | + void draw(QPainter& painter, double scale, double scale2 = -1.); |
| 36 | + bool isInside(QPointF& p , int offset = 0); |
| 37 | + bool isInside(double x, double y, int offset=0); |
| 38 | + void enlarge(int del); |
| 39 | + void translate(QPointF del); |
| 40 | + void scale(double factor); |
| 41 | + QVector<QPointF> makeCircleofPoints(int cnt); |
| 42 | + bool isValid(); |
| 43 | + QPointF m_center; |
| 44 | + double m_radius; |
| 45 | + gPlus m_p1; |
| 46 | + gPlus m_p2; |
| 47 | + protected: |
| 48 | + |
| 49 | + private: |
| 50 | +}; |
| 51 | + |
| 52 | +class ellipseOutline: public boundary |
| 53 | +{ |
| 54 | +public: |
| 55 | + ellipseOutline(); |
| 56 | + ellipseOutline(QPointF center, double minorAxis, double majorAxis); |
| 57 | + ellipseOutline(QPointF left, QPointF right, double ecc); |
| 58 | + void draw(QPainter& painter, double scale); |
| 59 | + bool isInside(QPointF& p , int offset = 0); |
| 60 | + void enlarge(int del); |
| 61 | + void translate(QPointF del); |
| 62 | + void scale(double factor); |
| 63 | + |
| 64 | + |
| 65 | + bool isValid(); |
| 66 | + QPointF m_center; |
| 67 | + double m_minor; |
| 68 | + double m_major; |
| 69 | + double m_left; |
| 70 | + double m_right; |
| 71 | + double e; |
| 72 | + gPlus m_p1; |
| 73 | + gPlus m_p2; |
| 74 | +}; |
| 75 | + |
| 76 | +class rectangleOutline: public boundary |
| 77 | +{ |
| 78 | +public: |
| 79 | + rectangleOutline(); |
| 80 | + rectangleOutline(QPointF upperLeft, QPointF lowerRight); |
| 81 | + void draw(QPainter& painter, double scale); |
| 82 | + bool isInside(QPointF& p , int offset = 0); |
| 83 | + void enlarge(int del); |
| 84 | + void translate(QPointF del); |
| 85 | + void scale(double factor); |
| 86 | + bool isValid(); |
| 87 | + QPointF m_upperLeft; |
| 88 | + QPointF m_lowerRight; |
| 89 | + gPlus m_p1; |
| 90 | + gPlus m_p2; |
| 91 | +}; |
| 92 | +QDataStream & operator<<(QDataStream & stream, const ellipseOutline &outline); |
| 93 | +QDataStream & operator<<(QDataStream & stream, const CircleOutline &outline); |
| 94 | +QDataStream & operator<<(QDataStream & stream, const rectangleOutline &outline); |
| 95 | + |
| 96 | + |
| 97 | +#endif // CIRCLEOUTLINE_H |
0 commit comments