本文整理汇总了C++中Track::AddNewPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Track::AddNewPoint方法的具体用法?C++ Track::AddNewPoint怎么用?C++ Track::AddNewPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::AddNewPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnIdTrkCreateClick
void AISTargetQueryDialog::OnIdTrkCreateClick( wxCommandEvent& event )
{
if( m_MMSI != 0 ) { // Faulty MMSI could be reported as 0
AIS_Target_Data *td = g_pAIS->Get_Target_Data_From_MMSI( m_MMSI );
if( td )
{
if ( td->b_PersistTrack ) //The target was tracked and the user wants to stop it
{
td->b_PersistTrack = false;
g_pAIS->m_persistent_tracks.erase(td->MMSI);
m_createTrkBtn->SetLabel(_("Record Track"));
}
else
{
RoutePoint *rp = NULL;
RoutePoint *rp1 = NULL;
Track *t = new Track();
t->m_RouteNameString = wxString::Format( _T("AIS %s (%u) %s %s"), td->GetFullName().c_str(), td->MMSI, wxDateTime::Now().FormatISODate().c_str(), wxDateTime::Now().FormatISOTime().c_str() );
wxAISTargetTrackListNode *node = td->m_ptrack->GetFirst();
while( node )
{
AISTargetTrackPoint *ptrack_point = node->GetData();
vector2D point( ptrack_point->m_lon, ptrack_point->m_lat );
rp1 = t->AddNewPoint( point, wxDateTime(ptrack_point->m_time).ToUTC() );
if( rp )
{
pSelect->AddSelectableTrackSegment( rp->m_lat, rp->m_lon, rp1->m_lat,
rp1->m_lon, rp, rp1, t );
}
rp = rp1;
node = node->GetNext();
}
pRouteList->Append( t );
pConfig->AddNewRoute( t, -1 );
t->RebuildGUIDList(); // ensure the GUID list is intact and good
if( pRouteManagerDialog && pRouteManagerDialog->IsShown() )
pRouteManagerDialog->UpdateTrkListCtrl();
Refresh( false );
if( wxID_YES == OCPNMessageBox(NULL,
_("The recently captured track of this target has been recorded.\nDo you want to continue recording until the end of the current OpenCPN session?"),
_("OpenCPN Info"), wxYES_NO | wxCENTER, 60 ) )
{
td->b_PersistTrack = true;
g_pAIS->m_persistent_tracks[td->MMSI] = t;
}
}
}
}
}