Swap out some wxSize for VECTOR2I

This commit is contained in:
Marek Roszko 2022-01-04 20:42:27 -05:00
parent 98ee6c5f85
commit e4dbfcd92d
18 changed files with 64 additions and 66 deletions

View File

@ -792,8 +792,8 @@ void RENDER_3D_OPENGL::generateViasAndPads()
{ {
if( pad->GetAttribute() != PAD_ATTRIB::NPTH ) if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
{ {
const wxSize drillsize = pad->GetDrillSize(); const VECTOR2I drillsize = pad->GetDrillSize();
const bool hasHole = drillsize.x && drillsize.y; const bool hasHole = drillsize.x && drillsize.y;
if( !hasHole ) if( !hasHole )
continue; continue;

View File

@ -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. * @param aErrorLoc determines if the approximation error be placed outside or inside the polygon.
*/ */
void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aCornerBuffer, const VECTOR2I& aPosition, 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 ); int aInflate, int aError, ERROR_LOC aErrorLoc );
/** /**

View File

@ -362,11 +362,11 @@ void CornerListRemoveDuplicates( std::vector<ROUNDED_CORNER>& aCorners )
void TransformTrapezoidToPolygon( SHAPE_POLY_SET& aCornerBuffer, const VECTOR2I& aPosition, 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 ) int aInflate, int aError, ERROR_LOC aErrorLoc )
{ {
SHAPE_POLY_SET outline; SHAPE_POLY_SET outline;
wxSize size( aSize / 2 ); VECTOR2I size( aSize / 2 );
std::vector<ROUNDED_CORNER> corners; std::vector<ROUNDED_CORNER> corners;
if( aInflate < 0 ) if( aInflate < 0 )

View File

@ -1233,8 +1233,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
wxArrayString error_msgs; wxArrayString error_msgs;
wxArrayString warning_msgs; wxArrayString warning_msgs;
wxString msg; wxString msg;
wxSize pad_size = m_dummyPad->GetSize(); VECTOR2I pad_size = m_dummyPad->GetSize();
wxSize drill_size = m_dummyPad->GetDrillSize(); VECTOR2I drill_size = m_dummyPad->GetDrillSize();
if( m_dummyPad->GetShape() == PAD_SHAPE::CUSTOM ) if( m_dummyPad->GetShape() == PAD_SHAPE::CUSTOM )
{ {
@ -1579,7 +1579,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
if( !m_locked->GetValue() || m_isFpEditor ) if( !m_locked->GetValue() || m_isFpEditor )
m_currentPad->SetPosition( m_padMaster->GetPosition() ); m_currentPad->SetPosition( m_padMaster->GetPosition() );
wxSize size; VECTOR2I size;
FOOTPRINT* footprint = m_currentPad->GetParent(); FOOTPRINT* footprint = m_currentPad->GetParent();
m_currentPad->SetSize( m_padMaster->GetSize() ); m_currentPad->SetSize( m_padMaster->GetSize() );

View File

@ -111,7 +111,7 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector <D356_RECORD>& aRecor
rk.pin = pad->GetNumber(); rk.pin = pad->GetNumber();
rk.refdes = footprint->GetReference(); rk.refdes = footprint->GetReference();
rk.midpoint = false; // XXX MAYBE need to be computed (how?) 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.drill = std::min( drill.x, drill.y );
rk.hole = (rk.drill != 0); rk.hole = (rk.drill != 0);
rk.smd = pad->GetAttribute() == PAD_ATTRIB::SMD; rk.smd = pad->GetAttribute() == PAD_ATTRIB::SMD;

View File

@ -470,7 +470,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
case PAD_SHAPE::ROUNDRECT: case PAD_SHAPE::ROUNDRECT:
case PAD_SHAPE::OVAL: case PAD_SHAPE::OVAL:
{ {
const wxSize& size = pad->GetSize(); const VECTOR2I& size = pad->GetSize();
int radius = std::min( size.x, size.y ) / 2; int radius = std::min( size.x, size.y ) / 2;
if( pad->GetShape() == PAD_SHAPE::ROUNDRECT ) if( pad->GetShape() == PAD_SHAPE::ROUNDRECT )

View File

@ -2341,7 +2341,7 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff
if( aSkipNonPlatedPads && !isPlated ) if( aSkipNonPlatedPads && !isPlated )
continue; continue;
wxSize clearance( aClearance, aClearance ); VECTOR2I clearance( aClearance, aClearance );
switch( aLayer ) switch( aLayer )
{ {
@ -2370,7 +2370,7 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff
if( ( clearance.x < 0 || clearance.x != clearance.y ) if( ( clearance.x < 0 || clearance.x != clearance.y )
&& pad->GetShape() != PAD_SHAPE::CUSTOM ) && pad->GetShape() != PAD_SHAPE::CUSTOM )
{ {
wxSize dummySize = pad->GetSize() + clearance + clearance; VECTOR2I dummySize = pad->GetSize() + clearance + clearance;
if( dummySize.x <= 0 || dummySize.y <= 0 ) if( dummySize.x <= 0 || dummySize.y <= 0 )
continue; continue;

View File

@ -374,7 +374,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
} }
else else
{ {
wxSize half_size = m_size / 2; VECTOR2I half_size = m_size / 2;
int half_width = std::min( half_size.x, half_size.y ); int half_width = std::min( half_size.x, half_size.y );
VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width ); VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width );
RotatePoint( half_len, m_orient ); 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; int r = ( effectiveShape == PAD_SHAPE::ROUNDRECT ) ? GetRoundRectCornerRadius() : 0;
VECTOR2I half_size( m_size.x / 2, m_size.y / 2 ); VECTOR2I half_size( m_size.x / 2, m_size.y / 2 );
wxSize trap_delta( 0, 0 ); VECTOR2I trap_delta( 0, 0 );
if( r ) if( r )
{ {
@ -490,11 +490,10 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
} }
BOX2I bbox = m_effectiveShape->BBox(); BOX2I bbox = m_effectiveShape->BBox();
m_effectiveBoundingBox = EDA_RECT( bbox.GetPosition(), m_effectiveBoundingBox = EDA_RECT( bbox.GetPosition(), VECTOR2I( bbox.GetWidth(), bbox.GetHeight() ) );
wxSize( bbox.GetWidth(), bbox.GetHeight() ) );
// Hole shape // 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 ); int half_width = std::min( half_size.x, half_size.y );
VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width ); 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<SHAPE_SEGMENT>( m_pos - half_len, m_pos + half_len, m_effectiveHoleShape = std::make_shared<SHAPE_SEGMENT>( m_pos - half_len, m_pos + half_len,
half_width * 2 ); half_width * 2 );
bbox = m_effectiveHoleShape->BBox(); bbox = m_effectiveHoleShape->BBox();
m_effectiveBoundingBox.Merge( EDA_RECT( bbox.GetPosition(), m_effectiveBoundingBox.Merge( EDA_RECT( bbox.GetPosition(), VECTOR2I( bbox.GetWidth(), bbox.GetHeight() ) ) );
wxSize( bbox.GetWidth(), bbox.GetHeight() ) ) );
// All done // All done
m_shapesDirty = false; m_shapesDirty = false;
@ -597,7 +595,7 @@ void PAD::SetAttribute( PAD_ATTRIB aAttribute )
m_attribute = aAttribute; m_attribute = aAttribute;
if( aAttribute == PAD_ATTRIB::SMD ) if( aAttribute == PAD_ATTRIB::SMD )
m_drill = wxSize( 0, 0 ); m_drill = VECTOR2I( 0, 0 );
SetDirty(); 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, // The pad inherits the margin only to calculate a default shape,
// therefore only if it is also a copper layer. // therefore only if it is also a copper layer.
@ -779,7 +777,7 @@ wxSize PAD::GetSolderPasteMargin() const
bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any(); bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
if( !isOnCopperLayer ) if( !isOnCopperLayer )
return wxSize( 0, 0 ); return VECTOR2I( 0, 0 );
int margin = m_localSolderPasteMargin; int margin = m_localSolderPasteMargin;
double mratio = m_localSolderPasteMarginRatio; 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.x = margin + KiROUND( m_size.x * mratio );
pad_margin.y = margin + KiROUND( m_size.y * mratio ); pad_margin.y = margin + KiROUND( m_size.y * mratio );
@ -1415,7 +1413,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad )
SetOrientation( pad_rot ); SetOrientation( pad_rot );
SetSize( aMasterPad.GetSize() ); SetSize( aMasterPad.GetSize() );
SetDelta( wxSize( 0, 0 ) ); SetDelta( VECTOR2I( 0, 0 ) );
SetOffset( aMasterPad.GetOffset() ); SetOffset( aMasterPad.GetOffset() );
SetDrillSize( aMasterPad.GetDrillSize() ); SetDrillSize( aMasterPad.GetDrillSize() );
SetDrillShape( aMasterPad.GetDrillShape() ); SetDrillShape( aMasterPad.GetDrillShape() );
@ -1431,7 +1429,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad )
case PAD_SHAPE::CIRCLE: case PAD_SHAPE::CIRCLE:
// ensure size.y == size.x // ensure size.y == size.x
SetSize( wxSize( GetSize().x, GetSize().x ) ); SetSize( VECTOR2I( GetSize().x, GetSize().x ) );
break; break;
default: default:
@ -1444,7 +1442,7 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad )
case PAD_ATTRIB::CONN: case PAD_ATTRIB::CONN:
// These pads do not have hole (they are expected to be only on one // These pads do not have hole (they are expected to be only on one
// external copper layer) // external copper layer)
SetDrillSize( wxSize( 0, 0 ) ); SetDrillSize( VECTOR2I( 0, 0 ) );
break; break;
default: default:
@ -1483,7 +1481,7 @@ void PAD::SwapData( BOARD_ITEM* aImage )
bool PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, bool PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aInflateValue,
int aError, ERROR_LOC aErrorLoc ) const int aError, ERROR_LOC aErrorLoc ) const
{ {
wxSize drillsize = GetDrillSize(); VECTOR2I drillsize = GetDrillSize();
if( !drillsize.x || !drillsize.y ) if( !drillsize.x || !drillsize.y )
return false; return false;

View File

@ -229,18 +229,18 @@ public:
void SetY0( int y ) { m_pos0.y = y; } void SetY0( int y ) { m_pos0.y = y; }
void SetX0( int x ) { m_pos0.x = x; } void SetX0( int x ) { m_pos0.x = x; }
void SetSize( const wxSize& aSize ) { m_size = aSize; SetDirty(); } void SetSize( const VECTOR2I& aSize ) { m_size = aSize; SetDirty(); }
const wxSize& GetSize() const { return m_size; } const VECTOR2I& GetSize() const { return m_size; }
void SetSizeX( const int aX ) { m_size.x = aX; SetDirty(); } void SetSizeX( const int aX ) { m_size.x = aX; SetDirty(); }
const int GetSizeX() const { return m_size.x; } const int GetSizeX() const { return m_size.x; }
void SetSizeY( const int aY ) { m_size.y = aY; SetDirty(); } void SetSizeY( const int aY ) { m_size.y = aY; SetDirty(); }
const int GetSizeY() const { return m_size.y; } const int GetSizeY() const { return m_size.y; }
void SetDelta( const wxSize& aSize ) { m_deltaSize = aSize; SetDirty(); } void SetDelta( const VECTOR2I& aSize ) { m_deltaSize = aSize; SetDirty(); }
const wxSize& GetDelta() const { return m_deltaSize; } const VECTOR2I& GetDelta() const { return m_deltaSize; }
void SetDrillSize( const wxSize& aSize ) { m_drill = aSize; SetDirty(); } void SetDrillSize( const VECTOR2I& aSize ) { m_drill = aSize; SetDirty(); }
const wxSize& GetDrillSize() const { return m_drill; } const VECTOR2I& GetDrillSize() const { return m_drill; }
void SetDrillSizeX( const int aX ) { m_drill.x = aX; SetDirty(); } void SetDrillSizeX( const int aX ) { m_drill.x = aX; SetDirty(); }
const int GetDrillSizeX() const { return m_drill.x; } const int GetDrillSizeX() const { return m_drill.x; }
void SetDrillSizeY( const int aY ) { m_drill.y = aY; SetDirty(); } void SetDrillSizeY( const int aY ) { m_drill.y = aY; SetDirty(); }
@ -470,7 +470,7 @@ public:
* *
* @return the margin for the solder mask layer. * @return the margin for the solder mask layer.
*/ */
wxSize GetSolderPasteMargin() const; VECTOR2I GetSolderPasteMargin() const;
void SetZoneConnection( ZONE_CONNECTION aType ) { m_zoneConnection = aType; } void SetZoneConnection( ZONE_CONNECTION aType ) { m_zoneConnection = aType; }
ZONE_CONNECTION GetZoneConnection() const { return m_zoneConnection; } ZONE_CONNECTION GetZoneConnection() const { return m_zoneConnection; }
@ -707,8 +707,8 @@ private:
int m_subRatsnest; // Variable used to handle subnet (block) number in int m_subRatsnest; // Variable used to handle subnet (block) number in
// ratsnest computations // ratsnest computations
wxSize m_drill; // Drill diameter (x == y) or slot dimensions (x != y) VECTOR2I m_drill; // Drill diameter (x == y) or slot dimensions (x != y)
wxSize m_size; // X and Y size (relative to orient 0) 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 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, LSET m_layerMask; // Bitwise layer: 1 = copper layer, 15 = cmp,
// 2..14 = internal layers, 16..31 = technical layers // 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 // one end and half expands the other. It is only valid
// to have a single axis be non-0. // to have a single axis be non-0.

View File

@ -1045,8 +1045,8 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
} }
else else
{ {
wxSize pad_size = aPad->GetSize(); VECTOR2I pad_size = aPad->GetSize();
wxSize margin; VECTOR2I margin;
switch( aLayer ) switch( aLayer )
{ {

View File

@ -133,7 +133,8 @@ private:
* It compensate and clamp the drill mark size depending on the current plot options. * It compensate and clamp the drill mark size depending on the current plot options.
*/ */
void plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const VECTOR2I& aDrillPos, 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 ); int aSmallDrill );
PLOTTER* m_plotter; PLOTTER* m_plotter;

View File

@ -281,7 +281,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
else if( sketchPads && aLayerMask[B_Fab] ) else if( sketchPads && aLayerMask[B_Fab] )
color = aPlotOpt.ColorSettings()->GetColor( B_Fab ); color = aPlotOpt.ColorSettings()->GetColor( B_Fab );
wxSize margin; VECTOR2I margin;
int width_adj = 0; int width_adj = 0;
if( onCopperLayer ) if( onCopperLayer )
@ -300,12 +300,12 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
int mask_clearance = margin.x; int mask_clearance = margin.x;
// Now offset the pad size by margin + width_adj // 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 // Store these parameters that can be modified to plot inflated/deflated pads shape
PAD_SHAPE padShape = pad->GetShape(); PAD_SHAPE padShape = pad->GetShape();
wxSize padSize = pad->GetSize(); VECTOR2I padSize = pad->GetSize();
wxSize padDelta = pad->GetDelta(); // has meaning only for trapezoidal pads VECTOR2I padDelta = pad->GetDelta(); // has meaning only for trapezoidal pads
double padCornerRadius = pad->GetRoundRectCornerRadius(); double padCornerRadius = pad->GetRoundRectCornerRadius();
// Don't draw a 0 sized pad. // Don't draw a 0 sized pad.
@ -744,7 +744,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
{ {
for( PAD* pad : footprint->Pads() ) for( PAD* pad : footprint->Pads() )
{ {
wxSize hole = pad->GetDrillSize(); VECTOR2I hole = pad->GetDrillSize();
if( hole.x == 0 || hole.y == 0 ) if( hole.x == 0 || hole.y == 0 )
continue; continue;

View File

@ -1059,10 +1059,10 @@ void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape )
void BRDITEMS_PLOTTER::plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const VECTOR2I& aDrillPos, 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 ) double aOrientation, int aSmallDrill )
{ {
wxSize drillSize = aDrillSize; VECTOR2I drillSize = aDrillSize;
// Small drill marks have no significance when applied to slots // Small drill marks have no significance when applied to slots
if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE ) if( aSmallDrill && aDrillShape == PAD_DRILL_SHAPE_CIRCLE )

View File

@ -1895,7 +1895,7 @@ void EAGLE_PLUGIN::packagePad( FOOTPRINT* aFootprint, wxXmlNode* aTree )
{ {
// The Eagle "long" pad is wider than it is tall, // The Eagle "long" pad is wider than it is tall,
// m_elongation is percent elongation // m_elongation is percent elongation
wxSize sz = pad->GetSize(); VECTOR2I sz = pad->GetSize();
sz.x = ( sz.x * ( 100 + m_rules->psElongationLong ) ) / 100; sz.x = ( sz.x * ( 100 + m_rules->psElongationLong ) ) / 100;
pad->SetSize( sz ); pad->SetSize( sz );
@ -2414,7 +2414,7 @@ void EAGLE_PLUGIN::transferPad( const EPAD_COMMON& aEaglePad, PAD* aPad ) const
aPad->SetPos0( padPos ); aPad->SetPos0( padPos );
// Solder mask // Solder mask
const wxSize& padSize( aPad->GetSize() ); const VECTOR2I& padSize( aPad->GetSize() );
aPad->SetLocalSolderMaskMargin( aPad->SetLocalSolderMaskMargin(
eagleClamp( m_rules->mlMinStopFrame, eagleClamp( m_rules->mlMinStopFrame,

View File

@ -4219,7 +4219,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
case T_drill: case T_drill:
{ {
bool haveWidth = false; bool haveWidth = false;
wxSize drillSize = pad->GetDrillSize(); VECTOR2I drillSize = pad->GetDrillSize();
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
@ -4234,15 +4234,15 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
{ {
if( !haveWidth ) if( !haveWidth )
{ {
drillSize.SetWidth( parseBoardUnits() ); drillSize.x = parseBoardUnits();
// If height is not defined the width and height are the same. // If height is not defined the width and height are the same.
drillSize.SetHeight( drillSize.GetWidth() ); drillSize.y = drillSize.x;
haveWidth = true; haveWidth = true;
} }
else else
{ {
drillSize.SetHeight( parseBoardUnits() ); drillSize.y = parseBoardUnits();
} }
} }

View File

@ -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() ); 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() ); m_out->Print( 0, " (rect_delta %s)", FormatInternalUnits( aPad->GetDelta() ).c_str() );
wxSize sz = aPad->GetDrillSize(); VECTOR2I sz = aPad->GetDrillSize();
VECTOR2I shapeoffset = aPad->GetOffset(); VECTOR2I shapeoffset = aPad->GetOffset();
if( (sz.GetWidth() > 0) || (sz.GetHeight() > 0) || if( (sz.x > 0) || (sz.y > 0) ||
(shapeoffset.x != 0) || (shapeoffset.y != 0) ) (shapeoffset.x != 0) || (shapeoffset.y != 0) )
{ {
m_out->Print( 0, " (drill" ); 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 ) if( aPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG )
m_out->Print( 0, " oval" ); m_out->Print( 0, " oval" );
if( sz.GetWidth() > 0 ) if( sz.x > 0 )
m_out->Print( 0, " %s", FormatInternalUnits( sz.GetWidth() ).c_str() ); m_out->Print( 0, " %s", FormatInternalUnits( sz.x ).c_str() );
if( sz.GetHeight() > 0 && sz.GetWidth() != sz.GetHeight() ) if( sz.y > 0 && sz.x != sz.y )
m_out->Print( 0, " %s", FormatInternalUnits( sz.GetHeight() ).c_str() ); m_out->Print( 0, " %s", FormatInternalUnits( sz.y ).c_str() );
if( (shapeoffset.x != 0) || (shapeoffset.y != 0) ) if( (shapeoffset.x != 0) || (shapeoffset.y != 0) )
m_out->Print( 0, " (offset %s)", FormatInternalUnits( aPad->GetOffset() ).c_str() ); m_out->Print( 0, " (offset %s)", FormatInternalUnits( aPad->GetOffset() ).c_str() );

View File

@ -33,7 +33,6 @@
#include <trigo.h> #include <trigo.h>
#include <xnode.h> #include <xnode.h>
#include <wx/gdicmn.h>
#include <wx/string.h> #include <wx/string.h>
namespace PCAD2KICAD { namespace PCAD2KICAD {
@ -287,13 +286,13 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
pad->SetShape( PAD_SHAPE::RECT ); // approximation pad->SetShape( PAD_SHAPE::RECT ); // approximation
} }
pad->SetSize( wxSize( width, height ) ); pad->SetSize( VECTOR2I( width, height ) );
pad->SetDelta( wxSize( 0, 0 ) ); pad->SetDelta( VECTOR2I( 0, 0 ) );
pad->SetOrientation( m_rotation + aRotation ); pad->SetOrientation( m_rotation + aRotation );
pad->SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); pad->SetDrillShape( PAD_DRILL_SHAPE_CIRCLE );
pad->SetOffset( wxPoint( 0, 0 ) ); pad->SetOffset( VECTOR2I( 0, 0 ) );
pad->SetDrillSize( wxSize( m_Hole, m_Hole ) ); pad->SetDrillSize( VECTOR2I( m_Hole, m_Hole ) );
pad->SetAttribute( padType ); pad->SetAttribute( padType );

View File

@ -493,7 +493,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, PAD* aPad )
*/ */
double correctionFactor = cos( M_PI / (double) circleToSegmentsCount ); double correctionFactor = cos( M_PI / (double) circleToSegmentsCount );
int extra_clearance = KiROUND( rradius * ( 1.0 - correctionFactor ) ); int extra_clearance = KiROUND( rradius * ( 1.0 - correctionFactor ) );
wxSize psize = aPad->GetSize(); VECTOR2I psize = aPad->GetSize();
psize.x += extra_clearance * 2; psize.x += extra_clearance * 2;
psize.y += extra_clearance * 2; psize.y += extra_clearance * 2;
rradius += extra_clearance; rradius += extra_clearance;