BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IntensityDataFFTPresenter.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/IntensityDataWidgets/IntensityDataFFTPresenter.cpp
6 //! @brief Defines class IntensityDataFFTPresenter
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Device/Data/DataUtils.h"
20 #include <QAction>
21 #include <QApplication>
22 #include <QWidget>
23 
25  : QObject(parent)
26  , m_fftAction(nullptr)
27  , m_fftModel(new SessionModel("TempFFTModel", this))
28  , m_fftItem(nullptr)
29  , m_in_fft_mode(false)
30 {
32  m_fftAction = new QAction(this);
33  m_fftAction->setText("Fourier");
34  m_fftAction->setIcon(QIcon(":/images/alpha-f-box.svg"));
35  m_fftAction->setToolTip("Get the Fourier Transform of current intensity map");
36  connect(m_fftAction, &QAction::triggered, this, &IntensityDataFFTPresenter::onFFTActionRequest);
37 }
38 
40 {
41  m_in_fft_mode = false;
42 }
43 
45 {
46  if (!origItem)
47  throw GUIHelpers::Error("IntensityDataFFTPresenter::fftItem() -> Error. Empty item.");
48 
49  QApplication::setOverrideCursor(Qt::WaitCursor);
50 
52 
53  QApplication::restoreOverrideCursor();
54 
55  return m_fftItem;
56 }
57 
59 {
60  return QList<QAction*>() << m_fftAction;
61 }
62 
64 {
65  return m_in_fft_mode;
66 }
67 
69 {
72 }
Defines namespace DataUtils.
Defines class GUIHelpers functions.
Defines class IntensityDataFFTPresenter.
Defines class IntensityDataItem.
Defines class SessionModel.
OutputData< double > * getOutputData()
Definition: DataItem.h:36
IntensityDataItem * fftItem(IntensityDataItem *origItem)
IntensityDataFFTPresenter(QWidget *parent=nullptr)
void setOutputData(OutputData< double > *data) override
The given pointer becomes owned by this class!!
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
Definition: SessionModel.h:125
std::unique_ptr< OutputData< double > > createFFT(const OutputData< double > &data)
Creates Fourier Transform (OutputData format) of intensity map (OutputData format).
Definition: DataUtils.cpp:256