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


C++ AATPoint类代码示例

本文整理汇总了C++中AATPoint的典型用法代码示例。如果您正苦于以下问题:C++ AATPoint类的具体用法?C++ AATPoint怎么用?C++ AATPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ell

AATIsoline::AATIsoline(const AATPoint& ap, const TaskProjection &projection):
  ell(ap.get_previous()->get_location_remaining(),
      ap.get_next()->get_location_remaining(),
      ap.get_location_target(),
      projection)
{
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:7,代码来源:AATIsoline.cpp

示例2: OnRangeModified

static void
OnRangeModified(fixed new_value)
{
  if (target_point < initial_active_task_point)
    return;

  const fixed new_range = new_value / fixed(100);
  if (new_range == range_and_radial.range)
    return;

  if (negative(new_range) != negative(range_and_radial.range)) {
    /* when the range gets flipped, flip the radial as well */
    if (negative(range_and_radial.radial.Native()))
      range_and_radial.radial += Angle::HalfCircle();
    else
      range_and_radial.radial -= Angle::HalfCircle();
    LoadRadial();
  }

  range_and_radial.range = new_range;

  {
    ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
    const OrderedTask &task = lease->GetOrderedTask();
    AATPoint *ap = task.GetAATTaskPoint(target_point);
    if (ap == nullptr)
      return;

    ap->SetTarget(range_and_radial,
                  lease->GetOrderedTask().GetTaskProjection());
  }

  map->Invalidate();
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:34,代码来源:TargetDialog.cpp

示例3: assert

bool
TargetMapWindow::isInSector(PixelPoint pt)
{
  assert(task != nullptr);

  GeoPoint gp = projection.ScreenToGeo(pt);

  ProtectedTaskManager::Lease lease(*task);
  AATPoint *p = lease->GetOrderedTask().GetAATTaskPoint(target_index);
  return p != nullptr && p->GetObservationZone().IsInSector(gp);
}
开发者ID:nkgautam,项目名称:XCSoar,代码行数:11,代码来源:TargetMapWindowDrag.cpp

示例4:

bool
TaskManager::TargetLock(const unsigned index, bool do_lock)
{
  if (!CheckOrderedTask())
    return false;

  AATPoint *ap = task_ordered.GetAATTaskPoint(index);
  if (ap)
    ap->target_lock(do_lock);

  return true;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例5:

bool
TaskManager::SetTarget(const unsigned index, RangeAndRadial rar)
{
  if (!CheckOrderedTask())
    return false;

  AATPoint *ap = ordered_task->GetAATTaskPoint(index);
  if (ap)
    ap->SetTarget(rar, ordered_task->GetTaskProjection());

  return true;
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:12,代码来源:TaskManager.cpp

示例6: seg

void
TaskPointRenderer::DrawIsoline(const AATPoint &tp)
{
  if (!tp.valid() || !IsTargetVisible(tp))
    return;

  AATIsolineSegment seg(tp, task_projection);
  if (!seg.IsValid())
    return;

  #define fixed_twentieth fixed(1.0 / 20.0)

  GeoPoint start = seg.Parametric(fixed_zero);
  GeoPoint end = seg.Parametric(fixed_one);

  if (m_proj.GeoToScreenDistance(start.Distance(end)) <= 2)
    return;

  RasterPoint screen[21];
  screen[0] = m_proj.GeoToScreen(start);
  screen[20] = m_proj.GeoToScreen(end);

  for (unsigned i = 1; i < 20; ++i) {
    fixed t = i * fixed_twentieth;
    GeoPoint ga = seg.Parametric(t);
    screen[i] = m_proj.GeoToScreen(ga);
  }

  canvas.Select(task_look.isoline_pen);
  canvas.SetBackgroundTransparent();
  canvas.DrawPolyline(screen, 21);
  canvas.SetBackgroundOpaque();
}
开发者ID:damianob,项目名称:xcsoar,代码行数:33,代码来源:TaskPointRenderer.cpp

示例7: seg

inline void
TaskPointRenderer::DrawIsoline(const AATPoint &tp)
{
  if (!tp.valid() || !IsTargetVisible(tp))
    return;

  AATIsolineSegment seg(tp, flat_projection);
  if (!seg.IsValid())
    return;

  GeoPoint start = seg.Parametric(0);
  GeoPoint end = seg.Parametric(1);

  if (m_proj.GeoToScreenDistance(start.DistanceS(end)) <= 2)
    return;

  BulkPixelPoint screen[21];
  screen[0] = m_proj.GeoToScreen(start);
  screen[20] = m_proj.GeoToScreen(end);

  for (unsigned i = 1; i < 20; ++i) {
    constexpr double twentieth = 1.0 / 20.0;
    auto t = i * twentieth;
    GeoPoint ga = seg.Parametric(t);
    screen[i] = m_proj.GeoToScreen(ga);
  }

  canvas.Select(task_look.isoline_pen);
  canvas.SetBackgroundTransparent();
  canvas.DrawPolyline(screen, 21);
  canvas.SetBackgroundOpaque();
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:32,代码来源:TaskPointRenderer.cpp

示例8:

bool
AATIsolineIntercept::Intercept(const AATPoint &ap, const AircraftState &state,
                               const double bearing_offset, GeoPoint& ip) const
{
  AircraftState s1, s2;
  if (ell.IntersectExtended(state.location, s1.location, s2.location)) {
    if (ap.IsInSector(s1)) {
      ip = s1.location;
      return true;
    }
    if (ap.IsInSector(s2)) {
      ip = s2.location;
      return true;
    }
  }
  return false;
}
开发者ID:alon,项目名称:xcsoar,代码行数:17,代码来源:AATIsolineIntercept.cpp

示例9: OnRadialModified

static void
OnRadialModified(fixed new_value)
{
  if (target_point < initial_active_task_point)
    return;

  Angle new_radial = Angle::Degrees(new_value);
  if (new_radial == range_and_radial.radial)
    return;

  bool must_reload_radial = false;
  if (new_radial >= Angle::HalfCircle()) {
    new_radial -= Angle::FullCircle();
    must_reload_radial = true;
  } else if (new_radial <= -Angle::HalfCircle()) {
    new_radial += Angle::FullCircle();
    must_reload_radial = true;
  }

  if ((new_radial.Absolute() > Angle::QuarterCircle()) !=
      (range_and_radial.radial.Absolute() > Angle::QuarterCircle())) {
    /* when the radial crosses the +/-90 degrees threshold, flip the
       range */
    range_and_radial.range = -range_and_radial.range;
    LoadRange();
  }

  range_and_radial.radial = new_radial;

  {
    ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
    const OrderedTask &task = lease->GetOrderedTask();
    AATPoint *ap = task.GetAATTaskPoint(target_point);
    if (ap == nullptr)
      return;

    ap->SetTarget(range_and_radial,
                  lease->GetOrderedTask().GetTaskProjection());
  }

  if (must_reload_radial)
    LoadRadial();

  map->Invalidate();
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:45,代码来源:TargetDialog.cpp

示例10: seg

void 
PrintHelper::aatpoint_print(std::ostream& f, 
                            const AATPoint& tp,
                            const AircraftState& state,
                            const TaskProjection &projection,
                            const int item) 
{
  switch(item) {
  case 0:
    orderedtaskpoint_print(f, tp, state, item);
    f << "#   Target " << tp.m_target_location.longitude << ","
      << tp.m_target_location.latitude << "\n";
    break;

  case 1:

    if (tp.valid() && (tp.getActiveState() != OrderedTaskPoint::BEFORE_ACTIVE)) {
      assert(tp.get_previous());
      assert(tp.get_next());
      // note in general this will only change if 
      // prev max or target changes

      AATIsolineSegment seg(tp, projection);
      fixed tdist = tp.get_previous()->GetLocationRemaining().Distance(
        tp.GetLocationMin());
      fixed rdist = tp.get_previous()->GetLocationRemaining().Distance(
        tp.get_location_target());

      bool filter_backtrack = true;
      if (seg.IsValid()) {
        for (double t = 0.0; t<=1.0; t+= 1.0/20) {
          GeoPoint ga = seg.Parametric(fixed(t));
          fixed dthis = tp.get_previous()->GetLocationRemaining().Distance(ga);
          if (!filter_backtrack 
              || (dthis>=tdist)
              || (dthis>=rdist)) {
            /// @todo unless double dist is better than current
            f << ga.longitude << " " << ga.latitude << "\n";
          }
        }
      } else {
        GeoPoint ga = seg.Parametric(fixed_zero);
        f << ga.longitude << " " << ga.latitude << "\n";
      }
      f << "\n";

    }
    break;
  }
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:50,代码来源:TaskPrinting.cpp

示例11:

bool
AATIsolineSegment::isInSector(const AATPoint& ap, fixed t) {
  GeoPoint a = ell.parametric(t);
  AIRCRAFT_STATE s;
  s.Location = a;
  if (ap.isInSector((s)))
    return true;
  else
    return false;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:10,代码来源:AATIsolineSegment.cpp

示例12:

AATIsoline::AATIsoline(const AATPoint& ap, const TaskProjection &projection)
  :ell(ap.GetPrevious()->GetLocationRemaining(),
       ap.GetNext()->GetLocationRemaining(),
       ap.GetTargetLocation(), projection) {}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:4,代码来源:AATIsoline.cpp

示例13: Visit

 virtual void Visit(const AATPoint& tp) {
   printf("# got an aat\n");
   ozv.Visit(*tp.get_oz());
 }
开发者ID:galippi,项目名称:xcsoar,代码行数:4,代码来源:harness_task.cpp

示例14: Visit

 virtual void Visit(AATPoint& tp) {
   ObservationZoneEdit ozv;
   tp.Accept_oz(ozv);
 }
开发者ID:hnpilot,项目名称:XCSoar,代码行数:4,代码来源:test_edittp.cpp


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