81#ifndef __GyotoConverters_H_
82#define __GyotoConverters_H_
177 double ToMeters(
double value,
const std::string &unit,
364 double ToHerz(
double value,
const std::string &unit);
379 double FromHerz(
double value,
const std::string &unit);
445 double
To (double val, const Unit &from_unit);
455 double
From (double val, const Unit &to_unit);
462 operator std::string() const ;
469 operator ut_unit*() const ;
480 const Gyoto::Units::Unit& to);
486 void
reset(const Gyoto::Units::Unit& from,
487 const Gyoto::Units::Unit& to);
503 double operator()(double value) const ;
Reference-counting pointers.
Base class for metrics.
Definition GyotoMetric.h:162
Can be pointed to by a SmartPointer.
Definition GyotoSmartPointer.h:81
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Wrapper around ut_converter from udunits.
Definition GyotoConverters.h:472
cv_converter * converter_
Underlying ut_converter object from udunits.
Definition GyotoConverters.h:475
void reset()
Reset to trivial Converter (Converter()(x)==x).
Converter()
Construct trivial Converter (Converter()(x)==x).
Wrapper around ut_unit from udunits.
Definition GyotoConverters.h:403
double From(double val, const Unit &to_unit)
Convert from Unit.
ut_unit * unit_
the underlying ut_unit (from udunits)
Definition GyotoConverters.h:407
double To(double val, const Unit &from_unit)
Convert to Unit.
std::string kind_
the string used to instantiate this unit
Definition GyotoConverters.h:408
Unit(const std::string &unit)
Build Unit described by string.
Access to metrics.
Definition GyotoAstrobj.h:47
Units-related classes and functions.
Definition GyotoConverters.h:98
double FromSeconds(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg=NULL)
Convert to arbitrary time unit from seconds.
double ToGeometricalTime(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg)
Convert from arbitrary time unit to geometrical units.
double ToGeometrical(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg)
Convert from arbitrary length unit to geometrical units.
bool areConvertible(const Unit &unit1, const Unit &unit2)
Is it possible to convert between unit1 and unit2?
ut_system * getSystem()
Retrieve the unit system used in all of Gyoto.
double FromKilograms(double value, const std::string &unit)
Convert to arbitrary mass unit from kilograms.
double FromGeometricalTime(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg)
Convert to arbitrary time unit from geometrical units.
double FromGeometrical(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg)
Convert to arbitrary length unit from geometrical units.
double FromHerz(double value, const std::string &unit)
Convert to arbitrary frequency unit from Herz.
double ToSeconds(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg=NULL)
Convert from arbitrary time unit to seconds.
double ToMeters(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg=NULL)
Convert from arbitrary length unit to meters.
double FromMeters(double value, const std::string &unit, const Gyoto::SmartPointer< Gyoto::Metric::Generic > &gg=NULL)
Convert to arbitrary length unit from meters.
double ToKilograms(double value, const std::string &unit)
Convert from arbitrary mass unit to kilograms.
void Init()
Load and initialize all (non-context-sensitive) units.
double ToHerz(double value, const std::string &unit)
Convert from arbitrary frequency unit to Herz.
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44