Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Spline
SplinePair.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
SplinePair.h
"
8
9
using namespace
std;
10
11
SplinePair::SplinePair
() :
12
m_x (0.0),
13
m_y (0.0)
14
{
15
}
16
17
SplinePair::SplinePair
(
double
scalar) :
18
m_x (scalar),
19
m_y (scalar)
20
{
21
}
22
23
SplinePair::SplinePair
(
double
x
,
24
double
y
) :
25
m_x (
x
),
26
m_y (
y
)
27
{
28
}
29
30
SplinePair
&
SplinePair::operator=
(
const
SplinePair
&other)
31
{
32
m_x = other.
x
();
33
m_y = other.
y
();
34
35
return
*
this
;
36
}
37
38
SplinePair::SplinePair
(
const
SplinePair
&other) :
39
m_x (other.
x
()),
40
m_y (other.
y
())
41
{
42
}
43
44
SplinePair
SplinePair::operator+
(
const
SplinePair
&other)
const
45
{
46
SplinePair
result (m_x + other.
x
(),
47
m_y + other.
y
());
48
49
return
result;
50
}
51
52
SplinePair
SplinePair::operator-
(
const
SplinePair
&other)
const
53
{
54
SplinePair
result (m_x - other.
x
(),
55
m_y - other.
y
());
56
57
return
result;
58
}
59
60
SplinePair
SplinePair::operator*
(
const
SplinePair
&other)
const
61
{
62
SplinePair
result (m_x * other.
x
(),
63
m_y * other.
y
());
64
65
return
result;
66
}
67
68
SplinePair
SplinePair::operator/
(
const
SplinePair
&other)
const
69
{
70
SplinePair
result (m_x / other.
x
(),
71
m_y / other.
y
());
72
73
return
result;
74
}
75
76
ostream &
operator<<
(ostream &str,
const
SplinePair
&pair)
77
{
78
str <<
"("
<< pair.
x
() <<
","
<< pair.
y
() <<
")"
;
79
80
return
str;
81
}
82
83
QDebug
operator<<
(QDebug dbg,
const
SplinePair
&pair)
84
{
85
QDebugStateSaver saver(dbg);
86
dbg.nospace() <<
"("
<< pair.
x
() <<
","
<< pair.
y
() <<
")"
;
87
88
return
dbg;
89
}
90
91
double
SplinePair::x
()
const
92
{
93
return
m_x;
94
}
95
96
double
SplinePair::y
()
const
97
{
98
return
m_y;
99
}
operator<<
ostream & operator<<(ostream &str, const SplinePair &pair)
Definition
SplinePair.cpp:76
SplinePair.h
SplinePair
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition
SplinePair.h:15
SplinePair::y
double y() const
Get method for y.
Definition
SplinePair.cpp:96
SplinePair::x
double x() const
Get method for x.
Definition
SplinePair.cpp:91
SplinePair::operator-
SplinePair operator-(const SplinePair &other) const
Subtraction operator.
Definition
SplinePair.cpp:52
SplinePair::SplinePair
SplinePair()
Default constructor. Normally used only by generic container classes.
Definition
SplinePair.cpp:11
SplinePair::operator/
SplinePair operator/(const SplinePair &other) const
Division operator.
Definition
SplinePair.cpp:68
SplinePair::operator*
SplinePair operator*(const SplinePair &other) const
Multiplication operator.
Definition
SplinePair.cpp:60
SplinePair::operator+
SplinePair operator+(const SplinePair &other) const
Addition operator.
Definition
SplinePair.cpp:44
SplinePair::operator=
SplinePair & operator=(const SplinePair &other)
Assignment constructor.
Definition
SplinePair.cpp:30
Generated on
for Engauge Digitizer by
1.17.0