-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathparser.h
53 lines (41 loc) · 1.12 KB
/
parser.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
#ifndef ParserH
#define ParserH
#include "types.h"
#include "Result.h"
namespace Denisenko {
namespace Raskroy {
struct ParsedPart {
scalar pos[2]; // location relative to left-bottom corner
Rect rect;
};
struct ParsedCut {
scalar pos[2];
scalar length;
unsigned s; // cut direction along 0=length or 1=width
};
typedef std::vector<ParsedPart> ParsedParts;
typedef std::vector<ParsedCut> ParsedCuts;
struct ParsedResult
{
ParsedParts parts;
ParsedCuts cuts;
Stat stat;
Part sheet;
unsigned amount;
};
class Parser
{
ParsedResult *m_pOutResult;
scalar m_sawThickness;
scalar m_halfSawThickness;
scalar m_detailsSummarySquare; // total parts square
scalar Details(unsigned s, scalar pos[2], const Rect&, const OldLayoutResult::Details&);
void Recursion(scalar pos[2], const Rect&, const OldLayoutResult&);
public:
scalar get_DetailsSummarySquare() {return m_detailsSummarySquare;};
Parser(void) : m_pOutResult(0), m_sawThickness(0), m_halfSawThickness(0), m_detailsSummarySquare(0) {}
void Parse(const Result&, ParsedResult&, scalar cutThickness);
};
} // namespace Denisenko
} // namespace Raskroy
#endif // ParserH