void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    RotatePoint( &m_Pos, aRotCentre, aAngle );
    m_Orient += aAngle;
    NORMALIZE_ANGLE_360( m_Orient );

    SetLocalCoord();
}
void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    // Used in footprint edition
    // Note also in module editor, m_Pos0 = m_Pos
    RotatePoint( &m_Pos, aRotCentre, aAngle );
    SetOrientation( GetOrientation() + aAngle );
    SetLocalCoord();
}
Beispiel #3
0
void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    RotatePoint( &m_Pos, aRotCentre, aAngle );

    m_Orient = NormalizeAngle360Min( m_Orient + aAngle );

    SetLocalCoord();
}
void EDGE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    // do the base class rotation
    DRAWSEGMENT::Rotate( aRotCentre, aAngle );

    // and now work out the new offset
    SetLocalCoord();
}
void TEXTE_MODULE::Flip( const wxPoint& aCentre )
{
    // flipping the footprint is relative to the X axis
    MIRROR( m_Pos.y, aCentre.y );
    NEGATE_AND_NORMALIZE_ANGLE_POS( m_Orient );
    SetLayer( FlipLayer( GetLayer() ) );
    m_Mirror = IsBackLayer( GetLayer() );
    SetLocalCoord();
}
void TEXTE_MODULE::Flip( const wxPoint& aCentre )
{
    // flipping the footprint is relative to the X axis
    SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );

    SetTextAngle( -GetTextAngle() );

    SetLayer( FlipLayer( GetLayer() ) );
    SetMirrored( IsBackLayer( GetLayer() ) );
    SetLocalCoord();
}
void EDGE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    // We should rotate the relative coordinates, but to avoid duplicate code,
    // do the base class rotation of draw coordinates, which is acceptable
    // because in module editor, m_Pos0 = m_Pos
    DRAWSEGMENT::Rotate( aRotCentre, aAngle );

    // and now update the relative coordinates, which are
    // the reference in most transforms.
    SetLocalCoord();
}
void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
{
    // Used in modedit, to transform the footprint
    // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
    // the position is mirrored, but the text itself is not mirrored
    if( aMirrorAroundXAxis )
        SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
    else
        SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );

    SetLocalCoord();
}
void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
{
    // Used in footprint edition
    // Note also in module editor, m_Pos0 = m_Pos

    wxPoint pt = GetTextPos();
    RotatePoint( &pt, aRotCentre, aAngle );
    SetTextPos( pt );

    SetTextAngle( GetTextAngle() + aAngle );
    SetLocalCoord();
}
void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
{
    // Used in modedit, to transform the footprint
    // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
    // the position is mirrored, but the text itself is not mirrored
    if( aMirrorAroundXAxis )
        MIRROR( m_Pos.y, aCentre.y );
    else
        MIRROR( m_Pos.x, aCentre.x );

    NEGATE_AND_NORMALIZE_ANGLE_POS( m_Orient );
    SetLocalCoord();
}
void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
{
    Offset( aMoveVector );
    SetLocalCoord();
}
void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
{
    m_Pos += aMoveVector;
    SetLocalCoord();
}