BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
IntensityDataFFTPresenter Class Reference

Description

Provides support in Fast Fourier transformation of IntensityDataItem. Contains own model to hold IntensityDataItem with fft-transformed results.

Definition at line 28 of file IntensityDataFFTPresenter.h.

Inheritance diagram for IntensityDataFFTPresenter:
[legend]
Collaboration diagram for IntensityDataFFTPresenter:
[legend]

Signals

void fftActionRequest ()
 

Public Member Functions

 IntensityDataFFTPresenter (QWidget *parent=nullptr)
 
QList< QAction * > actionList ()
 
IntensityDataItemfftItem (IntensityDataItem *origItem)
 
bool inFFTMode () const
 
void reset ()
 

Private Slots

void onFFTActionToggled (bool toggled)
 

Private Attributes

QAction * m_fftAction
 
IntensityDataItemm_fftItem
 
SessionModelm_fftModel
 
bool m_in_fft_mode
 

Constructor & Destructor Documentation

◆ IntensityDataFFTPresenter()

IntensityDataFFTPresenter::IntensityDataFFTPresenter ( QWidget *  parent = nullptr)

Definition at line 24 of file IntensityDataFFTPresenter.cpp.

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  m_fftAction->setCheckable(true);
37  connect(m_fftAction, &QAction::toggled, this, &IntensityDataFFTPresenter::onFFTActionToggled);
38 }
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
Definition: SessionModel.h:42
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
Definition: SessionModel.h:137

References SessionModel::insertItem(), m_fftAction, m_fftItem, m_fftModel, and onFFTActionToggled().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

QList< QAction * > IntensityDataFFTPresenter::actionList ( )

Definition at line 59 of file IntensityDataFFTPresenter.cpp.

60 {
61  return QList<QAction*>() << m_fftAction;
62 }

References m_fftAction.

Referenced by IntensityDataWidget::actionList().

◆ fftActionRequest

void IntensityDataFFTPresenter::fftActionRequest ( )
signal

◆ fftItem()

IntensityDataItem * IntensityDataFFTPresenter::fftItem ( IntensityDataItem origItem)

Definition at line 45 of file IntensityDataFFTPresenter.cpp.

46 {
47  if (!origItem)
48  throw Error("IntensityDataFFTPresenter::fftItem() -> Error. Empty item.");
49 
50  QApplication::setOverrideCursor(Qt::WaitCursor);
51 
52  m_fftItem->setDatafield(DataUtils::Data::createFFT(*origItem->getDatafield()).release());
53 
54  QApplication::restoreOverrideCursor();
55 
56  return m_fftItem;
57 }
Datafield * getDatafield()
Definition: DataItem.h:41
void setDatafield(Datafield *data) override
The given pointer becomes owned by this class!!

References Error, DataItem::getDatafield(), m_fftItem, and IntensityDataItem::setDatafield().

Referenced by IntensityDataWidget::onFFTAction().

Here is the call graph for this function:

◆ inFFTMode()

bool IntensityDataFFTPresenter::inFFTMode ( ) const

Definition at line 64 of file IntensityDataFFTPresenter.cpp.

65 {
66  return m_in_fft_mode;
67 }

References m_in_fft_mode.

Referenced by IntensityDataWidget::onFFTAction().

◆ onFFTActionToggled

void IntensityDataFFTPresenter::onFFTActionToggled ( bool  toggled)
privateslot

Definition at line 69 of file IntensityDataFFTPresenter.cpp.

70 {
71  m_in_fft_mode = toggled;
73 }

References fftActionRequest(), and m_in_fft_mode.

Referenced by IntensityDataFFTPresenter().

◆ reset()

void IntensityDataFFTPresenter::reset ( )

Definition at line 40 of file IntensityDataFFTPresenter.cpp.

41 {
42  m_in_fft_mode = false;
43 }

References m_in_fft_mode.

Referenced by IntensityDataWidget::setItem().

Member Data Documentation

◆ m_fftAction

QAction* IntensityDataFFTPresenter::m_fftAction
private

Definition at line 48 of file IntensityDataFFTPresenter.h.

Referenced by IntensityDataFFTPresenter(), and actionList().

◆ m_fftItem

IntensityDataItem* IntensityDataFFTPresenter::m_fftItem
private

Definition at line 50 of file IntensityDataFFTPresenter.h.

Referenced by IntensityDataFFTPresenter(), and fftItem().

◆ m_fftModel

SessionModel* IntensityDataFFTPresenter::m_fftModel
private

Definition at line 49 of file IntensityDataFFTPresenter.h.

Referenced by IntensityDataFFTPresenter().

◆ m_in_fft_mode

bool IntensityDataFFTPresenter::m_in_fft_mode
private

Definition at line 51 of file IntensityDataFFTPresenter.h.

Referenced by inFFTMode(), onFFTActionToggled(), and reset().


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