Esempio n. 1
0
void Route::AddPoint( RoutePoint *pNewPoint, bool b_rename_in_sequence, bool b_deferBoxCalc )
{
    if( pNewPoint->m_bIsolatedMark ) {
        pNewPoint->m_bKeepXRoute = true;
    }
    pNewPoint->m_bIsolatedMark = false;       // definitely no longer isolated
    pNewPoint->m_bIsInRoute = true;

    RoutePoint *prev = GetLastPoint();
    pRoutePointList->Append( pNewPoint );

    if( !b_deferBoxCalc )
        FinalizeForRendering();

    if( prev )
        UpdateSegmentDistance( prev, pNewPoint );

    if( b_rename_in_sequence && pNewPoint->GetName().IsEmpty() && !pNewPoint->m_bKeepXRoute ) {
        wxString name;
        name.Printf( _T ( "%03d" ), GetnPoints() );
        pNewPoint->SetName( name );
        pNewPoint->m_bDynamicName = true;
    }
    return;
}
Esempio n. 2
0
/// - Insert after a certain point
void WaypointManager::AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid)
{
    for (uint32 i = GetLastPoint(id, 0); i > point; --i)
        WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point+1 WHERE id=%u AND point=%u", id, i);

    _addNode(id, point + 1, x, y, z, o, delay, wpGuid);
}
Esempio n. 3
0
void Track::Clone( Track *psourcetrack, int start_nPoint, int end_nPoint, const wxString & suffix)
{
    if( psourcetrack->m_bIsInLayer ) return;

    m_TrackNameString = psourcetrack->m_TrackNameString + suffix;
    m_TrackStartString = psourcetrack->m_TrackStartString;
    m_TrackEndString = psourcetrack->m_TrackEndString;

    bool b_splitting = GetnPoints() == 0;

    int startTrkSegNo;
    if( b_splitting ) startTrkSegNo = psourcetrack->GetPoint( start_nPoint )->m_GPXTrkSegNo;
    else
        startTrkSegNo = GetLastPoint()->m_GPXTrkSegNo;

    int i;
    for( i = start_nPoint; i <= end_nPoint; i++ ) {

        TrackPoint *psourcepoint = psourcetrack->GetPoint( i );
        if(psourcepoint){
            TrackPoint *ptargetpoint = new TrackPoint( psourcepoint);
            
            AddPoint( ptargetpoint );
        }
    }
}
Esempio n. 4
0
void CFDE_Path::AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
  FX_PATHPOINT* pLast = GetLastPoint();
  if (!pLast || FXSYS_fabs(pLast->m_PointX - pt1.x) > 0.001 ||
      FXSYS_fabs(pLast->m_PointY - pt1.y) > 0.001) {
    MoveTo(pt1);
  }
  LineTo(pt2);
}
Esempio n. 5
0
/// - Insert after the last point
void WaypointManager::AddLastNode(uint32 id, float x, float y, float z, float o, uint32 delay, uint32 wpGuid)
{
    _addNode(id, GetLastPoint(id, 0) + 1, x, y, z, o, delay, wpGuid);
}
Esempio n. 6
0
FX_BOOL CFDE_Path::FigureClosed() const {
  FX_PATHPOINT* pPoint = GetLastPoint();
  return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : TRUE;
}
Esempio n. 7
0
FX_BOOL CFDE_Path::CloseFigure() {
  FX_PATHPOINT* pPoint = GetLastPoint();
  if (pPoint)
    pPoint->m_Flag |= FXPT_CLOSEFIGURE;
  return TRUE;
}