|
Mantid
|
Deals with formatting a label for a plot axis for a given type of workspace. More...
#include <PlotAxis.h>
Public Member Functions | |
| PlotAxis ()=delete | |
| Disable default constructor. More... | |
| PlotAxis (const bool plottingDistribution, const Mantid::API::MatrixWorkspace &workspace) | |
| Constructor with just a workspace (reverse order to above so compiler doesn't convert a a bool to an size_t and call the wrong thing. More... | |
| PlotAxis (const Mantid::API::IMDWorkspace &workspace, const size_t index) | |
| Constructor with workspace & axis index. More... | |
| PlotAxis (const Mantid::Geometry::IMDDimension &dim) | |
| Constructor with an IMDDimension. More... | |
| QString | title () const |
| Create a new axis title. More... | |
Private Member Functions | |
| void | titleFromDimension (const Mantid::Geometry::IMDDimension &dim) |
| Creates a title suitable for an axis attached to the given dimension. More... | |
| void | titleFromIndex (const Mantid::API::IMDWorkspace &workspace, const size_t index) |
| Creates a title suitable for an axis attached to the given index. More... | |
| void | titleFromYData (const Mantid::API::MatrixWorkspace &workspace, const bool plottingDistribution) |
| Creates a title suitable for the Y data values. More... | |
Private Attributes | |
| QString | m_title |
| Title. More... | |
Deals with formatting a label for a plot axis for a given type of workspace.
Definition at line 23 of file PlotAxis.h.
| MantidQt::API::PlotAxis::PlotAxis | ( | const Mantid::API::IMDWorkspace & | workspace, |
| const size_t | index | ||
| ) |
Constructor with workspace & axis index.
The title will be filled with the caption & units from the given Axis object of the workspace.
| workspace | The workspace containing the axis information |
| index | Index of the axis in the workspace to inspect |
Definition at line 53 of file PlotAxis.cpp.
References index, titleFromIndex(), and workspace.
| MantidQt::API::PlotAxis::PlotAxis | ( | const Mantid::Geometry::IMDDimension & | dim | ) |
Constructor with an IMDDimension.
The title will be filled with the caption & units from the given dimension object.
| dim | A dimension object, usually from a workspace |
Definition at line 65 of file PlotAxis.cpp.
References titleFromDimension().
| MantidQt::API::PlotAxis::PlotAxis | ( | const bool | plottingDistribution, |
| const Mantid::API::MatrixWorkspace & | workspace | ||
| ) |
Constructor with just a workspace (reverse order to above so compiler doesn't convert a a bool to an size_t and call the wrong thing.
The title will be filled with the caption & label for the Y data values within the workspace, ~ the Z axis.
| plottingDistribution | If true, the Y axis has been divided by the bin width |
| workspace | The workspace containing the Y title information |
Definition at line 74 of file PlotAxis.cpp.
References titleFromYData(), and workspace.
|
delete |
Disable default constructor.
| QString MantidQt::API::PlotAxis::title | ( | ) | const |
Create a new axis title.
Definition at line 81 of file PlotAxis.cpp.
References m_title.
|
private |
Creates a title suitable for an axis attached to the given dimension.
| dim | A dimension object that encapsulates the axis data |
Definition at line 98 of file PlotAxis.cpp.
References Mantid::Geometry::IMDDimension::getName(), Mantid::Geometry::IMDDimension::getUnits(), m_title, and MantidQt::API::toQStringInternal().
Referenced by PlotAxis(), and titleFromIndex().
|
private |
Creates a title suitable for an axis attached to the given index.
| workspace | The workspace containing the axis information |
| index | Index of the axis in the workspace to inspect |
Definition at line 87 of file PlotAxis.cpp.
References index, m_title, titleFromDimension(), and workspace.
Referenced by PlotAxis().
|
private |
Creates a title suitable for the Y data values.
Constructs a title using the unicode methods of the UnitLabel.
| workspace | The workspace containing the Y title information |
| plottingDistribution | If true, the Y axis has been divided by the bin width |
Definition at line 116 of file PlotAxis.cpp.
References m_title, and workspace.
Referenced by PlotAxis().
|
private |
Title.
Definition at line 49 of file PlotAxis.h.
Referenced by title(), titleFromDimension(), titleFromIndex(), and titleFromYData().