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


C++ ODPoint::SetDistance方法代码示例

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


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

示例1: UpdateProperties


//.........这里部分代码省略.........
        //  Note that Distance/Bearing for Leg 000 is as from current position

        double brg, leg_dist;
        bool starting_point = false;

        starting_point = ( i == 0 ) && enroute;
        if( m_pEnroutePoint && !starting_point ) starting_point = ( prp->m_GUID
                == m_pEnroutePoint->m_GUID );

        DistanceBearingMercator_Plugin( prp->m_lat, prp->m_lon, slat, slon, &brg, &leg_dist );

    // calculation of course at current WayPoint.
    double course=10, tmp_leg_dist=23;
    wxODPointListNode *next_node = node->GetNext();
    ODPoint * _next_prp = (next_node)? next_node->GetData(): NULL;
    if (_next_prp )
    {
        DistanceBearingMercator_Plugin( _next_prp->m_lat, _next_prp->m_lon, prp->m_lat, prp->m_lon, &course, &tmp_leg_dist );
    }else
    {
      course = 0.0;
      tmp_leg_dist = 0.0;
    }

    //prp->SetCourse(course); // save the course to the next waypoint for printing.
    // end of calculation


    t.Printf( _T("%6.2f ") + getUsrDistanceUnit_Plugin(), toUsrDistance_Plugin( leg_dist ) );
    if( arrival )
        m_opList->SetItem( item_line_index, 2, t );
    if( !enroute )
        m_opList->SetItem( item_line_index, 2, nullify );
    prp->SetDistance(leg_dist); // save the course to the next waypoint for printing.

        //  Bearing
    if( g_bShowMag )
        t.Printf( _T("%03.0f Deg. M"), g_ocpn_draw_pi->GetTrueOrMag( brg ) );
    else
        t.Printf( _T("%03.0f Deg. T"), g_ocpn_draw_pi->GetTrueOrMag( brg ) );

//    if( arrival )
//        m_opList->SetItem( item_line_index, 3, t );
//    if( !enroute )
//        m_opList->SetItem( item_line_index, 3, nullify );

    // Course (bearing of next )
    if (_next_prp){
        if( g_bShowMag )
            t.Printf( _T("%03.0f Deg. M"), g_ocpn_draw_pi->GetTrueOrMag( course ) );
        else
            t.Printf( _T("%03.0f Deg. T"), g_ocpn_draw_pi->GetTrueOrMag( course ) );
        if( arrival )
            m_opList->SetItem( item_line_index, 7, t );
    }
    else
        m_opList->SetItem( item_line_index, 7, nullify );

        //  Lat/Lon
        wxString tlat = toSDMM_PlugIn( 1, prp->m_lat, prp->m_bIsInTrack );  // low precision for routes
        if( arrival ) m_opList->SetItem( item_line_index, 4, tlat );

        wxString tlon = toSDMM_PlugIn( 2, prp->m_lon, prp->m_bIsInTrack );
        if( arrival ) m_opList->SetItem( item_line_index, 5, tlon );

开发者ID:ptulp,项目名称:ocpn_draw_pi,代码行数:65,代码来源:PathProp.cpp


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