-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshoulderwidget.cpp
More file actions
96 lines (88 loc) · 3.12 KB
/
Copy pathshoulderwidget.cpp
File metadata and controls
96 lines (88 loc) · 3.12 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "shoulderwidget.h"
ShoulderWidget::ShoulderWidget(bool l, QWidget *parent) :
QWidget(parent)
{
m_paintArea = new ShoulderPaintArea(l, this);
if (m_paintArea->Left()) {
m_paintArea->move(0,0);
} else {
m_paintArea->move(V_BUTTON_WIDTH + 2*H_BORDER,0);
}
m_paintArea->resize(PaintX(),PaintZ());
m_backButton = new QPushButton("Slice back", this);
m_backButton->resize(BUTTON_WIDTH,BUTTON_HEIGHT);
m_forwardButton = new QPushButton("Slice forward", this);
m_forwardButton->resize(BUTTON_WIDTH,BUTTON_HEIGHT);
if (m_paintArea->Left())
{
m_backButton->move(0,PaintZ() + TOP_BORDER);
m_forwardButton->move(PaintX() - BUTTON_WIDTH, PaintZ() + TOP_BORDER);
}
else
{
m_backButton->move(2*H_BORDER + V_BUTTON_WIDTH,PaintZ() + TOP_BORDER);
m_forwardButton->move(2*H_BORDER + V_BUTTON_WIDTH + PaintX() - BUTTON_WIDTH, PaintZ() + TOP_BORDER);
}
connect(m_backButton, SIGNAL (released()), this, SLOT (SliceBack()));
connect(m_forwardButton, SIGNAL (released()), this, SLOT (SliceForward()));
m_bezierDecXButton = new QPushButton("Voxel X dec", this);
m_bezierDecXButton->resize(BUTTON_WIDTH,BUTTON_HEIGHT);
m_bezierIncXButton = new QPushButton("Voxel X inc", this);
m_bezierIncXButton->resize(BUTTON_WIDTH,BUTTON_HEIGHT);
if (m_paintArea->Left())
{
m_bezierDecXButton->move(0,PaintZ() + 2*TOP_BORDER + BUTTON_HEIGHT);
m_bezierIncXButton->move(PaintX() - BUTTON_WIDTH, PaintZ() + 2*TOP_BORDER + BUTTON_HEIGHT);
}
else
{
m_bezierIncXButton->move(2*H_BORDER + V_BUTTON_WIDTH,PaintZ() + 2*TOP_BORDER + BUTTON_HEIGHT);
m_bezierDecXButton->move(2*H_BORDER + V_BUTTON_WIDTH + PaintX() - BUTTON_WIDTH, PaintZ() + 2*TOP_BORDER + BUTTON_HEIGHT);
}
connect(m_bezierDecXButton, SIGNAL (released()), this, SLOT (VoxelXBack()));
connect(m_bezierIncXButton, SIGNAL (released()), this, SLOT (VoxelXForward()));
m_bezierDecZButton = new QPushButton("Bottom", this);
m_bezierDecZButton->resize(V_BUTTON_WIDTH, BUTTON_HEIGHT);
m_bezierIncZButton = new QPushButton("Top", this);
m_bezierIncZButton->resize(V_BUTTON_WIDTH, BUTTON_HEIGHT);
if (m_paintArea->Left())
{
m_bezierDecZButton->move(PaintX() + H_BORDER, PaintZ() - BUTTON_HEIGHT);
m_bezierIncZButton->move(PaintX() + H_BORDER, 0);
}
else
{
m_bezierDecZButton->move(H_BORDER, PaintZ() - BUTTON_HEIGHT);
m_bezierIncZButton->move(H_BORDER, 0);
}
connect(m_bezierDecZButton, SIGNAL (released()), this, SLOT (VoxelZBack()));
connect(m_bezierIncZButton, SIGNAL (released()), this, SLOT (VoxelZForward()));
}
ShoulderWidget::~ShoulderWidget()
{
delete m_paintArea;
}
void ShoulderWidget::SliceBack()
{
m_paintArea->DecSlice();
}
void ShoulderWidget::SliceForward()
{
m_paintArea->IncSlice();
}
void ShoulderWidget::VoxelXBack()
{
m_paintArea->DecFocusX();
}
void ShoulderWidget::VoxelXForward()
{
m_paintArea->IncFocusX();
}
void ShoulderWidget::VoxelZBack()
{
m_paintArea->DecFocusZ();
}
void ShoulderWidget::VoxelZForward()
{
m_paintArea->IncFocusZ();
}