Example #1
0
void
TaskPointRenderer::Draw(const TaskPoint &tp, Layer layer)
{
  const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
  const AATPoint &atp = (const AATPoint &)tp;

  switch (tp.GetType()) {
  case TaskPointType::UNORDERED:
    if (layer == LAYER_LEG && location.IsValid())
      DrawTaskLine(location, tp.GetLocationRemaining());

    if (layer == LAYER_SYMBOLS)
      DrawBearing(tp);

    index++;
    break;

  case TaskPointType::START:
    index = 0;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }

    break;

  case TaskPointType::AST:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;

  case TaskPointType::AAT:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawIsoline(atp);
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;

  case TaskPointType::FINISH:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;
  }
}
Example #2
0
void
TaskPointRenderer::DrawBearing(const TaskPoint &tp)
{
  if (!location_available || !draw_bearing || !PointCurrent())
    return;

  canvas.Select(task_look.bearing_pen);
  map_canvas.DrawLineWithOffset(location, tp.GetLocationRemaining());
}
Example #3
0
void
RenderTaskPoint::DrawBearing(const TaskPoint &tp)
{
    if (!draw_bearing || !PointCurrent())
        return;

    canvas.Select(task_look.bearing_pen);
    map_canvas.offset_line(location, tp.GetLocationRemaining());
}
Example #4
0
void
TaskPointRenderer::DrawTarget(const TaskPoint &tp)
{
  if (!IsTargetVisible(tp))
    return;

  RasterPoint sc;
  if (m_proj.GeoToScreenIfVisible(tp.GetLocationRemaining(), sc))
    task_look.target_icon.Draw(canvas, sc.x, sc.y);
}
Example #5
0
void
RenderTaskPoint::Draw(const TaskPoint &tp, Layer layer)
{
    const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
    const AATPoint &atp = (const AATPoint &)tp;

    switch (tp.GetType()) {
    case TaskPoint::UNORDERED:
        if (layer == LAYER_LEG)
            DrawTaskLine(location, tp.GetLocationRemaining());

        if (layer == LAYER_SYMBOLS)
            DrawBearing(tp);

        index++;
        break;

    case TaskPoint::START:
        index = 0;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }

        break;

    case TaskPoint::AST:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::AAT:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawIsoline(atp);
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::FINISH:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::ROUTE:
        /* unreachable */
        assert(false);
        break;
    }
}