BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PlotEventInfo.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/PlotEventInfo.cpp
6 //! @brief Implementation of the class PlotEventInfo
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 "Core/Export/PyFmt.h"
18 
20  : m_in_axes_range(false)
21  , m_log_valued_axis(false)
22  , m_x(0.0)
23  , m_y(0.0)
24  , m_value(0.0)
25  , m_nx(0)
26  , m_ny(0)
27  , m_info_type(type)
28 {
29 }
30 
32 {
33  QString result;
34  result = m_info_type == PLOT_TYPE::Plot1D
35  ? QString(" [x: %1, y: %2] [binx: %3]")
36  .arg(QString::number(x(), 'f', 4))
37  .arg(valueToString())
38  .arg(m_nx, 2)
39  : QString(" [x: %1, y: %2] [binx: %3, biny:%4] [value: %5]")
40  .arg(QString::number(x(), 'f', 4))
41  .arg(QString::number(y(), 'f', 4), 2)
42  .arg(m_nx, 2)
43  .arg(m_ny, 2)
44  .arg(valueToString());
45 
46  return result;
47 }
48 
50 {
52  ? QString::fromStdString(pyfmt::printScientificDouble(m_value))
53  : QString::number(m_value, 'f', 2);
54 }
Defines class GUIHelpers functions.
Defines the class PlotEventInfo.
Defines functions in namespace pyfmt.
double x() const
Definition: PlotEventInfo.h:42
bool m_log_valued_axis
Definition: PlotEventInfo.h:57
QString valueToString() const
double y() const
Definition: PlotEventInfo.h:44
PLOT_TYPE m_info_type
Definition: PlotEventInfo.h:60
PlotEventInfo(PLOT_TYPE type)
QString statusString() const
std::string printScientificDouble(double input)
Definition: PyFmt.cpp:91