2 #include "ui_qxrdslicedialog.h"
10 m_SliceDialogSettings(settings)
13 printf(
"QxrdSliceDialog::QxrdSliceDialog(%p)\n",
this);
21 m_SlicePlot->init(set->slicePlotSettings());
28 printf(
"QxrdSliceDialog::~QxrdSliceDialog(%p)\n",
this);
44 set->set_SlicePolygon(poly);
52 m_SlicePlot->detachItems(QwtPlotItem::Rtti_PlotCurve);
53 m_SlicePlot->detachItems(QwtPlotItem::Rtti_PlotMarker);
58 QVector<double> xp,yp;
59 QString title =
m_Image->get_Title();
65 if (poly.size() >= 2) {
68 for (
int i=1; i<poly.size(); i++) {
70 double dx = p1.x() - p0.x();
71 double dy = p1.y() - p0.y();
72 length += sqrt(dx*dx + dy*dy);
80 title += tr(
" [%1,%2]").arg(p0.x()).arg(p0.y());
82 for (
int i=1; i<poly.size(); i++) {
84 double dx = p1.x() - p0.x();
85 double dy = p1.y() - p0.y();
86 double len = sqrt(dx*dx + dy*dy);
90 double x = p0.x() + r*dx/len;
91 double y = p0.y() + r*dy/len;
94 yp.append(
m_Image->value((
int) x, (
int) y));
103 if (poly.size() > 2) {
109 QPointF p1 = poly.last();
110 title += tr(
"[%1,%2]").arg(p1.x()).arg(p1.y());
114 pc->setSamples(xp, yp);
116 pc->attach(m_SlicePlot);
118 m_SlicePlot->updateZoomer();
119 m_SlicePlot->replot();
QxrdSliceDialogSettingsWPtr m_SliceDialogSettings
qint64 qcepDebug(int cond)
void onProcessedImageAvailable(QcepDoubleImageDataPtr image, QcepMaskDataPtr overflow)
A class which draws piecewise curves.
QxrdSliceDialog(QxrdSliceDialogSettingsWPtr settings, QWidget *parent)
QVector< QPointF > QcepPolygon
QWeakPointer< QxrdSliceDialogSettings > QxrdSliceDialogSettingsWPtr
QcepDoubleImageDataPtr m_Image
QSharedPointer< QcepMaskData > QcepMaskDataPtr
void slicePolygon(QVector< QPointF > poly)
QSharedPointer< QxrdSliceDialogSettings > QxrdSliceDialogSettingsPtr
virtual ~QxrdSliceDialog()
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr