From e4dbfcd92d1c8da4d0bbfeecb973fff8c389354d Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 4 Jan 2022 20:42:27 -0500 Subject: [PATCH] Swap out some wxSize for VECTOR2I --- .../3d_rendering/opengl/create_scene.cpp | 4 +-- .../include/convert_basic_shapes_to_polygon.h | 2 +- .../src/convert_basic_shapes_to_polygon.cpp | 4 +-- pcbnew/dialogs/dialog_pad_properties.cpp | 6 ++-- pcbnew/exporters/export_d356.cpp | 2 +- pcbnew/exporters/export_gencad.cpp | 2 +- pcbnew/footprint.cpp | 4 +-- pcbnew/pad.cpp | 28 +++++++++---------- pcbnew/pad.h | 20 ++++++------- pcbnew/pcb_painter.cpp | 4 +-- pcbnew/pcbplot.h | 3 +- pcbnew/plot_board_layers.cpp | 10 +++---- pcbnew/plot_brditems_plotter.cpp | 4 +-- pcbnew/plugins/eagle/eagle_plugin.cpp | 4 +-- pcbnew/plugins/kicad/pcb_parser.cpp | 8 +++--- pcbnew/plugins/kicad/pcb_plugin.cpp | 14 +++++----- pcbnew/plugins/pcad/pcb_pad.cpp | 9 +++--- .../specctra_export.cpp | 2 +- 18 files changed, 64 insertions(+), 66 deletions(-) diff --git a/3d-viewer/3d_rendering/opengl/create_scene.cpp b/3d-viewer/3d_rendering/opengl/create_scene.cpp index 894e92fdbf..026b1f8cbc 100644 --- a/3d-viewer/3d_rendering/opengl/create_scene.cpp +++ b/3d-viewer/3d_rendering/opengl/create_scene.cpp @@ -792,8 +792,8 @@ void RENDER_3D_OPENGL::generateViasAndPads() { if( pad->GetAttribute() != PAD_ATTRIB::NPTH ) { - const wxSize drillsize = pad->GetDrillSize(); - const bool hasHole = drillsize.x && drillsize.y; + const VECTOR2I drillsize = pad->GetDrillSize(); + const bool hasHole = drillsize.x && drillsize.y; if( !hasHole ) continue; diff --git a/libs/kimath/include/convert_basic_shapes_to_polygon.h b/libs/kimath/include/convert_basic_shapes_to_polygon.h index bf69cfbda5..5235e5c792 100644 --- a/libs/kimath/include/convert_basic_shapes_to_polygon.h +++ b/libs/kimath/include/convert_basic_shapes_to_polygon.h @@ -128,7 +128,7 @@ void TransformOvalToPolygon( SHAPE_POLY_SET& aCornerBuffer, const VECTOR2I& aSta * @param aErrorLoc determines if the approximation error be placed outside or inside the polygon. */ void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aCornerBuffer, const VECTOR2I& aPosition, - const wxSize& aSize, double aRotation, int aDeltaX, int aDeltaY, + const VECTOR2I& aSize, double aRotation, int aDeltaX, int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc ); /** diff --git a/libs/kimath/src/convert_basic_shapes_to_polygon.cpp b/libs/kimath/src/convert_basic_shapes_to_polygon.cpp index 31ded4a01f..59ef316663 100644 --- a/libs/kimath/src/convert_basic_shapes_to_polygon.cpp +++ b/libs/kimath/src/convert_basic_shapes_to_polygon.cpp @@ -362,11 +362,11 @@ void CornerListRemoveDuplicates( std::vector& aCorners ) void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aCornerBuffer, const VECTOR2I& aPosition, - const wxSize& aSize, double aRotation, int aDeltaX, int aDeltaY, + const VECTOR2I& aSize, double aRotation, int aDeltaX, int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc ) { SHAPE_POLY_SET outline; - wxSize size( aSize / 2 ); + VECTOR2I size( aSize / 2 ); std::vector corners; if( aInflate < 0 ) diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 8a54b36fd8..45af6f6db9 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -1233,8 +1233,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() wxArrayString error_msgs; wxArrayString warning_msgs; wxString msg; - wxSize pad_size = m_dummyPad->GetSize(); - wxSize drill_size = m_dummyPad->GetDrillSize(); + VECTOR2I pad_size = m_dummyPad->GetSize(); + VECTOR2I drill_size = m_dummyPad->GetDrillSize(); if( m_dummyPad->GetShape() == PAD_SHAPE::CUSTOM ) { @@ -1579,7 +1579,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() if( !m_locked->GetValue() || m_isFpEditor ) m_currentPad->SetPosition( m_padMaster->GetPosition() ); - wxSize size; + VECTOR2I size; FOOTPRINT* footprint = m_currentPad->GetParent(); m_currentPad->SetSize( m_padMaster->GetSize() ); diff --git a/pcbnew/exporters/export_d356.cpp b/pcbnew/exporters/export_d356.cpp index 7ad4ec03b1..0b35d1ab2a 100644 --- a/pcbnew/exporters/export_d356.cpp +++ b/pcbnew/exporters/export_d356.cpp @@ -111,7 +111,7 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector & aRecor rk.pin = pad->GetNumber(); rk.refdes = footprint->GetReference(); rk.midpoint = false; // XXX MAYBE need to be computed (how?) - const wxSize& drill = pad->GetDrillSize(); + const VECTOR2I& drill = pad->GetDrillSize(); rk.drill = std::min( drill.x, drill.y ); rk.hole = (rk.drill != 0); rk.smd = pad->GetAttribute() == PAD_ATTRIB::SMD; diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 1d45f1a0be..aae93046bf 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -470,7 +470,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb ) case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::OVAL: { - const wxSize& size = pad->GetSize(); + const VECTOR2I& size = pad->GetSize(); int radius = std::min( size.x, size.y ) / 2; if( pad->GetShape() == PAD_SHAPE::ROUNDRECT ) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index c299ef765c..35943b7062 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -2341,7 +2341,7 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff if( aSkipNonPlatedPads && !isPlated ) continue; - wxSize clearance( aClearance, aClearance ); + VECTOR2I clearance( aClearance, aClearance ); switch( aLayer ) { @@ -2370,7 +2370,7 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff if( ( clearance.x < 0 || clearance.x != clearance.y ) && pad->GetShape() != PAD_SHAPE::CUSTOM ) { - wxSize dummySize = pad->GetSize() + clearance + clearance; + VECTOR2I dummySize = pad->GetSize() + clearance + clearance; if( dummySize.x <= 0 || dummySize.y <= 0 ) continue; diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 2d9d7b2283..bc26200f1f 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -374,7 +374,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const } else { - wxSize half_size = m_size / 2; + VECTOR2I half_size = m_size / 2; int half_width = std::min( half_size.x, half_size.y ); VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width ); RotatePoint( half_len, m_orient ); @@ -389,7 +389,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const { int r = ( effectiveShape == PAD_SHAPE::ROUNDRECT ) ? GetRoundRectCornerRadius() : 0; VECTOR2I half_size( m_size.x / 2, m_size.y / 2 ); - wxSize trap_delta( 0, 0 ); + VECTOR2I trap_delta( 0, 0 ); if( r ) { @@ -490,11 +490,10 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const } BOX2I bbox = m_effectiveShape->BBox(); - m_effectiveBoundingBox = EDA_RECT( bbox.GetPosition(), - wxSize( bbox.GetWidth(), bbox.GetHeight() ) ); + m_effectiveBoundingBox = EDA_RECT( bbox.GetPosition(), VECTOR2I( bbox.GetWidth(), bbox.GetHeight() ) ); // Hole shape - wxSize half_size = m_drill / 2; + VECTOR2I half_size = m_drill / 2; int half_width = std::min( half_size.x, half_size.y ); VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width ); @@ -503,8 +502,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const m_effectiveHoleShape = std::make_shared( m_pos - half_len, m_pos + half_len, half_width * 2 ); bbox = m_effectiveHoleShape->BBox(); - m_effectiveBoundingBox.Merge( EDA_RECT( bbox.GetPosition(), - wxSize( bbox.GetWidth(), bbox.GetHeight() ) ) ); + m_effectiveBoundingBox.Merge( EDA_RECT( bbox.GetPosition(), VECTOR2I( bbox.GetWidth(), bbox.GetHeight() ) ) ); // All done m_shapesDirty = false; @@ -597,7 +595,7 @@ void PAD::SetAttribute( PAD_ATTRIB aAttribute ) m_attribute = aAttribute; if( aAttribute == PAD_ATTRIB::SMD ) - m_drill = wxSize( 0, 0 ); + m_drill = VECTOR2I( 0, 0 ); SetDirty(); } @@ -770,7 +768,7 @@ int PAD::GetSolderMaskExpansion() const } -wxSize PAD::GetSolderPasteMargin() const +VECTOR2I PAD::GetSolderPasteMargin() const { // The pad inherits the margin only to calculate a default shape, // therefore only if it is also a copper layer. @@ -779,7 +777,7 @@ wxSize PAD::GetSolderPasteMargin() const bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any(); if( !isOnCopperLayer ) - return wxSize( 0, 0 ); + return VECTOR2I( 0, 0 ); int margin = m_localSolderPasteMargin; double mratio = m_localSolderPasteMarginRatio; @@ -805,7 +803,7 @@ wxSize PAD::GetSolderPasteMargin() const } } - wxSize pad_margin; + VECTOR2I pad_margin; pad_margin.x = margin + KiROUND( m_size.x * mratio ); pad_margin.y = margin + KiROUND( m_size.y * mratio ); @@ -1415,7 +1413,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad ) SetOrientation( pad_rot ); SetSize( aMasterPad.GetSize() ); - SetDelta( wxSize( 0, 0 ) ); + SetDelta( VECTOR2I( 0, 0 ) ); SetOffset( aMasterPad.GetOffset() ); SetDrillSize( aMasterPad.GetDrillSize() ); SetDrillShape( aMasterPad.GetDrillShape() ); @@ -1431,7 +1429,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad ) case PAD_SHAPE::CIRCLE: // ensure size.y == size.x - SetSize( wxSize( GetSize().x, GetSize().x ) ); + SetSize( VECTOR2I( GetSize().x, GetSize().x ) ); break; default: @@ -1444,7 +1442,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad ) 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 ) ); + SetDrillSize( VECTOR2I( 0, 0 ) ); break; default: @@ -1483,7 +1481,7 @@ void PAD::SwapData( BOARD_ITEM* aImage ) bool PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, int aError, ERROR_LOC aErrorLoc ) const { - wxSize drillsize = GetDrillSize(); + VECTOR2I drillsize = GetDrillSize(); if( !drillsize.x || !drillsize.y ) return false; diff --git a/pcbnew/pad.h b/pcbnew/pad.h index d160ce9430..4f02f719ac 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -229,18 +229,18 @@ public: void SetY0( int y ) { m_pos0.y = y; } void SetX0( int x ) { m_pos0.x = x; } - void SetSize( const wxSize& aSize ) { m_size = aSize; SetDirty(); } - const wxSize& GetSize() const { return m_size; } + void SetSize( const VECTOR2I& aSize ) { m_size = aSize; SetDirty(); } + const VECTOR2I& GetSize() const { return m_size; } void SetSizeX( const int aX ) { m_size.x = aX; SetDirty(); } const int GetSizeX() const { return m_size.x; } void SetSizeY( const int aY ) { m_size.y = aY; SetDirty(); } const int GetSizeY() const { return m_size.y; } - void SetDelta( const wxSize& aSize ) { m_deltaSize = aSize; SetDirty(); } - const wxSize& GetDelta() const { return m_deltaSize; } + void SetDelta( const VECTOR2I& aSize ) { m_deltaSize = aSize; SetDirty(); } + const VECTOR2I& GetDelta() const { return m_deltaSize; } - void SetDrillSize( const wxSize& aSize ) { m_drill = aSize; SetDirty(); } - const wxSize& GetDrillSize() const { return m_drill; } + void SetDrillSize( const VECTOR2I& aSize ) { m_drill = aSize; SetDirty(); } + const VECTOR2I& GetDrillSize() const { return m_drill; } void SetDrillSizeX( const int aX ) { m_drill.x = aX; SetDirty(); } const int GetDrillSizeX() const { return m_drill.x; } void SetDrillSizeY( const int aY ) { m_drill.y = aY; SetDirty(); } @@ -470,7 +470,7 @@ public: * * @return the margin for the solder mask layer. */ - wxSize GetSolderPasteMargin() const; + VECTOR2I GetSolderPasteMargin() const; void SetZoneConnection( ZONE_CONNECTION aType ) { m_zoneConnection = aType; } ZONE_CONNECTION GetZoneConnection() const { return m_zoneConnection; } @@ -707,8 +707,8 @@ private: int m_subRatsnest; // Variable used to handle subnet (block) number in // ratsnest computations - wxSize m_drill; // Drill diameter (x == y) or slot dimensions (x != y) - wxSize m_size; // X and Y size (relative to orient 0) + VECTOR2I m_drill; // Drill diameter (x == y) or slot dimensions (x != y) + VECTOR2I m_size; // X and Y size (relative to orient 0) PAD_DRILL_SHAPE_T m_drillShape; // PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG @@ -733,7 +733,7 @@ private: LSET m_layerMask; // Bitwise layer: 1 = copper layer, 15 = cmp, // 2..14 = internal layers, 16..31 = technical layers - wxSize m_deltaSize; // Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes + VECTOR2I m_deltaSize; // Delta for PAD_SHAPE::TRAPEZOID; half the delta squeezes // one end and half expands the other. It is only valid // to have a single axis be non-0. diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index d59425bdf7..1eb5748304 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1045,8 +1045,8 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) } else { - wxSize pad_size = aPad->GetSize(); - wxSize margin; + VECTOR2I pad_size = aPad->GetSize(); + VECTOR2I margin; switch( aLayer ) { diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index bb3dfb356a..bd2ba2bb6e 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -133,7 +133,8 @@ private: * It compensate and clamp the drill mark size depending on the current plot options. */ void plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const VECTOR2I& aDrillPos, - const wxSize& aDrillSize, const wxSize& aPadSize, double aOrientation, + const VECTOR2I& aDrillSize, const VECTOR2I& aPadSize, + double aOrientation, int aSmallDrill ); PLOTTER* m_plotter; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 0a9492a6e0..8fc698a332 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -281,7 +281,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, else if( sketchPads && aLayerMask[B_Fab] ) color = aPlotOpt.ColorSettings()->GetColor( B_Fab ); - wxSize margin; + VECTOR2I margin; int width_adj = 0; if( onCopperLayer ) @@ -300,12 +300,12 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, int mask_clearance = margin.x; // Now offset the pad size by margin + width_adj - wxSize padPlotsSize = pad->GetSize() + margin * 2 + wxSize( width_adj, width_adj ); + VECTOR2I padPlotsSize = pad->GetSize() + margin * 2 + VECTOR2I( width_adj, width_adj ); // Store these parameters that can be modified to plot inflated/deflated pads shape PAD_SHAPE padShape = pad->GetShape(); - wxSize padSize = pad->GetSize(); - wxSize padDelta = pad->GetDelta(); // has meaning only for trapezoidal pads + VECTOR2I padSize = pad->GetSize(); + VECTOR2I padDelta = pad->GetDelta(); // has meaning only for trapezoidal pads double padCornerRadius = pad->GetRoundRectCornerRadius(); // Don't draw a 0 sized pad. @@ -744,7 +744,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, { for( PAD* pad : footprint->Pads() ) { - wxSize hole = pad->GetDrillSize(); + VECTOR2I hole = pad->GetDrillSize(); if( hole.x == 0 || hole.y == 0 ) continue; diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 0959cee266..02680e43d8 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -1059,10 +1059,10 @@ void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape ) void BRDITEMS_PLOTTER::plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const VECTOR2I& aDrillPos, - const wxSize& aDrillSize, const wxSize& aPadSize, + const VECTOR2I& aDrillSize, const VECTOR2I& aPadSize, double aOrientation, int aSmallDrill ) { - wxSize drillSize = aDrillSize; + VECTOR2I drillSize = aDrillSize; // Small drill marks have no significance when applied to slots if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE ) diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index 3b49a9f86b..ef66012b60 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -1895,7 +1895,7 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree ) { // The Eagle "long" pad is wider than it is tall, // m_elongation is percent elongation - wxSize sz = pad->GetSize(); + VECTOR2I sz = pad->GetSize(); sz.x = ( sz.x * ( 100 + m_rules->psElongationLong ) ) / 100; pad->SetSize( sz ); @@ -2414,7 +2414,7 @@ void EAGLE_PLUGIN::transferPad( const EPAD_COMMON& aEaglePad, PAD* aPad ) const aPad->SetPos0( padPos ); // Solder mask - const wxSize& padSize( aPad->GetSize() ); + const VECTOR2I& padSize( aPad->GetSize() ); aPad->SetLocalSolderMaskMargin( eagleClamp( m_rules->mlMinStopFrame, diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 61e2964077..3f52a1b423 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -4219,7 +4219,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent ) case T_drill: { bool haveWidth = false; - wxSize drillSize = pad->GetDrillSize(); + VECTOR2I drillSize = pad->GetDrillSize(); for( token = NextTok(); token != T_RIGHT; token = NextTok() ) { @@ -4234,15 +4234,15 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent ) { if( !haveWidth ) { - drillSize.SetWidth( parseBoardUnits() ); + drillSize.x = parseBoardUnits(); // If height is not defined the width and height are the same. - drillSize.SetHeight( drillSize.GetWidth() ); + drillSize.y = drillSize.x; haveWidth = true; } else { - drillSize.SetHeight( parseBoardUnits() ); + drillSize.y = parseBoardUnits(); } } diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index 5d2db33c89..8da67908bf 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -1454,13 +1454,13 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const m_out->Print( 0, " (size %s)", FormatInternalUnits( aPad->GetSize() ).c_str() ); - if( (aPad->GetDelta().GetWidth()) != 0 || (aPad->GetDelta().GetHeight() != 0 ) ) + if( (aPad->GetDelta().x) != 0 || (aPad->GetDelta().y != 0 ) ) m_out->Print( 0, " (rect_delta %s)", FormatInternalUnits( aPad->GetDelta() ).c_str() ); - wxSize sz = aPad->GetDrillSize(); + VECTOR2I sz = aPad->GetDrillSize(); VECTOR2I shapeoffset = aPad->GetOffset(); - if( (sz.GetWidth() > 0) || (sz.GetHeight() > 0) || + if( (sz.x > 0) || (sz.y > 0) || (shapeoffset.x != 0) || (shapeoffset.y != 0) ) { m_out->Print( 0, " (drill" ); @@ -1468,11 +1468,11 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const if( aPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) m_out->Print( 0, " oval" ); - if( sz.GetWidth() > 0 ) - m_out->Print( 0, " %s", FormatInternalUnits( sz.GetWidth() ).c_str() ); + if( sz.x > 0 ) + m_out->Print( 0, " %s", FormatInternalUnits( sz.x ).c_str() ); - if( sz.GetHeight() > 0 && sz.GetWidth() != sz.GetHeight() ) - m_out->Print( 0, " %s", FormatInternalUnits( sz.GetHeight() ).c_str() ); + if( sz.y > 0 && sz.x != sz.y ) + m_out->Print( 0, " %s", FormatInternalUnits( sz.y ).c_str() ); if( (shapeoffset.x != 0) || (shapeoffset.y != 0) ) m_out->Print( 0, " (offset %s)", FormatInternalUnits( aPad->GetOffset() ).c_str() ); diff --git a/pcbnew/plugins/pcad/pcb_pad.cpp b/pcbnew/plugins/pcad/pcb_pad.cpp index 5ae9ab3915..5dfc371bff 100644 --- a/pcbnew/plugins/pcad/pcb_pad.cpp +++ b/pcbnew/plugins/pcad/pcb_pad.cpp @@ -33,7 +33,6 @@ #include #include -#include #include namespace PCAD2KICAD { @@ -287,13 +286,13 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps pad->SetShape( PAD_SHAPE::RECT ); // approximation } - pad->SetSize( wxSize( width, height ) ); - pad->SetDelta( wxSize( 0, 0 ) ); + pad->SetSize( VECTOR2I( width, height ) ); + pad->SetDelta( VECTOR2I( 0, 0 ) ); pad->SetOrientation( m_rotation + aRotation ); pad->SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); - pad->SetOffset( wxPoint( 0, 0 ) ); - pad->SetDrillSize( wxSize( m_Hole, m_Hole ) ); + pad->SetOffset( VECTOR2I( 0, 0 ) ); + pad->SetDrillSize( VECTOR2I( m_Hole, m_Hole ) ); pad->SetAttribute( padType ); diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index bb54730a1d..c821319bde 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -493,7 +493,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, PAD* aPad ) */ double correctionFactor = cos( M_PI / (double) circleToSegmentsCount ); int extra_clearance = KiROUND( rradius * ( 1.0 - correctionFactor ) ); - wxSize psize = aPad->GetSize(); + VECTOR2I psize = aPad->GetSize(); psize.x += extra_clearance * 2; psize.y += extra_clearance * 2; rradius += extra_clearance;