BornAgain
1.19.79
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/View/PlotUtil/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
15
#include "
GUI/View/PlotUtil/PlotEventInfo.h
"
16
#include "Base/Py/PyFmt.h"
17
18
PlotEventInfo::PlotEventInfo
(
PLOT_TYPE
type)
19
: m_in_axes_range(false)
20
, m_log_valued_axis(false)
21
, m_x(0.0)
22
, m_y(0.0)
23
, m_value(0.0)
24
, m_nx(0)
25
, m_ny(0)
26
, m_info_type(type)
27
{
28
}
29
30
QString
PlotEventInfo::statusString
()
const
31
{
32
QString result;
33
result =
m_info_type
==
PLOT_TYPE::Plot1D
34
? QString(
" [x: %1, y: %2] [binx: %3]"
)
35
.arg(QString::number(
x
(),
'f'
, 4))
36
.arg(
valueToString
())
37
.arg(
m_nx
, 2)
38
: QString(
" [x: %1, y: %2] [binx: %3, biny:%4] [value: %5]"
)
39
.arg(QString::number(
x
(),
'f'
, 4))
40
.arg(QString::number(
y
(),
'f'
, 4), 2)
41
.arg(
m_nx
, 2)
42
.arg(
m_ny
, 2)
43
.arg(
valueToString
());
44
45
return
result;
46
}
47
48
QString
PlotEventInfo::valueToString
()
const
49
{
50
return
m_info_type
==
PLOT_TYPE::Plot1D
||
m_log_valued_axis
51
? QString::fromStdString(Py::Fmt::printScientificDouble(
m_value
))
52
: QString::number(
m_value
,
'f'
, 2);
53
}
PlotEventInfo.h
Defines the class PlotEventInfo.
PlotEventInfo::x
double x() const
Definition:
PlotEventInfo.h:42
PlotEventInfo::m_log_valued_axis
bool m_log_valued_axis
Definition:
PlotEventInfo.h:57
PlotEventInfo::m_ny
int m_ny
Definition:
PlotEventInfo.h:59
PlotEventInfo::valueToString
QString valueToString() const
Definition:
PlotEventInfo.cpp:48
PlotEventInfo::m_nx
int m_nx
Definition:
PlotEventInfo.h:59
PlotEventInfo::y
double y() const
Definition:
PlotEventInfo.h:44
PlotEventInfo::m_info_type
PLOT_TYPE m_info_type
Definition:
PlotEventInfo.h:60
PlotEventInfo::PlotEventInfo
PlotEventInfo(PLOT_TYPE type)
Definition:
PlotEventInfo.cpp:18
PlotEventInfo::m_value
double m_value
Definition:
PlotEventInfo.h:58
PlotEventInfo::statusString
QString statusString() const
Definition:
PlotEventInfo.cpp:30
ScientificPlot::PLOT_TYPE
PLOT_TYPE
Definition:
ScientificPlot.h:31
ScientificPlot::PLOT_TYPE::Plot1D
@ Plot1D
GUI
View
PlotUtil
PlotEventInfo.cpp
Generated by
1.9.1