本文整理汇总了C++中SbTime::format方法的典型用法代码示例。如果您正苦于以下问题:C++ SbTime::format方法的具体用法?C++ SbTime::format怎么用?C++ SbTime::format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SbTime
的用法示例。
在下文中一共展示了SbTime::format方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PUBLIC
//
// checks current time to see if we should start or stop playing
//
void
SoVRMLAudioClipP::timerCB(SoSensor *)
{
SbTime now = SbTime::getTimeOfDay();
SbTime start = PUBLIC(this)->startTime.getValue();
SbTime stop = PUBLIC(this)->stopTime.getValue();
#if COIN_DEBUG && DEBUG_AUDIO
SbString start_str = start.format("%D %h %m %s");
SbString stop_str = stop.format("%D %h %m %s");
SbString now_str = now.format("%D %h %m %s");
#endif // debug
#if COIN_DEBUG && DEBUG_AUDIO
SoDebugError::postInfo("SoVRMLAudioClipP::timerCB", "(timerCB)");
#endif // debug
if (((now>=stop) && (stop>start)) ||
(! SoAudioDevice::instance()->haveSound()) ||
(! SoAudioDevice::instance()->isEnabled()))
{
// we shouldn't be playing now
if (PUBLIC(this)->isActive.getValue())
this->stopPlaying();
return;
}
// if we got this far, ( (now<stop) || (stop<=start) )
if (this->soundHasFinishedPlaying) {
if (PUBLIC(this)->isActive.getValue()) {
// FIXME: perhaps add some additional slack, the size of one buffer? 20021008 thammer.
#if COIN_DEBUG && DEBUG_AUDIO
SoDebugError::postInfo("SoVRMLAudioClipP::timerCB", "soundHasFinishedPlaying");
#endif // debug
this->stopPlaying();
}
return;
}
if (now>=start) {
if (!PUBLIC(this)->isActive.getValue())
this->startPlaying();
}
}
示例2: switch
//.........这里部分代码省略.........
CASE(MFString,SO__CONCAT(MF,type)): \
for (i = 0; i < ((SoMField *)input)->getNum(); i++) { \
((SoMField *)input)->get1(i, string); \
((SoMField *)outField)->set1(i, string.getString()); \
} \
break
// All types except string:
CONVSTR(BitMask);
CONVSTR(Bool);
CONVSTR(Color);
CONVSTR(Enum);
CONVSTR(Float);
CONVSTR(Int32);
CONVSTR(Matrix);
CONVSTR(Name);
CONVSTR(Node);
CONVSTR(Path);
CONVSTR(Plane);
CONVSTR(Rotation);
CONVSTR(Short);
CONVSTR(UInt32);
CONVSTR(UShort);
CONVSTR(Vec2f);
CONVSTR(Vec3f);
CONVSTR(Vec4f);
#undef CONVSTR
// Special case for time to string; if the time is great enough,
// format as a date:
CASE(SFTime,SFString):
{
SbTime t = ((SoSFTime *)input)->getValue();
if (t.getValue() > 3.15e7) string = t.formatDate();
else string = t.format();
((SoSFString *)outField)->setValue(string);
}
break;
CASE(SFTime,MFString):
{
SbTime t = ((SoSFTime *)input)->getValue();
if (t.getValue() > 3.15e7) string = t.formatDate();
else string = t.format();
((SoMFString *)outField)->set1Value(0, string);
}
break;
CASE(MFTime,SFString):
{
SbTime t = (*((SoMFTime *)input))[0];
if (t.getValue() > 3.15e7) string = t.formatDate();
else string = t.format();
((SoSFString *)outField)->setValue(string);
}
break;
CASE(MFTime,MFString):
{
for (i = 0; i < ((SoMField *)input)->getNum(); i++) {
SbTime t = (*((SoMFTime *)input))[i];
if (t.getValue() > 3.15e7) string = t.formatDate();
else string = t.format();
((SoMFString *)outField)->set1Value(i, string);
}
}
break;
CASE(SFString,SFTime):
CASE(MFString,SFTime):