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


C++ AATPoint::GetPrevious方法代码示例

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


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

示例1: 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.GetTargetLocation().longitude << ","
          << tp.GetTargetLocation().latitude << "\n";
        break;

    case 1:

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

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

            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.GetPrevious()->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(0));
                f << ga.longitude << " " << ga.latitude << "\n";
            }
            f << "\n";

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

示例2:

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


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