k3d::measurement Namespace Reference

Contains objects for storing and converting real-world units-of-measure. More...

Namespaces

namespace  conversion
 

Contains policy objects for converting between real-world units-of-measure.


Classes

class  unit
 Defines a real-world unit of measure, including singular written name, plural written name, and functions to_si() and from_si() for converting quantities to-and-from their corresponding SI standard units. More...
class  conversion_proxy
 Defines a proxy object so we can do conversion-by-assignment. More...
class  quantity
 Defines a real-world quantity (a combination of value and unit). More...
class  angle
 Defines an angular unit-of-measure. More...
class  area
 Defines a unit-of-measure for area. More...
class  distance
 Defines a unit-of-measure for distance. More...
class  force
 Defines a unit-of-measure for force. More...
class  mass
 Defines a unit-of-measure for mass. More...
class  pressure
 Defines a unit-of-measure for pressure. More...
class  time
 Defines a unit-of-measure for time. More...
class  volume
 Defines a unit-of-measure for volume. More...

Typedefs

typedef void scalar
 Defines a "scalar" quantity (no unit-of-measure).
typedef std::map< std::string,
angle
angle_units_t
 Defines a collection of units of angular measure, keyed by string (typically name or symbol).
typedef std::map< std::string,
area
area_units_t
 Defines a collection of units of area, keyed by string (typically name or symbol).
typedef std::map< std::string,
distance
distance_units_t
 Defines a collection of units of distance, keyed by string (typically name or symbol).
typedef std::map< std::string,
force
force_units_t
 Defines a collection of units of force, keyed by string (typically name or symbol).
typedef std::map< std::string,
mass
mass_units_t
 Defines a collection of units of mass, keyed by string (typically name or symbol).
typedef std::map< std::string,
pressure
pressure_units_t
 Defines a collection of units of pressure, keyed by string (typically name or symbol).
typedef std::map< std::string,
time
time_units_t
 Defines a collection of units of time, keyed by string (typically name or symbol).
typedef std::map< std::string,
volume
volume_units_t
 Defines a collection of units of volume, keyed by string (typically name or symbol).

Functions

bool parse (std::istream &Stream, double &Value, std::string &Units)
 Parses a mathematical expression with optional real-world units-of-measure.
bool parse (const std::string Buffer, double &Value, std::string &Units)
 Parses a mathematical expression with optional real-world units-of-measure.
bool parse (const std::string Buffer, double &Value, const std::type_info *const Units)
 Parses a mathematical expression with optional real-world units-of-measure, automatically converting it to the appropriate SI units.
const angle_units_tangle_units ()
 Returns a singleton collection of common units of angular measure, keyed by symbol.
const area_units_tarea_units ()
 Returns a singleton collection of common units of area, keyed by symbol.
const distance_units_tdistance_units ()
 Returns a singleton collection of common units of distance, keyed by symbol.
const force_units_tforce_units ()
 Returns a singleton collection of common units of force, keyed by symbol.
const mass_units_tmass_units ()
 Returns a singleton collection of common units of mass, keyed by symbol.
const pressure_units_tpressure_units ()
 Returns a singleton collection of common units of pressure, keyed by symbol.
const time_units_ttime_units ()
 Returns a singleton collection of common units of time, keyed by symbol.
const volume_units_tvolume_units ()
 Returns a singleton collection of common units of volume, keyed by symbol.
const angleangle_units (const std::string Symbol)
 Returns a reference to a common unit of angular measure keyed by symbol. Throws std::exception if the symbol is unknown.
const areaarea_units (const std::string Symbol)
 Returns a reference to a common unit of area keyed by symbol. Throws std::exception if the symbol is unknown.
const distancedistance_units (const std::string Symbol)
 Returns a reference to a common unit of distance keyed by symbol. Throws std::exception if the symbol is unknown.
const forceforce_units (const std::string Symbol)
 Returns a reference to a common unit of force keyed by symbol. Throws std::exception if the symbol is unknown.
const massmass_units (const std::string Symbol)
 Returns a reference to a common unit of mass keyed by symbol. Throws std::exception if the symbol is unknown.
const pressurepressure_units (const std::string Symbol)
 Returns a reference to a common unit of pressure keyed by symbol. Throws std::exception if the symbol is unknown.
const timetime_units (const std::string Symbol)
 Returns a reference to a common unit of time keyed by symbol. Throws std::exception if the symbol is unknown.
const volumevolume_units (const std::string Symbol)
 Returns a reference to a common unit of volume keyed by symbol. Throws std::exception if the symbol is unknown.
template<typename quantity_t >
conversion_proxy< quantity_t > convert (const quantity_t Quantity)
 Convenience function for creating conversion_proxy objects.
template<typename quantity_t >
const quantity_t convert (const quantity_t Quantity, const typename quantity_t::unit_type Units)
 Convenience function for converting a quantity to another unit-of-measure.

Detailed Description

Contains objects for storing and converting real-world units-of-measure.


Typedef Documentation

typedef std::map<std::string, angle> k3d::measurement::angle_units_t

Defines a collection of units of angular measure, keyed by string (typically name or symbol).

typedef std::map<std::string, area> k3d::measurement::area_units_t

Defines a collection of units of area, keyed by string (typically name or symbol).

typedef std::map<std::string, distance> k3d::measurement::distance_units_t

Defines a collection of units of distance, keyed by string (typically name or symbol).

typedef std::map<std::string, force> k3d::measurement::force_units_t

Defines a collection of units of force, keyed by string (typically name or symbol).

typedef std::map<std::string, mass> k3d::measurement::mass_units_t

Defines a collection of units of mass, keyed by string (typically name or symbol).

typedef std::map<std::string, pressure> k3d::measurement::pressure_units_t

Defines a collection of units of pressure, keyed by string (typically name or symbol).

Defines a "scalar" quantity (no unit-of-measure).

typedef std::map<std::string, time> k3d::measurement::time_units_t

Defines a collection of units of time, keyed by string (typically name or symbol).

typedef std::map<std::string, volume> k3d::measurement::volume_units_t

Defines a collection of units of volume, keyed by string (typically name or symbol).


Function Documentation

const angle & k3d::measurement::angle_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of angular measure keyed by symbol. Throws std::exception if the symbol is unknown.

const angle_units_t & k3d::measurement::angle_units (  ) 

Returns a singleton collection of common units of angular measure, keyed by symbol.

Referenced by k3d::ngui::spin_button::control::display_value().

const area & k3d::measurement::area_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of area keyed by symbol. Throws std::exception if the symbol is unknown.

const area_units_t & k3d::measurement::area_units (  ) 

Returns a singleton collection of common units of area, keyed by symbol.

template<typename quantity_t >
const quantity_t k3d::measurement::convert ( const quantity_t  Quantity,
const typename quantity_t::unit_type  Units 
) [inline]

Convenience function for converting a quantity to another unit-of-measure.

template<typename quantity_t >
conversion_proxy<quantity_t> k3d::measurement::convert ( const quantity_t  Quantity  )  [inline]

Convenience function for creating conversion_proxy objects.

Referenced by k3d::ngui::spin_button::control::display_value().

const distance & k3d::measurement::distance_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of distance keyed by symbol. Throws std::exception if the symbol is unknown.

const distance_units_t & k3d::measurement::distance_units (  ) 

Returns a singleton collection of common units of distance, keyed by symbol.

const force & k3d::measurement::force_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of force keyed by symbol. Throws std::exception if the symbol is unknown.

const force_units_t & k3d::measurement::force_units (  ) 

Returns a singleton collection of common units of force, keyed by symbol.

const mass & k3d::measurement::mass_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of mass keyed by symbol. Throws std::exception if the symbol is unknown.

const mass_units_t & k3d::measurement::mass_units (  ) 

Returns a singleton collection of common units of mass, keyed by symbol.

bool k3d::measurement::parse ( const std::string  Buffer,
double &  Value,
const std::type_info *const   Units 
)

Parses a mathematical expression with optional real-world units-of-measure, automatically converting it to the appropriate SI units.

Parameters:
Buffer Input buffer containing the expression to be parsed
Value Iff the input expression is completely parsed, contains the expression value in SI units
Units Defines the type of measurement (e.g. angle, distance, time, volume, etc) to be formatted
Returns:
true, iff the input expression is completely parsed, false otherwise
bool k3d::measurement::parse ( const std::string  Buffer,
double &  Value,
std::string &  Units 
)

Parses a mathematical expression with optional real-world units-of-measure.

Parameters:
Buffer Input buffer containing the expression to be parsed
Value Iff the input expression is completely parsed, contains the expression value; otherwise unchanged
Units Iff the input expression is completely parsed, contains the (optional) unit-of-measure symbol; otherwise unchanged
Returns:
true, iff the input expression is completely parsed, false otherwise
bool k3d::measurement::parse ( std::istream &  Stream,
double &  Value,
std::string &  Units 
)

Parses a mathematical expression with optional real-world units-of-measure.

Parameters:
Stream Input stream containing the expression to be parsed
Value Iff the input expression is completely parsed, contains the expression value; otherwise unchanged
Units Iff the input expression is completely parsed, contains the (optional) unit-of-measure symbol; otherwise unchanged
Returns:
true, iff the input expression is completely parsed, false otherwise

Referenced by module::plot::detail::least_squares_solver_plotter::create_function_parsers(), module::k3d_io::document_importer::get_file_metadata(), k3d::ngui::spin_button::control::on_manual_value(), module::k3d_io::document_importer::read_file(), and detail::render_frame().

const pressure & k3d::measurement::pressure_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of pressure keyed by symbol. Throws std::exception if the symbol is unknown.

const pressure_units_t & k3d::measurement::pressure_units (  ) 

Returns a singleton collection of common units of pressure, keyed by symbol.

const time & k3d::measurement::time_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of time keyed by symbol. Throws std::exception if the symbol is unknown.

const time_units_t & k3d::measurement::time_units (  ) 

Returns a singleton collection of common units of time, keyed by symbol.

const volume & k3d::measurement::volume_units ( const std::string  Symbol  ) 

Returns a reference to a common unit of volume keyed by symbol. Throws std::exception if the symbol is unknown.

const volume_units_t & k3d::measurement::volume_units (  ) 

Returns a singleton collection of common units of volume, keyed by symbol.


Generated on Mon Mar 21 07:42:29 2011 for K-3D by doxygen 1.6.3