Choreonoid  1.8
Public Types | Public Member Functions | List of all members
cnoid::MaterialTable Class Reference

#include <MaterialTable.h>

Inheritance diagram for cnoid::MaterialTable:
cnoid::Referenced

Public Types

typedef std::function< ContactMaterial *(const ContactMaterial *org)> ContactMaterialCopyFactory
 

Public Member Functions

 MaterialTable ()
 
virtual ~MaterialTable ()
 
 MaterialTable (const MaterialTable &org)
 The constructor to do shallow copy. More...
 
 MaterialTable (const MaterialTable &org, CloneMap &cloneMap, ContactMaterialCopyFactory factory=nullptr)
 The constructor to do deep copy with a custom ContactMaterial type. More...
 
void clear ()
 
int maxMaterialId () const
 
int numMaterials () const
 
Materialmaterial (int id) const
 
int numContactMaterials () const
 
ContactMaterialcontactMaterial (int id1, int id2) const
 
ContactMaterialcontactMaterial (const std::string &name1, const std::string &name2) const
 
void forEachMaterial (std::function< void(int id, Material *material)> func)
 
void forEachMaterialPair (std::function< void(int id1, int id2, ContactMaterial *cm)> func)
 
int addMaterial (Material *material)
 
void setContactMaterial (int id1, int id2, ContactMaterial *cm)
 
void merge (MaterialTable *table)
 
bool load (const std::string &filename, std::ostream &os=nullout())
 
- Public Member Functions inherited from cnoid::Referenced
virtual ~Referenced ()
 

Additional Inherited Members

- Protected Member Functions inherited from cnoid::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
int refCount () const
 

Member Typedef Documentation

◆ ContactMaterialCopyFactory

Constructor & Destructor Documentation

◆ MaterialTable() [1/3]

MaterialTable::MaterialTable ( )

◆ ~MaterialTable()

MaterialTable::~MaterialTable ( )
virtual

◆ MaterialTable() [2/3]

MaterialTable::MaterialTable ( const MaterialTable org)

The constructor to do shallow copy.

◆ MaterialTable() [3/3]

MaterialTable::MaterialTable ( const MaterialTable org,
CloneMap cloneMap,
ContactMaterialCopyFactory  factory = nullptr 
)

The constructor to do deep copy with a custom ContactMaterial type.

Member Function Documentation

◆ addMaterial()

int MaterialTable::addMaterial ( Material material)
Returns
Material ID

◆ clear()

void MaterialTable::clear ( )

◆ contactMaterial() [1/2]

ContactMaterial * MaterialTable::contactMaterial ( const std::string &  name1,
const std::string &  name2 
) const

◆ contactMaterial() [2/2]

ContactMaterial * MaterialTable::contactMaterial ( int  id1,
int  id2 
) const

◆ forEachMaterial()

void MaterialTable::forEachMaterial ( std::function< void(int id, Material *material)>  func)

◆ forEachMaterialPair()

void MaterialTable::forEachMaterialPair ( std::function< void(int id1, int id2, ContactMaterial *cm)>  func)

◆ load()

bool MaterialTable::load ( const std::string &  filename,
std::ostream &  os = nullout() 
)

◆ material()

Material * MaterialTable::material ( int  id) const

◆ maxMaterialId()

int MaterialTable::maxMaterialId ( ) const

◆ merge()

void MaterialTable::merge ( MaterialTable table)

◆ numContactMaterials()

int MaterialTable::numContactMaterials ( ) const

◆ numMaterials()

int MaterialTable::numMaterials ( ) const

◆ setContactMaterial()

void MaterialTable::setContactMaterial ( int  id1,
int  id2,
ContactMaterial cm 
)

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