This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdialogshowestimated.cpp
204 lines (161 loc) · 6.82 KB
/
dialogshowestimated.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#include "dialogshowestimated.h"
DialogShowEstimated::DialogShowEstimated(QWidget *parent)
: QDialog(parent)
{
this->parent=(MainWindow *)parent;
std::cout<< "constructor DialogShowEstimated" <<std::endl;
labelTitle = new QLabel(tr("Show ESTIMATED transformations:"));
labScaleX = new QLabel(tr("scale X"));
scaleX = new QLineEdit;
scaleX->setText("0");
scaleX->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
scaleX->setMaximumWidth(100);
labScaleY = new QLabel(tr("scale Y"));
scaleY = new QLineEdit;
scaleY->setText("0");
scaleY->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
scaleY->setMaximumWidth(100);
labScaleZ = new QLabel(tr("scale Z"));
scaleZ = new QLineEdit;
scaleZ->setText("0");
scaleZ->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
scaleZ->setMaximumWidth(100);
labTraslaX = new QLabel(tr("trasla X"));
traslaX = new QLineEdit;
traslaX->setText("0");
traslaX->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
traslaX->setMaximumWidth(100);
labTraslaY = new QLabel(tr("trasla Y"));
traslaY = new QLineEdit;
traslaY->setText("0");
traslaY->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
traslaY->setMaximumWidth(100);
labTraslaZ = new QLabel(tr("trasla Z"));
traslaZ = new QLineEdit;
traslaZ->setText("0");
traslaZ->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
traslaZ->setMaximumWidth(100);
labTimeOffset = new QLabel(tr("Time Offset"));
timeOffset = new QLineEdit;
timeOffset->setText("0");
timeOffset->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
timeOffset->setMaximumWidth(100);
labRMax = new QLabel(tr("Correlation Max value"));
rMax = new QLineEdit;
rMax->setText("0");
rMax->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
rMax->setMaximumWidth(100);
labRotationMatrix = new QLabel(tr("Rotation Matrix Estimated"));
rotationMatrix = new QTextEdit;
rotationMatrix->setText("0 0 0 \n 0 0 0 \n 0 0 0\n");
rotationMatrix->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
rotationMatrix->setMaximumHeight(130);
rotationMatrix->setMaximumWidth(230);
labYaw = new QLabel(tr("Yaw"));
yaw = new QLineEdit;
yaw->setText("0");
yaw->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
yaw->setMaximumWidth(100);
labPitch = new QLabel(tr("Pitch"));
pitch = new QLineEdit;
pitch->setText("0");
pitch->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
pitch->setMaximumWidth(100);
labRoll = new QLabel(tr("Roll"));
roll = new QLineEdit;
roll->setText("0");
roll->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
roll->setMaximumWidth(100);
labRMSE = new QLabel(tr("RMSE"));
RMSE = new QLineEdit;
RMSE->setText("0");
RMSE->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
RMSE->setMaximumWidth(100);
buttonOK = new QPushButton(tr("&OK"));
buttonCancel = new QPushButton(tr("&Cancel"));
connect(buttonOK, SIGNAL(clicked()), this, SLOT(onOK()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(onCancel()));
std::cout<< "2 constructor DialogShowEstimated" <<std::endl;
QHBoxLayout *topLeftLayout = new QHBoxLayout;
topLeftLayout->addWidget(labelTitle);
//topLeftLayout->addWidget(lineEdit);
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addLayout(topLeftLayout);
leftLayout->addWidget(labScaleX);
leftLayout->addWidget(scaleX);
leftLayout->addWidget(labScaleY);
leftLayout->addWidget(scaleY);
leftLayout->addWidget(labScaleZ);
leftLayout->addWidget(scaleZ);
leftLayout->addWidget(labTraslaX);
leftLayout->addWidget(traslaX);
leftLayout->addWidget(labTraslaY);
leftLayout->addWidget(traslaY);
leftLayout->addWidget(labTraslaZ);
leftLayout->addWidget(traslaZ);
leftLayout->addWidget(labTimeOffset);
leftLayout->addWidget(timeOffset);
leftLayout->addWidget(labRMax);
leftLayout->addWidget(rMax);
leftLayout->addWidget(labYaw);
leftLayout->addWidget(yaw);
leftLayout->addWidget(labPitch);
leftLayout->addWidget(pitch);
leftLayout->addWidget(labRoll);
leftLayout->addWidget(roll);
leftLayout->addWidget(labRMSE);
leftLayout->addWidget(RMSE);
QHBoxLayout *buttonLayout2 = new QHBoxLayout;
buttonLayout2->addWidget(buttonOK);
buttonLayout2->addWidget(buttonCancel);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
mainLayout->addLayout(leftLayout, 0, 0);
mainLayout->addLayout(buttonLayout2, 1,0);
mainLayout->setRowStretch(2, 1);
setLayout(mainLayout);
setWindowTitle(tr("Show Estimated transformations"));
//extension->hide();
std::cout<< "FIN constructor DialogShowEstimated" <<std::endl;
}
void DialogShowEstimated::onOK()
{
std::cout<< "FIN onOK" <<std::endl;
this->close();
}
void DialogShowEstimated::setDataDialog(DataDialogShowEstimated* aModel){
dialogModel = aModel;
double value = 0.0;
std::cout<< "DialogShowEstimated::setDataDialog " << dialogModel->getDialogType() <<std::endl;
if (dialogModel->getDialogType() == 0){
labelTitle->setText("Show ESTIMATED transformations A TO B:");
} else if (dialogModel->getDialogType()==1) {
labelTitle->setText("Show ESTIMATED transformations B TO A:");
} else if (dialogModel->getDialogType()==2) {
labelTitle->setText("Show ESTIMATED transformations A TO B RANSAC:");
} else if (dialogModel->getDialogType()==3) {
labelTitle->setText("Show ESTIMATED transformations B TO A RANSAC:");
}
double myScale=dialogModel->getScaleX();
traslaX->setText( QString::number((dialogModel->getTraslaX()*myScale), 'f', 6));
traslaY->setText( QString::number((dialogModel->getTraslaY()*myScale), 'f', 6));
traslaZ->setText( QString::number((dialogModel->getTraslaZ()*myScale), 'f', 6));
scaleX->setText( QString::number(dialogModel->getScaleX(), 'f', 6));
scaleY->setText( QString::number(dialogModel->getScaleY(), 'f', 6));
scaleZ->setText( QString::number(dialogModel->getScaleZ(), 'f', 6));
timeOffset->setText( QString::number(dialogModel->getTimeOffset(), 'f', 6));
rMax->setText( QString::number(dialogModel->getRMax(), 'f', 6));
yaw->setText(QString::number(dialogModel->getYaw(),'f',6));
pitch->setText(QString::number(dialogModel->getPitch(),'f',6));
roll->setText(QString::number(dialogModel->getRoll(),'f',6));
RMSE->setText(QString::number(dialogModel->getRMSE(),'f',6));
}
DataDialogShowEstimated* DialogShowEstimated::getDataDialog(){
return dialogModel;
}
void DialogShowEstimated::onCancel()
{
std::cout<< "onCancel" <<std::endl;
buttonCancel->hide();
this->close();
}