Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::Units::Label Class Reference

Label unit. More...

Inheritance diagram for Mantid::Kernel::Units::Label:
Mantid::Kernel::Units::Empty Mantid::Kernel::Unit

Public Member Functions

const std::string caption () const override
 The full name of the unit.
 
Unitclone () const override
 
 Label ()
 Constructor.
 
const UnitLabel label () const override
 A label for the unit to be printed on axes,.
 
 Label (const std::string &caption, const std::string &label)
 
void setLabel (const std::string &cpt, const UnitLabel &lbl=UnitLabel(""))
 Set a caption and a label.
 
const std::string unitID () const override
 "Label"
 
- Public Member Functions inherited from Mantid::Kernel::Units::Empty
double conversionTOFMax () const override
 
double conversionTOFMin () const override
 
 Empty ()
 Constructor.
 
void init () override
 Finalize the initialization.
 
bool isConvertible () const override
 Returns if the unit can be used in conversions.
 
double singleFromTOF (const double tof) const override
 Convert a single tof value to this unit.
 
double singleToTOF (const double x) const override
 Convert a single X value to TOF.
 
- Public Member Functions inherited from Mantid::Kernel::Unit
virtual std::pair< double, double > conversionRange () const
 The range where conversion to TOF from given units is monotonic and reversible.
 
double convertSingleFromTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the time-of-flight to the concrete unit. TOF is in microseconds.
 
double convertSingleToTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the concrete unit to time-of-flight. TOF is in microseconds.
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from time-of-flight to the concrete unit.
 
void initialize (const double &_l1, const int &_emode, const UnitParametersMap &params)
 Initialize the unit to perform conversion using singleToTof() and singleFromTof()
 
bool isInitialized () const
 
bool operator!= (const Unit &u) const
 
bool operator== (const Unit &u) const
 
bool quickConversion (const Unit &destination, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
bool quickConversion (std::string destUnitName, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from the concrete unit to time-of-flight.
 
 Unit ()
 (Empty) Constructor
 
virtual ~Unit ()=default
 Virtual destructor.
 

Private Attributes

std::string m_caption
 Caption.
 
UnitLabel m_label
 Label.
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Kernel::Unit
void addConversion (std::string to, const double &factor, const double &power=1.0) const
 Add a 'quick conversion' from the unit class on which this method is called.
 
virtual void validateUnitParams (const int emode, const UnitParametersMap &params)
 
- Protected Attributes inherited from Mantid::Kernel::Unit
int emode
 emode :: The energy mode (0=elastic, 1=direct geometry, 2=indirect geometry)
 
bool initialized
 The unit values have been initialized.
 
double l1
 l1 :: The source-sample distance (in metres)
 
const UnitParametersMapm_params
 additional parameters l2 :: distance from sample to detector (in metres) twoTheta :: scattering angle in radians efixed :: Value of fixed energy: EI (emode=1) or EF (emode=2) (in meV) difc :: diffractometer constant DIFC
 

Detailed Description

Label unit.

Definition at line 228 of file Unit.h.

Constructor & Destructor Documentation

◆ Label() [1/2]

Mantid::Kernel::Units::Label::Label ( )

Constructor.

Definition at line 256 of file Unit.cpp.

Referenced by clone().

◆ Label() [2/2]

Mantid::Kernel::Units::Label::Label ( const std::string &  caption,
const std::string &  label 
)

Definition at line 258 of file Unit.cpp.

References caption(), label(), and setLabel().

Member Function Documentation

◆ caption()

const std::string Mantid::Kernel::Units::Label::caption ( ) const
inlineoverridevirtual

The full name of the unit.

Returns
The unit caption

Reimplemented from Mantid::Kernel::Units::Empty.

Definition at line 231 of file Unit.h.

Referenced by Label().

◆ clone()

Unit * Mantid::Kernel::Units::Label::clone ( ) const
overridevirtual
Returns
a cloned instance of the other

Reimplemented from Mantid::Kernel::Units::Empty.

Definition at line 270 of file Unit.cpp.

References Label().

◆ label()

const UnitLabel Mantid::Kernel::Units::Label::label ( ) const
overridevirtual

A label for the unit to be printed on axes,.

See also
UnitLabel
Returns
The unit label

Reimplemented from Mantid::Kernel::Units::Empty.

Definition at line 253 of file Unit.cpp.

Referenced by Label().

◆ setLabel()

void Mantid::Kernel::Units::Label::setLabel ( const std::string &  cpt,
const UnitLabel lbl = UnitLabel("") 
)

Set a caption and a label.

Definition at line 265 of file Unit.cpp.

References m_caption, and m_label.

Referenced by export_Label(), and Label().

◆ unitID()

const std::string Mantid::Kernel::Units::Label::unitID ( ) const
overridevirtual

"Label"

Reimplemented from Mantid::Kernel::Units::Empty.

Member Data Documentation

◆ m_caption

std::string Mantid::Kernel::Units::Label::m_caption
private

Caption.

Definition at line 241 of file Unit.h.

Referenced by setLabel().

◆ m_label

UnitLabel Mantid::Kernel::Units::Label::m_label
private

Label.

Definition at line 243 of file Unit.h.

Referenced by setLabel().


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