Replace PAD_SHAPE::RECT by PAD_SHAPE::RECTANGLE to avoid a collision NAME with a windows header on MSYS2, creating many compil warnings. No actual code change.

This commit is contained in:
jean-pierre charras 2023-06-02 11:10:48 +02:00
parent 0eb45a7f27
commit 9a47b34499
25 changed files with 58 additions and 50 deletions

View File

@ -34,7 +34,7 @@
enum class PAD_SHAPE : int enum class PAD_SHAPE : int
{ {
CIRCLE, CIRCLE,
RECT, RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
OVAL, OVAL,
TRAPEZOID, TRAPEZOID,
ROUNDRECT, ROUNDRECT,
@ -50,7 +50,7 @@ static inline std::string PAD_SHAPE_T_asString( PAD_SHAPE a )
switch( a ) switch( a )
{ {
case PAD_SHAPE::CIRCLE: return "PAD_SHAPE::CIRCLE"; case PAD_SHAPE::CIRCLE: return "PAD_SHAPE::CIRCLE";
case PAD_SHAPE::RECT: return "PAD_SHAPE::RECT"; case PAD_SHAPE::RECTANGLE: return "PAD_SHAPE::RECT";
case PAD_SHAPE::OVAL: return "PAD_SHAPE::OVAL"; case PAD_SHAPE::OVAL: return "PAD_SHAPE::OVAL";
case PAD_SHAPE::TRAPEZOID: return "PAD_SHAPE::TRAPEZOID"; case PAD_SHAPE::TRAPEZOID: return "PAD_SHAPE::TRAPEZOID";
case PAD_SHAPE::ROUNDRECT: return "PAD_SHAPE::ROUNDRECT"; case PAD_SHAPE::ROUNDRECT: return "PAD_SHAPE::ROUNDRECT";

View File

@ -57,7 +57,7 @@ static PAD_SHAPE code_shape[] =
{ {
PAD_SHAPE::CIRCLE, PAD_SHAPE::CIRCLE,
PAD_SHAPE::OVAL, PAD_SHAPE::OVAL,
PAD_SHAPE::RECT, PAD_SHAPE::RECTANGLE,
PAD_SHAPE::TRAPEZOID, PAD_SHAPE::TRAPEZOID,
PAD_SHAPE::ROUNDRECT, PAD_SHAPE::ROUNDRECT,
PAD_SHAPE::CHAMFERED_RECT, PAD_SHAPE::CHAMFERED_RECT,
@ -602,7 +602,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
default: default:
case PAD_SHAPE::CIRCLE: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CIRCLE ); break; case PAD_SHAPE::CIRCLE: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CIRCLE ); break;
case PAD_SHAPE::OVAL: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_OVAL ); break; case PAD_SHAPE::OVAL: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_OVAL ); break;
case PAD_SHAPE::RECT: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_RECT ); break; case PAD_SHAPE::RECTANGLE: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_RECT ); break;
case PAD_SHAPE::TRAPEZOID: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_TRAPEZOID ); break; case PAD_SHAPE::TRAPEZOID: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_TRAPEZOID ); break;
case PAD_SHAPE::ROUNDRECT: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_ROUNDRECT ); break; case PAD_SHAPE::ROUNDRECT: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_ROUNDRECT ); break;
@ -614,7 +614,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
break; break;
case PAD_SHAPE::CUSTOM: case PAD_SHAPE::CUSTOM:
if( m_previewPad->GetAnchorPadShape() == PAD_SHAPE::RECT ) if( m_previewPad->GetAnchorPadShape() == PAD_SHAPE::RECTANGLE )
m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CUSTOM_RECT_ANCHOR ); m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CUSTOM_RECT_ANCHOR );
else else
m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR ); m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR );
@ -1670,7 +1670,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
if( m_currentPad->GetShape() == PAD_SHAPE::ROUNDRECT && if( m_currentPad->GetShape() == PAD_SHAPE::ROUNDRECT &&
m_currentPad->GetRoundRectRadiusRatio() == 0.0 ) m_currentPad->GetRoundRectRadiusRatio() == 0.0 )
{ {
m_currentPad->SetShape( PAD_SHAPE::RECT ); m_currentPad->SetShape( PAD_SHAPE::RECTANGLE );
} }
// Set the fabrication property: // Set the fabrication property:
@ -1774,7 +1774,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
aPad->SetShape( code_shape[m_PadShapeSelector->GetSelection()] ); aPad->SetShape( code_shape[m_PadShapeSelector->GetSelection()] );
if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR ) if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR )
aPad->SetAnchorPadShape( PAD_SHAPE::RECT ); aPad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
else else
aPad->SetAnchorPadShape( PAD_SHAPE::CIRCLE ); aPad->SetAnchorPadShape( PAD_SHAPE::CIRCLE );

View File

@ -117,7 +117,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run()
case PAD_SHAPE::CIRCLE: case PAD_SHAPE::CIRCLE:
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
return 1; return 1;
@ -171,7 +171,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run()
case PAD_SHAPE::CIRCLE: case PAD_SHAPE::CIRCLE:
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
annularWidth = std::min( pad->GetSizeX() - pad->GetDrillSizeX(), annularWidth = std::min( pad->GetSizeX() - pad->GetDrillSizeX(),
pad->GetSizeY() - pad->GetDrillSizeY() ) / 2; pad->GetSizeY() - pad->GetDrillSizeY() ) / 2;

View File

@ -455,7 +455,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
pad->GetSize().x / (SCALE_FACTOR * 2) ); pad->GetSize().x / (SCALE_FACTOR * 2) );
break; break;
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
fprintf( aFile, " RECTANGULAR %g\n", fprintf( aFile, " RECTANGULAR %g\n",
pad->GetDrillSize().x / SCALE_FACTOR ); pad->GetDrillSize().x / SCALE_FACTOR );

View File

@ -161,7 +161,7 @@ private:
shapeId = 2; shapeId = 2;
break; break;
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
shapeId = 1; shapeId = 1;
break; break;

View File

@ -147,7 +147,7 @@ FOOTPRINT* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprint
case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC: // Arc Stub created by a polygonal approach: case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC: // Arc Stub created by a polygonal approach:
{ {
pad->SetShape( PAD_SHAPE::CUSTOM ); pad->SetShape( PAD_SHAPE::CUSTOM );
pad->SetAnchorPadShape( PAD_SHAPE::RECT ); pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
int numPoints = ( angle.AsDegrees() / 5.0 ) + 3; int numPoints = ( angle.AsDegrees() / 5.0 ) + 3;
std::vector<VECTOR2I> polyPoints; std::vector<VECTOR2I> polyPoints;
@ -218,7 +218,7 @@ FOOTPRINT* MICROWAVE_TOOL::createBaseFootprint( const wxString& aValue,
pad->SetSize( VECTOR2I( tw, tw ) ); pad->SetSize( VECTOR2I( tw, tw ) );
pad->SetPosition( footprint->GetPosition() ); pad->SetPosition( footprint->GetPosition() );
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetAttribute( PAD_ATTRIB::SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( F_Cu ); pad->SetLayerSet( F_Cu );

View File

@ -469,7 +469,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
break; break;
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
{ {
@ -1224,7 +1224,7 @@ wxString PAD::ShowPadShape() const
{ {
case PAD_SHAPE::CIRCLE: return _( "Circle" ); case PAD_SHAPE::CIRCLE: return _( "Circle" );
case PAD_SHAPE::OVAL: return _( "Oval" ); case PAD_SHAPE::OVAL: return _( "Oval" );
case PAD_SHAPE::RECT: return _( "Rect" ); case PAD_SHAPE::RECTANGLE: return _( "Rect" );
case PAD_SHAPE::TRAPEZOID: return _( "Trap" ); case PAD_SHAPE::TRAPEZOID: return _( "Trap" );
case PAD_SHAPE::ROUNDRECT: return _( "Roundrect" ); case PAD_SHAPE::ROUNDRECT: return _( "Roundrect" );
case PAD_SHAPE::CHAMFERED_RECT: return _( "Chamferedrect" ); case PAD_SHAPE::CHAMFERED_RECT: return _( "Chamferedrect" );
@ -1631,7 +1631,7 @@ void PAD::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer,
break; break;
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
{ {
int ddx = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.x / 2 : 0; int ddx = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.x / 2 : 0;
int ddy = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.y / 2 : 0; int ddy = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.y / 2 : 0;
@ -1707,7 +1707,7 @@ static struct PAD_DESC
ENUM_MAP<PAD_SHAPE>::Instance() ENUM_MAP<PAD_SHAPE>::Instance()
.Map( PAD_SHAPE::CIRCLE, _HKI( "Circle" ) ) .Map( PAD_SHAPE::CIRCLE, _HKI( "Circle" ) )
.Map( PAD_SHAPE::RECT, _HKI( "Rectangle" ) ) .Map( PAD_SHAPE::RECTANGLE, _HKI( "Rectangle" ) )
.Map( PAD_SHAPE::OVAL, _HKI( "Oval" ) ) .Map( PAD_SHAPE::OVAL, _HKI( "Oval" ) )
.Map( PAD_SHAPE::TRAPEZOID, _HKI( "Trapezoid" ) ) .Map( PAD_SHAPE::TRAPEZOID, _HKI( "Trapezoid" ) )
.Map( PAD_SHAPE::ROUNDRECT, _HKI( "Rounded rectangle" ) ) .Map( PAD_SHAPE::ROUNDRECT, _HKI( "Rounded rectangle" ) )

View File

@ -227,12 +227,12 @@ public:
/** /**
* Set the shape of the anchor pad for custom shaped pads. * Set the shape of the anchor pad for custom shaped pads.
* *
* @param aShape is the shape of the anchor pad shape( currently, only #PAD_SHAPE::RECT or * @param aShape is the shape of the anchor pad shape( currently, only #PAD_SHAPE::RECTANGLE or
* #PAD_SHAPE::CIRCLE. * #PAD_SHAPE::CIRCLE.
*/ */
void SetAnchorPadShape( PAD_SHAPE aShape ) void SetAnchorPadShape( PAD_SHAPE aShape )
{ {
m_anchorPadShape = ( aShape == PAD_SHAPE::RECT ) ? PAD_SHAPE::RECT : PAD_SHAPE::CIRCLE; m_anchorPadShape = ( aShape == PAD_SHAPE::RECTANGLE ) ? PAD_SHAPE::RECTANGLE : PAD_SHAPE::CIRCLE;
SetDirty(); SetDirty();
} }
@ -758,9 +758,10 @@ private:
VECTOR2I m_pos; // Pad Position on board VECTOR2I m_pos; // Pad Position on board
PAD_SHAPE m_padShape; // Shape: PAD_SHAPE::CIRCLE, PAD_SHAPE::RECT, PAD_SHAPE m_padShape; // Shape: PAD_SHAPE::CIRCLE, PAD_SHAPE::RECTANGLE,
// PAD_SHAPE::OVAL, PAD_SHAPE::TRAPEZOID, // PAD_SHAPE::OVAL, PAD_SHAPE::TRAPEZOID,
// PAD_SHAPE::ROUNDRECT, PAD_SHAPE_POLYGON // PAD_SHAPE::ROUNDRECT, PAD_SHAPE::CHAMFERED_RECT,
// PAD_SHAPE::CUSTOM
/* /*
* Editing definitions of primitives for custom pad shapes. In local coordinates relative * Editing definitions of primitives for custom pad shapes. In local coordinates relative
* to m_Pos (NOT shapePos) at orient 0. * to m_Pos (NOT shapePos) at orient 0.
@ -794,7 +795,7 @@ private:
int m_chamferPositions; // The positions of the chamfers (at orient 0) int m_chamferPositions; // The positions of the chamfers (at orient 0)
PAD_SHAPE m_anchorPadShape; // For custom shaped pads: shape of pad anchor, PAD_SHAPE m_anchorPadShape; // For custom shaped pads: shape of pad anchor,
// PAD_SHAPE::RECT, PAD_SHAPE::CIRCLE // PAD_SHAPE::RECTANGLE, PAD_SHAPE::CIRCLE
/* /*
* Most of the time the hole is the center of the shape (m_Offset = 0). But some designers * Most of the time the hole is the center of the shape (m_Offset = 0). But some designers

View File

@ -234,7 +234,7 @@ void PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, ERROR_LOC aE
// The anchor pad is always at 0,0 // The anchor pad is always at 0,0
switch( GetAnchorPadShape() ) switch( GetAnchorPadShape() )
{ {
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
{ {
SHAPE_RECT rect( -GetSize().x / 2, -GetSize().y / 2, GetSize().x, GetSize().y ); SHAPE_RECT rect( -GetSize().x / 2, -GetSize().y / 2, GetSize().x, GetSize().y );
aMergedPolygon->AddOutline( rect.Outline() ); aMergedPolygon->AddOutline( rect.Outline() );

View File

@ -395,7 +395,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
itemplotter.PlotPad( pad, color, padPlotMode ); itemplotter.PlotPad( pad, color, padPlotMode );
break; break;
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
pad->SetSize( padPlotsSize ); pad->SetSize( padPlotsSize );
if( mask_clearance > 0 ) if( mask_clearance > 0 )

View File

@ -228,7 +228,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
&gbr_metadata ); &gbr_metadata );
break; break;
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode, m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
&gbr_metadata ); &gbr_metadata );
break; break;

View File

@ -2468,7 +2468,7 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con
switch( aElem.topshape ) switch( aElem.topshape )
{ {
case ALTIUM_PAD_SHAPE::RECT: case ALTIUM_PAD_SHAPE::RECT:
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
break; break;
case ALTIUM_PAD_SHAPE::CIRCLE: case ALTIUM_PAD_SHAPE::CIRCLE:

View File

@ -1136,7 +1136,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
// Cadstar diamond shape is a square rotated 45 degrees // Cadstar diamond shape is a square rotated 45 degrees
// We convert it in KiCad to a square with chamfered edges // We convert it in KiCad to a square with chamfered edges
int sizeOfSquare = (double) getKiCadLength( csPadcode.Shape.Size ) * sqrt(2.0); int sizeOfSquare = (double) getKiCadLength( csPadcode.Shape.Size ) * sqrt(2.0);
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetChamferRectRatio( 0.5 ); pad->SetChamferRectRatio( 0.5 );
pad->SetSize( { sizeOfSquare, sizeOfSquare } ); pad->SetSize( { sizeOfSquare, sizeOfSquare } );
@ -1165,7 +1165,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
break; break;
case PAD_SHAPE_TYPE::RECTANGLE: case PAD_SHAPE_TYPE::RECTANGLE:
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetSize( { getKiCadLength( (long long) csPadcode.Shape.Size pad->SetSize( { getKiCadLength( (long long) csPadcode.Shape.Size
+ (long long) csPadcode.Shape.LeftLength + (long long) csPadcode.Shape.LeftLength
+ (long long) csPadcode.Shape.RightLength ), + (long long) csPadcode.Shape.RightLength ),
@ -1189,7 +1189,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
case PAD_SHAPE_TYPE::SQUARE: case PAD_SHAPE_TYPE::SQUARE:
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetSize( { getKiCadLength( csPadcode.Shape.Size ), pad->SetSize( { getKiCadLength( csPadcode.Shape.Size ),
getKiCadLength( csPadcode.Shape.Size ) } ); getKiCadLength( csPadcode.Shape.Size ) } );
break; break;
@ -1259,7 +1259,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
if( editedPadOutline.Contains( { 0, 0 } ) ) if( editedPadOutline.Contains( { 0, 0 } ) )
{ {
pad->SetAnchorPadShape( PAD_SHAPE::RECT ); pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
pad->SetSize( VECTOR2I( { 4, 4 } ) ); pad->SetSize( VECTOR2I( { 4, 4 } ) );
pad->SetShape( PAD_SHAPE::CUSTOM ); pad->SetShape( PAD_SHAPE::CUSTOM );
pad->AddPrimitive( padShape ); pad->AddPrimitive( padShape );

View File

@ -1888,7 +1888,7 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
break; break;
case EPAD::SQUARE: case EPAD::SQUARE:
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
break; break;
case EPAD::OFFSET: case EPAD::OFFSET:
@ -2386,7 +2386,7 @@ void EAGLE_PLUGIN::packageSMD( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
pad->SetKeepTopBottom( false ); // TODO: correct? This seems to be KiCad default on import pad->SetKeepTopBottom( false ); // TODO: correct? This seems to be KiCad default on import
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetAttribute( PAD_ATTRIB::SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
VECTOR2I padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() ); VECTOR2I padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() );

View File

@ -614,7 +614,7 @@ size_t FABMASTER::processPadStacks( size_t aRow )
} }
else if( pad_shape == "RECTANGLE" ) else if( pad_shape == "RECTANGLE" )
{ {
pad->shape = PAD_SHAPE::RECT; pad->shape = PAD_SHAPE::RECTANGLE;
} }
else if( pad_shape == "ROUNDED_RECT" ) else if( pad_shape == "ROUNDED_RECT" )
{ {
@ -622,14 +622,14 @@ size_t FABMASTER::processPadStacks( size_t aRow )
} }
else if( pad_shape == "SQUARE" ) else if( pad_shape == "SQUARE" )
{ {
pad->shape = PAD_SHAPE::RECT; pad->shape = PAD_SHAPE::RECTANGLE;
pad->height = pad->width; pad->height = pad->width;
} }
else if( pad_shape == "OBLONG" || pad_shape == "OBLONG_X" || pad_shape == "OBLONG_Y" ) else if( pad_shape == "OBLONG" || pad_shape == "OBLONG_X" || pad_shape == "OBLONG_Y" )
pad->shape = PAD_SHAPE::OVAL; pad->shape = PAD_SHAPE::OVAL;
else if( pad_shape == "OCTAGON" ) else if( pad_shape == "OCTAGON" )
{ {
pad->shape = PAD_SHAPE::RECT; pad->shape = PAD_SHAPE::RECTANGLE;
pad->is_octogon = true; pad->is_octogon = true;
} }
else if( pad_shape == "SHAPE" ) else if( pad_shape == "SHAPE" )

View File

@ -546,7 +546,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader )
static const LSET pad_front( 3, F_Cu, F_Mask, F_Paste ); static const LSET pad_front( 3, F_Cu, F_Mask, F_Paste );
static const LSET pad_back( 3, B_Cu, B_Mask, B_Paste ); static const LSET pad_back( 3, B_Cu, B_Mask, B_Paste );
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
pad->SetAttribute( PAD_ATTRIB::SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( pad_front ); pad->SetLayerSet( pad_front );
@ -644,7 +644,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader )
pad->SetLayerSet( pad_set ); pad->SetLayerSet( pad_set );
if( testFlags( parameters[paramCnt-2], 0x0100, wxT( "square" ) ) ) if( testFlags( parameters[paramCnt-2], 0x0100, wxT( "square" ) ) )
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
// Set the pad name: // Set the pad name:
// Pcbnew pad name is used for electrical connection calculations. // Pcbnew pad name is used for electrical connection calculations.

View File

@ -4130,7 +4130,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
break; break;
case T_rect: case T_rect:
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
break; break;
case T_oval: case T_oval:
@ -4620,7 +4620,7 @@ bool PCB_PARSER::parsePAD_option( PAD* aPad )
break; break;
case T_rect: case T_rect:
aPad->SetAnchorPadShape( PAD_SHAPE::RECT ); aPad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
break; break;
default: default:

View File

@ -1382,7 +1382,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const
switch( aPad->GetShape() ) switch( aPad->GetShape() )
{ {
case PAD_SHAPE::CIRCLE: shape = "circle"; break; case PAD_SHAPE::CIRCLE: shape = "circle"; break;
case PAD_SHAPE::RECT: shape = "rect"; break; case PAD_SHAPE::RECTANGLE: shape = "rect"; break;
case PAD_SHAPE::OVAL: shape = "oval"; break; case PAD_SHAPE::OVAL: shape = "oval"; break;
case PAD_SHAPE::TRAPEZOID: shape = "trapezoid"; break; case PAD_SHAPE::TRAPEZOID: shape = "trapezoid"; break;
case PAD_SHAPE::CHAMFERED_RECT: case PAD_SHAPE::CHAMFERED_RECT:
@ -1629,7 +1629,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const
#endif #endif
// Output the anchor pad shape (circle/rect) // Output the anchor pad shape (circle/rect)
if( aPad->GetAnchorPadShape() == PAD_SHAPE::RECT ) if( aPad->GetAnchorPadShape() == PAD_SHAPE::RECTANGLE )
shape = "rect"; shape = "rect";
else else
shape = "circle"; shape = "circle";

View File

@ -1340,7 +1340,7 @@ void LEGACY_PLUGIN::loadPAD( FOOTPRINT* aFootprint )
switch( padchar ) switch( padchar )
{ {
case 'C': padshape = static_cast<int>( PAD_SHAPE::CIRCLE ); break; case 'C': padshape = static_cast<int>( PAD_SHAPE::CIRCLE ); break;
case 'R': padshape = static_cast<int>( PAD_SHAPE::RECT ); break; case 'R': padshape = static_cast<int>( PAD_SHAPE::RECTANGLE ); break;
case 'O': padshape = static_cast<int>( PAD_SHAPE::OVAL ); break; case 'O': padshape = static_cast<int>( PAD_SHAPE::OVAL ); break;
case 'T': padshape = static_cast<int>( PAD_SHAPE::TRAPEZOID ); break; case 'T': padshape = static_cast<int>( PAD_SHAPE::TRAPEZOID ); break;
default: default:

View File

@ -276,7 +276,7 @@ void PCAD_PAD::AddToFootprint( FOOTPRINT* aFootprint, const EDA_ANGLE& aRotation
} }
else if( padShapeName.IsSameAs( wxT( "Rect" ), false ) ) else if( padShapeName.IsSameAs( wxT( "Rect" ), false ) )
{ {
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECTANGLE );
} }
else if( padShapeName.IsSameAs( wxT( "RndRect" ), false ) ) else if( padShapeName.IsSameAs( wxT( "RndRect" ), false ) )
{ {
@ -284,7 +284,7 @@ void PCAD_PAD::AddToFootprint( FOOTPRINT* aFootprint, const EDA_ANGLE& aRotation
} }
else if( padShapeName.IsSameAs( wxT( "Polygon" ), false ) ) else if( padShapeName.IsSameAs( wxT( "Polygon" ), false ) )
{ {
pad->SetShape( PAD_SHAPE::RECT ); // approximation pad->SetShape( PAD_SHAPE::RECTANGLE ); // approximation
} }
pad->SetSize( VECTOR2I( width, height ) ); pad->SetSize( VECTOR2I( width, height ) );

View File

@ -8,6 +8,13 @@
#include <pad.h> #include <pad.h>
%} %}
/* Only for compatibility with old python scripts: */
const int PAD_SHAPE_RECT = (const int)PAD_SHAPE::RECTANGLE;
%{
const int PAD_SHAPE_RECT = (const int)PAD_SHAPE::RECTANGLE;
%}
%extend PAD %extend PAD
{ {
%pythoncode %pythoncode

View File

@ -327,7 +327,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, PAD* aPad )
break; break;
} }
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
{ {
double dx = scale( aPad->GetSize().x ) / 2.0; double dx = scale( aPad->GetSize().x ) / 2.0;
double dy = scale( aPad->GetSize().y ) / 2.0; double dy = scale( aPad->GetSize().y ) / 2.0;

View File

@ -824,7 +824,7 @@ std::vector<PCB_SHAPE*> PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun, BOARD
{ {
aCommit.Modify( aPad ); aCommit.Modify( aPad );
if( aPad->GetShape() == PAD_SHAPE::RECT || aPad->GetShape() == PAD_SHAPE::CIRCLE ) if( aPad->GetShape() == PAD_SHAPE::RECTANGLE || aPad->GetShape() == PAD_SHAPE::CIRCLE )
{ {
aPad->SetAnchorPadShape( aPad->GetShape() ); aPad->SetAnchorPadShape( aPad->GetShape() );
} }

View File

@ -473,7 +473,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos
break; break;
} }
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
case PAD_SHAPE::CHAMFERED_RECT: case PAD_SHAPE::CHAMFERED_RECT:

View File

@ -282,7 +282,7 @@ std::shared_ptr<EDIT_POINTS> PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem )
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
case PAD_SHAPE::CHAMFERED_RECT: case PAD_SHAPE::CHAMFERED_RECT:
{ {
@ -1298,7 +1298,7 @@ void PCB_POINT_EDITOR::updateItem() const
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
case PAD_SHAPE::CHAMFERED_RECT: case PAD_SHAPE::CHAMFERED_RECT:
{ {
@ -1812,7 +1812,7 @@ void PCB_POINT_EDITOR::updatePoints()
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::TRAPEZOID:
case PAD_SHAPE::RECT: case PAD_SHAPE::RECTANGLE:
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
case PAD_SHAPE::CHAMFERED_RECT: case PAD_SHAPE::CHAMFERED_RECT:
{ {