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


C++ OrderedTaskPoint::BoundingBoxOverlaps方法代码示例

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


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

示例1: switch

void
TaskPointRenderer::DrawOrdered(const OrderedTaskPoint &tp, Layer layer)
{
  switch (layer) {
  case LAYER_OZ_SHADE:
    if (tp.BoundingBoxOverlaps(bb_screen))
      // draw shaded part of observation zone
      DrawOZBackground(canvas, tp);

    break;

  case LAYER_LEG:
    if (index > 0)
      DrawTaskLine(last_point, tp.GetLocationRemaining());

    last_point = tp.GetLocationRemaining();

    break;

  case LAYER_OZ_OUTLINE:
    if (tp.BoundingBoxOverlaps(bb_screen))
      DrawOZForeground(tp);

    break;

  case LAYER_SYMBOLS:
    return;
  }
}
开发者ID:damianob,项目名称:xcsoar,代码行数:29,代码来源:TaskPointRenderer.cpp

示例2: switch

void
TaskPointRenderer::DrawOrdered(const OrderedTaskPoint &tp, Layer layer)
{
  int offset = index - active_index;

  if (offset == 0 && task_finished && tp.GetType() == TaskPointType::FINISH)
    /* if the task is finished, pretend the active_index is past the
       current index; we need this because XCSoar never moves
       active_index to one after the finish point, because that would
       point to an invalid task point index */
    offset = -1;

  switch (layer) {
  case LAYER_OZ_SHADE:
    if (tp.BoundingBoxOverlaps(bb_screen))
      // draw shaded part of observation zone
      DrawOZBackground(canvas, tp, offset);

    break;

  case LAYER_LEG:
    if (index > 0)
      DrawTaskLine(last_point, tp.GetLocationRemaining());

    last_point = tp.GetLocationRemaining();

    break;

  case LAYER_OZ_OUTLINE:
    if (tp.BoundingBoxOverlaps(bb_screen)) {
      if (mode_optional_start && offset == 0)
        /* render optional starts as deactivated */
        offset = -1;

      DrawOZForeground(tp, offset);
    }

    break;

  case LAYER_SYMBOLS:
    return;
  }
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:43,代码来源:TaskPointRenderer.cpp

示例3: UpdateStartTransition

bool
OrderedTask::CheckTransitionPoint(OrderedTaskPoint &point,
                                  const AircraftState &state,
                                  const AircraftState &state_last,
                                  const FlatBoundingBox &bb_now,
                                  const FlatBoundingBox &bb_last,
                                  bool &transition_enter,
                                  bool &transition_exit,
                                  bool &last_started,
                                  const bool is_start)
{
  const bool nearby = point.BoundingBoxOverlaps(bb_now) ||
    point.BoundingBoxOverlaps(bb_last);

  if (nearby && point.TransitionEnter(state, state_last)) {
    transition_enter = true;

    if (task_events != NULL)
      task_events->EnterTransition(point);
  }
  
  if (nearby && point.TransitionExit(state, state_last, task_projection)) {
    transition_exit = true;

    if (task_events != NULL)
      task_events->ExitTransition(point);
    
    // detect restart
    if (is_start && last_started)
      last_started = false;
  }
  
  if (is_start) 
    UpdateStartTransition(state, point);
  
  return nearby
    ? point.UpdateSampleNear(state, task_projection)
    : point.UpdateSampleFar(state, task_projection);
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:39,代码来源:OrderedTask.cpp


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