Choreonoid  1.1
構成 | Public メソッド | Static Public メソッド | すべてのメンバ一覧
クラス cnoid::SceneBodyManager

#include <SceneBodyManager.h>

構成

class  FactoryHolder

Public メソッド

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

Static Public メソッド

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

このクラスの説明は次のファイルから生成されました: