void doUndoMoveODPoint( UndoAction* action ) { double lat, lon; ODPoint* currentPoint = (ODPoint*) action->after[0]; wxRealPoint* lastPoint = (wxRealPoint*) action->before[0]; lat = currentPoint->m_lat; lon = currentPoint->m_lon; currentPoint->m_lat = lastPoint->y; currentPoint->m_lon = lastPoint->x; lastPoint->y = lat; lastPoint->x = lon; SelectItem* selectable = (SelectItem*) action->selectable[0]; selectable->m_slat = currentPoint->m_lat; selectable->m_slon = currentPoint->m_lon; if( ( NULL != pMarkPropDialog ) && ( pMarkPropDialog->IsShown() ) ){ if( currentPoint == pMarkPropDialog->GetRoutePoint() ) pMarkPropDialog->UpdateProperties(true); } wxArrayPtrVoid* pathArray = g_pPathMan->GetPathArrayContaining( currentPoint ); if( pathArray ) { for( unsigned int ir = 0; ir < pathArray->GetCount(); ir++ ) { ODPath *pp = (ODPath *) pathArray->Item( ir ); pp->FinalizeForRendering(); pp->UpdateSegmentDistances(); g_pODConfig->UpdatePath( pp ); } delete pathArray; } }
void EBL::UpdateEBL( void ) { g_pODSelect->DeleteAllSelectablePathSegments( this ); g_pODSelect->DeleteAllSelectableODPoints( this ); g_pODSelect->AddAllSelectablePathSegments( this ); g_pODSelect->AddAllSelectableODPoints( this ); FinalizeForRendering(); UpdateSegmentDistances(); bool prev_bskip = g_pODConfig->m_bSkipChangeSetUpdate; g_pODConfig->m_bSkipChangeSetUpdate = false; if(m_iPersistenceType == ID_EBL_PERSISTENT || m_iPersistenceType == ID_EBL_PERSISTENT_CRASH) g_pODConfig->UpdatePath( this ); g_pODConfig->m_bSkipChangeSetUpdate = prev_bskip; for( unsigned int ip = 0; ip < m_pODPointList->GetCount(); ip++ ) { ODPath *pp = (ODPath *) m_pODPointList->Item( ip ); if( g_pPathMan->IsPathValid(pp) ) { pp->FinalizeForRendering(); pp->UpdateSegmentDistances(); pp->m_bIsBeingEdited = false; g_pODConfig->UpdatePath( pp ); pp->SetHiLite( 0 ); } } // Update the PathProperties Dialog, if currently shown if( ( NULL != g_pEBLPropDialog ) && ( g_pEBLPropDialog->IsShown() ) ) { if( m_pODPointList ) { for( unsigned int ip = 0; ip < m_pODPointList->GetCount(); ip++ ) { ODPath *pp = (ODPath *) m_pODPointList->Item( ip ); if( g_pPathMan->IsPathValid(pp) ) { g_pEBLPropDialog->SetPathAndUpdate( pp, true ); } } } } }