Choreonoid
1.1
|
#include <SceneBodyManager.h>
構成 | |
class | FactoryHolder |
Public メソッド | |
SceneBodyManager (ExtensionManager &ext) | |
~SceneBodyManager () | |
FactoryHolder * | addSceneBodyFactory (boost::function< SceneBody *(BodyItem *)> factory) |
Static Public メソッド | |
static SceneBodyManager * | instance () |
SceneBodyManager::SceneBodyManager | ( | ExtensionManager & | ext) |
SceneBodyManager::~SceneBodyManager | ( | ) |
SceneBodyManager::FactoryHolder * SceneBodyManager::addSceneBodyFactory | ( | boost::function< SceneBody *(BodyItem *)> | factory) |
factory | A factory function object that creates a scene body instance of a customized sub class. In order to avoid the collision between the multiple factories, it is desirable that the factory function checks the actual type of a BodyItem instance and a customized scene body is only returned if the type matches. Example code is as follows: SceneBody* factory(BodyItem* bodyItem)
{
BodyItemEx* ex = dynamic_cast<BodyItemEx*>(bodyItem);
if(ex){
return new SceneBodyEx(ex);
}
return 0;
}
|
|
static |