forked from apsystems/GrblHoming
-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathpositem.cpp
More file actions
48 lines (43 loc) · 751 Bytes
/
positem.cpp
File metadata and controls
48 lines (43 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "positem.h"
void PosItem::setCoords(double x1, double y1, double i1, double j1)
{
x = x1;
y = y1;
i = i1;
j = j1;
}
void PosItem::setCoords(double x1, double y1, bool mm1)
{
x = x1;
y = y1;
i = x1;
j = y1;
mm = mm1;
}
void PosItem::expand(const PosItem& item)
{
if (item.x < x)
x = item.x;
if (item.y < y)
y = item.y;
if (item.i > i)
i = item.i;
if (item.j > j)
j = item.j;
}
void PosItem::toMm()
{
x *= MM_IN_AN_INCH;
y *= MM_IN_AN_INCH;
i *= MM_IN_AN_INCH;
j *= MM_IN_AN_INCH;
mm = true;
}
void PosItem::toInches()
{
x /= MM_IN_AN_INCH;
y /= MM_IN_AN_INCH;
i /= MM_IN_AN_INCH;
j /= MM_IN_AN_INCH;
mm = false;
}