-
Notifications
You must be signed in to change notification settings - Fork 4
/
layout2d.h
40 lines (30 loc) · 1.07 KB
/
layout2d.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
#ifndef Layout2dH
#define Layout2dH
#include "layout1d.h"
namespace Denisenko {
namespace Raskroy {
const scalar DEFAULT_SAW_THICKNESS = 4;
class Layout2d {
Amounts *m_remains;
Sizes *m_sizes;
scalar *m_minSize;
Layout1d m_layout1d;
int m_nesting;
int m_completedCounter;
bool Recursion(Sizes::iterator begin, const Rect&, Stat&, int s, OldLayoutResult&, Amounts &rashod);
public:
Layout2d(Sizes sizes[], scalar minSize[], Amounts *remains)
: m_remains(remains), m_sizes(sizes), m_minSize(minSize),
m_layout1d(remains, DEFAULT_SAW_THICKNESS), m_nesting(0), m_completedCounter(0)
{
}
void put_SawThickness(scalar x) throw () {m_layout1d.put_SawThickness(x);}
scalar get_SawThickness(void) throw () {return m_layout1d.get_SawThickness();}
bool Optimize(const Rect&, Stat&, int s, OldLayoutResult&, Amounts &rashod);
bool new_optimize(const Rect &rect, LayoutBuilder &layout);
void ResetCompletedCounter() { m_completedCounter = 0; }
int GetCompletedCounter() { return m_completedCounter; }
};
} // namespace Denisenko
} // namespace Raskroy
#endif // Layout2dH