diff --git a/include/pad_shapes.h b/include/pad_shapes.h index 557482344b..84015da532 100644 --- a/include/pad_shapes.h +++ b/include/pad_shapes.h @@ -34,7 +34,7 @@ enum class PAD_SHAPE : int { CIRCLE, - RECT, + RECTANGLE, // do not use just RECT: it collides in a header on MSYS2 OVAL, TRAPEZOID, ROUNDRECT, @@ -50,7 +50,7 @@ static inline std::string PAD_SHAPE_T_asString( PAD_SHAPE a ) switch( a ) { 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::TRAPEZOID: return "PAD_SHAPE::TRAPEZOID"; case PAD_SHAPE::ROUNDRECT: return "PAD_SHAPE::ROUNDRECT"; diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 79a9934a29..caba40655e 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -57,7 +57,7 @@ static PAD_SHAPE code_shape[] = { PAD_SHAPE::CIRCLE, PAD_SHAPE::OVAL, - PAD_SHAPE::RECT, + PAD_SHAPE::RECTANGLE, PAD_SHAPE::TRAPEZOID, PAD_SHAPE::ROUNDRECT, PAD_SHAPE::CHAMFERED_RECT, @@ -602,7 +602,7 @@ void DIALOG_PAD_PROPERTIES::initValues() default: 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::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::ROUNDRECT: m_PadShapeSelector->SetSelection( CHOICE_SHAPE_ROUNDRECT ); break; @@ -614,7 +614,7 @@ void DIALOG_PAD_PROPERTIES::initValues() break; 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 ); else m_PadShapeSelector->SetSelection( CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR ); @@ -1670,7 +1670,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() if( m_currentPad->GetShape() == PAD_SHAPE::ROUNDRECT && m_currentPad->GetRoundRectRadiusRatio() == 0.0 ) { - m_currentPad->SetShape( PAD_SHAPE::RECT ); + m_currentPad->SetShape( PAD_SHAPE::RECTANGLE ); } // Set the fabrication property: @@ -1774,7 +1774,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) aPad->SetShape( code_shape[m_PadShapeSelector->GetSelection()] ); if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR ) - aPad->SetAnchorPadShape( PAD_SHAPE::RECT ); + aPad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE ); else aPad->SetAnchorPadShape( PAD_SHAPE::CIRCLE ); diff --git a/pcbnew/drc/drc_test_provider_annular_width.cpp b/pcbnew/drc/drc_test_provider_annular_width.cpp index 96bca4befa..a1207b99b7 100644 --- a/pcbnew/drc/drc_test_provider_annular_width.cpp +++ b/pcbnew/drc/drc_test_provider_annular_width.cpp @@ -117,7 +117,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() case PAD_SHAPE::CIRCLE: case PAD_SHAPE::OVAL: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::ROUNDRECT: return 1; @@ -171,7 +171,7 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run() case PAD_SHAPE::CIRCLE: case PAD_SHAPE::OVAL: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::ROUNDRECT: annularWidth = std::min( pad->GetSizeX() - pad->GetDrillSizeX(), pad->GetSizeY() - pad->GetDrillSizeY() ) / 2; diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 543ca70455..cf2d776e95 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -455,7 +455,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb ) pad->GetSize().x / (SCALE_FACTOR * 2) ); break; - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: fprintf( aFile, " RECTANGULAR %g\n", pad->GetDrillSize().x / SCALE_FACTOR ); diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index feab85642e..1c1a233f3e 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -161,7 +161,7 @@ private: shapeId = 2; break; - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: shapeId = 1; break; diff --git a/pcbnew/microwave/microwave_footprint.cpp b/pcbnew/microwave/microwave_footprint.cpp index 0e5dd6d874..fcf5179ba5 100644 --- a/pcbnew/microwave/microwave_footprint.cpp +++ b/pcbnew/microwave/microwave_footprint.cpp @@ -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: { pad->SetShape( PAD_SHAPE::CUSTOM ); - pad->SetAnchorPadShape( PAD_SHAPE::RECT ); + pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE ); int numPoints = ( angle.AsDegrees() / 5.0 ) + 3; std::vector polyPoints; @@ -218,7 +218,7 @@ FOOTPRINT* MICROWAVE_TOOL::createBaseFootprint( const wxString& aValue, pad->SetSize( VECTOR2I( tw, tw ) ); pad->SetPosition( footprint->GetPosition() ); - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); pad->SetAttribute( PAD_ATTRIB::SMD ); pad->SetLayerSet( F_Cu ); diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 4370bee2f0..82678e3304 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -469,7 +469,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const break; - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::ROUNDRECT: { @@ -1224,7 +1224,7 @@ wxString PAD::ShowPadShape() const { case PAD_SHAPE::CIRCLE: return _( "Circle" ); 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::ROUNDRECT: return _( "Roundrect" ); case PAD_SHAPE::CHAMFERED_RECT: return _( "Chamferedrect" ); @@ -1631,7 +1631,7 @@ void PAD::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, break; case PAD_SHAPE::TRAPEZOID: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: { int ddx = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.x / 2 : 0; int ddy = GetShape() == PAD_SHAPE::TRAPEZOID ? m_deltaSize.y / 2 : 0; @@ -1707,7 +1707,7 @@ static struct PAD_DESC ENUM_MAP::Instance() .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::TRAPEZOID, _HKI( "Trapezoid" ) ) .Map( PAD_SHAPE::ROUNDRECT, _HKI( "Rounded rectangle" ) ) diff --git a/pcbnew/pad.h b/pcbnew/pad.h index dd56527ee6..8e10c2cbeb 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -227,12 +227,12 @@ public: /** * 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. */ 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(); } @@ -758,9 +758,10 @@ private: 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::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 * to m_Pos (NOT shapePos) at orient 0. @@ -794,7 +795,7 @@ private: 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::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 diff --git a/pcbnew/pad_custom_shape_functions.cpp b/pcbnew/pad_custom_shape_functions.cpp index c4b4bd37bd..b7ea9414cc 100644 --- a/pcbnew/pad_custom_shape_functions.cpp +++ b/pcbnew/pad_custom_shape_functions.cpp @@ -234,7 +234,7 @@ void PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, ERROR_LOC aE // The anchor pad is always at 0,0 switch( GetAnchorPadShape() ) { - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: { SHAPE_RECT rect( -GetSize().x / 2, -GetSize().y / 2, GetSize().x, GetSize().y ); aMergedPolygon->AddOutline( rect.Outline() ); diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 41c63f8162..e81238cabf 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -395,7 +395,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, itemplotter.PlotPad( pad, color, padPlotMode ); break; - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: pad->SetSize( padPlotsSize ); if( mask_clearance > 0 ) diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 69553b004d..dfe2302c3a 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -228,7 +228,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_ &gbr_metadata ); break; - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode, &gbr_metadata ); break; diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index cdc6c74146..3e44bcbd47 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -2468,7 +2468,7 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con switch( aElem.topshape ) { case ALTIUM_PAD_SHAPE::RECT: - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); break; case ALTIUM_PAD_SHAPE::CIRCLE: diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index 88a550bd33..15677b829e 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -1136,7 +1136,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, // Cadstar diamond shape is a square rotated 45 degrees // We convert it in KiCad to a square with chamfered edges 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->SetSize( { sizeOfSquare, sizeOfSquare } ); @@ -1165,7 +1165,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, break; case PAD_SHAPE_TYPE::RECTANGLE: - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); pad->SetSize( { getKiCadLength( (long long) csPadcode.Shape.Size + (long long) csPadcode.Shape.LeftLength + (long long) csPadcode.Shape.RightLength ), @@ -1189,7 +1189,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, case PAD_SHAPE_TYPE::SQUARE: - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); pad->SetSize( { getKiCadLength( csPadcode.Shape.Size ), getKiCadLength( csPadcode.Shape.Size ) } ); break; @@ -1259,7 +1259,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, if( editedPadOutline.Contains( { 0, 0 } ) ) { - pad->SetAnchorPadShape( PAD_SHAPE::RECT ); + pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE ); pad->SetSize( VECTOR2I( { 4, 4 } ) ); pad->SetShape( PAD_SHAPE::CUSTOM ); pad->AddPrimitive( padShape ); diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index d1af162d18..9767bffab0 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -1888,7 +1888,7 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree ) break; case EPAD::SQUARE: - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); break; 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->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); pad->SetAttribute( PAD_ATTRIB::SMD ); VECTOR2I padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() ); diff --git a/pcbnew/plugins/fabmaster/import_fabmaster.cpp b/pcbnew/plugins/fabmaster/import_fabmaster.cpp index 24aad46c7f..d879eedd28 100644 --- a/pcbnew/plugins/fabmaster/import_fabmaster.cpp +++ b/pcbnew/plugins/fabmaster/import_fabmaster.cpp @@ -614,7 +614,7 @@ size_t FABMASTER::processPadStacks( size_t aRow ) } else if( pad_shape == "RECTANGLE" ) { - pad->shape = PAD_SHAPE::RECT; + pad->shape = PAD_SHAPE::RECTANGLE; } else if( pad_shape == "ROUNDED_RECT" ) { @@ -622,14 +622,14 @@ size_t FABMASTER::processPadStacks( size_t aRow ) } else if( pad_shape == "SQUARE" ) { - pad->shape = PAD_SHAPE::RECT; + pad->shape = PAD_SHAPE::RECTANGLE; pad->height = pad->width; } else if( pad_shape == "OBLONG" || pad_shape == "OBLONG_X" || pad_shape == "OBLONG_Y" ) pad->shape = PAD_SHAPE::OVAL; else if( pad_shape == "OCTAGON" ) { - pad->shape = PAD_SHAPE::RECT; + pad->shape = PAD_SHAPE::RECTANGLE; pad->is_octogon = true; } else if( pad_shape == "SHAPE" ) diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index 1525db103b..95e7a890f7 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -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_back( 3, B_Cu, B_Mask, B_Paste ); - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); pad->SetAttribute( PAD_ATTRIB::SMD ); pad->SetLayerSet( pad_front ); @@ -644,7 +644,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader ) pad->SetLayerSet( pad_set ); if( testFlags( parameters[paramCnt-2], 0x0100, wxT( "square" ) ) ) - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); // Set the pad name: // Pcbnew pad name is used for electrical connection calculations. diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 0f59fd938b..8445bb0ad3 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -4130,7 +4130,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent ) break; case T_rect: - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); break; case T_oval: @@ -4620,7 +4620,7 @@ bool PCB_PARSER::parsePAD_option( PAD* aPad ) break; case T_rect: - aPad->SetAnchorPadShape( PAD_SHAPE::RECT ); + aPad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE ); break; default: diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index e1d6aa5210..65df243491 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -1382,7 +1382,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const switch( aPad->GetShape() ) { 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::TRAPEZOID: shape = "trapezoid"; break; case PAD_SHAPE::CHAMFERED_RECT: @@ -1629,7 +1629,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const #endif // Output the anchor pad shape (circle/rect) - if( aPad->GetAnchorPadShape() == PAD_SHAPE::RECT ) + if( aPad->GetAnchorPadShape() == PAD_SHAPE::RECTANGLE ) shape = "rect"; else shape = "circle"; diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index e200fc04a1..1a80d2249f 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1340,7 +1340,7 @@ void LEGACY_PLUGIN::loadPAD( FOOTPRINT* aFootprint ) switch( padchar ) { case 'C': padshape = static_cast( PAD_SHAPE::CIRCLE ); break; - case 'R': padshape = static_cast( PAD_SHAPE::RECT ); break; + case 'R': padshape = static_cast( PAD_SHAPE::RECTANGLE ); break; case 'O': padshape = static_cast( PAD_SHAPE::OVAL ); break; case 'T': padshape = static_cast( PAD_SHAPE::TRAPEZOID ); break; default: diff --git a/pcbnew/plugins/pcad/pcad_pad.cpp b/pcbnew/plugins/pcad/pcad_pad.cpp index 92eb1d519e..b752aa2e9a 100644 --- a/pcbnew/plugins/pcad/pcad_pad.cpp +++ b/pcbnew/plugins/pcad/pcad_pad.cpp @@ -276,7 +276,7 @@ void PCAD_PAD::AddToFootprint( FOOTPRINT* aFootprint, const EDA_ANGLE& aRotation } else if( padShapeName.IsSameAs( wxT( "Rect" ), false ) ) { - pad->SetShape( PAD_SHAPE::RECT ); + pad->SetShape( PAD_SHAPE::RECTANGLE ); } 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 ) ) { - pad->SetShape( PAD_SHAPE::RECT ); // approximation + pad->SetShape( PAD_SHAPE::RECTANGLE ); // approximation } pad->SetSize( VECTOR2I( width, height ) ); diff --git a/pcbnew/python/swig/pad.i b/pcbnew/python/swig/pad.i index f38b7fe463..f71a8b9314 100644 --- a/pcbnew/python/swig/pad.i +++ b/pcbnew/python/swig/pad.i @@ -8,6 +8,13 @@ #include %} +/* 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 { %pythoncode diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index ede48eebb7..34baa56ca7 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -327,7 +327,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, PAD* aPad ) break; } - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: { double dx = scale( aPad->GetSize().x ) / 2.0; double dy = scale( aPad->GetSize().y ) / 2.0; diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index a5f2226c49..0f1b564f34 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -824,7 +824,7 @@ std::vector PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun, BOARD { 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() ); } diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index d69717f44c..5399eef884 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -473,7 +473,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos break; } - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::TRAPEZOID: case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::CHAMFERED_RECT: diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index f4fa285bd8..53639adecc 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -282,7 +282,7 @@ std::shared_ptr PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem ) case PAD_SHAPE::OVAL: case PAD_SHAPE::TRAPEZOID: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::CHAMFERED_RECT: { @@ -1298,7 +1298,7 @@ void PCB_POINT_EDITOR::updateItem() const case PAD_SHAPE::OVAL: case PAD_SHAPE::TRAPEZOID: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::CHAMFERED_RECT: { @@ -1812,7 +1812,7 @@ void PCB_POINT_EDITOR::updatePoints() case PAD_SHAPE::OVAL: case PAD_SHAPE::TRAPEZOID: - case PAD_SHAPE::RECT: + case PAD_SHAPE::RECTANGLE: case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::CHAMFERED_RECT: {