#include <Wavelengths.h>
Public Member Functions | |
| virtual bool | setStartValues (const std::vector< double > &startValues, WavelengthUnitsType valueUnits)=0 |
| virtual const std::vector < double > & | getStartValues () const =0 |
| virtual bool | hasStartValues () const =0 |
| virtual bool | setCenterValues (const std::vector< double > ¢erValues, WavelengthUnitsType valueUnits)=0 |
| virtual const std::vector < double > & | getCenterValues () const =0 |
| virtual bool | hasCenterValues () const =0 |
| virtual bool | setEndValues (const std::vector< double > &endValues, WavelengthUnitsType valueUnits)=0 |
| virtual const std::vector < double > & | getEndValues () const =0 |
| virtual bool | hasEndValues () const =0 |
| virtual void | setUnits (WavelengthUnitsType units, bool convertValues=true)=0 |
| virtual WavelengthUnitsType | getUnits () const =0 |
| virtual void | clear ()=0 |
| virtual bool | isEmpty () const =0 |
| virtual unsigned int | getNumWavelengths () const =0 |
| virtual void | scaleValues (double dScaleFactor)=0 |
| virtual void | calculateFwhm (double dConstant=1.0)=0 |
| virtual std::vector< double > | getFwhm ()=0 |
| virtual bool | initializeFromWavelengths (const Wavelengths *pWavelengths)=0 |
| virtual bool | initializeFromDynamicObject (const DynamicObject *pData, bool convertToDisplayUnits)=0 |
| virtual bool | applyToDynamicObject (DynamicObject *pData)=0 |
Static Public Member Functions | |
| static unsigned int | getNumWavelengths (const DynamicObject *pData) |
| static double | convertValue (double value, WavelengthUnitsType valueUnits, WavelengthUnitsType newUnits) |
| static std::string | WavelengthType () |
| static std::string | WavelengthsArg () |
| static std::string | WavelengthFileArg () |
Protected Member Functions | |
| virtual | ~Wavelengths () |
This class provides a common object for working with wavelength values. It contains start, center, and end wavelength values and the units associated with the values. The values and units can be set directly or initialized from special metadata attributes in a DynamicObject or from another Wavelengths object. The Wavelengths object can be used as an input or output plug-in arg. Additional convenience static methods are provided to convert wavelength values between units and to query the number of wavelength values in a DynamicObject.
Wavelength objects should be created with an object factory resource as follows:
FactoryResource<Wavelengths> pWavelengths;
When the Wavelengths object is created, the start, center, and end value vectors are empty (i.e. isEmpty() returns true), and the units are set to WavelengthUnitsType::MICRONS.
Definition at line 44 of file Wavelengths.h.
| virtual Wavelengths::~Wavelengths | ( | ) | [protected, virtual] |
This should be destroyed by calling ObjectFactory::destroyObject().
Definition at line 492 of file Wavelengths.h.
| virtual bool Wavelengths::setStartValues | ( | const std::vector< double > & | startValues, | |
| WavelengthUnitsType | valueUnits | |||
| ) | [pure virtual] |
Sets starting wavelength values.
The number of starting values must equal the number of center and ending values if they are present.
| startValues | The starting wavelength values. | |
| valueUnits | The units of the starting wavelength values. If the units are not the same units returned by getUnits(), the values are automatically converted before they are set. |
true if the start values are successfully set; returns false if any of the following occur:| virtual const std::vector<double>& Wavelengths::getStartValues | ( | ) | const [pure virtual] |
Returns the starting wavelength values.
| virtual bool Wavelengths::hasStartValues | ( | ) | const [pure virtual] |
Queries whether starting wavelength values are present.
This is a convenience method that is equivalent to calling !getStartValues().empty().
true if starting wavelengths are present; otherwise returns false.| virtual bool Wavelengths::setCenterValues | ( | const std::vector< double > & | centerValues, | |
| WavelengthUnitsType | valueUnits | |||
| ) | [pure virtual] |
Sets center wavelength values.
The number of center values must equal the number of starting and ending values if they are present.
| centerValues | The center wavelength values. | |
| valueUnits | The units of the center wavelength values. If the units are not the same units returned by getUnits(), the values are automatically converted before they are set. |
true if the center values are successfully set; returns false if any of the following occur:| virtual const std::vector<double>& Wavelengths::getCenterValues | ( | ) | const [pure virtual] |
Returns the center wavelength values.
| virtual bool Wavelengths::hasCenterValues | ( | ) | const [pure virtual] |
Queries whether center wavelength values are present.
This is a convenience method that is equivalent to calling !getCenterValues().empty().
true if center wavelengths are present; otherwise returns false.| virtual bool Wavelengths::setEndValues | ( | const std::vector< double > & | endValues, | |
| WavelengthUnitsType | valueUnits | |||
| ) | [pure virtual] |
Sets ending wavelength values.
The number of ending values must equal the number of starting and center values if they are present.
| endValues | The ending wavelength values. | |
| valueUnits | The units of the ending wavelength values. If the units are not the same units returned by getUnits(), the values are automatically converted before they are set. |
true if the ending values are successfully set; returns false if any of the following occur:| virtual const std::vector<double>& Wavelengths::getEndValues | ( | ) | const [pure virtual] |
Returns the ending wavelength values.
| virtual bool Wavelengths::hasEndValues | ( | ) | const [pure virtual] |
Queries whether ending wavelength values are present.
This is a convenience method that is equivalent to calling !getEndValues().empty().
true if ending wavelengths are present; otherwise returns false.| virtual void Wavelengths::setUnits | ( | WavelengthUnitsType | units, | |
| bool | convertValues = true | |||
| ) | [pure virtual] |
Assigns units to the wavelength values.
| units | The new wavelength units. | |
| convertValues | If set to true, all wavelength values are converted to the new units. If set to false, no wavelength values are modified. |
| virtual WavelengthUnitsType Wavelengths::getUnits | ( | ) | const [pure virtual] |
Returns the units of the start, center, and end wavelength values.
| virtual void Wavelengths::clear | ( | ) | [pure virtual] |
Clears the wavelength values and units.
This method clears the start, center, and end wavelength values, and sets the units to WavelengthUnitsType::MICRONS. After calling this method, isEmpty() returns true.
| virtual bool Wavelengths::isEmpty | ( | ) | const [pure virtual] |
Queries whether start, center, or end wavelength values are present.
true if start, center, and end wavelengths are not present (i.e. all wavelength vectors are empty); otherwise returns false.| virtual unsigned int Wavelengths::getNumWavelengths | ( | ) | const [pure virtual] |
Returns the number of wavelength values.
| virtual void Wavelengths::scaleValues | ( | double | dScaleFactor | ) | [pure virtual] |
Adjusts all wavelength values by a given scale factor.
This method multiplies the start, center, and end wavelengths by the given scale factor. The units are not changed.
| dScaleFactor | The scale factor by which to adjust the wavelength values. This method does nothing if the scale factor is zero or negative. |
| virtual void Wavelengths::calculateFwhm | ( | double | dConstant = 1.0 |
) | [pure virtual] |
Populates the start and end wavelengths by calculating the full width at half maximum (FWHM) of the center wavelength values.
This method does nothing if center wavelength values are not set.
| dConstant | An optional constant that is multiplied by the wavelength width when calculating the FWHM. |
| virtual std::vector<double> Wavelengths::getFwhm | ( | ) | [pure virtual] |
Returns the calculated full width at half maximum (FWHM) values.
If start or end wavelengths are not set, this method calculates the FWHM and returns the values for each wavelength.
| virtual bool Wavelengths::initializeFromWavelengths | ( | const Wavelengths * | pWavelengths | ) | [pure virtual] |
Sets the start, center, and end wavelength values and units to those of another Wavelengths object.
| pWavelengths | The Wavelengths object from which to set the wavelength values and units. |
true if the start, center, and end values and units are successfully set from the Wavelengths object; otherwise returns false.| virtual bool Wavelengths::initializeFromDynamicObject | ( | const DynamicObject * | pData, | |
| bool | convertToDisplayUnits | |||
| ) | [pure virtual] |
Sets the start, center, and end wavelength values and units based on special metadata attributes.
| pData | The DynamicObject containing the special metadata attributes from which to set the wavelength values and units. | |
| convertToDisplayUnits | If set to true, all wavelength values are converted to the units set in the WAVELENGTH_DISPLAY_UNITS_METADATA_NAME special metadata attribute. If set to false, the units will be set to WavelengthUnitsType::MICRONS, which is how the values are stored in the DynamicObject. |
true if the start, center, and end values and units are successfully set from the special metadata attributes; otherwise returns false.| virtual bool Wavelengths::applyToDynamicObject | ( | DynamicObject * | pData | ) | [pure virtual] |
Sets wavelength values and units special metadata attributes in a DynamicObject.
If starting, center, or ending values are not present, the existing special metadata attribute is removed. If isEmpty() returns true, the units attribute is removed.
The wavelength values are set into the DynamicObject in microns, regardless of the units returned by getUnits(). The units returned by getUnits() are set into the WAVELENGTH_DISPLAY_UNITS_METADATA_NAME attribute as the display units.
| pData | The DynamicObject in which to set the wavelength values and units special metadata attributes. |
true if the start, center, and end values and units special metadata attributes are successfully updated in the DynamicObject; otherwise returns false.| static unsigned int Wavelengths::getNumWavelengths | ( | const DynamicObject * | pData | ) | [static] |
Returns the number of wavelength values contained in the special metadata attributes of a DynamicObject.
This method is a convenience method to get the number of wavelength values in a DynamicObject without creating a Wavelengths instance and without making copies of its wavelength vectors.
| pData | The DynamicObject from which to get the number of wavelength values contained in the special metadata attributes. This should be the DynamicObject containing the "Special" attribute. |
Definition at line 364 of file Wavelengths.h.
| static double Wavelengths::convertValue | ( | double | value, | |
| WavelengthUnitsType | valueUnits, | |||
| WavelengthUnitsType | newUnits | |||
| ) | [static] |
Converts a wavelength value from one set of units to another.
| value | The wavelength value to convert. | |
| valueUnits | The units of the given value. | |
| newUnits | The units to which the value should be converted. |
Definition at line 409 of file Wavelengths.h.
| static std::string Wavelengths::WavelengthType | ( | ) | [static] |
The type string that should be returned from PlugIn::getType() for types of plug-ins that import or export wavelengths.
Definition at line 459 of file Wavelengths.h.
| static std::string Wavelengths::WavelengthsArg | ( | ) | [static] |
A default name for a Wavelengths plug-in argument.
Definition at line 471 of file Wavelengths.h.
| static std::string Wavelengths::WavelengthFileArg | ( | ) | [static] |
A default name for a wavelengths file plug-in argument.
Definition at line 483 of file Wavelengths.h.