本文整理汇总了C++中osg::NodeVisitor::className方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeVisitor::className方法的具体用法?C++ NodeVisitor::className怎么用?C++ NodeVisitor::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::NodeVisitor
的用法示例。
在下文中一共展示了NodeVisitor::className方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traverse
//.........这里部分代码省略.........
_timeOfLastEvent = nv.getFrameStamp()->getReferenceTime();
}
double timeSinceLastEvent = nv.getFrameStamp() ? nv.getFrameStamp()->getReferenceTime()-_timeOfLastEvent : 0.0;
if (timeSinceLastEvent>_idleDurationBeforeTimeoutDisplay)
{
_displayTimeout = true;
}
if (timeSinceLastEvent>_idleDurationBeforeTimeoutAction)
{
_displayTimeout = false;
needToAction = true;
needToDismiss = false;
}
if (!previous_displayTimeout && _displayTimeout)
{
if (viewer && (_displayBroadcastKeyPos._key!=0 || _displayBroadcastKeyPos._x!=FLT_MAX || _displayBroadcastKeyPos._y!=FLT_MAX))
{
OSG_NOTICE<<"Doing display broadcast key event"<<_displayBroadcastKeyPos._key<<std::endl;
broadcastEvent(viewer, _displayBroadcastKeyPos);
}
OperationVisitor leave(OperationVisitor::ENTER);
accept(leave);
if (leave.sleepTime()!=0.0)
{
OSG_NOTICE<<"Pausing for "<<leave.sleepTime()<<std::endl;
OpenThreads::Thread::microSleep(static_cast<unsigned int>(1000000.0*leave.sleepTime()));
OSG_NOTICE<<"Finished Pause "<<std::endl;
}
}
if (needToDismiss)
{
if (viewer && (_dismissBroadcastKeyPos._key!=0 || _dismissBroadcastKeyPos._x!=FLT_MAX || _dismissBroadcastKeyPos._y!=FLT_MAX))
{
OSG_NOTICE<<"Doing dismiss broadcast key event"<<_dismissBroadcastKeyPos._key<<std::endl;
broadcastEvent(viewer, _dismissBroadcastKeyPos);
}
OperationVisitor leave(OperationVisitor::LEAVE);
accept(leave);
}
Transform::traverse(nv);
if (needToAction)
{
OSG_NOTICE<<"Do timeout action"<<std::endl;
_previousFrameNumber = -1;
_timeOfLastEvent = nv.getFrameStamp()->getReferenceTime();
if (_actionJumpData.requiresJump())
{
OSG_NOTICE<<"Doing timeout jump"<<std::endl;
_actionJumpData.jump(SlideEventHandler::instance());
}
if (_actionKeyPos._key!=0 || _actionKeyPos._x!=FLT_MAX || _actionKeyPos._y!=FLT_MAX)
{
OSG_NOTICE<<"Doing timeout key event"<<_actionKeyPos._key<<std::endl;
if (SlideEventHandler::instance()) SlideEventHandler::instance()->dispatchEvent(_actionKeyPos);
}
if (viewer && (_actionBroadcastKeyPos._key!=0 || _actionBroadcastKeyPos._x!=FLT_MAX || _actionBroadcastKeyPos._y!=FLT_MAX))
{
OSG_NOTICE<<"Doing timeout broadcast key event"<<_actionBroadcastKeyPos._key<<std::endl;
broadcastEvent(viewer, _actionBroadcastKeyPos);
}
}
}
else if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR)
{
if (_displayTimeout) Transform::traverse(nv);
}
else
{
if (strcmp(nv.className(),"FindOperatorsVisitor")==0)
{
OSG_NOTICE<<"Timout::traverse() "<<nv.className()<<", ignoring traversal"<<std::endl;
}
else
{
Transform::traverse(nv);
}
}
}