Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
38ec24c5
Commit
38ec24c5
authored
Jul 15, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
before changeing planiCalc form class to ordinary header file
parent
fc767dbb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
258 additions
and
19 deletions
+258
-19
Circle.cc
src/Wima/Circle.cc
+8
-5
Circle.h
src/Wima/Circle.h
+2
-1
PlanimetryCalculus.cc
src/Wima/PlanimetryCalculus.cc
+233
-10
PlanimetryCalculus.h
src/Wima/PlanimetryCalculus.h
+15
-3
No files found.
src/Wima/Circle.cc
View file @
38ec24c5
...
...
@@ -12,18 +12,16 @@ Circle::Circle(QObject *parent)
Circle
::
Circle
(
double
radius
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_circleRadius
(
radius
)
,
_circleRadius
(
radius
>=
0
?
radius
:
0
)
,
_circleOrigin
(
QPointF
(
0
,
0
))
{
}
Circle
::
Circle
(
double
radius
,
QPointF
origin
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_circleRadius
(
radius
)
,
_circleRadius
(
radius
>=
0
?
radius
:
0
)
,
_circleOrigin
(
origin
)
{
}
Circle
::
Circle
(
const
Circle
&
other
,
QObject
*
parent
)
...
...
@@ -95,7 +93,7 @@ QPointF Circle::origin() const
*
* \sa QPointF
*/
QPolygonF
Circle
::
approximate
(
int
numberOfCorners
)
QPolygonF
Circle
::
approximate
(
int
numberOfCorners
)
const
{
if
(
numberOfCorners
<
3
)
return
QPolygonF
();
...
...
@@ -114,6 +112,11 @@ QPolygonF Circle::approximate(int numberOfCorners)
return
polygon
;
}
bool
Circle
::
isNull
()
const
{
return
_circleRadius
<=
0
?
true
:
false
;
}
/*!
* \class Circle
* \brief Provies a circle with radius and origin.
...
...
src/Wima/Circle.h
View file @
38ec24c5
...
...
@@ -25,7 +25,8 @@ public:
QPointF
origin
()
const
;
// Member methodes
QPolygonF
approximate
(
int
numberOfCorners
);
QPolygonF
approximate
(
int
numberOfCorners
)
const
;
bool
isNull
()
const
;
signals:
void
radiusChanged
(
double
radius
);
...
...
src/Wima/PlanimetryCalculus.cc
View file @
38ec24c5
This diff is collapsed.
Click to expand it.
src/Wima/PlanimetryCalculus.h
View file @
38ec24c5
...
...
@@ -11,16 +11,28 @@ class PlanimetryCalculus
public:
PlanimetryCalculus
();
enum
IntersectType
{
CircleInsideNoIntersection
,
CircleInsideTouching
,
CircleInsideIntersection
,
CircleOutsideIntersection
,
CircleOutsideTouching
,
CircleOutsideNoIntersection
,
//Circle Circle intersection
enum
IntersectType
{
InsideNoIntersection
,
InsideTouching
,
InsideIntersection
,
OutsideIntersection
,
OutsideTouching
,
OutsideNoIntersection
,
CirclesEqual
,
//Circle Circle intersection
NoIntersection
,
Tangent
,
Secant
// Circle Line Intersetion
NoIntersection
,
Tangent
,
Secant
,
// Circle Line Intersetion
Error
// general
};
void
rotatePoint
(
QPointF
&
point
,
double
alpha
);
void
rotatePoint
(
QList
<
QPointF
>
&
point
,
double
alpha
);
void
rotatePointDegree
(
QPointF
&
point
,
double
alpha
);
void
rotatePointDegree
(
QList
<
QPointF
>
&
points
,
double
alpha
);
IntersectType
intersects
(
const
Circle
&
circle1
,
const
Circle
&
circle2
);
IntersectType
intersects
(
const
Circle
&
circle1
,
const
Circle
&
circle2
,
QList
<
QPointF
>
&
intersectionPoints
);
IntersectType
intersects
(
const
Circle
&
circle
,
const
QLineF
&
line
);
IntersectType
intersects
(
const
Circle
&
circle
,
const
QLineF
&
line
,
QList
<
QPointF
>
&
intersectionPoints
);
double
distance
(
const
QPointF
&
p1
,
const
QPointF
p2
);
double
angle
(
const
QPointF
&
p1
,
const
QPointF
p2
);
double
angleDegree
(
const
QPointF
&
p1
,
const
QPointF
p2
);
private:
IntersectType
intersects
(
const
Circle
&
circle
,
const
QLineF
&
line
,
QList
<
QPointF
>
&
intersectionPoints
,
bool
calcIntersect
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment