-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStitch.cpp
More file actions
51 lines (44 loc) · 866 Bytes
/
Stitch.cpp
File metadata and controls
51 lines (44 loc) · 866 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
49
50
51
/* Created on: 12/05/2021
* Author: Ziniu Lu (luziniuoskar@outlook.com)
*/
#include "Stitch.h"
BEGIN_PROJECT_NAMESPACE
// Stitch
bool Stitch::check_type() const
{
if (type == Start)
{
return (in_0 == -1U && in_1 == -1U &&
out_0 != -1U && out_1 == -1U);
}
else if (type == End)
{
return (in_0 != -1U && in_1 == -1U &&
out_0 == -1U && out_1 == -1U);
}
else if (type == Tuck || type == Miss || type == Knit)
{
return (in_0 != -1U && in_1 == -1U &&
out_0 != -1U && out_1 == -1U);
}
else if (type == Increase)
{
return (in_0 != -1U && in_1 == -1U &&
out_0 != -1U && out_1 != -1U);
}
else if (type == Decrease)
{
return (in_0 != -1U && in_1 != -1U &&
out_0 != -1U && out_1 == -1U);
}
else
{
return false;
}
}
// Stitches
const std::vector<Stitch>& Stitches::get()
{
return this->stitches;
}
END_PROJECT_NAMESPACE