本文整理汇总了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 );