void D_PAD::ImportSettingsFromMaster( const D_PAD& aMasterPad ) { SetShape( aMasterPad.GetShape() ); SetLayerSet( aMasterPad.GetLayerSet() ); SetAttribute( aMasterPad.GetAttribute() ); // The pad orientation, for historical reasons is the // pad rotation + parent rotation. // So we have to manage this parent rotation double pad_rot = aMasterPad.GetOrientation(); if( aMasterPad.GetParent() ) pad_rot -= aMasterPad.GetParent()->GetOrientation(); if( GetParent() ) pad_rot += GetParent()->GetOrientation(); SetOrientation( pad_rot ); SetSize( aMasterPad.GetSize() ); SetDelta( wxSize( 0, 0 ) ); SetOffset( aMasterPad.GetOffset() ); SetDrillSize( aMasterPad.GetDrillSize() ); SetDrillShape( aMasterPad.GetDrillShape() ); SetRoundRectRadiusRatio( aMasterPad.GetRoundRectRadiusRatio() ); switch( aMasterPad.GetShape() ) { case PAD_SHAPE_TRAPEZOID: SetDelta( aMasterPad.GetDelta() ); break; case PAD_SHAPE_CIRCLE: // ensure size.y == size.x SetSize( wxSize( GetSize().x, GetSize().x ) ); break; default: ; } switch( aMasterPad.GetAttribute() ) { case PAD_ATTRIB_SMD: case PAD_ATTRIB_CONN: // These pads do not have hole (they are expected to be only on one // external copper layer) SetDrillSize( wxSize( 0, 0 ) ); break; default: ; } // Add or remove custom pad shapes: SetPrimitives( aMasterPad.GetPrimitives() ); SetAnchorPadShape( aMasterPad.GetAnchorPadShape() ); MergePrimitivesAsPolygon(); }
void D_PAD::Flip( const wxPoint& aCentre ) { int y = GetPosition().y; MIRROR( y, aCentre.y ); // invert about x axis. SetY( y ); MIRROR( m_Pos0.y, 0 ); MIRROR( m_Offset.y, 0 ); MIRROR( m_DeltaSize.y, 0 ); SetOrientation( -GetOrientation() ); // flip pads layers // PADS items are currently on all copper layers, or // currently, only on Front or Back layers. // So the copper layers count is not taken in account SetLayerSet( FlipLayerMask( m_layerMask ) ); // m_boundingRadius = -1; the shape has not been changed }
void D_PAD::Flip( const wxPoint& aCentre ) { int y = GetPosition().y - aCentre.y; y = -y; // invert about x axis. y += aCentre.y; SetY( y ); m_Pos0.y = -m_Pos0.y; m_Offset.y = -m_Offset.y; m_DeltaSize.y = -m_DeltaSize.y; SetOrientation( -GetOrientation() ); // flip pads layers SetLayerSet( FlipLayerMask( m_layerMask ) ); // m_boundingRadius = -1; the shape has not been changed }