MaterialDensity Class Reference

Encapsulates density types. More...

#include <MaterialDensity.hh>

Static Public Member Functions

static double Density (const std::string &_material)
 Return the density of the given material name, or -1 if the material is not found. More...
 
static double Density (const MaterialType _material)
 Return the density of a material. More...
 
static const std::map
< MaterialType, double > & 
Materials ()
 Accessor for retrieving density entries. More...
 
static std::tuple
< MaterialType, double > 
Nearest (const double _value, const double _epsilon=IGN_DBL_MAX)
 Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found. More...
 
static MaterialType NearestMaterial (const double _value, const double _epsilon=IGN_DBL_MAX)
 Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found. More...
 

Detailed Description

Encapsulates density types.

Member Function Documentation

static double Density ( const std::string &  _material)
static

Return the density of the given material name, or -1 if the material is not found.

Parameters
[in]_materialName of the material, See MaterialType.
Returns
Matching density if found, otherwise -1.
static double Density ( const MaterialType  _material)
static

Return the density of a material.

Parameters
[in]_materialType of the material, See MaterialType.
Returns
Matching density if found, otherwise -1.
static const std::map<MaterialType, double>& Materials ( )
static

Accessor for retrieving density entries.

Returns
List of entries.
static std::tuple<MaterialType, double> Nearest ( const double  _value,
const double  _epsilon = IGN_DBL_MAX 
)
static

Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found.

Parameters
[in]_valueDensity value of entry to match.
[in]_epsilonAllowable range of difference between _value, and a material's density.
Returns
A tuple where the first element is the MaterialType, and the second the density. A value of {MATERIAL_TYPE_END, -1} is returned on error.
static MaterialType NearestMaterial ( const double  _value,
const double  _epsilon = IGN_DBL_MAX 
)
static

Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found.

Parameters
[in]_valueDensity value of entry to match.
[in]_epsilonAllowable range of difference between _value, and a material's density.
Returns
The nearest material type. MATERIAL_TYPE_END on error.

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