-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stitch.h
61 lines (50 loc) · 978 Bytes
/
Stitch.h
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
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <string>
#include <vector>
#include "iglHeader.h"
struct Stitch
{
uint32_t index;
uint32_t yarn;
enum : char
{
Start = 's',
End = 'e',
Tuck = 't',
Miss = 'm',
Knit = 'k',
Increase = 'i',
Decrease = 'd',
};
enum : char
{
CW = 'c', Clockweise = CW,
AC = 'a', Anticlockweise = AC, CCW = AC, Counterclockweise = AC,
};
char type = Knit;
char direction = CW;
uint32_t in_0 = -1U;
uint32_t in_1 = -1U;
uint32_t out_0 = -1U;
uint32_t out_1 = -1U;
MAT_3d vertex;
RVec_3d color;
bool check_type() const;
};
class Stitches
{
std::vector<Stitch> stitches;
public:
bool load_stitches(std::string const& path);
const std::vector<Stitch>& get();
bool display();
bool display(size_t pos, size_t len);
};
class Settings
{
public:
std::string ROOT_DIR = "../"; // root directory of current solution
std::string FILE_NAME = ""; // file name of 3d mesh, read from Settings.csv
size_t pos = 0;
size_t len = 0;
};