Choreonoid  1.1
クラス | 公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
cnoid::SceneBodyManager クラス

#include <SceneBodyManager.h>

クラス

class  FactoryHolder
 

公開メンバ関数

 SceneBodyManager (ExtensionManager &ext)
 
 ~SceneBodyManager ()
 
FactoryHolderaddSceneBodyFactory (boost::function< SceneBody *(BodyItem *)> factory)
 

静的公開メンバ関数

static SceneBodyManagerinstance ()
 

構築子と解体子

SceneBodyManager::SceneBodyManager ( ExtensionManager &  ext)
SceneBodyManager::~SceneBodyManager ( )

関数詳解

SceneBodyManager::FactoryHolder * SceneBodyManager::addSceneBodyFactory ( boost::function< SceneBody *(BodyItem *)>  factory)
引数
factoryA 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;
}
戻り値
A holder object of the registered factory. The destructor of the holder object unregisters the factory. This object is usually passed to 'ExtensionManager::manage()' function so that the factory can be automatically removed when the plugin is finalized.
SceneBodyManager * SceneBodyManager::instance ( )
static

このクラス詳解は次のファイルから抽出されました: