RobWorkProject
Public Member Functions | List of all members
MaterialDataMap Class Reference

A map of materials and friction models defined between materials. More...

#include <MaterialDataMap.hpp>

Public Member Functions

 MaterialDataMap ()
 Constructor.
 
virtual ~MaterialDataMap ()
 Destructor.
 
void add (const std::string &name, const std::string &desc)
 Add a material name with a description. More...
 
int getDataID (const std::string &material) const
 Converts a string of material type name to an int identifier. More...
 
const std::string & getMaterialName (int id) const
 Convert an id of a material to the name of the material. More...
 
const std::vector< std::string > & getMaterials ()
 Get a list of the names of all materials. More...
 
int getMaxMatID () const
 Get the number of materials. More...
 
bool hasFrictionData (int matAID, int matBID, int dataType=Coulomb) const
 Test if the given material pair has friction data in map. More...
 
bool hasFrictionData (const std::string &matAID, const std::string &matBID, int dataType=Coulomb) const
 Test if the given material pair has friction data in map. More...
 
const FrictionDatagetFrictionData (int matAID, int matBID, int dataType=Coulomb) const
 Get a specific friction model for a pair of materials. More...
 
const std::vector< FrictionDatagetFrictionDatas (int matAID, int matBID) const
 Get all friction data associated to the given pair of materials. More...
 
const FrictionDatagetFrictionData (const std::string &matAID, const std::string &matBID, int dataType=Coulomb) const
 Get a specific friction model for a pair of materials. More...
 
const std::vector< FrictionDatagetFrictionDatas (const std::string &matAID, const std::string &matBID) const
 Get all friction data associated to the given pair of materials. More...
 
void addFrictionData (const std::string &materialA, const std::string &materialB, const FrictionData &data)
 Add friction data for the given pair of materials. More...
 
const FrictionDatagetDefaultFriction (int type) const
 Get the default friction model. More...
 

Detailed Description

A map of materials and friction models defined between materials.

Member Function Documentation

◆ add()

void add ( const std::string &  name,
const std::string &  desc 
)

Add a material name with a description.

Parameters
name[in] name of material.
desc[in] description of material.

◆ addFrictionData()

void addFrictionData ( const std::string &  materialA,
const std::string &  materialB,
const FrictionData data 
)

Add friction data for the given pair of materials.

Parameters
materialA[in] the name of the first material.
materialB[in] the name of the second material.
data[in] the data to add.

◆ getDataID()

int getDataID ( const std::string &  material) const

Converts a string of material type name to an int identifier.

Parameters
material[in] name of material.
Returns
the id of the material.

◆ getDefaultFriction()

const FrictionData& getDefaultFriction ( int  type) const

Get the default friction model.

Parameters
type[in] the type of model.
Returns
the default friction data.

◆ getFrictionData() [1/2]

const FrictionData& getFrictionData ( int  matAID,
int  matBID,
int  dataType = Coulomb 
) const

Get a specific friction model for a pair of materials.

Parameters
matAID[in] id of first material.
matBID[in] id of second material.
dataType[in] the type of friction data (default is Coulomb).
Returns
the friction data.

◆ getFrictionData() [2/2]

const FrictionData& getFrictionData ( const std::string &  matAID,
const std::string &  matBID,
int  dataType = Coulomb 
) const

Get a specific friction model for a pair of materials.

Parameters
matAID[in] the name of the first material.
matBID[in] the name of the second material.
dataType[in] the type of friction data (default is Coulomb).
Returns
the friction data.

◆ getFrictionDatas() [1/2]

const std::vector<FrictionData> getFrictionDatas ( int  matAID,
int  matBID 
) const

Get all friction data associated to the given pair of materials.

Parameters
matAID[in] the id of the first material.
matBID[in] the id of the second material.
Returns
a vector of friction data.

◆ getFrictionDatas() [2/2]

const std::vector<FrictionData> getFrictionDatas ( const std::string &  matAID,
const std::string &  matBID 
) const

Get all friction data associated to the given pair of materials.

Parameters
matAID[in] the name of the first material.
matBID[in] the name of the second material.
Returns
a vector of friction data.

◆ getMaterialName()

const std::string& getMaterialName ( int  id) const

Convert an id of a material to the name of the material.

Parameters
id[in] the id of the material.
Returns
the name of the material.

◆ getMaterials()

const std::vector<std::string>& getMaterials ( )

Get a list of the names of all materials.

Returns
a list of material names.

◆ getMaxMatID()

int getMaxMatID ( ) const

Get the number of materials.

Returns
the maximum id of a material.

◆ hasFrictionData() [1/2]

bool hasFrictionData ( int  matAID,
int  matBID,
int  dataType = Coulomb 
) const

Test if the given material pair has friction data in map.

Parameters
matAID[in] id of first material.
matBID[in] id of second material.
dataType[in] the type of friction data (default is Coulomb).
Returns
true if friction data exists - false otherwise.

◆ hasFrictionData() [2/2]

bool hasFrictionData ( const std::string &  matAID,
const std::string &  matBID,
int  dataType = Coulomb 
) const

Test if the given material pair has friction data in map.

Parameters
matAID[in] the name of the first material.
matBID[in] the name of the second material.
dataType[in] the type of friction data (default is Coulomb).
Returns
true if friction data exists - false otherwise.

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