当前位置: 首页>>代码示例>>C++>>正文


C++ NodePtr::added方法代码示例

本文整理汇总了C++中NodePtr::added方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::added方法的具体用法?C++ NodePtr::added怎么用?C++ NodePtr::added使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NodePtr的用法示例。


在下文中一共展示了NodePtr::added方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: targetAddedToScene

void
Water::targetAddedHandler(AbstractComponent::Ptr cmp, NodePtr target)
{
    target->added()->connect([&](NodePtr node, NodePtr target, NodePtr ancestor)
    {
        if (target->root()->hasComponent<SceneManager>())
            targetAddedToScene(nullptr, target, nullptr);
    });
}
开发者ID:RinWorld,项目名称:minko,代码行数:9,代码来源:Water.cpp

示例2:

void
Hologram::targetAddedHandler(AbstractComponent::Ptr cmp, NodePtr target)
{
    _addedToSceneSlot = target->added()->connect(std::bind(
        &Hologram::initTarget,
        std::static_pointer_cast<Hologram>(shared_from_this()),
        cmp,
        std::placeholders::_2,
        std::placeholders::_3
        ));
}
开发者ID:RinWorld,项目名称:minko,代码行数:11,代码来源:Hologram.cpp

示例3: logic_error

void
OculusVRCamera::targetAddedHandler(AbsCmpPtr component, NodePtr target)
{
	if (targets().size() > 1)
		throw std::logic_error("The OculusVRCamera component cannot have more than 1 target.");

	_addedSlot = target->added()->connect(std::bind(
		&OculusVRCamera::addedHandler,
		shared_from_this(),
		std::placeholders::_1,
		std::placeholders::_2,
		std::placeholders::_3
	));

	_removedSlot = target->removed()->connect(std::bind(
		&OculusVRCamera::removedHandler,
		shared_from_this(),
		std::placeholders::_1,
		std::placeholders::_2,
		std::placeholders::_3
	));

	_targetComponentAddedHandler = target->componentAdded()->connect(std::bind(
		&OculusVRCamera::targetComponentAddedHandler,
		shared_from_this(),
		std::placeholders::_1,
		std::placeholders::_2,
		std::placeholders::_3
	));

	_targetComponentRemovedHandler = target->componentRemoved()->connect(std::bind(
		&OculusVRCamera::targetComponentRemovedHandler,
		shared_from_this(),
		std::placeholders::_1,
		std::placeholders::_2,
		std::placeholders::_3
	));

	_targetTransform = target->hasComponent<Transform>() 
		? target->component<Transform>()
		: nullptr;

	addedHandler(target->root(), target, target->parent());

}
开发者ID:123woodman,项目名称:minko,代码行数:45,代码来源:OculusVRCamera.cpp

示例4: logic_error

            virtual
            void
            targetAddedHandler(AbstractComponent::Ptr ctrl, NodePtr target)
            {
                if (targets().size() > 1)
                    throw std::logic_error("This component cannot have more than 1 target.");

                auto cb = std::bind(
                    &AbstractRootDataComponent::addedOrRemovedHandler,
                    this->shared_from_this(),
                    std::placeholders::_1,
                    std::placeholders::_2,
                    std::placeholders::_3
                );

                _addedSlot = target->added()->connect(cb);
                _removedSlot = target->removed()->connect(cb);

                updateRoot(target->root());
            }
开发者ID:123woodman,项目名称:minko,代码行数:20,代码来源:AbstractRootDataComponent.hpp


注:本文中的NodePtr::added方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。