本文整理汇总了C++中osg::Node::getUpdateCallback方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getUpdateCallback方法的具体用法?C++ Node::getUpdateCallback怎么用?C++ Node::getUpdateCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Node
的用法示例。
在下文中一共展示了Node::getUpdateCallback方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void apply(osg::Node& node)
{
if (node.getStateSet()) process(node.getStateSet());
if (node.getUpdateCallback())
{
_operatorList.insert(new CallbackOperator(&node, node.getUpdateCallback()));
}
LayerAttributes* la = dynamic_cast<LayerAttributes*>(node.getUserData());
if (la)
{
if ((_objectsHandled[la]++)==0)
{
OSG_NOTICE<<"LayerAttributeOperator for "<<la<<" required, assigning one."<<std::endl;
_operatorList.insert(new LayerAttributesOperator(&node, la));
}
else
{
OSG_NOTICE<<"LayerAttributeOperator for "<<la<<" not required, as one already assigned."<<std::endl;
}
}
traverse(node);
}
示例2: apply
void apply(osg::Node& node)
{
if (node.getStateSet()) process(node.getStateSet());
if (node.getUpdateCallback())
{
_operatorList.insert(new CallbackOperator(&node, node.getUpdateCallback()));
}
LayerAttributes* la = dynamic_cast<LayerAttributes*>(node.getUserData());
if (la)
{
_operatorList.insert(new LayerAttributesOperator(&node, la));
}
traverse(node);
}
示例3: collectUpdateCallback
void AnimationCleanerVisitor::collectUpdateCallback(osg::Node& node) {
osg::Callback *callBack = node.getUpdateCallback();
while(callBack) {
BaseAnimationUpdateCallback* update = getCallbackType<BaseAnimationUpdateCallback>(callBack);
if(update) {
_updates[update] = osg::ref_ptr<osg::Node>(&node);
}
callBack = callBack->getNestedCallback();
}
}
示例4: apply
void LinkVisitor::apply(osg::Node& node)
{
osg::StateSet* st = node.getStateSet();
if (st)
handle_stateset(st);
osg::NodeCallback* cb = node.getUpdateCallback();
while (cb)
{
osgAnimation::AnimationUpdateCallbackBase* cba = dynamic_cast<osgAnimation::AnimationUpdateCallbackBase*>(cb);
if (cba)
link(cba);
cb = cb->getNestedCallback();
}
traverse(node);
}
示例5: apply
void apply(osg::Node& node) {
if (_am.valid()){
osgAnimation::Animation * anim=_am->getRegisteredAnimation(0);
OSG_WARN<<"aim0"<<anim->getName()<<std::endl;
return;
}
if (node.getUpdateCallback()) {
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
if (b) {
osgAnimation::Animation * anim=b->getRegisteredAnimation(0);
OSG_WARN<<"aim0"<<anim->getName()<<std::endl;
_am = new osgAnimation::BasicAnimationManager(*b);
return;
}
}
traverse(node);
}
示例6: apply
void apply(osg::Node& node)
{
if (_animManager.valid())
{
return;
}
if (node.getUpdateCallback())
{
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
if (b)
{
_animManager = new osgAnimation::BasicAnimationManager(*b);
return;
}
}
traverse(node);
}
示例7: apply
void apply(osg::Node& node) {
if (_am.valid())
return;
if (node.getUpdateCallback()) {
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
if (b) {
_am = new osgAnimation::BasicAnimationManager(*b);
const osgAnimation::AnimationList & pAL = b->getAnimationList();
for(osgAnimation::AnimationList::const_iterator citAL = pAL.begin();
citAL != pAL.end();
citAL++) {
osgAnimation::ChannelList & channelList = (*citAL)->getChannels();
for(osgAnimation::ChannelList::iterator itCL = channelList.begin();
itCL != channelList.end();
itCL++) {
osgAnimation::Sampler * pSampler = (*itCL)->getSampler();
osgAnimation::KeyframeContainer * pKFC = pSampler->getKeyframeContainer();
{
osgAnimation::TemplateKeyframeContainer<osg::Vec3f> *pTKFC_Vec3f =
dynamic_cast<osgAnimation::TemplateKeyframeContainer<osg::Vec3f> *>(pKFC);
if((pTKFC_Vec3f != 0) && (pTKFC_Vec3f->size() > 199)) {
pTKFC_Vec3f->erase(pTKFC_Vec3f->begin()+110, pTKFC_Vec3f->end());
}
}
{
osgAnimation::TemplateKeyframeContainer<osg::Quat> *pTKFC_Quat =
dynamic_cast<osgAnimation::TemplateKeyframeContainer<osg::Quat> *>(pKFC);
if((pTKFC_Quat != 0) && (pTKFC_Quat->size() > 199)) {
pTKFC_Quat->erase(pTKFC_Quat->begin()+110, pTKFC_Quat->end());
}
}
}
}
// osgDB::writeNodeFile(node,"C:/Matej/test.osg");
return;
}
}
traverse(node);
}
示例8: apply
void ControllerVisitor::apply(osg::Node &node)
{
osg::Callback* callback = node.getUpdateCallback();
while (callback)
{
if (Controller* ctrl = dynamic_cast<Controller*>(callback))
visit(node, *ctrl);
if (CompositeStateSetUpdater* composite = dynamic_cast<CompositeStateSetUpdater*>(callback))
{
for (unsigned int i=0; i<composite->getNumControllers(); ++i)
{
StateSetUpdater* statesetcontroller = composite->getController(i);
if (Controller* ctrl = dynamic_cast<Controller*>(statesetcontroller))
visit(node, *ctrl);
}
}
callback = callback->getNestedCallback();
}
traverse(node);
}
示例9: apply
void AnimationCleanerVisitor::apply(osg::Node& node) {
osgAnimation::BasicAnimationManager* manager = getCallbackType<osgAnimation::BasicAnimationManager>(node.getUpdateCallback());
if(manager) {
_managers[manager] = osg::ref_ptr<osg::Node>(&node);
collectAnimationChannels(*manager);
}
collectUpdateCallback(node);
traverse(node);
}