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


C++ Track::AddNewPoint方法代码示例

本文整理汇总了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;
                }
            }
        }
    }
}
开发者ID:adrianquiala,项目名称:OpenCPN,代码行数:54,代码来源:AISTargetQueryDialog.cpp


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