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

Description

Contains parameters of mouse position in 1D or 2D plot.

Definition at line 26 of file PlotEventInfo.h.

Public Member Functions

 PlotEventInfo (PLOT_TYPE type)
 
bool inAxesRange () const
 
bool isLogValueAxis () const
 
int nx () const
 
int ny () const
 
void setInAxesRange (bool flag)
 
void setLogValueAxis (bool flag)
 
void setNx (int nx)
 
void setNy (int ny)
 
void setValue (double value)
 
void setX (double x)
 
void setY (double y)
 
QString statusString () const
 
double value () const
 
double x () const
 
double y () const
 

Private Types

using PLOT_TYPE = ScientificPlot::PLOT_TYPE
 

Private Member Functions

QString valueToString () const
 

Private Attributes

bool m_in_axes_range
 
PLOT_TYPE m_info_type
 
bool m_log_valued_axis
 
int m_nx
 
int m_ny
 
double m_value
 
double m_x
 
double m_y
 

Member Typedef Documentation

◆ PLOT_TYPE

Definition at line 27 of file PlotEventInfo.h.

Constructor & Destructor Documentation

◆ PlotEventInfo()

PlotEventInfo::PlotEventInfo ( PLOT_TYPE  type)

Definition at line 18 of file PlotEventInfo.cpp.

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 }
bool m_log_valued_axis
Definition: PlotEventInfo.h:57
bool m_in_axes_range
Definition: PlotEventInfo.h:57
PLOT_TYPE m_info_type
Definition: PlotEventInfo.h:60

Member Function Documentation

◆ inAxesRange()

bool PlotEventInfo::inAxesRange ( ) const
inline

Definition at line 36 of file PlotEventInfo.h.

36 { return m_in_axes_range; }

References m_in_axes_range.

Referenced by ScientificPlotEvent::onCustomMouseMove().

◆ isLogValueAxis()

bool PlotEventInfo::isLogValueAxis ( ) const
inline

Definition at line 39 of file PlotEventInfo.h.

39 { return m_log_valued_axis; }

References m_log_valued_axis.

◆ nx()

int PlotEventInfo::nx ( ) const
inline

Definition at line 50 of file PlotEventInfo.h.

50 { return m_nx; }

References m_nx.

Referenced by ColorMap::eventInfo(), and setNx().

◆ ny()

int PlotEventInfo::ny ( ) const
inline

Definition at line 52 of file PlotEventInfo.h.

52 { return m_ny; }

References m_ny.

Referenced by ColorMap::eventInfo(), and setNy().

◆ setInAxesRange()

void PlotEventInfo::setInAxesRange ( bool  flag)
inline

Definition at line 35 of file PlotEventInfo.h.

35 { m_in_axes_range = flag; }

References m_in_axes_range.

Referenced by Plot1D::eventInfo(), SpecularPlot::eventInfo(), and ColorMap::eventInfo().

◆ setLogValueAxis()

void PlotEventInfo::setLogValueAxis ( bool  flag)
inline

Definition at line 38 of file PlotEventInfo.h.

38 { m_log_valued_axis = flag; }

References m_log_valued_axis.

Referenced by ColorMap::eventInfo().

◆ setNx()

void PlotEventInfo::setNx ( int  nx)
inline

Definition at line 49 of file PlotEventInfo.h.

49 { m_nx = nx; }
int nx() const
Definition: PlotEventInfo.h:50

References m_nx, and nx().

Referenced by Plot1D::eventInfo(), SpecularPlot::eventInfo(), and ColorMap::eventInfo().

Here is the call graph for this function:

◆ setNy()

void PlotEventInfo::setNy ( int  ny)
inline

Definition at line 51 of file PlotEventInfo.h.

51 { m_ny = ny; }
int ny() const
Definition: PlotEventInfo.h:52

References m_ny, and ny().

Referenced by ColorMap::eventInfo().

Here is the call graph for this function:

◆ setValue()

void PlotEventInfo::setValue ( double  value)
inline

Definition at line 46 of file PlotEventInfo.h.

46 { m_value = value; }
double value() const
Definition: PlotEventInfo.h:47

References m_value, and value().

Referenced by Plot1D::eventInfo(), SpecularPlot::eventInfo(), and ColorMap::eventInfo().

Here is the call graph for this function:

◆ setX()

void PlotEventInfo::setX ( double  x)
inline

Definition at line 41 of file PlotEventInfo.h.

41 { m_x = x; }
double x() const
Definition: PlotEventInfo.h:42

References m_x, and x().

Referenced by Plot1D::eventInfo(), SpecularPlot::eventInfo(), and ColorMap::eventInfo().

Here is the call graph for this function:

◆ setY()

void PlotEventInfo::setY ( double  y)
inline

Definition at line 43 of file PlotEventInfo.h.

43 { m_y = y; }
double y() const
Definition: PlotEventInfo.h:44

References m_y, and y().

Referenced by ColorMap::eventInfo().

Here is the call graph for this function:

◆ statusString()

QString PlotEventInfo::statusString ( ) const

Definition at line 30 of file PlotEventInfo.cpp.

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 }
QString valueToString() const

References m_info_type, m_nx, m_ny, ScientificPlot::Plot1D, valueToString(), x(), and y().

Here is the call graph for this function:

◆ value()

double PlotEventInfo::value ( ) const
inline

Definition at line 47 of file PlotEventInfo.h.

47 { return m_value; }

References m_value.

Referenced by setValue().

◆ valueToString()

QString PlotEventInfo::valueToString ( ) const
private

Definition at line 48 of file PlotEventInfo.cpp.

49 {
51  ? QString::fromStdString(Py::Fmt::printScientificDouble(m_value))
52  : QString::number(m_value, 'f', 2);
53 }

References m_info_type, m_log_valued_axis, m_value, and ScientificPlot::Plot1D.

Referenced by statusString().

◆ x()

double PlotEventInfo::x ( ) const
inline

Definition at line 42 of file PlotEventInfo.h.

42 { return m_x; }

References m_x.

Referenced by Plot1D::eventInfo(), SpecularPlot::eventInfo(), setX(), and statusString().

◆ y()

double PlotEventInfo::y ( ) const
inline

Definition at line 44 of file PlotEventInfo.h.

44 { return m_y; }

References m_y.

Referenced by setY(), and statusString().

Member Data Documentation

◆ m_in_axes_range

bool PlotEventInfo::m_in_axes_range
private

Definition at line 57 of file PlotEventInfo.h.

Referenced by inAxesRange(), and setInAxesRange().

◆ m_info_type

PLOT_TYPE PlotEventInfo::m_info_type
private

Definition at line 60 of file PlotEventInfo.h.

Referenced by statusString(), and valueToString().

◆ m_log_valued_axis

bool PlotEventInfo::m_log_valued_axis
private

Definition at line 57 of file PlotEventInfo.h.

Referenced by isLogValueAxis(), setLogValueAxis(), and valueToString().

◆ m_nx

int PlotEventInfo::m_nx
private

Definition at line 59 of file PlotEventInfo.h.

Referenced by nx(), setNx(), and statusString().

◆ m_ny

int PlotEventInfo::m_ny
private

Definition at line 59 of file PlotEventInfo.h.

Referenced by ny(), setNy(), and statusString().

◆ m_value

double PlotEventInfo::m_value
private

Definition at line 58 of file PlotEventInfo.h.

Referenced by setValue(), value(), and valueToString().

◆ m_x

double PlotEventInfo::m_x
private

Definition at line 58 of file PlotEventInfo.h.

Referenced by setX(), and x().

◆ m_y

double PlotEventInfo::m_y
private

Definition at line 58 of file PlotEventInfo.h.

Referenced by setY(), and y().


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