• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TracePoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: distance_metric

 /**
  * Calculate error distance, between last through this to next,
  * if this node is removed.  This metric provides for Douglas-Peuker
  * thinning.
  *
  * @param last Point previous in time to this node
  * @param node This node
  * @param next Point succeeding this node
  *
  * @return Distance error if this node is thinned
  */
 static unsigned distance_metric(const TracePoint& last,
                                 const TracePoint& node,
                                 const TracePoint& next) {
     const int d_this = last.flat_distance(node) + node.flat_distance(next);
     const int d_rem = last.flat_distance(next);
     return abs(d_this - d_rem);
 }
开发者ID:macsux,项目名称:XCSoar,代码行数:18,代码来源:Trace.hpp


示例2:

bool
AbstractContest::IsFinishAltitudeValid(const TracePoint& start,
                                       const TracePoint& finish) const
{
    return finish.GetIntegerAltitude() + (int)finish_alt_diff >=
           start.GetIntegerAltitude();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:7,代码来源:AbstractContest.cpp


示例3: DistanceMetric

 /**
  * Calculate error distance, between last through this to next,
  * if this node is removed.  This metric provides for Douglas-Peuker
  * thinning.
  *
  * @param last Point previous in time to this node
  * @param node This node
  * @param next Point succeeding this node
  *
  * @return Distance error if this node is thinned
  */
 static unsigned DistanceMetric(const TracePoint &last,
                                const TracePoint &node,
                                const TracePoint &next) {
   const int d_this = last.FlatDistanceTo(node) + node.FlatDistanceTo(next);
   const int d_rem = last.FlatDistanceTo(next);
   return abs(d_this - d_rem);
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:18,代码来源:Trace.hpp


示例4: Invalid

 gcc_const
 static TracePoint Invalid() {
   TracePoint point;
   point.Clear();
   ((SearchPoint &)point).SetInvalid();
   return point;
 }
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:7,代码来源:Point.hpp


示例5: operator

 /**
  * Retrieve coordinate value from object given coordinate index
  * @param d WaypointEnvelope object
  * @param k index of coordinate
  *
  * @return Coordinate value
  */
 int operator() ( const TracePoint &d, const unsigned k) const {
   switch(k) {
   case 0:
     return d.get_flatLocation().Longitude;
   case 1:
     return d.get_flatLocation().Latitude;
   };
   return 0; 
 };
开发者ID:galippi,项目名称:xcsoar,代码行数:16,代码来源:TracePoint.hpp


示例6: PrintTracePoint

static void
PrintTracePoint(const TracePoint &point, std::ofstream& fs)
{
  fs << point.GetTime()
     << " " << point.GetLocation().longitude
     << " " << point.GetLocation().latitude
     << " " << point.GetAltitude()
     << " " << point.GetVario()
     << "\n";
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:10,代码来源:Printing.cpp


示例7: TraceDelta

 TraceDelta(const TracePoint &p_last, const TracePoint &p,
            const TracePoint &p_next)
     :point(p),
      elim_time(time_metric(p_last, p, p_next)),
      elim_distance(distance_metric(p_last, p, p_next)),
      delta_distance(p.flat_distance(p_last))
 {
     assert(elim_distance != null_delta);
 }
开发者ID:macsux,项目名称:XCSoar,代码行数:9,代码来源:Trace.hpp


示例8: TraceDelta

 TraceDelta(const TracePoint &p_last, const TracePoint &p,
            const TracePoint &p_next)
   :point(p),
    elim_time(TimeMetric(p_last, p, p_next)),
    elim_distance(DistanceMetric(p_last, p, p_next)),
    delta_distance(p.FlatDistanceTo(p_last))
 {
   assert(elim_distance != null_delta);
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:9,代码来源:Trace.hpp


示例9: GetMinimumFinishAltitude

 gcc_pure
 int GetMinimumFinishAltitude(const TracePoint &start) const {
   return start.GetIntegerAltitude() - finish_alt_diff;
 }
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:4,代码来源:AbstractContest.hpp


示例10: GetMaximumStartAltitude

 gcc_pure
 int GetMaximumStartAltitude(const TracePoint &finish) const {
   return finish.GetIntegerAltitude() + finish_alt_diff;
 }
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:4,代码来源:AbstractContest.hpp


示例11: update

 void update(const TracePoint &p_last, const TracePoint &p_next) {
     elim_time = time_metric(p_last, point, p_next);
     elim_distance = distance_metric(p_last, point, p_next);
     delta_distance = point.flat_distance(p_last);
 }
开发者ID:macsux,项目名称:XCSoar,代码行数:5,代码来源:Trace.hpp


示例12: approx_sq_dist

 /** 
  * Calculate approximate squared (flat projected) distance between this point
  * and another
  * 
  * @param tp Point to calculate distance to
  * 
  * @return Approximate squared distance
  */
 gcc_pure
 unsigned approx_sq_dist(const TracePoint& tp) const {
   return dsqr(get_flatLocation().Longitude-tp.get_flatLocation().Longitude)+
     dsqr(get_flatLocation().Latitude-tp.get_flatLocation().Latitude);
 }
开发者ID:galippi,项目名称:xcsoar,代码行数:13,代码来源:TracePoint.hpp


示例13: TimeMetric

 /**
  * Calculate error time, between last through this to next,
  * if this node is removed.  This metric provides for fair thinning
  * (tendency to to result in equal time steps)
  *
  * @param last Point previous in time to this node
  * @param node This node
  * @param next Point succeeding this node
  *
  * @return Time delta if this node is thinned
  */
 static unsigned TimeMetric(const TracePoint &last, const TracePoint &node,
                            const TracePoint &next) {
   return next.DeltaTime(last)
     - std::min(next.DeltaTime(node), node.DeltaTime(last));
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:16,代码来源:Trace.hpp


示例14: Update

 void Update(const TracePoint &p_last, const TracePoint &p_next) {
   elim_time = TimeMetric(p_last, point, p_next);
   elim_distance = DistanceMetric(p_last, point, p_next);
   delta_distance = point.FlatDistanceTo(p_last);
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:5,代码来源:Trace.hpp


示例15: TriangleSecondLeg

 TriangleSecondLeg(bool _fai, const TracePoint &_a, const TracePoint &_b)
   :is_fai(_fai), a(_a), b(_b), df_1(a.flat_distance(b)) {}
开发者ID:macsux,项目名称:XCSoar,代码行数:2,代码来源:OLCTriangle.cpp


示例16: Result

TriangleSecondLeg::Result
TriangleSecondLeg::Calculate(const TracePoint &c, unsigned best) const
{
  // this is a heuristic to remove invalid triangles
  // we do as much of this in flat projection for speed

  const unsigned df_2 = b.flat_distance(c);
  const unsigned df_3 = c.flat_distance(a);
  const unsigned df_total = df_1+df_2+df_3;

  // require some distance!
  if (df_total<20) {
    return Result(0, 0);
  }

  // no point scanning if worst than best
  if (df_total<= best) {
    return Result(0, 0);
  }

  const unsigned shortest = min(df_1, min(df_2, df_3));

  // require all legs to have distance
  if (!shortest) {
    return Result(0, 0);
  }

  if (is_fai && (shortest*4<df_total)) { // fails min < 25% worst-case rule!
    return Result(0, 0);
  }

  const unsigned d = df_3+df_2;

  // without FAI rules, allow any triangle
  if (!is_fai) {
    return Result(d, df_total);
  }

  if (shortest*25>=df_total*7) { 
    // passes min > 28% rule,
    // this automatically means we pass max > 45% worst-case
    return Result(d, df_total);
  }

  const unsigned longest = max(df_1, max(df_2, df_3));
  if (longest*20>df_total*9) { // fails max > 45% worst-case rule!
    return Result(0, 0);
  }

  // passed basic tests, now detailed ones

  // find accurate min leg distance
  fixed leg(0);
  if (df_1 == shortest) {
    leg = a.get_location().distance(b.get_location());
  } else if (df_2 == shortest) {
    leg = b.get_location().distance(c.get_location());
  } else if (df_3 == shortest) {
    leg = c.get_location().distance(a.get_location());
  }

  // estimate total distance by scaling.
  // this is a slight approximation, but saves having to do
  // three accurate distance calculations.

  const fixed d_total((df_total*leg)/shortest);
  if (d_total>=fixed(500000)) {
    // long distance, ok that it failed 28% rule
    return Result(d, df_total);
  }

  return Result(0, 0);
}
开发者ID:macsux,项目名称:XCSoar,代码行数:73,代码来源:OLCTriangle.cpp


示例17: location

inline
ContestTracePoint::ContestTracePoint(const TracePoint &src)
  :time(src.GetTime()), location(src.GetLocation()) {}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:3,代码来源:Cast.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TracePointVector类代码示例发布时间:2022-05-31
下一篇:
C++ TraceOutput类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap