2 #include "ui_qxrddistortioncorrectiondialog.h"
10 QDockWidget(parent.data()),
12 m_DistortionCorrection(dis)
15 printf(
"QxrdDistortionCorrectionDialog::QxrdDistortionCorrectionDialog(%p)\n",
this);
21 dis->prop_DistortionImagePath()->linkTo(m_DistortionCalibrationPath);
22 dis->prop_P0()->linkTo(m_DistortionP0X, m_DistortionP0Y);
23 dis->prop_P1()->linkTo(m_DistortionP1X, m_DistortionP1Y);
24 dis->prop_P2()->linkTo(m_DistortionP2X, m_DistortionP2Y);
25 dis->prop_N1()->linkTo(m_DistortionN1);
26 dis->prop_N2()->linkTo(m_DistortionN2);
27 dis->prop_F0()->linkTo(m_DistortionF0X, m_DistortionF0Y);
28 dis->prop_F1()->linkTo(m_DistortionF1X, m_DistortionF1Y);
29 dis->prop_F2()->linkTo(m_DistortionF2X, m_DistortionF2Y);
31 dis->prop_WMin()->linkTo(m_DistortionWMin);
32 dis->prop_WMax()->linkTo(m_DistortionWMax);
33 dis->prop_WNom()->linkTo(m_DistortionWNom);
34 dis->prop_RatMin()->linkTo(m_DistortionRatMin);
35 dis->prop_HgtMin()->linkTo(m_DistortionHgtMin);
36 dis->prop_DistMax()->linkTo(m_DistortionDistMaxX, m_DistortionDistMaxY);
52 printf(
"QxrdDistortionCorrectionDialog::~QxrdDistortionCorrectionDialog(%p)\n",
this);
61 m_DistortionGridTable->setRowCount(0);
72 int nRows = qMax(iVals.count(), jVals.count());
73 nRows = qMax(nRows, xVals.count());
74 nRows = qMax(nRows, yVals.count());
75 nRows = qMax(nRows, fxVals.count());
76 nRows = qMax(nRows, fyVals.count());
77 nRows = qMax(nRows, dxVals.count());
78 nRows = qMax(nRows, dyVals.count());
80 m_DistortionGridTable->setRowCount(nRows);
82 for (
int r = 0; r<nRows; r++) {
83 if (r < iVals.count()) {
84 m_DistortionGridTable->setItem(r,0,
new QTableWidgetItem(tr(
"%1").arg(iVals[r])));
87 if (r < jVals.count()) {
88 m_DistortionGridTable->setItem(r,1,
new QTableWidgetItem(tr(
"%1").arg(jVals[r])));
91 if (r < xVals.count()) {
92 m_DistortionGridTable->setItem(r,2,
new QTableWidgetItem(tr(
"%1").arg(xVals[r])));
95 if (r < yVals.count()) {
96 m_DistortionGridTable->setItem(r,3,
new QTableWidgetItem(tr(
"%1").arg(yVals[r])));
99 if (r < fxVals.count()) {
100 m_DistortionGridTable->setItem(r,4,
new QTableWidgetItem(tr(
"%1").arg(fxVals[r])));
103 if (r < fyVals.count()) {
104 m_DistortionGridTable->setItem(r,5,
new QTableWidgetItem(tr(
"%1").arg(fyVals[r])));
107 if (r < dxVals.count()) {
108 m_DistortionGridTable->setItem(r,6,
new QTableWidgetItem(tr(
"%1").arg(dxVals[r])));
111 if (r < dyVals.count()) {
112 m_DistortionGridTable->setItem(r,7,
new QTableWidgetItem(tr(
"%1").arg(dyVals[r])));
116 m_DistortionGridTable->resizeColumnsToContents();
117 m_DistortionGridTable->resizeRowsToContents();
130 img->detachItems(QwtPlotItem::Rtti_PlotCurve);
131 img->detachItems(QwtPlotItem::Rtti_PlotMarker);
142 int n = xVals.count();
144 for (
int i=0; i<n; i++) {
145 data->
append(
QxrdPoint4D(xVals.value(i), yVals.value(i), dxVals.value(i), dyVals.value(i)));
148 curve -> setSamples(data);
150 curve -> attach(img);
QxrdDistortionCorrectionWPtr m_DistortionCorrection
QVector< int > QcepIntVector
QSharedPointer< QxrdWindow > QxrdWindowPtr
qint64 qcepDebug(int cond)
QxrdDistortionCorrectionDialog(QxrdDistortionCorrectionPtr dis, QxrdWindowPtr parent)
void init(QxrdDistortionCorrectionDialogSettingsWPtr settings)
virtual ~QxrdDistortionCorrectionDialog()
QVector< double > QcepDoubleVector
void updateDistortionGraph()
QWeakPointer< QxrdDistortionCorrectionDialogSettings > QxrdDistortionCorrectionDialogSettingsWPtr
void append(const QxrdPoint4D &pt)
void fitCalibrationGrid()
QSharedPointer< QxrdDistortionCorrection > QxrdDistortionCorrectionPtr