-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmodelmover.cpp
104 lines (82 loc) · 2 KB
/
cmodelmover.cpp
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
97
98
99
100
101
102
103
104
#include "cmodelmover.h"
#include "mainwindow.h"
class CModelMoverPrivate
{
friend class CModelMover;
CModelMoverPrivate() :
gui(nullptr),
trX(0), trY(0), trZ(0),
rX(0), rY(0), rZ(0),
state(BotSocket::ENSS_FALL),
localIp(0), remoteIp(0),
localPort(0), remotePort(0)
{ }
MainWindow *gui;
BotSocket::TDistance trX, trY, trZ;
BotSocket::TDegree rX, rY, rZ;
BotSocket::TSocketState state;
uint32_t localIp, remoteIp;
uint16_t localPort, remotePort;
};
CModelMover::CModelMover() :
d_ptr(new CModelMoverPrivate())
{
}
CModelMover::~CModelMover()
{
delete d_ptr;
}
BotSocket::TSocketState CModelMover::socketState() const
{
return d_ptr->state;
}
BotSocket::TDistance CModelMover::getTrX() const
{
return d_ptr->trX;
}
BotSocket::TDistance CModelMover::getTrY() const
{
return d_ptr->trY;
}
BotSocket::TDistance CModelMover::getTrZ() const
{
return d_ptr->trZ;
}
BotSocket::TDegree CModelMover::getRX() const
{
return d_ptr->rX;
}
BotSocket::TDegree CModelMover::getRY() const
{
return d_ptr->rY;
}
BotSocket::TDegree CModelMover::getRZ() const
{
return d_ptr->rZ;
}
void CModelMover::setGui(MainWindow * const gui)
{
d_ptr->gui = gui;
}
void CModelMover::transformModel(const BotSocket::TDistance trX,
const BotSocket::TDistance trY,
const BotSocket::TDistance trZ,
const BotSocket::TDegree rX,
const BotSocket::TDegree rY,
const BotSocket::TDegree rZ)
{
d_ptr->trX = trX;
d_ptr->trY = trY;
d_ptr->trZ = trZ;
d_ptr->rX = rX;
d_ptr->rY = rY;
d_ptr->rZ = rZ;
if (d_ptr->gui != nullptr)
d_ptr->gui->updateMdlTransform();
}
void CModelMover::socketStateChanged(const BotSocket::TSocketState state)
{
d_ptr->state = state;
if (d_ptr->gui != nullptr)
d_ptr->gui->updateBotSocketState();
}