QXRD  0.11.16
Public Slots | Public Member Functions | Private Attributes | List of all members
QxrdDistortionCorrectionDialog Class Reference

#include <qxrddistortioncorrectiondialog.h>

Inheritance diagram for QxrdDistortionCorrectionDialog:
Inheritance graph
[legend]
Collaboration diagram for QxrdDistortionCorrectionDialog:
Collaboration graph
[legend]

Public Slots

void updateGridTable ()
 
void updateDistortionGraph ()
 

Public Member Functions

 QxrdDistortionCorrectionDialog (QxrdDistortionCorrectionPtr dis, QxrdWindowPtr parent)
 
virtual ~QxrdDistortionCorrectionDialog ()
 
void init (QxrdDistortionCorrectionDialogSettingsWPtr settings)
 

Private Attributes

QxrdWindowWPtr m_Window
 
QxrdDistortionCorrectionWPtr m_DistortionCorrection
 

Detailed Description

Definition at line 10 of file qxrddistortioncorrectiondialog.h.

Constructor & Destructor Documentation

QxrdDistortionCorrectionDialog::QxrdDistortionCorrectionDialog ( QxrdDistortionCorrectionPtr  dis,
QxrdWindowPtr  parent 
)
explicit

Definition at line 9 of file qxrddistortioncorrectiondialog.cpp.

References DEBUG_CONSTRUCTORS, QxrdDistortionCorrection::fitCalibrationGrid(), qcepDebug(), updateDistortionGraph(), and updateGridTable().

9  :
10  QDockWidget(parent.data()),
11  m_Window(parent),
13 {
15  printf("QxrdDistortionCorrectionDialog::QxrdDistortionCorrectionDialog(%p)\n", this);
16  }
17 
18  setupUi(this);
19 
20  if (dis) {
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);
30 
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);
37 
38  connect(m_FitGridButton, &QAbstractButton::clicked, dis.data(), &QxrdDistortionCorrection::fitCalibrationGrid);
39  }
40 
41  connect(m_UpdateGridButton, &QAbstractButton::clicked, this, &QxrdDistortionCorrectionDialog::updateGridTable);
42  connect(m_UpdateGraphButton, &QAbstractButton::clicked, this, &QxrdDistortionCorrectionDialog::updateDistortionGraph);
43 }
QxrdDistortionCorrectionWPtr m_DistortionCorrection
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

QxrdDistortionCorrectionDialog::~QxrdDistortionCorrectionDialog ( )
virtual

Definition at line 49 of file qxrddistortioncorrectiondialog.cpp.

References DEBUG_CONSTRUCTORS, and qcepDebug().

50 {
52  printf("QxrdDistortionCorrectionDialog::~QxrdDistortionCorrectionDialog(%p)\n", this);
53  }
54 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

Member Function Documentation

void QxrdDistortionCorrectionDialog::init ( QxrdDistortionCorrectionDialogSettingsWPtr  settings)

Definition at line 45 of file qxrddistortioncorrectiondialog.cpp.

46 {
47 }
void QxrdDistortionCorrectionDialog::updateDistortionGraph ( )
slot

Definition at line 121 of file qxrddistortioncorrectiondialog.cpp.

References QxrdPlotVectorFieldData::append(), m_DistortionCorrection, and m_Window.

Referenced by QxrdDistortionCorrectionDialog().

122 {
124  QxrdWindowPtr win(m_Window);
125 
126  if (dis && win) {
127  QxrdDistortionCorrectionPlot *img = win->m_DistortionCorrectionPlot;
128 
129  if (img) {
130  img->detachItems(QwtPlotItem::Rtti_PlotCurve);
131  img->detachItems(QwtPlotItem::Rtti_PlotMarker);
132 
134 
136 
137  QcepDoubleVector xVals = dis->get_XVals();
138  QcepDoubleVector yVals = dis->get_YVals();
139  QcepDoubleVector dxVals = dis->get_DXVals();
140  QcepDoubleVector dyVals = dis->get_DYVals();
141 
142  int n = xVals.count();
143 
144  for (int i=0; i<n; i++) {
145  data->append(QxrdPoint4D(xVals.value(i), yVals.value(i), dxVals.value(i), dyVals.value(i)));
146  }
147 
148  curve -> setSamples(data);
149 
150  curve -> attach(img);
151 
152  img->replot();
153  }
154  }
155 }
QxrdDistortionCorrectionWPtr m_DistortionCorrection
QSharedPointer< QxrdWindow > QxrdWindowPtr
Definition: qxrdwindow-ptr.h:6
QVector< double > QcepDoubleVector
Definition: qcepmacros.h:19
void append(const QxrdPoint4D &pt)
QSharedPointer< QxrdDistortionCorrection > QxrdDistortionCorrectionPtr

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdDistortionCorrectionDialog::updateGridTable ( )
slot

Definition at line 56 of file qxrddistortioncorrectiondialog.cpp.

References m_DistortionCorrection.

Referenced by QxrdDistortionCorrectionDialog().

57 {
59 
60  if (dis) {
61  m_DistortionGridTable->setRowCount(0);
62 
63  QcepIntVector iVals = dis->get_IVals();
64  QcepIntVector jVals = dis->get_JVals();
65  QcepDoubleVector xVals = dis->get_XVals();
66  QcepDoubleVector yVals = dis->get_YVals();
67  QcepDoubleVector fxVals = dis->get_FXVals();
68  QcepDoubleVector fyVals = dis->get_FYVals();
69  QcepDoubleVector dxVals = dis->get_DXVals();
70  QcepDoubleVector dyVals = dis->get_DYVals();
71 
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());
79 
80  m_DistortionGridTable->setRowCount(nRows);
81 
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])));
85  }
86 
87  if (r < jVals.count()) {
88  m_DistortionGridTable->setItem(r,1, new QTableWidgetItem(tr("%1").arg(jVals[r])));
89  }
90 
91  if (r < xVals.count()) {
92  m_DistortionGridTable->setItem(r,2, new QTableWidgetItem(tr("%1").arg(xVals[r])));
93  }
94 
95  if (r < yVals.count()) {
96  m_DistortionGridTable->setItem(r,3, new QTableWidgetItem(tr("%1").arg(yVals[r])));
97  }
98 
99  if (r < fxVals.count()) {
100  m_DistortionGridTable->setItem(r,4, new QTableWidgetItem(tr("%1").arg(fxVals[r])));
101  }
102 
103  if (r < fyVals.count()) {
104  m_DistortionGridTable->setItem(r,5, new QTableWidgetItem(tr("%1").arg(fyVals[r])));
105  }
106 
107  if (r < dxVals.count()) {
108  m_DistortionGridTable->setItem(r,6, new QTableWidgetItem(tr("%1").arg(dxVals[r])));
109  }
110 
111  if (r < dyVals.count()) {
112  m_DistortionGridTable->setItem(r,7, new QTableWidgetItem(tr("%1").arg(dyVals[r])));
113  }
114  }
115 
116  m_DistortionGridTable->resizeColumnsToContents();
117  m_DistortionGridTable->resizeRowsToContents();
118  }
119 }
QxrdDistortionCorrectionWPtr m_DistortionCorrection
QVector< int > QcepIntVector
Definition: qcepmacros.h:23
QVector< double > QcepDoubleVector
Definition: qcepmacros.h:19
QSharedPointer< QxrdDistortionCorrection > QxrdDistortionCorrectionPtr

Here is the caller graph for this function:

Member Data Documentation

QxrdDistortionCorrectionWPtr QxrdDistortionCorrectionDialog::m_DistortionCorrection
private

Definition at line 27 of file qxrddistortioncorrectiondialog.h.

Referenced by updateDistortionGraph(), and updateGridTable().

QxrdWindowWPtr QxrdDistortionCorrectionDialog::m_Window
private

Definition at line 26 of file qxrddistortioncorrectiondialog.h.

Referenced by updateDistortionGraph().


The documentation for this class was generated from the following files: