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


C++ SbTime::getMsecValue方法代码示例

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


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

示例1: if

// This function gets called whenever something has happened to any of
// the sensor queues. It starts or reschedules a timer which will
// trigger when a sensor is ripe for plucking.
void
SoGuiP::sensorQueueChanged(void * cbdata)
{
  SoSensorManager * sensormanager = SoDB::getSensorManager();

  SbTime timevalue;
  if (sensormanager->isTimerSensorPending(timevalue)) {
    SbTime interval = timevalue - SbTime::getTimeOfDay();

    if (interval.getValue() < 0.0) interval.setValue(0.0);
    if (SoWinP::timerSensorId != 0) Win32::KillTimer(NULL, SoWinP::timerSensorId);
    
    SoWinP::timerSensorId =
      Win32::SetTimer(NULL,
                      /* ignored because of NULL first argument: */ 0,
                      interval.getMsecValue(),
                      (TIMERPROC)SoWinP::timerSensorCB);
  }
  else if (SoWinP::timerSensorId != 0) {
    Win32::KillTimer(NULL, SoWinP::timerSensorId);
    SoWinP::timerSensorId = 0;
  }

  if (sensormanager->isDelaySensorPending()) {
        
    if (SoWinP::idleSensorId == 0) {
      SoWinP::idleSensorId =
        Win32::SetTimer(NULL,
                        /* ignored because of NULL first argument: */ 0,

                        // FIXME: this seems like a rather bogus way
                        // of setting up a timer to check when the
                        // system goes idle. Should investigate how
                        // this actually works, and perhaps if there
                        // is some other mechanism we could
                        // use. 20040721 mortene.
                        0,

                        (TIMERPROC)SoWinP::idleSensorCB);
    }

    if (SoWinP::delaySensorId == 0) {
      unsigned long timeout = SoDB::getDelaySensorTimeout().getMsecValue();
      SoWinP::delaySensorId =
        Win32::SetTimer(NULL,
                        /* ignored because of NULL first argument: */ 0,
                        timeout,
                        (TIMERPROC)SoWinP::delaySensorCB);
    }
  }
  else {
    if (SoWinP::idleSensorId != 0) {
      Win32::KillTimer(NULL, SoWinP::idleSensorId);
      SoWinP::idleSensorId = 0;
    }

    if (SoWinP::delaySensorId != 0) {
      Win32::KillTimer(NULL, SoWinP::delaySensorId);
      SoWinP::delaySensorId = 0;
    }
  }
}
开发者ID:googleknight,项目名称:Coin3D,代码行数:65,代码来源:SoWin.cpp


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