D_PAD -> PAD.
This commit is contained in:
parent
f0d0e17aab
commit
f5443de7f9
|
@ -540,12 +540,12 @@ class BOARD_ADAPTER
|
|||
void createNewTrack( const TRACK* aTrack, CGENERICCONTAINER2D *aDstContainer,
|
||||
int aClearanceValue );
|
||||
|
||||
void createNewPadWithClearance( const D_PAD *aPad,
|
||||
void createNewPadWithClearance( const PAD *aPad,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayer,
|
||||
wxSize aClearanceValue ) const;
|
||||
|
||||
COBJECT2D *createNewPadDrill( const D_PAD* aPad, int aInflateValue );
|
||||
COBJECT2D *createNewPadDrill( const PAD* aPad, int aInflateValue );
|
||||
|
||||
void AddPadsShapesWithClearanceToContainer( const MODULE *aModule,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
|
@ -587,12 +587,12 @@ class BOARD_ADAPTER
|
|||
CGENERICCONTAINER2D *aDstContainer,
|
||||
const BOARD_ITEM &aBoardItem );
|
||||
|
||||
void buildPadShapeThickOutlineAsSegments( const D_PAD *aPad,
|
||||
void buildPadShapeThickOutlineAsSegments( const PAD *aPad,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
int aWidth );
|
||||
|
||||
// Helper functions to create poly contours
|
||||
void buildPadShapeThickOutlineAsPolygon( const D_PAD *aPad,
|
||||
void buildPadShapeThickOutlineAsPolygon( const PAD *aPad,
|
||||
SHAPE_POLY_SET &aCornerBuffer,
|
||||
int aWidth) const;
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ void BOARD_ADAPTER::createNewTrack( const TRACK* aTrack, CGENERICCONTAINER2D *aD
|
|||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::createNewPadWithClearance( const D_PAD* aPad,
|
||||
void BOARD_ADAPTER::createNewPadWithClearance( const PAD* aPad,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayer,
|
||||
wxSize aClearanceValue ) const
|
||||
|
@ -347,7 +347,7 @@ void BOARD_ADAPTER::createNewPadWithClearance( const D_PAD* aPad,
|
|||
if( ( aClearanceValue.x < 0 || aClearanceValue.x != aClearanceValue.y )
|
||||
&& aPad->GetShape() != PAD_SHAPE_CUSTOM )
|
||||
{
|
||||
D_PAD dummy( *aPad );
|
||||
PAD dummy( *aPad );
|
||||
dummy.SetSize( aPad->GetSize() + aClearanceValue + aClearanceValue );
|
||||
dummy.TransformShapeWithClearanceToPolygon( poly, aLayer, 0, ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
aClearanceValue = { 0, 0 };
|
||||
|
@ -435,7 +435,7 @@ void BOARD_ADAPTER::createNewPadWithClearance( const D_PAD* aPad,
|
|||
}
|
||||
|
||||
|
||||
COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const D_PAD* aPad, int aInflateValue )
|
||||
COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const PAD* aPad, int aInflateValue )
|
||||
{
|
||||
wxSize drillSize = aPad->GetDrillSize();
|
||||
|
||||
|
@ -481,7 +481,7 @@ void BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer( const MODULE* aModule
|
|||
bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads )
|
||||
{
|
||||
for( D_PAD* pad : aModule->Pads() )
|
||||
for( PAD* pad : aModule->Pads() )
|
||||
{
|
||||
if( !pad->IsOnLayer( aLayerId ) )
|
||||
continue;
|
||||
|
@ -840,7 +840,7 @@ void BOARD_ADAPTER::AddSolidAreasShapesToContainer( const ZONE* aZoneContainer,
|
|||
|
||||
|
||||
|
||||
void BOARD_ADAPTER::buildPadShapeThickOutlineAsSegments( const D_PAD* aPad,
|
||||
void BOARD_ADAPTER::buildPadShapeThickOutlineAsSegments( const PAD* aPad,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
int aWidth )
|
||||
{
|
||||
|
|
|
@ -465,7 +465,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
const wxSize padHole = pad->GetDrillSize();
|
||||
|
||||
|
@ -499,7 +499,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
const wxSize padHole = pad->GetDrillSize();
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
{
|
||||
int linewidth = g_DrawDefaultLineThickness;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( !pad->IsOnLayer( curr_layer_id ) )
|
||||
continue;
|
||||
|
@ -1027,7 +1027,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
{
|
||||
const int linewidth = g_DrawDefaultLineThickness;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( !pad->IsOnLayer( curr_layer_id ) )
|
||||
continue;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <footprint.h>
|
||||
|
||||
|
||||
void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const D_PAD* aPad,
|
||||
void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const PAD* aPad,
|
||||
SHAPE_POLY_SET& aCornerBuffer,
|
||||
int aWidth ) const
|
||||
{
|
||||
|
|
|
@ -749,7 +749,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event )
|
|||
{
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
D_PAD* item = dynamic_cast<D_PAD *>( intersectedBoardItem );
|
||||
PAD* item = dynamic_cast<PAD *>( intersectedBoardItem );
|
||||
|
||||
if( item )
|
||||
{
|
||||
|
|
|
@ -1161,7 +1161,7 @@ void C3D_RENDER_RAYTRACING::insert3DViaHole( const VIA* aVia )
|
|||
|
||||
// Based on draw3DPadHole from
|
||||
// 3d_draw_helper_functions.cpp
|
||||
void C3D_RENDER_RAYTRACING::insert3DPadHole( const D_PAD* aPad )
|
||||
void C3D_RENDER_RAYTRACING::insert3DPadHole( const PAD* aPad )
|
||||
{
|
||||
const COBJECT2D *object2d_A = NULL;
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ private:
|
|||
|
||||
void add_3D_vias_and_pads_to_container();
|
||||
void insert3DViaHole( const VIA* aVia );
|
||||
void insert3DPadHole( const D_PAD* aPad );
|
||||
void insert3DPadHole( const PAD* aPad );
|
||||
void load_3D_models( CCONTAINER &aDstContainer, bool aSkipMaterialInformation );
|
||||
void add_3D_models( CCONTAINER &aDstContainer,
|
||||
const S3DMODEL *a3DModel,
|
||||
|
|
|
@ -74,7 +74,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
|
|||
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
const D_PAD* pad = static_cast<const D_PAD*>( aItem );
|
||||
const PAD* pad = static_cast<const PAD*>( aItem );
|
||||
|
||||
ret = hash<int>{}( pad->GetShape() << 16 );
|
||||
hash_combine( ret, pad->GetDrillShape() << 18 );
|
||||
|
|
|
@ -300,7 +300,7 @@ public:
|
|||
wxPoint m_AuxOrigin; ///< origin for plot exports
|
||||
wxPoint m_GridOrigin; ///< origin for grid offsets
|
||||
|
||||
D_PAD m_Pad_Master; // A dummy pad to store all default parameters
|
||||
PAD m_Pad_Master; // A dummy pad to store all default parameters
|
||||
// when importing values or creating a new pad
|
||||
|
||||
// Set to true if the board has a stackup management.
|
||||
|
|
|
@ -236,9 +236,8 @@ public:
|
|||
|
||||
/**
|
||||
* Function IsOnLayer
|
||||
* tests to see if this object is on the given layer. Is virtual so
|
||||
* objects like D_PAD, which reside on multiple layers can do their own
|
||||
* form of testing.
|
||||
* tests to see if this object is on the given layer. Virtual so objects like PAD, which
|
||||
* reside on multiple layers can do their own form of testing.
|
||||
* @param aLayer The layer to test for.
|
||||
* @return bool - true if on given layer, else false.
|
||||
*/
|
||||
|
|
|
@ -87,7 +87,7 @@ enum KICAD_T
|
|||
|
||||
// Items in pcb
|
||||
PCB_MODULE_T, ///< class MODULE, a footprint
|
||||
PCB_PAD_T, ///< class D_PAD, a pad in a footprint
|
||||
PCB_PAD_T, ///< class PAD, a pad in a footprint
|
||||
PCB_SHAPE_T, ///< class PCB_SHAPE, a segment not on copper layers
|
||||
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
|
||||
PCB_FP_TEXT_T, ///< class FP_TEXT, text in a footprint
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
/**
|
||||
* Enum PAD_SHAPE_T
|
||||
* is the set of pad shapes, used with D_PAD::{Set,Get}Shape()
|
||||
* is the set of pad shapes, used with PAD::{Set,Get}Shape()
|
||||
*/
|
||||
enum PAD_SHAPE_T
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ static inline std::string PAD_SHAPE_T_asString( PAD_SHAPE_T a )
|
|||
|
||||
/**
|
||||
* Enum PAD_DRILL_SHAPE_T
|
||||
* is the set of pad drill shapes, used with D_PAD::{Set,Get}DrillShape()
|
||||
* is the set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
|
||||
*/
|
||||
enum PAD_DRILL_SHAPE_T
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ enum PAD_DRILL_SHAPE_T
|
|||
|
||||
/**
|
||||
* Enum PAD_ATTR_T
|
||||
* is the set of pad shapes, used with D_PAD::{Set,Get}Attribute()
|
||||
* is the set of pad shapes, used with PAD::{Set,Get}Attribute()
|
||||
* The double name is for convenience of Python devs
|
||||
*/
|
||||
enum PAD_ATTR_T
|
||||
|
|
|
@ -52,7 +52,7 @@ class BOARD_CONNECTED_ITEM;
|
|||
class COLOR_SETTINGS;
|
||||
class MODULE;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class EDA_3D_VIEWER;
|
||||
class GENERAL_COLLECTOR;
|
||||
class GENERAL_COLLECTORS_GUIDE;
|
||||
|
@ -309,7 +309,7 @@ public:
|
|||
*/
|
||||
void PlaceFootprint( MODULE* aFootprint, bool aRecreateRatsnest = true );
|
||||
|
||||
void ShowPadPropertiesDialog( D_PAD* aPad );
|
||||
void ShowPadPropertiesDialog( PAD* aPad );
|
||||
|
||||
/**
|
||||
* Function SelectFootprintFromLibTree
|
||||
|
|
|
@ -119,9 +119,9 @@ public:
|
|||
|
||||
/**
|
||||
* Function ViewGetLayers()
|
||||
* Returns the all the layers within the VIEW the object is painted on. For instance, a D_PAD
|
||||
* spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is
|
||||
* repeatedly called for each of the layers returned by ViewGetLayers(), depending on the
|
||||
* Returns the all the layers within the VIEW the object is painted on. For instance, a PAD
|
||||
* spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw()
|
||||
* is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the
|
||||
* rendering order.
|
||||
* @param aLayers[]: output layer index array
|
||||
* @param aCount: number of layer indices in aLayers[]
|
||||
|
|
|
@ -173,7 +173,7 @@ void ARRAY_CREATOR::Invoke()
|
|||
// Renumber non-aperture pads.
|
||||
if( this_item->Type() == PCB_PAD_T )
|
||||
{
|
||||
auto& pad = static_cast<D_PAD&>( *this_item );
|
||||
PAD& pad = static_cast<PAD&>( *this_item );
|
||||
|
||||
if( PAD_NAMING::PadCanHaveName( pad ) )
|
||||
{
|
||||
|
|
|
@ -306,7 +306,7 @@ void AR_AUTOPLACER::addFpBody( wxPoint aStart, wxPoint aEnd, LSET aLayerMask )
|
|||
}
|
||||
}
|
||||
|
||||
void AR_AUTOPLACER::addPad( D_PAD* aPad, int aClearance )
|
||||
void AR_AUTOPLACER::addPad( PAD* aPad, int aClearance )
|
||||
{
|
||||
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
|
||||
EDA_RECT bbox = aPad->GetBoundingBox();
|
||||
|
@ -356,7 +356,7 @@ void AR_AUTOPLACER::buildFpAreas( MODULE* aFootprint, int aFpClearance )
|
|||
addFpBody( fpBBox.GetOrigin(), fpBBox.GetEnd(), layerMask );
|
||||
|
||||
// Trace pads + clearance areas.
|
||||
for( D_PAD* pad : aFootprint->Pads() )
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
{
|
||||
int margin = (m_matrix.m_GridRouting / 2) + pad->GetOwnClearance( pad->GetLayer() );
|
||||
addPad( pad, margin );
|
||||
|
@ -410,7 +410,7 @@ void AR_AUTOPLACER::genModuleOnRoutingMatrix( MODULE* Module )
|
|||
CELL_IS_MODULE, AR_MATRIX::WRITE_OR_CELL );
|
||||
|
||||
// Trace pads + clearance areas.
|
||||
for( D_PAD* pad : Module->Pads() )
|
||||
for( PAD* pad : Module->Pads() )
|
||||
{
|
||||
int margin = (m_matrix.m_GridRouting / 2) + pad->GetOwnClearance( pad->GetLayer() );
|
||||
m_matrix.PlacePad( pad, CELL_IS_MODULE, margin, AR_MATRIX::WRITE_OR_CELL );
|
||||
|
@ -679,10 +679,10 @@ int AR_AUTOPLACER::getOptimalModulePlacement(MODULE* aModule)
|
|||
}
|
||||
|
||||
|
||||
const D_PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefModule, D_PAD* aRefPad, const wxPoint& aOffset)
|
||||
const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefModule, PAD* aRefPad, const wxPoint& aOffset)
|
||||
{
|
||||
const D_PAD* nearest = nullptr;
|
||||
int64_t nearestDist = INT64_MAX;
|
||||
const PAD* nearest = nullptr;
|
||||
int64_t nearestDist = INT64_MAX;
|
||||
|
||||
for ( auto mod : m_board->Modules() )
|
||||
{
|
||||
|
|
|
@ -109,17 +109,17 @@ private:
|
|||
MODULE* pickModule();
|
||||
|
||||
void placeModule( MODULE* aModule, bool aDoNotRecreateRatsnest, const wxPoint& aPos );
|
||||
const D_PAD* nearestPad( MODULE* aRefModule, D_PAD* aRefPad, const wxPoint& aOffset );
|
||||
const PAD* nearestPad( MODULE* aRefModule, PAD* aRefPad, const wxPoint& aOffset );
|
||||
|
||||
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
|
||||
void addFpBody( wxPoint aStart, wxPoint aEnd, LSET aLayerMask );
|
||||
void addFpBody( wxPoint aStart, wxPoint aEnd, LSET aLayerMask );
|
||||
|
||||
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
|
||||
void addPad( D_PAD* aPad, int aClearance );
|
||||
void addPad( PAD* aPad, int aClearance );
|
||||
|
||||
// Build m_fpAreaTop and m_fpAreaBottom polygonal shapes for aFootprint.
|
||||
// aFpClearance is a mechanical clearance.
|
||||
void buildFpAreas( MODULE* aFootprint, int aFpClearance );
|
||||
void buildFpAreas( MODULE* aFootprint, int aFpClearance );
|
||||
|
||||
AR_MATRIX m_matrix;
|
||||
SHAPE_POLY_SET m_topFreeArea; // The polygonal description of the top side free areas;
|
||||
|
|
|
@ -910,7 +910,7 @@ void AR_MATRIX::CreateKeepOutRectangle(
|
|||
}
|
||||
|
||||
|
||||
void AR_MATRIX::PlacePad( D_PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic )
|
||||
void AR_MATRIX::PlacePad( PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic )
|
||||
{
|
||||
int dx, dy;
|
||||
wxPoint shape_pos = aPad->ShapePos();
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
class PCB_SHAPE;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class MODULE;
|
||||
|
||||
#define AR_MAX_ROUTING_LAYERS_COUNT 2
|
||||
|
@ -131,24 +131,30 @@ public:
|
|||
void SetDist( int aRow, int aCol, int aSide, DIST_CELL );
|
||||
|
||||
void TraceSegmentPcb( PCB_SHAPE* pt_segm, int color, int marge, AR_MATRIX::CELL_OP op_logic );
|
||||
void CreateKeepOutRectangle(
|
||||
int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut, LSET aLayerMask );
|
||||
void PlacePad( D_PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut,
|
||||
LSET aLayerMask );
|
||||
|
||||
void PlacePad( PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double angle, LSET aLayerMask,
|
||||
int color, AR_MATRIX::CELL_OP op_logic );
|
||||
int color, AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, LSET aLayerMask, int color,
|
||||
AR_MATRIX::CELL_OP op_logic );
|
||||
AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
private:
|
||||
void drawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, LAYER_NUM layer, int color,
|
||||
CELL_OP op_logic );
|
||||
|
||||
void traceCircle( int ux0, int uy0, int ux1, int uy1, int lg, LAYER_NUM layer, int color,
|
||||
AR_MATRIX::CELL_OP op_logic );
|
||||
void traceFilledCircle(
|
||||
int cx, int cy, int radius, LSET aLayerMask, int color, AR_MATRIX::CELL_OP op_logic );
|
||||
AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
void traceFilledCircle( int cx, int cy, int radius, LSET aLayerMask, int color,
|
||||
AR_MATRIX::CELL_OP op_logic );
|
||||
|
||||
void traceArc( int ux0, int uy0, int ux1, int uy1, double ArcAngle, int lg, LAYER_NUM layer,
|
||||
int color, AR_MATRIX::CELL_OP op_logic );
|
||||
int color, AR_MATRIX::CELL_OP op_logic );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -516,7 +516,7 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID aLayer, bool isEnabled )
|
|||
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
pad->SetLocalRatsnestVisible( isEnabled );
|
||||
}
|
||||
|
||||
|
@ -773,7 +773,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const
|
|||
if( footprint->m_Uuid == aID )
|
||||
return footprint;
|
||||
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( pad->m_Uuid == aID )
|
||||
return pad;
|
||||
|
@ -848,7 +848,7 @@ void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
|
|||
{
|
||||
aMap[ footprint->m_Uuid ] = footprint;
|
||||
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
aMap[ pad->m_Uuid ] = pad;
|
||||
|
||||
aMap[ footprint->Reference().m_Uuid ] = &footprint->Reference();
|
||||
|
@ -977,7 +977,7 @@ unsigned BOARD::GetNodesCount( int aNet ) const
|
|||
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( ( aNet == -1 && pad->GetNetCode() > 0 ) || aNet == pad->GetNetCode() )
|
||||
retval++;
|
||||
|
@ -1329,11 +1329,11 @@ int BOARD::SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount )
|
|||
{
|
||||
// Build the pad count by net:
|
||||
padCountListByNet.clear();
|
||||
std::vector<D_PAD*> pads = GetPads();
|
||||
std::vector<PAD*> pads = GetPads();
|
||||
|
||||
padCountListByNet.assign( max_netcode + 1, 0 );
|
||||
|
||||
for( D_PAD* pad : pads )
|
||||
for( PAD* pad : pads )
|
||||
{
|
||||
int netCode = pad->GetNetCode();
|
||||
|
||||
|
@ -1443,14 +1443,14 @@ int BOARD::SetAreasNetCodesFromNetNames()
|
|||
}
|
||||
|
||||
|
||||
D_PAD* BOARD::GetPad( const wxPoint& aPosition, LSET aLayerSet )
|
||||
PAD* BOARD::GetPad( const wxPoint& aPosition, LSET aLayerSet )
|
||||
{
|
||||
if( !aLayerSet.any() )
|
||||
aLayerSet = LSET::AllCuMask();
|
||||
|
||||
for( MODULE* footprint : m_modules )
|
||||
{
|
||||
D_PAD* pad = NULL;
|
||||
PAD* pad = NULL;
|
||||
|
||||
if( footprint->HitTest( aPosition ) )
|
||||
pad = footprint->GetPad( aPosition, aLayerSet );
|
||||
|
@ -1463,7 +1463,7 @@ D_PAD* BOARD::GetPad( const wxPoint& aPosition, LSET aLayerSet )
|
|||
}
|
||||
|
||||
|
||||
D_PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint )
|
||||
PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint )
|
||||
{
|
||||
const wxPoint& aPosition = aTrace->GetEndPoint( aEndPoint );
|
||||
|
||||
|
@ -1473,11 +1473,11 @@ D_PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint )
|
|||
}
|
||||
|
||||
|
||||
D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet )
|
||||
PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet )
|
||||
{
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( pad->GetPosition() != aPosition )
|
||||
continue;
|
||||
|
@ -1492,7 +1492,7 @@ D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet )
|
|||
}
|
||||
|
||||
|
||||
D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerSet )
|
||||
PAD* BOARD::GetPad( std::vector<PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerSet )
|
||||
{
|
||||
// Search aPadList for aPosition
|
||||
// aPadList is sorted by X then Y values, and a fast binary search is used
|
||||
|
@ -1511,7 +1511,7 @@ D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, L
|
|||
|
||||
delta /= 2;
|
||||
|
||||
D_PAD* pad = aPadList[idx];
|
||||
PAD* pad = aPadList[idx];
|
||||
|
||||
if( pad->GetPosition() == aPosition ) // candidate found
|
||||
{
|
||||
|
@ -1591,7 +1591,7 @@ D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, L
|
|||
*
|
||||
* This function is used to build ordered pads lists
|
||||
*/
|
||||
bool sortPadsByXthenYCoord( D_PAD* const & ref, D_PAD* const & comp )
|
||||
bool sortPadsByXthenYCoord( PAD* const & ref, PAD* const & comp )
|
||||
{
|
||||
if( ref->GetPosition().x == comp->GetPosition().x )
|
||||
return ref->GetPosition().y < comp->GetPosition().y;
|
||||
|
@ -1599,11 +1599,11 @@ bool sortPadsByXthenYCoord( D_PAD* const & ref, D_PAD* const & comp )
|
|||
}
|
||||
|
||||
|
||||
void BOARD::GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode )
|
||||
void BOARD::GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode )
|
||||
{
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads( ) )
|
||||
for( PAD* pad : footprint->Pads( ) )
|
||||
{
|
||||
if( aNetCode < 0 || pad->GetNetCode() == aNetCode )
|
||||
aVector.push_back( pad );
|
||||
|
@ -1614,7 +1614,7 @@ void BOARD::GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNe
|
|||
}
|
||||
|
||||
|
||||
void BOARD::PadDelete( D_PAD* aPad )
|
||||
void BOARD::PadDelete( PAD* aPad )
|
||||
{
|
||||
GetConnectivity()->Remove( aPad );
|
||||
|
||||
|
@ -1644,7 +1644,7 @@ std::tuple<int, double, double> BOARD::GetTrackLength( const TRACK& aTrack ) con
|
|||
|
||||
for( auto pad_it : connectivity->GetConnectedPads( item ) )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>( pad_it );
|
||||
PAD* pad = static_cast<PAD*>( pad_it );
|
||||
|
||||
if( pad->HitTest( track->GetStart(), track->GetWidth() / 2 )
|
||||
&& pad->HitTest( track->GetEnd(), track->GetWidth() / 2 ) )
|
||||
|
@ -1657,7 +1657,7 @@ std::tuple<int, double, double> BOARD::GetTrackLength( const TRACK& aTrack ) con
|
|||
if( !inPad )
|
||||
length += track->GetLength();
|
||||
}
|
||||
else if( D_PAD* pad = dyn_cast<D_PAD*>( item ) )
|
||||
else if( PAD* pad = dyn_cast<PAD*>( item ) )
|
||||
{
|
||||
package_length += pad->GetPadToDieLength();
|
||||
}
|
||||
|
@ -1856,13 +1856,13 @@ bool BOARD::GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines, wxString* aError
|
|||
}
|
||||
|
||||
|
||||
const std::vector<D_PAD*> BOARD::GetPads() const
|
||||
const std::vector<PAD*> BOARD::GetPads() const
|
||||
{
|
||||
std::vector<D_PAD*> allPads;
|
||||
std::vector<PAD*> allPads;
|
||||
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
allPads.push_back( pad );
|
||||
}
|
||||
|
||||
|
@ -1890,7 +1890,7 @@ const std::vector<BOARD_CONNECTED_ITEM*> BOARD::AllConnectedItems()
|
|||
|
||||
for( MODULE* footprint : Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
items.push_back( pad );
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class PICKED_ITEMS_LIST;
|
|||
class BOARD;
|
||||
class ZONE;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class MARKER_PCB;
|
||||
class MSG_PANEL_ITEM;
|
||||
class NETLIST;
|
||||
|
@ -701,7 +701,7 @@ public:
|
|||
*
|
||||
* @return D_PADS - a full list of pads
|
||||
*/
|
||||
const std::vector<D_PAD*> GetPads() const;
|
||||
const std::vector<PAD*> GetPads() const;
|
||||
|
||||
void BuildListOfNets()
|
||||
{
|
||||
|
@ -990,10 +990,10 @@ public:
|
|||
*
|
||||
* @param aPosition A wxPoint object containing the position to hit test.
|
||||
* @param aLayerMask A layer or layers to mask the hit test.
|
||||
* @return A pointer to a D_PAD object if found or NULL if not found.
|
||||
* @return A pointer to a PAD object if found or NULL if not found.
|
||||
*/
|
||||
D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
|
||||
D_PAD* GetPad( const wxPoint& aPosition )
|
||||
PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
|
||||
PAD* GetPad( const wxPoint& aPosition )
|
||||
{
|
||||
return GetPad( aPosition, LSET().set() );
|
||||
}
|
||||
|
@ -1003,9 +1003,9 @@ public:
|
|||
*
|
||||
* @param aTrace A pointer to a TRACK object to hit test against.
|
||||
* @param aEndPoint The end point of \a aTrace the hit test against.
|
||||
* @return A pointer to a D_PAD object if found or NULL if not found.
|
||||
* @return A pointer to a PAD object if found or NULL if not found.
|
||||
*/
|
||||
D_PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
|
||||
PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
|
||||
|
||||
/**
|
||||
* Return pad found at \a aPosition on \a aLayerMask using the fast search method.
|
||||
|
@ -1014,9 +1014,9 @@ public:
|
|||
* </p>
|
||||
* @param aPosition A wxPoint object containing the position to hit test.
|
||||
* @param aLayerMask A layer or layers to mask the hit test.
|
||||
* @return A pointer to a D_PAD object if found or NULL if not found.
|
||||
* @return A pointer to a PAD object if found or NULL if not found.
|
||||
*/
|
||||
D_PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
|
||||
PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
|
||||
|
||||
/**
|
||||
* Locate the pad connected at \a aPosition on \a aLayer starting at list position
|
||||
|
@ -1027,19 +1027,19 @@ public:
|
|||
* function.
|
||||
* </p>
|
||||
* @note The normal pad list is sorted by increasing netcodes.
|
||||
* @param aPadList = the list of pads candidates (a std::vector<D_PAD*>)
|
||||
* @param aPadList = the list of pads candidates (a std::vector<PAD*>)
|
||||
* @param aPosition A wxPoint object containing the position to test.
|
||||
* @param aLayerMask A layer or layers to mask the hit test.
|
||||
* @return a D_PAD object pointer to the connected pad.
|
||||
* @return a PAD object pointer to the connected pad.
|
||||
*/
|
||||
D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
|
||||
PAD* GetPad( std::vector<PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
|
||||
|
||||
/**
|
||||
* Delete a given pad from the BOARD by removing it from its module and
|
||||
* from the m_NetInfo. Makes no UI calls.
|
||||
* @param aPad is the pad to delete.
|
||||
*/
|
||||
void PadDelete( D_PAD* aPad );
|
||||
void PadDelete( PAD* aPad );
|
||||
|
||||
/**
|
||||
* First empties then fills the vector with all pads and sorts them by
|
||||
|
@ -1052,7 +1052,7 @@ public:
|
|||
* = -1 to build the full pad list.
|
||||
* = a given netcode to build the pad list relative to the given net
|
||||
*/
|
||||
void GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode = -1 );
|
||||
void GetSortedPadListByXthenYCoord( std::vector<PAD*>& aVector, int aNetCode = -1 );
|
||||
|
||||
/**
|
||||
* Returns data on the length and number of track segments connected to a given track.
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
class NETCLASS;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
|
||||
/**
|
||||
* BOARD_CONNECTED_ITEM
|
||||
|
|
|
@ -131,7 +131,7 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB
|
|||
bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads ) const
|
||||
{
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
if( aLayer != UNDEFINED_LAYER && !pad->IsOnLayer(aLayer) )
|
||||
continue;
|
||||
|
@ -201,7 +201,7 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB
|
|||
if( ( clearance.x < 0 || clearance.x != clearance.y )
|
||||
&& pad->GetShape() != PAD_SHAPE_CUSTOM )
|
||||
{
|
||||
D_PAD dummy( *pad );
|
||||
PAD dummy( *pad );
|
||||
dummy.SetSize( pad->GetSize() + clearance + clearance );
|
||||
dummy.TransformShapeWithClearanceToPolygon( aCornerBuffer, aLayer, 0,
|
||||
aMaxError, aErrorLoc );
|
||||
|
@ -560,10 +560,10 @@ void TRACK::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearanceValue,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
bool ignoreLineWidth ) const
|
||||
void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearanceValue,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
bool ignoreLineWidth ) const
|
||||
{
|
||||
wxASSERT_MSG( !ignoreLineWidth, "IgnoreLineWidth has no meaning for pads." );
|
||||
|
||||
|
@ -685,7 +685,7 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "D_PAD::TransformShapeWithClearanceToPolygon no implementation for "
|
||||
wxFAIL_MSG( "PAD::TransformShapeWithClearanceToPolygon no implementation for "
|
||||
+ PAD_SHAPE_T_asString( GetShape() ) );
|
||||
break;
|
||||
}
|
||||
|
@ -693,8 +693,8 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
|||
|
||||
|
||||
|
||||
bool D_PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aInflateValue,
|
||||
int aError, ERROR_LOC aErrorLoc ) const
|
||||
bool PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aInflateValue,
|
||||
int aError, ERROR_LOC aErrorLoc ) const
|
||||
{
|
||||
wxSize drillsize = GetDrillSize();
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
||||
MODULE* module = nullptr;
|
||||
PCB_GROUP* group = nullptr;
|
||||
D_PAD* pad = nullptr;
|
||||
PAD* pad = nullptr;
|
||||
bool pad_through = false;
|
||||
VIA* via = nullptr;
|
||||
MARKER_PCB* marker = nullptr;
|
||||
|
@ -278,7 +278,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
// board side must be seen
|
||||
// if pad is a thru hole, then it can be visible when its parent module is not.
|
||||
// for through pads: pads on Front or Back board sides must be seen
|
||||
pad = (D_PAD*) item;
|
||||
pad = static_cast<PAD*>( item );
|
||||
|
||||
if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
|
||||
(pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
|
||||
|
|
|
@ -278,7 +278,7 @@ public:
|
|||
|
||||
/**
|
||||
* A scan list for all primary board items, omitting items which are subordinate to
|
||||
* a MODULE, such as D_PAD and TEXTEMODULE.
|
||||
* a MODULE, such as PAD and FP_TEXT.
|
||||
*/
|
||||
static const KICAD_T BoardLevelItems[];
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
|||
if( m_itemMap.find ( aItem ) != m_itemMap.end() )
|
||||
return false;
|
||||
|
||||
add( m_itemList, static_cast<D_PAD*>( aItem ) );
|
||||
add( m_itemList, static_cast<PAD*>( aItem ) );
|
||||
|
||||
break;
|
||||
|
||||
|
@ -450,9 +450,9 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
|||
reportProgress( aReporter, ii++, size, delta );
|
||||
}
|
||||
|
||||
for( MODULE* mod : aBoard->Modules() )
|
||||
for( MODULE* footprint : aBoard->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
Add( pad );
|
||||
reportProgress( aReporter, ii++, size, delta );
|
||||
|
|
|
@ -506,24 +506,24 @@ const
|
|||
|
||||
|
||||
void CONNECTIVITY_DATA::GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem,
|
||||
std::set<D_PAD*>* pads ) const
|
||||
std::set<PAD*>* pads ) const
|
||||
{
|
||||
for( auto citem : m_connAlgo->ItemEntry( aItem ).GetItems() )
|
||||
for( CN_ITEM* citem : m_connAlgo->ItemEntry( aItem ).GetItems() )
|
||||
{
|
||||
for( auto connected : citem->ConnectedItems() )
|
||||
for( CN_ITEM* connected : citem->ConnectedItems() )
|
||||
{
|
||||
if( connected->Valid() && connected->Parent()->Type() == PCB_PAD_T )
|
||||
pads->insert( static_cast<D_PAD*> ( connected->Parent() ) );
|
||||
pads->insert( static_cast<PAD*> ( connected->Parent() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const std::vector<D_PAD*> CONNECTIVITY_DATA::GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem )
|
||||
const std::vector<PAD*> CONNECTIVITY_DATA::GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem )
|
||||
const
|
||||
{
|
||||
std::set<D_PAD*> pads;
|
||||
std::vector<D_PAD*> rv;
|
||||
std::set<PAD*> pads;
|
||||
std::vector<PAD*> rv;
|
||||
|
||||
GetConnectedPads( aItem, &pads );
|
||||
|
||||
|
@ -559,7 +559,7 @@ unsigned int CONNECTIVITY_DATA::GetPadCount( int aNet ) const
|
|||
if( !pad->Valid() || pad->Parent()->Type() != PCB_PAD_T)
|
||||
continue;
|
||||
|
||||
D_PAD* dpad = static_cast<D_PAD*>( pad->Parent() );
|
||||
PAD* dpad = static_cast<PAD*>( pad->Parent() );
|
||||
|
||||
if( aNet < 0 || aNet == dpad->GetNetCode() )
|
||||
n++;
|
||||
|
@ -727,7 +727,7 @@ const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForItems( std::vector<B
|
|||
const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForComponent( MODULE* aComponent, bool aSkipInternalConnections )
|
||||
{
|
||||
std::set<int> nets;
|
||||
std::set<const D_PAD*> pads;
|
||||
std::set<const PAD*> pads;
|
||||
std::vector<CN_EDGE> edges;
|
||||
|
||||
for( auto pad : aComponent->Pads() )
|
||||
|
@ -745,8 +745,8 @@ const std::vector<CN_EDGE> CONNECTIVITY_DATA::GetRatsnestForComponent( MODULE* a
|
|||
auto srcNode = edge.GetSourceNode();
|
||||
auto dstNode = edge.GetTargetNode();
|
||||
|
||||
auto srcParent = static_cast<const D_PAD*>( srcNode->Parent() );
|
||||
auto dstParent = static_cast<const D_PAD*>( dstNode->Parent() );
|
||||
const PAD* srcParent = static_cast<const PAD*>( srcNode->Parent() );
|
||||
const PAD* dstParent = static_cast<const PAD*>( dstNode->Parent() );
|
||||
|
||||
bool srcFound = ( pads.find(srcParent) != pads.end() );
|
||||
bool dstFound = ( pads.find(dstParent) != pads.end() );
|
||||
|
|
|
@ -50,7 +50,7 @@ class ZONE;
|
|||
class RN_DATA;
|
||||
class RN_NET;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class MODULE;
|
||||
class PROGRESS_REPORTER;
|
||||
|
||||
|
@ -191,9 +191,9 @@ public:
|
|||
|
||||
const std::vector<TRACK*> GetConnectedTracks( const BOARD_CONNECTED_ITEM* aItem ) const;
|
||||
|
||||
const std::vector<D_PAD*> GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem ) const;
|
||||
const std::vector<PAD*> GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem ) const;
|
||||
|
||||
void GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem, std::set<D_PAD*>* pads ) const;
|
||||
void GetConnectedPads( const BOARD_CONNECTED_ITEM* aItem, std::set<PAD*>* pads ) const;
|
||||
|
||||
const std::vector<BOARD_CONNECTED_ITEM*> GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem, const VECTOR2I& aAnchor, KICAD_T aTypes[] );
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ const VECTOR2I CN_ITEM::GetAnchor( int n ) const
|
|||
{
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
D_PAD* pad = (D_PAD*) m_parent;
|
||||
PAD* pad = static_cast<PAD*>( m_parent );
|
||||
|
||||
if( n == 0 )
|
||||
return VECTOR2I( pad->GetPosition() );
|
||||
|
@ -197,7 +197,7 @@ void CN_ITEM::RemoveInvalidRefs()
|
|||
}
|
||||
|
||||
|
||||
CN_ITEM* CN_LIST::Add( D_PAD* pad )
|
||||
CN_ITEM* CN_LIST::Add( PAD* pad )
|
||||
{
|
||||
if( !pad->IsOnCopperLayer() )
|
||||
return nullptr;
|
||||
|
|
|
@ -503,7 +503,7 @@ public:
|
|||
return m_items.size();
|
||||
}
|
||||
|
||||
CN_ITEM* Add( D_PAD* pad );
|
||||
CN_ITEM* Add( PAD* pad );
|
||||
|
||||
CN_ITEM* Add( TRACK* track );
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo
|
|||
const KICAD_T onlyRouting[] = { PCB_PAD_T, PCB_ARC_T, PCB_VIA_T, PCB_TRACE_T, EOT };
|
||||
|
||||
auto padCandidates = connectivity->GetConnectedItems( path.from, onlyRouting );
|
||||
D_PAD* toPad = nullptr;
|
||||
PAD* toPad = nullptr;
|
||||
|
||||
for( auto pitem : padCandidates )
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo
|
|||
if( pitem->Type() != PCB_PAD_T )
|
||||
continue;
|
||||
|
||||
D_PAD *pad = static_cast<D_PAD*>( pitem );
|
||||
PAD *pad = static_cast<PAD*>( pitem );
|
||||
|
||||
wxString toName = pad->GetParent()->GetReference() + "-" + pad->GetName();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <set>
|
||||
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class BOARD_CONNECTED_ITEM;
|
||||
|
||||
class FROM_TO_CACHE
|
||||
|
@ -32,17 +32,17 @@ public:
|
|||
struct FT_ENDPOINT
|
||||
{
|
||||
wxString name;
|
||||
D_PAD* parent;
|
||||
PAD* parent;
|
||||
};
|
||||
|
||||
struct FT_PATH
|
||||
{
|
||||
int net;
|
||||
D_PAD *from;
|
||||
D_PAD *to;
|
||||
PAD* from;
|
||||
PAD* to;
|
||||
wxString fromName, toName;
|
||||
wxString fromWildcard, toWildcard;
|
||||
bool isUnique;
|
||||
bool isUnique;
|
||||
std::set<BOARD_CONNECTED_ITEM*> pathItems;
|
||||
};
|
||||
|
||||
|
|
|
@ -906,7 +906,7 @@ bool isCopperOutside( const MODULE* aMod, SHAPE_POLY_SET& aShape )
|
|||
{
|
||||
bool padOutside = false;
|
||||
|
||||
for( D_PAD* pad : aMod->Pads() )
|
||||
for( PAD* pad : aMod->Pads() )
|
||||
{
|
||||
SHAPE_POLY_SET poly = aShape;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
int netcode = -1;
|
||||
bool multiHighlight = false;
|
||||
MODULE* module = NULL;
|
||||
D_PAD* pad = NULL;
|
||||
PAD* pad = NULL;
|
||||
BOARD* pcb = GetBoard();
|
||||
|
||||
CROSS_PROBING_SETTINGS& crossProbingSettings = GetPcbNewSettings()->m_CrossProbing;
|
||||
|
@ -414,7 +414,7 @@ std::string FormatProbeItem( BOARD_ITEM* aItem )
|
|||
case PCB_PAD_T:
|
||||
{
|
||||
module = (MODULE*) aItem->GetParent();
|
||||
wxString pad = ((D_PAD*)aItem)->GetName();
|
||||
wxString pad = static_cast<PAD*>( aItem )->GetName();
|
||||
|
||||
return StrPrintf( "$PART: \"%s\" $PAD: \"%s\"",
|
||||
TO_UTF8( module->GetReference() ),
|
||||
|
@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
COMPONENT* component = new COMPONENT( module->GetFPID(), module->GetReference(),
|
||||
module->GetValue(), module->GetPath() );
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
const wxString& netname = pad->GetShortNetname();
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
|
|||
}
|
||||
}
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
// Go through pads types list
|
||||
for( auto& type : m_padsTypes )
|
||||
|
|
|
@ -488,9 +488,9 @@ void PCB_EDIT_FRAME::ExchangeFootprint( MODULE* aExisting, MODULE* aNew, BOARD_C
|
|||
|
||||
aNew->SetLocked( aExisting->IsLocked() );
|
||||
|
||||
for( D_PAD* pad : aNew->Pads() )
|
||||
for( PAD* pad : aNew->Pads() )
|
||||
{
|
||||
D_PAD* oldPad = aExisting->FindPadByName( pad->GetName() );
|
||||
PAD* oldPad = aExisting->FindPadByName( pad->GetName() );
|
||||
|
||||
if( oldPad )
|
||||
{
|
||||
|
|
|
@ -141,7 +141,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
|
|||
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( pad->GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
|
||||
{
|
||||
|
|
|
@ -1156,7 +1156,7 @@ void DIALOG_NET_INSPECTOR::OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardIt
|
|||
}
|
||||
else if( MODULE* footprint = dynamic_cast<MODULE*>( aBoardItem ) )
|
||||
{
|
||||
for( const D_PAD* pad : footprint->Pads() )
|
||||
for( const PAD* pad : footprint->Pads() )
|
||||
{
|
||||
OPT<LIST_ITEM_ITER> r = m_data_model->findItem( pad->GetNet() );
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ void DIALOG_NET_INSPECTOR::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoard
|
|||
}
|
||||
else if( MODULE* footprint = dynamic_cast<MODULE*>( aBoardItem ) )
|
||||
{
|
||||
for( const D_PAD* pad : footprint->Pads() )
|
||||
for( const PAD* pad : footprint->Pads() )
|
||||
{
|
||||
OPT<LIST_ITEM_ITER> r = m_data_model->findItem( pad->GetNet() );
|
||||
|
||||
|
@ -1376,7 +1376,7 @@ std::unique_ptr<DIALOG_NET_INSPECTOR::LIST_ITEM> DIALOG_NET_INSPECTOR::buildNewI
|
|||
BOARD_CONNECTED_ITEM* item = ( *i )->Parent();
|
||||
|
||||
if( item->Type() == PCB_PAD_T )
|
||||
new_item->AddChipWireLength( static_cast<D_PAD*>( item )->GetPadToDieLength() );
|
||||
new_item->AddChipWireLength( static_cast<PAD*>( item )->GetPadToDieLength() );
|
||||
|
||||
else if( TRACK* track = dynamic_cast<TRACK*>( item ) )
|
||||
{
|
||||
|
@ -1473,7 +1473,7 @@ void DIALOG_NET_INSPECTOR::buildNetsList()
|
|||
|
||||
for( MODULE* footprint : m_brd->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
auto i = std::lower_bound( nets.begin(), nets.end(), pad->GetNetCode(),
|
||||
NET_INFO_CMP_LESS() );
|
||||
|
|
|
@ -93,7 +93,7 @@ static PAD_ATTR_T code_type[] =
|
|||
#define NPTH_DLG_TYPE 3
|
||||
#define APERTURE_DLG_TYPE 4
|
||||
|
||||
void PCB_BASE_FRAME::ShowPadPropertiesDialog( D_PAD* aPad )
|
||||
void PCB_BASE_FRAME::ShowPadPropertiesDialog( PAD* aPad )
|
||||
{
|
||||
DIALOG_PAD_PROPERTIES dlg( this, aPad );
|
||||
|
||||
|
@ -112,7 +112,7 @@ void PCB_BASE_FRAME::ShowPadPropertiesDialog( D_PAD* aPad )
|
|||
}
|
||||
|
||||
|
||||
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ) :
|
||||
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad ) :
|
||||
DIALOG_PAD_PROPERTIES_BASE( aParent ),
|
||||
m_parent( aParent ),
|
||||
m_canUpdate( false ),
|
||||
|
@ -156,7 +156,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP
|
|||
m_nonCopperWarningIcon->SetBitmap( KiBitmap( dialog_warning_xpm ) );
|
||||
|
||||
m_padMaster = &m_parent->GetDesignSettings().m_Pad_Master;
|
||||
m_dummyPad = new D_PAD( (MODULE*) NULL );
|
||||
m_dummyPad = new PAD((MODULE*) NULL );
|
||||
|
||||
if( aPad )
|
||||
{
|
||||
|
@ -1073,7 +1073,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un
|
|||
{
|
||||
case PTH_DLG_TYPE:
|
||||
if( !layer_mask.any() )
|
||||
layer_mask = D_PAD::PTHMask();
|
||||
layer_mask = PAD::PTHMask();
|
||||
|
||||
if( !( layer_mask & LSET::AllCuMask() ).any() )
|
||||
m_rbCopperLayersSel->SetSelection( 3 );
|
||||
|
@ -1088,7 +1088,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un
|
|||
|
||||
case SMD_DLG_TYPE:
|
||||
if( !layer_mask.any() )
|
||||
layer_mask = D_PAD::SMDMask();
|
||||
layer_mask = PAD::SMDMask();
|
||||
|
||||
if( layer_mask.test( F_Cu ) )
|
||||
m_rbCopperLayersSel->SetSelection( 0 );
|
||||
|
@ -1099,7 +1099,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un
|
|||
|
||||
case CONN_DLG_TYPE:
|
||||
if( !layer_mask.any() )
|
||||
layer_mask = D_PAD::ConnSMDMask();
|
||||
layer_mask = PAD::ConnSMDMask();
|
||||
|
||||
if( layer_mask.test( F_Cu ) )
|
||||
m_rbCopperLayersSel->SetSelection( 0 );
|
||||
|
@ -1110,7 +1110,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un
|
|||
|
||||
case NPTH_DLG_TYPE:
|
||||
if( !layer_mask.any() )
|
||||
layer_mask = D_PAD::UnplatedHoleMask();
|
||||
layer_mask = PAD::UnplatedHoleMask();
|
||||
|
||||
if( layer_mask.test( F_Cu ) && layer_mask.test( B_Cu ) )
|
||||
m_rbCopperLayersSel->SetSelection( 0 );
|
||||
|
@ -1125,7 +1125,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un
|
|||
|
||||
case APERTURE_DLG_TYPE:
|
||||
if( !layer_mask.any() )
|
||||
layer_mask = D_PAD::ApertureMask();
|
||||
layer_mask = PAD::ApertureMask();
|
||||
|
||||
m_rbCopperLayersSel->SetSelection( 0 );
|
||||
break;
|
||||
|
@ -1635,7 +1635,7 @@ PAD_PROP_T DIALOG_PAD_PROPERTIES::getSelectedProperty()
|
|||
}
|
||||
|
||||
|
||||
bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad )
|
||||
bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -47,14 +47,14 @@
|
|||
class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad );
|
||||
DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad );
|
||||
~DIALOG_PAD_PROPERTIES();
|
||||
|
||||
private:
|
||||
PCB_BASE_FRAME* m_parent;
|
||||
D_PAD* m_currentPad; // pad currently being edited
|
||||
D_PAD* m_dummyPad; // a working copy used to show changes
|
||||
D_PAD* m_padMaster; // pad used to create new pads in board or footprint editor
|
||||
PAD* m_currentPad; // pad currently being edited
|
||||
PAD* m_dummyPad; // a working copy used to show changes
|
||||
PAD* m_padMaster; // pad used to create new pads in board or footprint editor
|
||||
BOARD* m_board; // the main board: this is the board handled by the PCB
|
||||
// editor or the dummy board used by the footprint editor
|
||||
bool m_isFlipped; // indicates the parent footprint is flipped (mirrored) in
|
||||
|
@ -104,7 +104,7 @@ private:
|
|||
void updatePadLayersList( LSET layer_mask, bool remove_unconnected, bool keep_top_bottom );
|
||||
|
||||
/// Copy values from dialog field to aPad's members
|
||||
bool transferDataToPad( D_PAD* aPad );
|
||||
bool transferDataToPad( PAD* aPad );
|
||||
|
||||
bool Show( bool aShow ) override;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <dialog_push_pad_properties_base.h>
|
||||
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class PCB_BASE_FRAME;
|
||||
/************************************/
|
||||
/* class DIALOG_PUSH_PAD_PROPERTIES */
|
||||
|
|
|
@ -319,13 +319,13 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
}
|
||||
|
||||
|
||||
bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& changingPads )
|
||||
bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<PAD*>& changingPads )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
if( changingPads.size() == 1 )
|
||||
{
|
||||
D_PAD* pad = *changingPads.begin();
|
||||
PAD* pad = *changingPads.begin();
|
||||
msg.Printf( _( "This will change the net assigned to %s pad %s to %s.\n"
|
||||
"Do you wish to continue?" ),
|
||||
pad->GetParent()->GetReference(),
|
||||
|
@ -334,8 +334,8 @@ bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<D_PAD*>& c
|
|||
}
|
||||
else if( changingPads.size() == 2 )
|
||||
{
|
||||
D_PAD* pad1 = *changingPads.begin();
|
||||
D_PAD* pad2 = *( ++changingPads.begin() );
|
||||
PAD* pad1 = *changingPads.begin();
|
||||
PAD* pad2 = *( ++changingPads.begin() );
|
||||
msg.Printf( _( "This will change the net assigned to %s pad %s and %s pad %s to %s.\n"
|
||||
"Do you wish to continue?" ),
|
||||
pad1->GetParent()->GetReference(),
|
||||
|
@ -364,26 +364,25 @@ bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow()
|
|||
{
|
||||
auto connectivity = m_frame->GetBoard()->GetConnectivity();
|
||||
int newNetCode = m_netSelector->GetSelectedNetcode();
|
||||
std::vector<D_PAD*> changingPads;
|
||||
std::vector<PAD*> changingPads;
|
||||
|
||||
if ( !m_netSelector->IsIndeterminate() )
|
||||
{
|
||||
std::set<D_PAD*> connectedPads;
|
||||
std::set<PAD*> connectedPads;
|
||||
|
||||
for( auto& item : m_items )
|
||||
for( EDA_ITEM* item : m_items )
|
||||
{
|
||||
const KICAD_T ourTypes[] = { PCB_TRACE_T, PCB_PAD_T, PCB_VIA_T, PCB_MODULE_T, EOT };
|
||||
auto connectedItems = connectivity->GetConnectedItems( static_cast<BOARD_CONNECTED_ITEM*>( item ), ourTypes, true );
|
||||
for ( auto citem : connectedItems )
|
||||
|
||||
for ( BOARD_CONNECTED_ITEM* citem : connectedItems )
|
||||
{
|
||||
if( citem->Type() == PCB_PAD_T )
|
||||
{
|
||||
connectedPads.insert( static_cast<D_PAD*>( citem ) );
|
||||
}
|
||||
connectedPads.insert( static_cast<PAD*>( citem ) );
|
||||
}
|
||||
}
|
||||
|
||||
for( D_PAD* pad : connectedPads )
|
||||
for( PAD* pad : connectedPads )
|
||||
{
|
||||
if( pad->GetNetCode() != newNetCode )
|
||||
changingPads.push_back( pad );
|
||||
|
@ -563,7 +562,7 @@ bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow()
|
|||
// Commit::Push() will rebuild connectivitiy propagating nets from connected pads
|
||||
// outwards. We therefore have to update the connected pads in order for the net
|
||||
// change to "stick".
|
||||
for( D_PAD* pad : changingPads )
|
||||
for( PAD* pad : changingPads )
|
||||
{
|
||||
m_commit.Modify( pad );
|
||||
pad->SetNetCode( m_netSelector->GetSelectedNetcode() );
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
class PCBNEW_SELECTION;
|
||||
class COMMIT;
|
||||
class PCB_BASE_FRAME;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
|
||||
class DIALOG_TRACK_VIA_PROPERTIES : public DIALOG_TRACK_VIA_PROPERTIES_BASE
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ private:
|
|||
void onViaSelect( wxCommandEvent& aEvent ) override;
|
||||
void onViaEdit( wxCommandEvent& aEvent ) override;
|
||||
|
||||
bool confirmPadChange( const std::vector<D_PAD*>& connectedPads );
|
||||
bool confirmPadChange( const std::vector<PAD*>& connectedPads );
|
||||
|
||||
PCB_BASE_FRAME* m_frame;
|
||||
const PCBNEW_SELECTION& m_items; // List of items to be modified.
|
||||
|
|
|
@ -114,7 +114,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow()
|
|||
|
||||
if( item->Type() == PCB_PAD_T && m_rbScope->GetSelection() == SCOPE_PADS )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>( item );
|
||||
PAD* pad = static_cast<PAD*>( item );
|
||||
|
||||
pad->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE );
|
||||
pad->SetKeepTopBottom( m_cbPreservePads->IsChecked() );
|
||||
|
|
|
@ -699,7 +699,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRulesForItems( DRC_CONSTRAINT_TYPE_T aConstraintI
|
|||
// whether or not there's a flashed pad. Not true for NPTHs.
|
||||
if( a->Type() == PCB_PAD_T )
|
||||
{
|
||||
const D_PAD* pad = static_cast<const D_PAD*>( a );
|
||||
const PAD* pad = static_cast<const PAD*>( a );
|
||||
|
||||
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( aLayer ) )
|
||||
aConstraintId = HOLE_CLEARANCE_CONSTRAINT;
|
||||
|
|
|
@ -251,7 +251,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
|
|||
|
||||
if( typeMask[ PCB_PAD_T ] )
|
||||
{
|
||||
for( D_PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : mod->Pads() )
|
||||
{
|
||||
if( ( pad->GetLayerSet() & aLayers ).any() )
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
|
||||
void testTrackClearances();
|
||||
|
||||
bool testPadAgainstItem( D_PAD* pad, SHAPE* padShape, PCB_LAYER_ID layer, BOARD_ITEM* other );
|
||||
bool testPadAgainstItem( PAD* pad, SHAPE* padShape, PCB_LAYER_ID layer, BOARD_ITEM* other );
|
||||
|
||||
void testPadClearances();
|
||||
|
||||
|
@ -226,9 +226,9 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
|
|||
|
||||
static std::shared_ptr<SHAPE> getShape( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer )
|
||||
{
|
||||
if( aItem->Type() == PCB_PAD_T && !static_cast<D_PAD*>( aItem )->FlashLayer( aLayer ) )
|
||||
if( aItem->Type() == PCB_PAD_T && !static_cast<PAD*>( aItem )->FlashLayer( aLayer ) )
|
||||
{
|
||||
D_PAD* aPad = static_cast<D_PAD*>( aItem );
|
||||
PAD* aPad = static_cast<PAD*>( aItem );
|
||||
|
||||
if( aPad->GetAttribute() == PAD_ATTRIB_PTH )
|
||||
{
|
||||
|
@ -397,7 +397,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
|
|||
}
|
||||
|
||||
|
||||
bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( D_PAD* pad, SHAPE* padShape,
|
||||
bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* padShape,
|
||||
PCB_LAYER_ID layer,
|
||||
BOARD_ITEM* other )
|
||||
{
|
||||
|
@ -420,7 +420,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( D_PAD* pad, SHAPE*
|
|||
|
||||
if( other->Type() == PCB_PAD_T )
|
||||
{
|
||||
auto otherPad = static_cast<D_PAD*>( other );
|
||||
auto otherPad = static_cast<PAD*>( other );
|
||||
|
||||
// If pads are equivalent (ie: from the same footprint with the same pad number)...
|
||||
if( pad->SameLogicalPadAs( otherPad ) )
|
||||
|
@ -522,7 +522,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
|
|||
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( !reportProgress( ii++, count, delta ) )
|
||||
break;
|
||||
|
|
|
@ -85,7 +85,7 @@ static std::shared_ptr<SHAPE_CIRCLE> getDrilledHoleShape( BOARD_ITEM* aItem )
|
|||
}
|
||||
else if( aItem->Type() == PCB_PAD_T )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>( aItem );
|
||||
PAD* pad = static_cast<PAD*>( aItem );
|
||||
return std::make_shared<SHAPE_CIRCLE>( pad->GetPosition(), pad->GetDrillSize().x / 2 );
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run()
|
|||
|
||||
if( item->Type() == PCB_PAD_T )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>( item );
|
||||
PAD* pad = static_cast<PAD*>( item );
|
||||
|
||||
// Check for round hole
|
||||
if( pad->GetDrillSize().x && pad->GetDrillSize().x == pad->GetDrillSize().y )
|
||||
|
@ -198,7 +198,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run()
|
|||
|
||||
for( MODULE* footprint : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( !reportProgress( ii++, count, delta ) )
|
||||
break;
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
private:
|
||||
void checkVia( VIA* via, bool aExceedMicro, bool aExceedStd );
|
||||
void checkPad( D_PAD* aPad );
|
||||
void checkPad( PAD* aPad );
|
||||
|
||||
BOARD* m_board;
|
||||
};
|
||||
|
@ -86,7 +86,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
|
|||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_TOO_SMALL_DRILL ) )
|
||||
break;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_TOO_SMALL_DRILL ) )
|
||||
break;
|
||||
|
@ -124,7 +124,7 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run()
|
|||
}
|
||||
|
||||
|
||||
void DRC_TEST_PROVIDER_HOLE_SIZE::checkPad( D_PAD* aPad )
|
||||
void DRC_TEST_PROVIDER_HOLE_SIZE::checkPad( PAD* aPad )
|
||||
{
|
||||
int holeSize = std::min( aPad->GetDrillSize().x, aPad->GetDrillSize().y );
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist )
|
|||
}
|
||||
else
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_NET_CONFLICT ) )
|
||||
break;
|
||||
|
|
|
@ -295,11 +295,11 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode )
|
|||
ent.viaCount++;
|
||||
ent.totalVia += computeViaThruLength( via, nitem.second ); // fixme: via thru distance
|
||||
}
|
||||
else if ( auto trk = dyn_cast<TRACK*>(citem ))
|
||||
else if ( TRACK* trk = dyn_cast<TRACK*>(citem ))
|
||||
{
|
||||
ent.totalRoute += trk->GetLength();
|
||||
}
|
||||
else if ( auto pad = dyn_cast<D_PAD*>( citem ))
|
||||
else if ( PAD* pad = dyn_cast<PAD*>( citem ))
|
||||
{
|
||||
ent.totalPadToDie += pad->GetPadToDieLength();
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
ShowPadPropertiesDialog( static_cast<D_PAD*>( aItem ) );
|
||||
ShowPadPropertiesDialog( static_cast<PAD*>( aItem ) );
|
||||
break;
|
||||
|
||||
case PCB_MODULE_T:
|
||||
|
|
|
@ -355,18 +355,18 @@ std::string PLACE_FILE_EXPORTER::GenReportData()
|
|||
else
|
||||
buffer += "layer other\n";
|
||||
|
||||
std::vector<D_PAD*> sortedPads;
|
||||
std::vector<PAD*> sortedPads;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
sortedPads.push_back( pad );
|
||||
|
||||
std::sort( sortedPads.begin(), sortedPads.end(),
|
||||
[]( D_PAD* a, D_PAD* b ) -> bool
|
||||
[]( PAD* a, PAD* b ) -> bool
|
||||
{
|
||||
return StrNumCmp( a->GetName(), b->GetName(), true ) < 0;
|
||||
});
|
||||
|
||||
for( D_PAD* pad : sortedPads )
|
||||
for( PAD* pad : sortedPads )
|
||||
{
|
||||
sprintf( line, "$PAD \"%s\"\n", TO_UTF8( pad->GetName() ) );
|
||||
buffer += line;
|
||||
|
|
|
@ -354,9 +354,9 @@ static void CreateArtworksSection( FILE* aFile )
|
|||
// Via name is synthesized from their attributes, pads are numbered
|
||||
static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
|
||||
{
|
||||
std::vector<D_PAD*> padstacks;
|
||||
std::vector<VIA*> vias;
|
||||
std::vector<VIA*> viastacks;
|
||||
std::vector<PAD*> padstacks;
|
||||
std::vector<VIA*> vias;
|
||||
std::vector<VIA*> viastacks;
|
||||
|
||||
padstacks.resize( 1 ); // We count pads from 1
|
||||
|
||||
|
@ -368,10 +368,10 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
|
||||
// Enumerate and sort the pads
|
||||
|
||||
std::vector<D_PAD*> pads = aPcb->GetPads();
|
||||
std::sort( pads.begin(), pads.end(), []( const D_PAD* a, const D_PAD* b )
|
||||
std::vector<PAD*> pads = aPcb->GetPads();
|
||||
std::sort( pads.begin(), pads.end(), []( const PAD* a, const PAD* b )
|
||||
{
|
||||
return D_PAD::Compare( a, b ) < 0;
|
||||
return PAD::Compare( a, b ) < 0;
|
||||
} );
|
||||
|
||||
|
||||
|
@ -402,17 +402,17 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
}
|
||||
|
||||
// Emit component pads
|
||||
D_PAD* old_pad = 0;
|
||||
int pad_name_number = 0;
|
||||
PAD* old_pad = 0;
|
||||
int pad_name_number = 0;
|
||||
|
||||
for( unsigned i = 0; i<pads.size(); ++i )
|
||||
{
|
||||
D_PAD* pad = pads[i];
|
||||
PAD* pad = pads[i];
|
||||
const wxPoint& off = pad->GetOffset();
|
||||
|
||||
pad->SetSubRatsnest( pad_name_number );
|
||||
|
||||
if( old_pad && 0==D_PAD::Compare( old_pad, pad ) )
|
||||
if( old_pad && 0 == PAD::Compare( old_pad, pad ) )
|
||||
continue; // already created
|
||||
|
||||
old_pad = pad;
|
||||
|
@ -629,7 +629,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
* until it appears yet another noncompliant importer */
|
||||
for( unsigned i = 1; i < padstacks.size(); i++ )
|
||||
{
|
||||
D_PAD* pad = padstacks[i];
|
||||
PAD* pad = padstacks[i];
|
||||
|
||||
// Straight padstack
|
||||
fprintf( aFile, "PADSTACK PAD%u %g\n", i, pad->GetDrillSize().x / SCALE_FACTOR );
|
||||
|
@ -750,7 +750,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb )
|
|||
// set of already emitted pins to check for duplicates
|
||||
std::set<wxString> pins;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
/* Padstacks are defined using the correct layers for the pads, therefore to
|
||||
* all pads need to be marked as TOP to use the padstack information correctly.
|
||||
|
@ -900,7 +900,7 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
|
|||
|
||||
for( MODULE* module : aPcb->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
if( pad->GetNetCode() != net->GetNet() )
|
||||
continue;
|
||||
|
|
|
@ -49,7 +49,7 @@ class HYPERLYNX_PAD_STACK
|
|||
public:
|
||||
friend class HYPERLYNX_EXPORTER;
|
||||
|
||||
HYPERLYNX_PAD_STACK( BOARD* aBoard, const D_PAD* aPad );
|
||||
HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad );
|
||||
HYPERLYNX_PAD_STACK( BOARD* aBoard, const VIA* aVia );
|
||||
~HYPERLYNX_PAD_STACK(){};
|
||||
|
||||
|
@ -222,7 +222,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const D_PAD* aPad )
|
||||
HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad )
|
||||
{
|
||||
m_board = aBoard;
|
||||
m_sx = aPad->GetSize().x;
|
||||
|
@ -404,7 +404,7 @@ bool HYPERLYNX_EXPORTER::writePadStacks()
|
|||
{
|
||||
for( MODULE* mod : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : mod->Pads() )
|
||||
{
|
||||
HYPERLYNX_PAD_STACK* ps = addPadStack( HYPERLYNX_PAD_STACK( m_board, pad ) );
|
||||
m_padMap[pad] = ps;
|
||||
|
@ -431,7 +431,7 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
|
|||
{
|
||||
for( BOARD_ITEM* item : aObjects )
|
||||
{
|
||||
if( D_PAD* pad = dyn_cast<D_PAD*>( item ) )
|
||||
if( PAD* pad = dyn_cast<PAD*>( item ) )
|
||||
{
|
||||
auto pstackIter = m_padMap.find( pad );
|
||||
|
||||
|
@ -548,7 +548,7 @@ const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcod
|
|||
|
||||
for( MODULE* mod : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : mod->Pads() )
|
||||
{
|
||||
if( check( pad ) )
|
||||
rv.push_back( pad );
|
||||
|
|
|
@ -1110,7 +1110,7 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, FP_SHAPE* aOutline, MOD
|
|||
}
|
||||
|
||||
|
||||
static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_PAD* aPad )
|
||||
static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, PAD* aPad )
|
||||
{
|
||||
// The (maybe offset) pad position
|
||||
wxPoint pad_pos = aPad->ShapePos();
|
||||
|
@ -1243,7 +1243,7 @@ static void export_vrml_padshape( MODEL_VRML& aModel, VRML_LAYER* aTinLayer, D_P
|
|||
}
|
||||
|
||||
|
||||
static void export_vrml_pad( MODEL_VRML& aModel, BOARD* aPcb, D_PAD* aPad )
|
||||
static void export_vrml_pad( MODEL_VRML& aModel, BOARD* aPcb, PAD* aPad )
|
||||
{
|
||||
double hole_drill_w = (double) aPad->GetDrillSize().x * BOARD_SCALE / 2.0;
|
||||
double hole_drill_h = (double) aPad->GetDrillSize().y * BOARD_SCALE / 2.0;
|
||||
|
@ -1394,7 +1394,7 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
|
|||
}
|
||||
|
||||
// Export pads
|
||||
for( D_PAD* pad : aModule->Pads() )
|
||||
for( PAD* pad : aModule->Pads() )
|
||||
export_vrml_pad( aModel, aPcb, pad );
|
||||
|
||||
bool isFlipped = aModule->GetLayer() == B_Cu;
|
||||
|
|
|
@ -45,8 +45,8 @@ static bool CmpHoleSorting( const HOLE_INFO& a, const HOLE_INFO& b )
|
|||
return a.m_Hole_Diameter < b.m_Hole_Diameter;
|
||||
|
||||
// group by components when possible
|
||||
const D_PAD* pada = dyn_cast<const D_PAD*>( a.m_ItemParent );
|
||||
const D_PAD* padb = dyn_cast<const D_PAD*>( b.m_ItemParent );
|
||||
const PAD* pada = dyn_cast<const PAD*>( a.m_ItemParent );
|
||||
const PAD* padb = dyn_cast<const PAD*>( b.m_ItemParent );
|
||||
|
||||
if( pada && padb )
|
||||
{
|
||||
|
|
|
@ -183,10 +183,10 @@ int GERBER_WRITER::createDrillFile( wxString& aFullFilename, bool aIsNpth,
|
|||
|
||||
last_item_is_via = true;
|
||||
}
|
||||
else if( dyn_cast<const D_PAD*>( hole_descr.m_ItemParent ) )
|
||||
else if( dyn_cast<const PAD*>( hole_descr.m_ItemParent ) )
|
||||
{
|
||||
last_item_is_via = false;
|
||||
const D_PAD* pad = dyn_cast<const D_PAD*>( hole_descr.m_ItemParent );
|
||||
const PAD* pad = dyn_cast<const PAD*>( hole_descr.m_ItemParent );
|
||||
|
||||
if( pad->GetProperty() == PAD_PROP_CASTELLATED )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDDRILL );
|
||||
|
|
|
@ -466,7 +466,7 @@ void GERBER_JOBFILE_WRITER::addJSONDesignRules()
|
|||
|
||||
for( MODULE* module : m_pcb->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
for( PCB_LAYER_ID layer : pad->GetLayerSet().Seq() )
|
||||
{
|
||||
|
|
|
@ -222,13 +222,13 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness, &gbr_metadata );
|
||||
}
|
||||
|
||||
std::vector<D_PAD*>pad_key_list;
|
||||
std::vector<PAD*>pad_key_list;
|
||||
|
||||
if( m_plotPad1Marker )
|
||||
{
|
||||
findPads1( pad_key_list, footprint );
|
||||
|
||||
for( D_PAD* pad1 : pad_key_list )
|
||||
for( PAD* pad1 : pad_key_list )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POSITION );
|
||||
|
@ -253,11 +253,11 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PADOTHER_POSITION );
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
|
||||
|
||||
for( D_PAD* pad: footprint->Pads() )
|
||||
for( PAD* pad: footprint->Pads() )
|
||||
{
|
||||
bool skip_pad = false;
|
||||
|
||||
for( D_PAD* pad1 : pad_key_list )
|
||||
for( PAD* pad1 : pad_key_list )
|
||||
{
|
||||
if( pad == pad1 ) // Already plotted
|
||||
{
|
||||
|
@ -324,13 +324,13 @@ double PLACEFILE_GERBER_WRITER::mapRotationAngle( double aAngle )
|
|||
}
|
||||
|
||||
|
||||
void PLACEFILE_GERBER_WRITER::findPads1( std::vector<D_PAD*>& aPadList, MODULE* aFootprint ) const
|
||||
void PLACEFILE_GERBER_WRITER::findPads1( std::vector<PAD*>& aPadList, MODULE* aFootprint ) const
|
||||
{
|
||||
// Fint the pad "1" or pad "A1"
|
||||
// this is possible only if only one pad is found
|
||||
// Usefull to place a marker in this position
|
||||
|
||||
for( D_PAD* pad : aFootprint->Pads() )
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
{
|
||||
if( !pad->IsOnLayer( m_layer ) )
|
||||
continue;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
class BOARD;
|
||||
class MODULE;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
|
||||
/**
|
||||
* PLACEFILE_GERBER_WRITER is a class mainly used to create Gerber drill files
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
* @param aPadList is the list to fill
|
||||
* @param aFootprint is the footprint to test
|
||||
*/
|
||||
void findPads1( std::vector<D_PAD*>& aPadList, MODULE* aFootprint ) const;
|
||||
void findPads1( std::vector<PAD*>& aPadList, MODULE* aFootprint ) const;
|
||||
};
|
||||
|
||||
#endif // #ifndef PLACEFILE_GERBER_WRITER_H
|
||||
|
|
|
@ -1117,7 +1117,7 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
|||
|
||||
|
||||
// Store net names for all pads, to create net remap information
|
||||
std::unordered_map<D_PAD*, wxString> netMap;
|
||||
std::unordered_map<PAD*, wxString> netMap;
|
||||
|
||||
for( const auto& pad : GetBoard()->GetPads() )
|
||||
{
|
||||
|
|
|
@ -99,9 +99,9 @@ MODULE::MODULE( const MODULE& aFootprint ) :
|
|||
std::map<BOARD_ITEM*, BOARD_ITEM*> ptrMap;
|
||||
|
||||
// Copy pads
|
||||
for( D_PAD* pad : aFootprint.Pads() )
|
||||
for( PAD* pad : aFootprint.Pads() )
|
||||
{
|
||||
D_PAD* newPad = static_cast<D_PAD*>( pad->Clone() );
|
||||
PAD* newPad = static_cast<PAD*>( pad->Clone() );
|
||||
ptrMap[ pad ] = newPad;
|
||||
Add( newPad );
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ MODULE::~MODULE()
|
|||
delete m_Value;
|
||||
delete m_initial_comments;
|
||||
|
||||
for( D_PAD* p : m_pads )
|
||||
for( PAD* p : m_pads )
|
||||
delete p;
|
||||
|
||||
m_pads.clear();
|
||||
|
@ -234,7 +234,7 @@ MODULE& MODULE::operator=( MODULE&& aOther )
|
|||
// Move the pads
|
||||
m_pads.clear();
|
||||
|
||||
for( D_PAD* pad : aOther.Pads() )
|
||||
for( PAD* pad : aOther.Pads() )
|
||||
Add( pad );
|
||||
|
||||
aOther.Pads().clear();
|
||||
|
@ -330,9 +330,9 @@ MODULE& MODULE::operator=( const MODULE& aOther )
|
|||
// Copy pads
|
||||
m_pads.clear();
|
||||
|
||||
for( D_PAD* pad : aOther.Pads() )
|
||||
for( PAD* pad : aOther.Pads() )
|
||||
{
|
||||
D_PAD* newPad = new D_PAD( *pad );
|
||||
PAD* newPad = new PAD( *pad );
|
||||
ptrMap[ pad ] = newPad;
|
||||
Add( newPad );
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ void MODULE::ClearAllNets()
|
|||
{
|
||||
// Force the ORPHANED dummy net info for all pads.
|
||||
// ORPHANED dummy net does not depend on a board
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
pad->SetNetCode( NETINFO_LIST::ORPHANED );
|
||||
}
|
||||
|
||||
|
@ -456,9 +456,9 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
|||
|
||||
case PCB_PAD_T:
|
||||
if( aMode == ADD_MODE::APPEND )
|
||||
m_pads.push_back( static_cast<D_PAD*>( aBoardItem ) );
|
||||
m_pads.push_back( static_cast<PAD*>( aBoardItem ) );
|
||||
else
|
||||
m_pads.push_front( static_cast<D_PAD*>( aBoardItem ) );
|
||||
m_pads.push_front( static_cast<PAD*>( aBoardItem ) );
|
||||
break;
|
||||
|
||||
case PCB_FP_ZONE_T:
|
||||
|
@ -517,7 +517,7 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
|
|||
case PCB_PAD_T:
|
||||
for( auto it = m_pads.begin(); it != m_pads.end(); ++it )
|
||||
{
|
||||
if( *it == static_cast<D_PAD*>( aBoardItem ) )
|
||||
if( *it == static_cast<PAD*>( aBoardItem ) )
|
||||
{
|
||||
m_pads.erase( it );
|
||||
break;
|
||||
|
@ -589,7 +589,7 @@ EDA_RECT MODULE::GetFootprintRect() const
|
|||
area.Merge( item->GetBoundingBox() );
|
||||
}
|
||||
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
area.Merge( pad->GetBoundingBox() );
|
||||
|
||||
for( FP_ZONE* zone : m_fp_zones )
|
||||
|
@ -617,7 +617,7 @@ EDA_RECT MODULE::GetFpPadsLocalBbox() const
|
|||
if( dummy.GetOrientation() )
|
||||
dummy.SetOrientation( 0 );
|
||||
|
||||
for( D_PAD* pad : dummy.Pads() )
|
||||
for( PAD* pad : dummy.Pads() )
|
||||
area.Merge( pad->GetBoundingBox() );
|
||||
|
||||
return area;
|
||||
|
@ -817,7 +817,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
return false;
|
||||
|
||||
// Determine if any elements in the MODULE intersect the rect
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->HitTest( arect, false, 0 ) )
|
||||
return true;
|
||||
|
@ -843,9 +843,9 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
}
|
||||
|
||||
|
||||
D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
||||
PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
||||
{
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->GetName() == aPadName )
|
||||
return pad;
|
||||
|
@ -855,9 +855,9 @@ D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
|||
}
|
||||
|
||||
|
||||
D_PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
||||
PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
||||
{
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
// ... and on the correct layer.
|
||||
if( !( pad->GetLayerSet() & aLayerMask ).any() )
|
||||
|
@ -871,11 +871,11 @@ D_PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
|||
}
|
||||
|
||||
|
||||
D_PAD* MODULE::GetTopLeftPad()
|
||||
PAD* MODULE::GetTopLeftPad()
|
||||
{
|
||||
D_PAD* topLeftPad = GetFirstPad();
|
||||
PAD* topLeftPad = GetFirstPad();
|
||||
|
||||
for( D_PAD* p : m_pads )
|
||||
for( PAD* p : m_pads )
|
||||
{
|
||||
wxPoint pnt = p->GetPosition(); // GetPosition() returns the center of the pad
|
||||
|
||||
|
@ -897,7 +897,7 @@ unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
|
||||
unsigned cnt = 0;
|
||||
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->GetAttribute() == PAD_ATTRIB_NPTH )
|
||||
continue;
|
||||
|
@ -914,7 +914,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
std::set<wxString> usedNames;
|
||||
|
||||
// Create a set of used pad numbers
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
// Skip pads not on copper layers (used to build complex
|
||||
// solder paste shapes for instance)
|
||||
|
@ -978,7 +978,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
|
|||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
result = IterateForward<D_PAD*>( m_pads, inspector, testData, p );
|
||||
result = IterateForward<PAD*>( m_pads, inspector, testData, p );
|
||||
++p;
|
||||
break;
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ void MODULE::RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction )
|
|||
{
|
||||
try
|
||||
{
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
aFunction( static_cast<BOARD_ITEM*>( pad ) );
|
||||
|
||||
for( FP_ZONE* zone : m_fp_zones )
|
||||
|
@ -1098,7 +1098,7 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads
|
|||
|
||||
if( aIncludePads )
|
||||
{
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
int pad_layers[KIGFX::VIEW::VIEW_MAX_LAYERS], pad_layers_count;
|
||||
pad->ViewGetLayers( pad_layers, pad_layers_count );
|
||||
|
@ -1283,7 +1283,7 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
|||
NORMALIZE_ANGLE_180( m_Orient );
|
||||
|
||||
// Mirror pads to other side of board.
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
pad->Flip( m_Pos, false );
|
||||
|
||||
// Mirror zones to other side of board.
|
||||
|
@ -1330,7 +1330,7 @@ void MODULE::SetPosition( const wxPoint& aPos )
|
|||
m_Reference->EDA_TEXT::Offset( delta );
|
||||
m_Value->EDA_TEXT::Offset( delta );
|
||||
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
pad->SetPosition( pad->GetPosition() + delta );
|
||||
|
||||
for( ZONE* zone : m_fp_zones )
|
||||
|
@ -1386,7 +1386,7 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
|
|||
m_Value->SetDrawCoord();
|
||||
|
||||
// Update the pad local coordinates.
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
pad->SetPos0( pad->GetPos0() + moveVector );
|
||||
pad->SetDrawCoord();
|
||||
|
@ -1429,7 +1429,7 @@ void MODULE::SetOrientation( double aNewAngle )
|
|||
|
||||
m_Orient = aNewAngle;
|
||||
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
{
|
||||
pad->SetOrientation( pad->GetOrientation() + angleChange );
|
||||
pad->SetDrawCoord();
|
||||
|
@ -1482,7 +1482,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
|
|||
{
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
D_PAD* new_pad = new D_PAD( *static_cast<const D_PAD*>( aItem ) );
|
||||
PAD* new_pad = new PAD( *static_cast<const PAD*>( aItem ) );
|
||||
const_cast<KIID&>( new_pad->m_Uuid ) = KIID();
|
||||
|
||||
if( aAddToModule )
|
||||
|
@ -1563,7 +1563,7 @@ wxString MODULE::GetNextPadName( const wxString& aLastPadName ) const
|
|||
std::set<wxString> usedNames;
|
||||
|
||||
// Create a set of used pad numbers
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
usedNames.insert( pad->GetName() );
|
||||
|
||||
wxString prefix = UTIL::GetReferencePrefix( aLastPadName );
|
||||
|
@ -1624,7 +1624,7 @@ double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
|
|||
// build list of holes (covered areas not available for selection)
|
||||
SHAPE_POLY_SET holes;
|
||||
|
||||
for( D_PAD* pad : m_pads )
|
||||
for( PAD* pad : m_pads )
|
||||
addRect( holes, pad->GetBoundingBox() );
|
||||
|
||||
addRect( holes, m_Reference->GetBoundingBox() );
|
||||
|
@ -1681,7 +1681,7 @@ std::shared_ptr<SHAPE> MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
|||
|
||||
// We'll go with (2) for now....
|
||||
|
||||
for( D_PAD* pad : Pads() )
|
||||
for( PAD* pad : Pads() )
|
||||
shape->AddShape( pad->GetEffectiveShape( aLayer )->Clone() );
|
||||
|
||||
for( BOARD_ITEM* item : GraphicalItems() )
|
||||
|
@ -1752,7 +1752,7 @@ void MODULE::SwapData( BOARD_ITEM* aImage )
|
|||
|
||||
bool MODULE::HasThroughHolePads() const
|
||||
{
|
||||
for( D_PAD* pad : Pads() )
|
||||
for( PAD* pad : Pads() )
|
||||
{
|
||||
if( pad->GetAttribute() != PAD_ATTRIB_SMD )
|
||||
return true;
|
||||
|
@ -1786,7 +1786,7 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE
|
|||
}
|
||||
|
||||
|
||||
bool MODULE::cmp_pads::operator()( const D_PAD* aFirst, const D_PAD* aSecond ) const
|
||||
bool MODULE::cmp_pads::operator()( const PAD* aFirst, const PAD* aSecond ) const
|
||||
{
|
||||
if( aFirst->GetName() != aSecond->GetName() )
|
||||
return StrNumCmp( aFirst->GetName(), aSecond->GetName() ) < 0;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
class LINE_READER;
|
||||
class EDA_3D_CANVAS;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class BOARD;
|
||||
class MSG_PANEL_ITEM;
|
||||
class SHAPE;
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
bool m_Show; ///< Include module in rendering
|
||||
};
|
||||
|
||||
DECL_DEQ_FOR_SWIG( PADS, D_PAD* )
|
||||
DECL_DEQ_FOR_SWIG( PADS, PAD* )
|
||||
DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
|
||||
DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
|
||||
DECL_VEC_FOR_SWIG( MODULE_GROUPS, PCB_GROUP* )
|
||||
|
@ -481,12 +481,12 @@ public:
|
|||
|
||||
/**
|
||||
* Function FindPadByName
|
||||
* returns a D_PAD* with a matching name. Note that names may not be
|
||||
* returns a PAD* with a matching name. Note that names may not be
|
||||
* unique, depending on how the foot print was created.
|
||||
* @param aPadName the pad name to find
|
||||
* @return D_PAD* - The first matching name is returned, or NULL if not found.
|
||||
* @return PAD* - The first matching name is returned, or NULL if not found.
|
||||
*/
|
||||
D_PAD* FindPadByName( const wxString& aPadName ) const;
|
||||
PAD* FindPadByName( const wxString& aPadName ) const;
|
||||
|
||||
/**
|
||||
* Function GetPad
|
||||
|
@ -494,17 +494,17 @@ public:
|
|||
*
|
||||
* @param aPosition A wxPoint object containing the position to hit test.
|
||||
* @param aLayerMask A layer or layers to mask the hit test.
|
||||
* @return A pointer to a D_PAD object if found otherwise NULL.
|
||||
* @return A pointer to a PAD object if found otherwise NULL.
|
||||
*/
|
||||
D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
|
||||
PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
|
||||
|
||||
D_PAD* GetTopLeftPad();
|
||||
PAD* GetTopLeftPad();
|
||||
|
||||
/**
|
||||
* Gets the first pad in the list or NULL if none
|
||||
* @return first pad or null pointer
|
||||
*/
|
||||
D_PAD* GetFirstPad() const
|
||||
PAD* GetFirstPad() const
|
||||
{
|
||||
return m_pads.empty() ? nullptr : m_pads.front();
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ public:
|
|||
|
||||
struct cmp_pads
|
||||
{
|
||||
bool operator()( const D_PAD* aFirst, const D_PAD* aSecond ) const;
|
||||
bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -691,10 +691,10 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
|
||||
PADS m_pads; // D_PAD items, owned by pointer
|
||||
FP_ZONES m_fp_zones; // FP_ZONE items, owned by pointer
|
||||
MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
|
||||
DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
|
||||
PADS m_pads; // PAD items, owned by pointer
|
||||
FP_ZONES m_fp_zones; // FP_ZONE items, owned by pointer
|
||||
MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
|
||||
|
||||
double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees.
|
||||
wxPoint m_Pos; // Position of module on the board in internal units.
|
||||
|
|
|
@ -163,7 +163,8 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
{
|
||||
switch( aItem->Type() )
|
||||
{
|
||||
case PCB_PAD_T:ShowPadPropertiesDialog( static_cast<D_PAD*>( aItem ));
|
||||
case PCB_PAD_T:
|
||||
ShowPadPropertiesDialog( static_cast<PAD*>( aItem ));
|
||||
break;
|
||||
|
||||
case PCB_MODULE_T:
|
||||
|
@ -171,10 +172,12 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case PCB_FP_TEXT_T:ShowTextPropertiesDialog( aItem );
|
||||
case PCB_FP_TEXT_T:
|
||||
ShowTextPropertiesDialog( aItem );
|
||||
break;
|
||||
|
||||
case PCB_FP_SHAPE_T :ShowGraphicItemPropertiesDialog( aItem );
|
||||
case PCB_FP_SHAPE_T :
|
||||
ShowGraphicItemPropertiesDialog( aItem );
|
||||
break;
|
||||
|
||||
case PCB_FP_ZONE_T:
|
||||
|
|
|
@ -85,7 +85,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
|
|||
// Do not modify existing board
|
||||
MODULE newFootprint( *footprint );
|
||||
|
||||
for( D_PAD* pad : newFootprint.Pads() )
|
||||
for( PAD* pad : newFootprint.Pads() )
|
||||
pad->SetNetCode( 0 );
|
||||
|
||||
// locked means "locked in place"; copied items therefore can't be locked
|
||||
|
@ -115,7 +115,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
|
|||
text->SetType( FP_TEXT::TEXT_is_DIVERS );
|
||||
|
||||
// If it is only a footprint, clear the nets from the pads
|
||||
if( D_PAD* pad = dyn_cast<D_PAD*>( clone ) )
|
||||
if( PAD* pad = dyn_cast<PAD*>( clone ) )
|
||||
pad->SetNetCode( 0 );
|
||||
|
||||
// Add the pad to the new footprint before moving to ensure the local coords are
|
||||
|
@ -192,7 +192,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
|
|||
{
|
||||
// Create a parent to own the copied pad
|
||||
MODULE* footprint = new MODULE( m_board );
|
||||
D_PAD* pad = (D_PAD*) item->Clone();
|
||||
PAD* pad = (PAD*) item->Clone();
|
||||
|
||||
footprint->SetPosition( pad->GetPosition() );
|
||||
pad->SetPos0( wxPoint() );
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintShape )
|
||||
{
|
||||
int oX;
|
||||
D_PAD* pad;
|
||||
PAD* pad;
|
||||
MODULE* module;
|
||||
wxString msg, cmp_name;
|
||||
int pad_count = 2;
|
||||
|
@ -203,7 +203,7 @@ MODULE* MICROWAVE_TOOL::createBaseFootprint( const wxString& aValue,
|
|||
|
||||
while( aPadCount-- )
|
||||
{
|
||||
D_PAD* pad = new D_PAD( footprint );
|
||||
PAD* pad = new PAD( footprint );
|
||||
|
||||
footprint->Add( pad, ADD_MODE::INSERT );
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ MODULE* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& aIn
|
|||
* (Radius decreases if necessary)
|
||||
*/
|
||||
|
||||
D_PAD* pad;
|
||||
PAD* pad;
|
||||
wxString msg;
|
||||
|
||||
PCB_EDIT_FRAME& editFrame = *getEditFrame<PCB_EDIT_FRAME>();
|
||||
|
@ -437,7 +437,7 @@ MODULE* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& aIn
|
|||
}
|
||||
|
||||
// Place a pad on each end of coil.
|
||||
pad = new D_PAD( footprint );
|
||||
pad = new PAD( footprint );
|
||||
|
||||
footprint->Add( pad );
|
||||
|
||||
|
@ -451,7 +451,7 @@ MODULE* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& aIn
|
|||
pad->SetAttribute( PAD_ATTRIB_SMD );
|
||||
pad->SetShape( PAD_SHAPE_CIRCLE );
|
||||
|
||||
D_PAD* newpad = new D_PAD( *pad );
|
||||
PAD* newpad = new PAD( *pad );
|
||||
const_cast<KIID&>( newpad->m_Uuid ) = KIID();
|
||||
|
||||
footprint->Add( newpad );
|
||||
|
|
|
@ -240,7 +240,8 @@ void MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr( wxCommandEvent& event )
|
|||
|
||||
MODULE* MICROWAVE_TOOL::createPolygonShape()
|
||||
{
|
||||
D_PAD* pad1, * pad2;
|
||||
PAD* pad1;
|
||||
PAD* pad2;
|
||||
MODULE* module;
|
||||
wxString cmp_name;
|
||||
int pad_count = 2;
|
||||
|
|
|
@ -40,7 +40,7 @@ class wxDC;
|
|||
class wxPoint;
|
||||
class LINE_READER;
|
||||
class EDA_DRAW_FRAME;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class BOARD;
|
||||
class BOARD_ITEM;
|
||||
class MSG_PANEL_ITEM;
|
||||
|
@ -56,7 +56,7 @@ class PCB_BASE_FRAME;
|
|||
#define CH_ACTIF 8 /* Not routed. */
|
||||
#define LOCAL_RATSNEST_ITEM 0x8000 /* Line between two pads of a single module. */
|
||||
|
||||
DECL_VEC_FOR_SWIG( D_PADS, D_PAD* )
|
||||
DECL_VEC_FOR_SWIG( PADS_VEC, PAD* )
|
||||
|
||||
/**
|
||||
* NETINFO_ITEM
|
||||
|
|
|
@ -90,7 +90,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANE
|
|||
|
||||
for( MODULE* mod : board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : mod->Pads() )
|
||||
for( PAD* pad : mod->Pads() )
|
||||
{
|
||||
if( pad->GetNetCode() == GetNet() )
|
||||
{
|
||||
|
|
|
@ -220,7 +220,7 @@ void NETINFO_MAPPING::Update()
|
|||
// footprints/pads
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
nets.insert( pad->GetNetCode() );
|
||||
}
|
||||
|
||||
|
|
|
@ -79,13 +79,13 @@ BOARD_NETLIST_UPDATER::~BOARD_NETLIST_UPDATER()
|
|||
// These functions allow inspection of pad nets during dry runs by keeping a cache of
|
||||
// current pad netnames indexed by pad.
|
||||
|
||||
void BOARD_NETLIST_UPDATER::cacheNetname( D_PAD* aPad, const wxString& aNetname )
|
||||
void BOARD_NETLIST_UPDATER::cacheNetname( PAD* aPad, const wxString& aNetname )
|
||||
{
|
||||
m_padNets[ aPad ] = aNetname;
|
||||
}
|
||||
|
||||
|
||||
wxString BOARD_NETLIST_UPDATER::getNetname( D_PAD* aPad )
|
||||
wxString BOARD_NETLIST_UPDATER::getNetname( PAD* aPad )
|
||||
{
|
||||
if( m_isDryRun && m_padNets.count( aPad ) )
|
||||
return m_padNets[ aPad ];
|
||||
|
@ -94,13 +94,13 @@ wxString BOARD_NETLIST_UPDATER::getNetname( D_PAD* aPad )
|
|||
}
|
||||
|
||||
|
||||
void BOARD_NETLIST_UPDATER::cachePinFunction( D_PAD* aPad, const wxString& aPinFunction )
|
||||
void BOARD_NETLIST_UPDATER::cachePinFunction( PAD* aPad, const wxString& aPinFunction )
|
||||
{
|
||||
m_padPinFunctions[ aPad ] = aPinFunction;
|
||||
}
|
||||
|
||||
|
||||
wxString BOARD_NETLIST_UPDATER::getPinFunction( D_PAD* aPad )
|
||||
wxString BOARD_NETLIST_UPDATER::getPinFunction( PAD* aPad )
|
||||
{
|
||||
if( m_isDryRun && m_padPinFunctions.count( aPad ) )
|
||||
return m_padPinFunctions[ aPad ];
|
||||
|
@ -171,7 +171,7 @@ MODULE* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
|
|||
// Set the pads ratsnest settings to the global settings
|
||||
bool set_ratsnest = m_frame->GetDisplayOptions().m_ShowGlobalRatsnest;
|
||||
|
||||
for ( D_PAD* pad : footprint->Pads() )
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
pad->SetLocalRatsnestVisible( set_ratsnest );
|
||||
|
||||
m_newFootprintsCount++;
|
||||
|
@ -355,7 +355,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
|
|||
bool changed = false;
|
||||
|
||||
// At this point, the component footprint is updated. Now update the nets.
|
||||
for( D_PAD* pad : aPcbComponent->Pads() )
|
||||
for( PAD* pad : aPcbComponent->Pads() )
|
||||
{
|
||||
const COMPONENT_NET& net = aNewComponent->GetNet( pad->GetName() );
|
||||
|
||||
|
@ -568,7 +568,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
|
|||
// net is guaranteed to be wrong.
|
||||
wxString updatedNetname = wxEmptyString;
|
||||
|
||||
for( D_PAD* pad : m_zoneConnectionsCache[ zone ] )
|
||||
for( PAD* pad : m_zoneConnectionsCache[ zone ] )
|
||||
{
|
||||
if( getNetname( pad ) != zone->GetNetname() )
|
||||
{
|
||||
|
@ -657,24 +657,24 @@ bool BOARD_NETLIST_UPDATER::deleteUnusedComponents( NETLIST& aNetlist )
|
|||
|
||||
bool BOARD_NETLIST_UPDATER::deleteSinglePadNets()
|
||||
{
|
||||
int count = 0;
|
||||
wxString netname;
|
||||
wxString msg;
|
||||
D_PAD* previouspad = NULL;
|
||||
int count = 0;
|
||||
wxString netname;
|
||||
wxString msg;
|
||||
PAD* previouspad = NULL;
|
||||
|
||||
// We need the pad list for next tests.
|
||||
|
||||
m_board->BuildListOfNets();
|
||||
|
||||
std::vector<D_PAD*> padlist = m_board->GetPads();
|
||||
std::vector<PAD*> padlist = m_board->GetPads();
|
||||
|
||||
// Sort pads by netlist name
|
||||
std::sort( padlist.begin(), padlist.end(), [ this ]( D_PAD* a, D_PAD* b ) -> bool
|
||||
std::sort( padlist.begin(), padlist.end(), [ this ]( PAD* a, PAD* b ) -> bool
|
||||
{
|
||||
return getNetname( a ) < getNetname( b );
|
||||
} );
|
||||
|
||||
for( D_PAD* pad : padlist )
|
||||
for( PAD* pad : padlist )
|
||||
{
|
||||
if( getNetname( pad ).IsEmpty() )
|
||||
continue;
|
||||
|
|
|
@ -134,11 +134,11 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void cacheNetname( D_PAD* aPad, const wxString& aNetname );
|
||||
wxString getNetname( D_PAD* aPad );
|
||||
void cacheNetname( PAD* aPad, const wxString& aNetname );
|
||||
wxString getNetname( PAD* aPad );
|
||||
|
||||
void cachePinFunction( D_PAD* aPad, const wxString& aPinFunction );
|
||||
wxString getPinFunction( D_PAD* aPad );
|
||||
void cachePinFunction( PAD* aPad, const wxString& aPinFunction );
|
||||
wxString getPinFunction( PAD* aPad );
|
||||
|
||||
wxPoint estimateComponentInsertionPosition();
|
||||
MODULE* addNewComponent( COMPONENT* aComponent );
|
||||
|
@ -156,12 +156,12 @@ private:
|
|||
BOARD* m_board;
|
||||
REPORTER* m_reporter;
|
||||
|
||||
std::map<ZONE*, std::vector<D_PAD*>> m_zoneConnectionsCache;
|
||||
std::map<wxString, wxString> m_oldToNewNets;
|
||||
std::map<D_PAD*, wxString> m_padNets;
|
||||
std::map<D_PAD*, wxString> m_padPinFunctions;
|
||||
std::vector<MODULE*> m_addedComponents;
|
||||
std::map<wxString, NETINFO_ITEM*> m_addedNets;
|
||||
std::map<ZONE*, std::vector<PAD*>> m_zoneConnectionsCache;
|
||||
std::map<wxString, wxString> m_oldToNewNets;
|
||||
std::map<PAD*, wxString> m_padNets;
|
||||
std::map<PAD*, wxString> m_padPinFunctions;
|
||||
std::vector<MODULE*> m_addedComponents;
|
||||
std::map<wxString, NETINFO_ITEM*> m_addedNets;
|
||||
|
||||
bool m_deleteSinglePadNets;
|
||||
bool m_deleteUnusedComponents;
|
||||
|
|
191
pcbnew/pad.cpp
191
pcbnew/pad.cpp
|
@ -23,11 +23,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_pad.cpp
|
||||
* D_PAD class implementation.
|
||||
*/
|
||||
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
@ -50,7 +45,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
D_PAD::D_PAD( MODULE* parent ) :
|
||||
PAD::PAD( MODULE* parent ) :
|
||||
BOARD_CONNECTED_ITEM( parent, PCB_PAD_T )
|
||||
{
|
||||
m_size.x = m_size.y = Mils2iu( 60 ); // Default pad size 60 mils.
|
||||
|
@ -97,7 +92,7 @@ D_PAD::D_PAD( MODULE* parent ) :
|
|||
}
|
||||
|
||||
|
||||
D_PAD::D_PAD( const D_PAD& aOther ) :
|
||||
PAD::PAD( const PAD& aOther ) :
|
||||
BOARD_CONNECTED_ITEM( aOther.GetParent(), PCB_PAD_T )
|
||||
{
|
||||
BOARD_CONNECTED_ITEM::operator=( aOther );
|
||||
|
@ -116,7 +111,7 @@ D_PAD::D_PAD( const D_PAD& aOther ) :
|
|||
}
|
||||
|
||||
|
||||
D_PAD& D_PAD::operator=( const D_PAD &aOther )
|
||||
PAD& PAD::operator=( const PAD &aOther )
|
||||
{
|
||||
BOARD_CONNECTED_ITEM::operator=( aOther );
|
||||
|
||||
|
@ -135,42 +130,42 @@ D_PAD& D_PAD::operator=( const D_PAD &aOther )
|
|||
}
|
||||
|
||||
|
||||
LSET D_PAD::PTHMask()
|
||||
LSET PAD::PTHMask()
|
||||
{
|
||||
static LSET saved = LSET::AllCuMask() | LSET( 2, F_Mask, B_Mask );
|
||||
return saved;
|
||||
}
|
||||
|
||||
|
||||
LSET D_PAD::SMDMask()
|
||||
LSET PAD::SMDMask()
|
||||
{
|
||||
static LSET saved( 3, F_Cu, F_Paste, F_Mask );
|
||||
return saved;
|
||||
}
|
||||
|
||||
|
||||
LSET D_PAD::ConnSMDMask()
|
||||
LSET PAD::ConnSMDMask()
|
||||
{
|
||||
static LSET saved( 2, F_Cu, F_Mask );
|
||||
return saved;
|
||||
}
|
||||
|
||||
|
||||
LSET D_PAD::UnplatedHoleMask()
|
||||
LSET PAD::UnplatedHoleMask()
|
||||
{
|
||||
static LSET saved = LSET( 4, F_Cu, B_Cu, F_Mask, B_Mask );
|
||||
return saved;
|
||||
}
|
||||
|
||||
|
||||
LSET D_PAD::ApertureMask()
|
||||
LSET PAD::ApertureMask()
|
||||
{
|
||||
static LSET saved( 1, F_Paste );
|
||||
return saved;
|
||||
}
|
||||
|
||||
|
||||
bool D_PAD::IsFlipped() const
|
||||
bool PAD::IsFlipped() const
|
||||
{
|
||||
if( GetParent() && GetParent()->GetLayer() == B_Cu )
|
||||
return true;
|
||||
|
@ -178,7 +173,7 @@ bool D_PAD::IsFlipped() const
|
|||
}
|
||||
|
||||
|
||||
bool D_PAD::FlashLayer( LSET aLayers ) const
|
||||
bool PAD::FlashLayer( LSET aLayers ) const
|
||||
{
|
||||
for( auto layer : aLayers.Seq() )
|
||||
{
|
||||
|
@ -190,7 +185,7 @@ bool D_PAD::FlashLayer( LSET aLayers ) const
|
|||
}
|
||||
|
||||
|
||||
bool D_PAD::FlashLayer( int aLayer ) const
|
||||
bool PAD::FlashLayer( int aLayer ) const
|
||||
{
|
||||
// Return the "normal" shape if the caller doesn't specify a particular layer
|
||||
if( aLayer == UNDEFINED_LAYER )
|
||||
|
@ -222,13 +217,13 @@ bool D_PAD::FlashLayer( int aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetRoundRectCornerRadius() const
|
||||
int PAD::GetRoundRectCornerRadius() const
|
||||
{
|
||||
return KiROUND( std::min( m_size.x, m_size.y ) * m_roundedCornerScale );
|
||||
}
|
||||
|
||||
|
||||
void D_PAD::SetRoundRectCornerRadius( double aRadius )
|
||||
void PAD::SetRoundRectCornerRadius( double aRadius )
|
||||
{
|
||||
int min_r = std::min( m_size.x, m_size.y );
|
||||
|
||||
|
@ -237,7 +232,7 @@ void D_PAD::SetRoundRectCornerRadius( double aRadius )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetRoundRectRadiusRatio( double aRadiusScale )
|
||||
void PAD::SetRoundRectRadiusRatio( double aRadiusScale )
|
||||
{
|
||||
m_roundedCornerScale = std::max( 0.0, std::min( aRadiusScale, 0.5 ) );
|
||||
|
||||
|
@ -245,7 +240,7 @@ void D_PAD::SetRoundRectRadiusRatio( double aRadiusScale )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetChamferRectRatio( double aChamferScale )
|
||||
void PAD::SetChamferRectRatio( double aChamferScale )
|
||||
{
|
||||
m_chamferScale = std::max( 0.0, std::min( aChamferScale, 0.5 ) );
|
||||
|
||||
|
@ -253,7 +248,7 @@ void D_PAD::SetChamferRectRatio( double aChamferScale )
|
|||
}
|
||||
|
||||
|
||||
const std::shared_ptr<SHAPE_POLY_SET>& D_PAD::GetEffectivePolygon( PCB_LAYER_ID aLayer ) const
|
||||
const std::shared_ptr<SHAPE_POLY_SET>& PAD::GetEffectivePolygon( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( aLayer );
|
||||
|
@ -262,7 +257,7 @@ const std::shared_ptr<SHAPE_POLY_SET>& D_PAD::GetEffectivePolygon( PCB_LAYER_ID
|
|||
}
|
||||
|
||||
|
||||
std::shared_ptr<SHAPE> D_PAD::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
||||
std::shared_ptr<SHAPE> PAD::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( aLayer );
|
||||
|
@ -271,7 +266,7 @@ std::shared_ptr<SHAPE> D_PAD::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
const SHAPE_SEGMENT* D_PAD::GetEffectiveHoleShape() const
|
||||
const SHAPE_SEGMENT* PAD::GetEffectiveHoleShape() const
|
||||
{
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( UNDEFINED_LAYER );
|
||||
|
@ -280,7 +275,7 @@ const SHAPE_SEGMENT* D_PAD::GetEffectiveHoleShape() const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetBoundingRadius() const
|
||||
int PAD::GetBoundingRadius() const
|
||||
{
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( UNDEFINED_LAYER );
|
||||
|
@ -289,7 +284,7 @@ int D_PAD::GetBoundingRadius() const
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
|
||||
void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
BOARD* board = GetBoard();
|
||||
int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
|
||||
|
@ -407,7 +402,7 @@ void D_PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
|
|||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "D_PAD::buildEffectiveShapes: Unsupported pad shape: "
|
||||
wxFAIL_MSG( "PAD::buildEffectiveShapes: Unsupported pad shape: "
|
||||
+ PAD_SHAPE_T_asString( effectiveShape ) );
|
||||
break;
|
||||
}
|
||||
|
@ -471,7 +466,7 @@ void D_PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
const EDA_RECT D_PAD::GetBoundingBox() const
|
||||
const EDA_RECT PAD::GetBoundingBox() const
|
||||
{
|
||||
if( m_shapesDirty )
|
||||
BuildEffectiveShapes( UNDEFINED_LAYER );
|
||||
|
@ -480,7 +475,7 @@ const EDA_RECT D_PAD::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetDrawCoord()
|
||||
void PAD::SetDrawCoord()
|
||||
{
|
||||
MODULE* module = (MODULE*) m_Parent;
|
||||
|
||||
|
@ -498,7 +493,7 @@ void D_PAD::SetDrawCoord()
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetLocalCoord()
|
||||
void PAD::SetLocalCoord()
|
||||
{
|
||||
MODULE* module = (MODULE*) m_Parent;
|
||||
|
||||
|
@ -513,7 +508,7 @@ void D_PAD::SetLocalCoord()
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetAttribute( PAD_ATTR_T aAttribute )
|
||||
void PAD::SetAttribute( PAD_ATTR_T aAttribute )
|
||||
{
|
||||
m_attribute = aAttribute;
|
||||
|
||||
|
@ -524,7 +519,7 @@ void D_PAD::SetAttribute( PAD_ATTR_T aAttribute )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetProperty( PAD_PROP_T aProperty )
|
||||
void PAD::SetProperty( PAD_PROP_T aProperty )
|
||||
{
|
||||
m_property = aProperty;
|
||||
|
||||
|
@ -532,7 +527,7 @@ void D_PAD::SetProperty( PAD_PROP_T aProperty )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SetOrientation( double aAngle )
|
||||
void PAD::SetOrientation( double aAngle )
|
||||
{
|
||||
NORMALIZE_ANGLE_POS( aAngle );
|
||||
m_orient = aAngle;
|
||||
|
@ -541,7 +536,7 @@ void D_PAD::SetOrientation( double aAngle )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
||||
void PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
||||
{
|
||||
if( aFlipLeftRight )
|
||||
{
|
||||
|
@ -600,7 +595,7 @@ void D_PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
|||
|
||||
|
||||
// Flip (mirror) the basic shapes (primitives), in custom pads
|
||||
void D_PAD::FlipPrimitives( bool aFlipLeftRight )
|
||||
void PAD::FlipPrimitives( bool aFlipLeftRight )
|
||||
{
|
||||
for( std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
|
||||
primitive->Flip( wxPoint( 0, 0 ), aFlipLeftRight );
|
||||
|
@ -610,7 +605,7 @@ void D_PAD::FlipPrimitives( bool aFlipLeftRight )
|
|||
|
||||
|
||||
// Returns the position of the pad.
|
||||
wxPoint D_PAD::ShapePos() const
|
||||
wxPoint PAD::ShapePos() const
|
||||
{
|
||||
if( m_offset.x == 0 && m_offset.y == 0 )
|
||||
return m_pos;
|
||||
|
@ -625,7 +620,7 @@ wxPoint D_PAD::ShapePos() const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetLocalClearanceOverrides( wxString* aSource ) const
|
||||
int PAD::GetLocalClearanceOverrides( wxString* aSource ) const
|
||||
{
|
||||
// A pad can have specific clearance that overrides its NETCLASS clearance value
|
||||
if( GetLocalClearance() )
|
||||
|
@ -639,7 +634,7 @@ int D_PAD::GetLocalClearanceOverrides( wxString* aSource ) const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetLocalClearance( wxString* aSource ) const
|
||||
int PAD::GetLocalClearance( wxString* aSource ) const
|
||||
{
|
||||
if( aSource )
|
||||
*aSource = wxString::Format( _( "pad %s" ), GetName() );
|
||||
|
@ -650,7 +645,7 @@ int D_PAD::GetLocalClearance( wxString* aSource ) const
|
|||
|
||||
// Mask margins handling:
|
||||
|
||||
int D_PAD::GetSolderMaskMargin() const
|
||||
int PAD::GetSolderMaskMargin() const
|
||||
{
|
||||
// The pad inherits the margin only to calculate a default shape,
|
||||
// therefore only if it is also a copper layer
|
||||
|
@ -695,7 +690,7 @@ int D_PAD::GetSolderMaskMargin() const
|
|||
}
|
||||
|
||||
|
||||
wxSize D_PAD::GetSolderPasteMargin() const
|
||||
wxSize PAD::GetSolderPasteMargin() const
|
||||
{
|
||||
// The pad inherits the margin only to calculate a default shape,
|
||||
// therefore only if it is also a copper layer.
|
||||
|
@ -719,9 +714,7 @@ wxSize D_PAD::GetSolderPasteMargin() const
|
|||
auto brd = GetBoard();
|
||||
|
||||
if( margin == 0 && brd )
|
||||
{
|
||||
margin = brd->GetDesignSettings().m_SolderPasteMargin;
|
||||
}
|
||||
margin = brd->GetDesignSettings().m_SolderPasteMargin;
|
||||
|
||||
if( mratio == 0.0 )
|
||||
mratio = module->GetLocalSolderPasteMarginRatio();
|
||||
|
@ -747,7 +740,7 @@ wxSize D_PAD::GetSolderPasteMargin() const
|
|||
}
|
||||
|
||||
|
||||
ZONE_CONNECTION D_PAD::GetEffectiveZoneConnection( wxString* aSource ) const
|
||||
ZONE_CONNECTION PAD::GetEffectiveZoneConnection( wxString* aSource ) const
|
||||
{
|
||||
MODULE* module = GetParent();
|
||||
|
||||
|
@ -768,7 +761,7 @@ ZONE_CONNECTION D_PAD::GetEffectiveZoneConnection( wxString* aSource ) const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetEffectiveThermalSpokeWidth( wxString* aSource ) const
|
||||
int PAD::GetEffectiveThermalSpokeWidth( wxString* aSource ) const
|
||||
{
|
||||
MODULE* module = GetParent();
|
||||
|
||||
|
@ -787,7 +780,7 @@ int D_PAD::GetEffectiveThermalSpokeWidth( wxString* aSource ) const
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::GetEffectiveThermalGap( wxString* aSource ) const
|
||||
int PAD::GetEffectiveThermalGap( wxString* aSource ) const
|
||||
{
|
||||
MODULE* module = GetParent();
|
||||
|
||||
|
@ -806,7 +799,7 @@ int D_PAD::GetEffectiveThermalGap( wxString* aSource ) const
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
EDA_UNITS units = aFrame->GetUserUnits();
|
||||
wxString msg, msg2;
|
||||
|
@ -909,7 +902,7 @@ void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
|
|||
}
|
||||
|
||||
|
||||
bool D_PAD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||
bool PAD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||
{
|
||||
VECTOR2I delta = aPosition - GetPosition();
|
||||
int boundingRadius = GetBoundingRadius() + aAccuracy;
|
||||
|
@ -921,7 +914,7 @@ bool D_PAD::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
|||
}
|
||||
|
||||
|
||||
bool D_PAD::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
|
||||
bool PAD::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
|
||||
{
|
||||
auto getArea = []( const SHAPE_POLY_SET& aPoly ) -> double
|
||||
{
|
||||
|
@ -960,7 +953,7 @@ bool D_PAD::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) con
|
|||
}
|
||||
|
||||
|
||||
int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
|
||||
int PAD::Compare( const PAD* padref, const PAD* padcmp )
|
||||
{
|
||||
int diff;
|
||||
|
||||
|
@ -1016,7 +1009,7 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
void PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
{
|
||||
RotatePoint( &m_pos, aRotCentre, aAngle );
|
||||
|
||||
|
@ -1028,7 +1021,7 @@ void D_PAD::Rotate( const wxPoint& aRotCentre, double aAngle )
|
|||
}
|
||||
|
||||
|
||||
wxString D_PAD::ShowPadShape() const
|
||||
wxString PAD::ShowPadShape() const
|
||||
{
|
||||
switch( GetShape() )
|
||||
{
|
||||
|
@ -1044,7 +1037,7 @@ wxString D_PAD::ShowPadShape() const
|
|||
}
|
||||
|
||||
|
||||
wxString D_PAD::ShowPadAttr() const
|
||||
wxString PAD::ShowPadAttr() const
|
||||
{
|
||||
switch( GetAttribute() )
|
||||
{
|
||||
|
@ -1057,7 +1050,7 @@ wxString D_PAD::ShowPadAttr() const
|
|||
}
|
||||
|
||||
|
||||
wxString D_PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
{
|
||||
if( GetName().IsEmpty() )
|
||||
{
|
||||
|
@ -1075,26 +1068,26 @@ wxString D_PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
|
|||
}
|
||||
|
||||
|
||||
BITMAP_DEF D_PAD::GetMenuImage() const
|
||||
BITMAP_DEF PAD::GetMenuImage() const
|
||||
{
|
||||
return pad_xpm;
|
||||
}
|
||||
|
||||
|
||||
EDA_ITEM* D_PAD::Clone() const
|
||||
EDA_ITEM* PAD::Clone() const
|
||||
{
|
||||
return new D_PAD( *this );
|
||||
return new PAD( *this );
|
||||
}
|
||||
|
||||
|
||||
bool D_PAD::PadShouldBeNPTH() const
|
||||
bool PAD::PadShouldBeNPTH() const
|
||||
{
|
||||
return( m_attribute == PAD_ATTRIB_PTH
|
||||
&& m_drill.x >= m_size.x && m_drill.y >= m_size.y );
|
||||
}
|
||||
|
||||
|
||||
void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
void PAD::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 0;
|
||||
|
||||
|
@ -1168,7 +1161,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
}
|
||||
|
||||
|
||||
double D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||
double PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
if( aView->GetPrintMode() > 0 ) // In printing mode the pad is always drawable
|
||||
return 0.0;
|
||||
|
@ -1228,7 +1221,7 @@ double D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
}
|
||||
|
||||
|
||||
const BOX2I D_PAD::ViewBBox() const
|
||||
const BOX2I PAD::ViewBBox() const
|
||||
{
|
||||
// Bounding box includes soldermask too. Remember mask and/or paste
|
||||
// margins can be < 0
|
||||
|
@ -1245,13 +1238,13 @@ const BOX2I D_PAD::ViewBBox() const
|
|||
}
|
||||
|
||||
|
||||
MODULE* D_PAD::GetParent() const
|
||||
MODULE* PAD::GetParent() const
|
||||
{
|
||||
return dynamic_cast<MODULE*>( m_Parent );
|
||||
}
|
||||
|
||||
|
||||
void D_PAD::ImportSettingsFrom( const D_PAD& aMasterPad )
|
||||
void PAD::ImportSettingsFrom( const PAD& aMasterPad )
|
||||
{
|
||||
SetShape( aMasterPad.GetShape() );
|
||||
SetLayerSet( aMasterPad.GetLayerSet() );
|
||||
|
@ -1335,7 +1328,7 @@ void D_PAD::ImportSettingsFrom( const D_PAD& aMasterPad )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::SwapData( BOARD_ITEM* aImage )
|
||||
void PAD::SwapData( BOARD_ITEM* aImage )
|
||||
{
|
||||
assert( aImage->Type() == PCB_PAD_T );
|
||||
|
||||
|
@ -1372,56 +1365,56 @@ static struct PAD_DESC
|
|||
.Map( PAD_PROP_CASTELLATED, _HKI( "Castellated pad" ) );
|
||||
|
||||
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
|
||||
REGISTER_TYPE( D_PAD );
|
||||
propMgr.InheritsAfter( TYPE_HASH( D_PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) );
|
||||
REGISTER_TYPE( PAD );
|
||||
propMgr.InheritsAfter( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) );
|
||||
|
||||
auto padType = new PROPERTY_ENUM<D_PAD, PAD_ATTR_T>( _HKI( "Pad Type" ),
|
||||
&D_PAD::SetAttribute, &D_PAD::GetAttribute );
|
||||
auto padType = new PROPERTY_ENUM<PAD, PAD_ATTR_T>( _HKI( "Pad Type" ),
|
||||
&PAD::SetAttribute, &PAD::GetAttribute );
|
||||
propMgr.AddProperty( padType );
|
||||
|
||||
auto shape = new PROPERTY_ENUM<D_PAD, PAD_SHAPE_T>( _HKI( "Shape" ),
|
||||
&D_PAD::SetShape, &D_PAD::GetShape );
|
||||
auto shape = new PROPERTY_ENUM<PAD, PAD_SHAPE_T>( _HKI( "Shape" ),
|
||||
&PAD::SetShape, &PAD::GetShape );
|
||||
propMgr.AddProperty( shape );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, wxString>( _HKI( "Pad Number" ),
|
||||
&D_PAD::SetName, &D_PAD::GetName ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, double>( _HKI( "Orientation" ),
|
||||
&D_PAD::SetOrientationDegrees, &D_PAD::GetOrientationDegrees,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, wxString>( _HKI( "Pad Number" ),
|
||||
&PAD::SetName, &PAD::GetName ) );
|
||||
propMgr.AddProperty( new PROPERTY<PAD, double>( _HKI( "Orientation" ),
|
||||
&PAD::SetOrientationDegrees, &PAD::GetOrientationDegrees,
|
||||
PROPERTY_DISPLAY::DEGREE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Size X" ),
|
||||
&D_PAD::SetSizeX, &D_PAD::GetSizeX,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Size X" ),
|
||||
&PAD::SetSizeX, &PAD::GetSizeX,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Size Y" ),
|
||||
&D_PAD::SetSizeY, &D_PAD::GetSizeY,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Size Y" ),
|
||||
&PAD::SetSizeY, &PAD::GetSizeY,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Hole Size X" ),
|
||||
&D_PAD::SetDrillSizeX, &D_PAD::GetDrillSizeX,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Hole Size X" ),
|
||||
&PAD::SetDrillSizeX, &PAD::GetDrillSizeX,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Hole Size Y" ),
|
||||
&D_PAD::SetDrillSizeY, &D_PAD::GetDrillSizeY,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Hole Size Y" ),
|
||||
&PAD::SetDrillSizeY, &PAD::GetDrillSizeY,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Pad To Die Length" ),
|
||||
&D_PAD::SetPadToDieLength, &D_PAD::GetPadToDieLength,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Pad To Die Length" ),
|
||||
&PAD::SetPadToDieLength, &PAD::GetPadToDieLength,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Local Soldermask Margin" ),
|
||||
&D_PAD::SetLocalSolderMaskMargin, &D_PAD::GetLocalSolderMaskMargin,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Local Soldermask Margin" ),
|
||||
&PAD::SetLocalSolderMaskMargin, &PAD::GetLocalSolderMaskMargin,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Local Solderpaste Margin" ),
|
||||
&D_PAD::SetLocalSolderPasteMargin, &D_PAD::GetLocalSolderPasteMargin,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Local Solderpaste Margin" ),
|
||||
&PAD::SetLocalSolderPasteMargin, &PAD::GetLocalSolderPasteMargin,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, double>( _HKI( "Local Solderpaste Margin Ratio" ),
|
||||
&D_PAD::SetLocalSolderPasteMarginRatio, &D_PAD::GetLocalSolderPasteMarginRatio ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Thermal Relief Spoke Width" ),
|
||||
&D_PAD::SetThermalSpokeWidth, &D_PAD::GetThermalSpokeWidth,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, double>( _HKI( "Local Solderpaste Margin Ratio" ),
|
||||
&PAD::SetLocalSolderPasteMarginRatio, &PAD::GetLocalSolderPasteMarginRatio ) );
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Thermal Relief Spoke Width" ),
|
||||
&PAD::SetThermalSpokeWidth, &PAD::GetThermalSpokeWidth,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Thermal Relief" ),
|
||||
&D_PAD::SetThermalGap, &D_PAD::GetThermalGap,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Thermal Relief" ),
|
||||
&PAD::SetThermalGap, &PAD::GetThermalGap,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
propMgr.AddProperty( new PROPERTY_ENUM<D_PAD, PAD_PROP_T>( _HKI( "Fabrication Property" ),
|
||||
&D_PAD::SetProperty, &D_PAD::GetProperty ) );
|
||||
propMgr.AddProperty( new PROPERTY_ENUM<PAD, PAD_PROP_T>( _HKI( "Fabrication Property" ),
|
||||
&PAD::SetProperty, &PAD::GetProperty ) );
|
||||
|
||||
auto roundRadiusRatio = new PROPERTY<D_PAD, double>( _HKI( "Round Radius Ratio" ),
|
||||
&D_PAD::SetRoundRectRadiusRatio, &D_PAD::GetRoundRectRadiusRatio );
|
||||
auto roundRadiusRatio = new PROPERTY<PAD, double>( _HKI( "Round Radius Ratio" ),
|
||||
&PAD::SetRoundRectRadiusRatio, &PAD::GetRoundRectRadiusRatio );
|
||||
roundRadiusRatio->SetAvailableFunc(
|
||||
[=]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
|
@ -1429,8 +1422,8 @@ static struct PAD_DESC
|
|||
} );
|
||||
propMgr.AddProperty( roundRadiusRatio );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<D_PAD, int>( _HKI( "Local Clearance" ),
|
||||
&D_PAD::SetLocalClearance, &D_PAD::GetLocalClearance,
|
||||
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Local Clearance" ),
|
||||
&PAD::SetLocalClearance, &PAD::GetLocalClearance,
|
||||
PROPERTY_DISPLAY::DISTANCE ) );
|
||||
// TODO delta, dirill shape offset, layerset, zone connection
|
||||
}
|
||||
|
|
33
pcbnew/pad.h
33
pcbnew/pad.h
|
@ -22,15 +22,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_pad.h
|
||||
* @brief Pad object description
|
||||
*/
|
||||
#ifndef PAD_H
|
||||
#define PAD_H
|
||||
|
||||
#ifndef PAD_H_
|
||||
#define PAD_H_
|
||||
|
||||
#include "zones.h"
|
||||
#include <zones.h>
|
||||
#include <board_connected_item.h>
|
||||
#include <class_board_item.h>
|
||||
#include <convert_to_biu.h>
|
||||
|
@ -61,15 +56,15 @@ namespace KIGFX
|
|||
class VIEW;
|
||||
}
|
||||
|
||||
class D_PAD : public BOARD_CONNECTED_ITEM
|
||||
class PAD : public BOARD_CONNECTED_ITEM
|
||||
{
|
||||
public:
|
||||
D_PAD( MODULE* parent );
|
||||
PAD( MODULE* parent );
|
||||
|
||||
// Copy constructor & operator= are needed because the list of basic shapes
|
||||
// must be duplicated in copy.
|
||||
D_PAD( const D_PAD& aPad );
|
||||
D_PAD& operator=( const D_PAD &aOther );
|
||||
PAD( const PAD& aPad );
|
||||
PAD& operator=( const PAD &aOther );
|
||||
|
||||
/*
|
||||
* Default layers used for pads, according to the pad type.
|
||||
|
@ -116,7 +111,7 @@ public:
|
|||
* as aMasterPad
|
||||
* @param aMasterPad = the template pad
|
||||
*/
|
||||
void ImportSettingsFrom( const D_PAD& aMasterPad );
|
||||
void ImportSettingsFrom( const PAD& aMasterPad );
|
||||
|
||||
/**
|
||||
* @return true if the pad has a footprint parent flipped
|
||||
|
@ -143,7 +138,7 @@ public:
|
|||
* @param other
|
||||
* @return
|
||||
*/
|
||||
bool SameLogicalPadAs( const D_PAD* other ) const
|
||||
bool SameLogicalPadAs( const PAD* other ) const
|
||||
{
|
||||
// hide tricks behind sensible API
|
||||
return GetParent() == other->GetParent() && m_name == other->m_name;
|
||||
|
@ -579,7 +574,7 @@ public:
|
|||
* compares two pads and return 0 if they are equal.
|
||||
* @return int - <0 if left less than right, 0 if equal, >0 if left greater than right.
|
||||
*/
|
||||
static int Compare( const D_PAD* padref, const D_PAD* padcmp );
|
||||
static int Compare( const PAD* padref, const PAD* padcmp );
|
||||
|
||||
void Move( const wxPoint& aMoveVector ) override
|
||||
{
|
||||
|
@ -609,12 +604,12 @@ public:
|
|||
EDA_ITEM* Clone() const override;
|
||||
|
||||
/**
|
||||
* same as Clone, but returns a D_PAD item.
|
||||
* same as Clone, but returns a PAD item.
|
||||
* Useful mainly for python scripts, because Clone returns an EDA_ITEM.
|
||||
*/
|
||||
D_PAD* ClonePad() const
|
||||
PAD* ClonePad() const
|
||||
{
|
||||
return (D_PAD*) Clone();
|
||||
return (PAD*) Clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -745,4 +740,4 @@ private:
|
|||
int m_thermalGap;
|
||||
};
|
||||
|
||||
#endif // PAD_H_
|
||||
#endif // PAD_H
|
||||
|
|
|
@ -22,11 +22,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_pad_custom_shape_functions.cpp
|
||||
* D_PAD functions specific to custom shaped pads.
|
||||
*/
|
||||
|
||||
#include <board.h>
|
||||
#include <class_board_item.h>
|
||||
#include <pcb_shape.h>
|
||||
|
@ -41,7 +36,7 @@
|
|||
* the shape is a polygon (can be with thick outline), segment, circle or arc
|
||||
*/
|
||||
|
||||
void D_PAD::AddPrimitivePoly( const SHAPE_POLY_SET& aPoly, int aThickness )
|
||||
void PAD::AddPrimitivePoly( const SHAPE_POLY_SET& aPoly, int aThickness )
|
||||
{
|
||||
std::vector<wxPoint> points;
|
||||
|
||||
|
@ -57,7 +52,7 @@ void D_PAD::AddPrimitivePoly( const SHAPE_POLY_SET& aPoly, int aThickness )
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitivePoly( const std::vector<wxPoint>& aPoly, int aThickness )
|
||||
void PAD::AddPrimitivePoly( const std::vector<wxPoint>& aPoly, int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetShape( S_POLYGON );
|
||||
|
@ -68,7 +63,7 @@ void D_PAD::AddPrimitivePoly( const std::vector<wxPoint>& aPoly, int aThickness
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitiveSegment( const wxPoint& aStart, const wxPoint& aEnd, int aThickness )
|
||||
void PAD::AddPrimitiveSegment( const wxPoint& aStart, const wxPoint& aEnd, int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetStart( aStart );
|
||||
|
@ -79,8 +74,8 @@ void D_PAD::AddPrimitiveSegment( const wxPoint& aStart, const wxPoint& aEnd, int
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitiveArc( const wxPoint& aCenter, const wxPoint& aStart, int aArcAngle,
|
||||
int aThickness )
|
||||
void PAD::AddPrimitiveArc( const wxPoint& aCenter, const wxPoint& aStart, int aArcAngle,
|
||||
int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetShape( S_ARC );
|
||||
|
@ -93,8 +88,8 @@ void D_PAD::AddPrimitiveArc( const wxPoint& aCenter, const wxPoint& aStart, int
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitiveCurve( const wxPoint& aStart, const wxPoint& aEnd, const wxPoint& aCtrl1,
|
||||
const wxPoint& aCtrl2, int aThickness )
|
||||
void PAD::AddPrimitiveCurve( const wxPoint& aStart, const wxPoint& aEnd, const wxPoint& aCtrl1,
|
||||
const wxPoint& aCtrl2, int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetShape( S_CURVE );
|
||||
|
@ -108,7 +103,7 @@ void D_PAD::AddPrimitiveCurve( const wxPoint& aStart, const wxPoint& aEnd, const
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitiveCircle( const wxPoint& aCenter, int aRadius, int aThickness )
|
||||
void PAD::AddPrimitiveCircle( const wxPoint& aCenter, int aRadius, int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetShape( S_CIRCLE );
|
||||
|
@ -120,7 +115,7 @@ void D_PAD::AddPrimitiveCircle( const wxPoint& aCenter, int aRadius, int aThickn
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitiveRect( const wxPoint& aStart, const wxPoint& aEnd, int aThickness )
|
||||
void PAD::AddPrimitiveRect( const wxPoint& aStart, const wxPoint& aEnd, int aThickness )
|
||||
{
|
||||
PCB_SHAPE* item = new PCB_SHAPE();
|
||||
item->SetShape( S_RECT );
|
||||
|
@ -132,7 +127,7 @@ void D_PAD::AddPrimitiveRect( const wxPoint& aStart, const wxPoint& aEnd, int aT
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList )
|
||||
void PAD::ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList )
|
||||
{
|
||||
// clear old list
|
||||
DeletePrimitivesList();
|
||||
|
@ -145,7 +140,7 @@ void D_PAD::ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aP
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList )
|
||||
void PAD::AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList )
|
||||
{
|
||||
// Add duplicates of aPrimitivesList to the pad primitives list:
|
||||
for( const std::shared_ptr<PCB_SHAPE>& prim : aPrimitivesList )
|
||||
|
@ -155,7 +150,7 @@ void D_PAD::AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPr
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::AddPrimitive( PCB_SHAPE* aPrimitive )
|
||||
void PAD::AddPrimitive( PCB_SHAPE* aPrimitive )
|
||||
{
|
||||
m_editPrimitives.emplace_back( aPrimitive );
|
||||
|
||||
|
@ -164,7 +159,7 @@ void D_PAD::AddPrimitive( PCB_SHAPE* aPrimitive )
|
|||
|
||||
|
||||
// clear the basic shapes list and associated data
|
||||
void D_PAD::DeletePrimitivesList()
|
||||
void PAD::DeletePrimitivesList()
|
||||
{
|
||||
m_editPrimitives.clear();
|
||||
|
||||
|
@ -172,8 +167,8 @@ void D_PAD::DeletePrimitivesList()
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::addPadPrimitivesToPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER_ID aLayer,
|
||||
int aError, ERROR_LOC aErrorLoc ) const
|
||||
void PAD::addPadPrimitivesToPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER_ID aLayer,
|
||||
int aError, ERROR_LOC aErrorLoc ) const
|
||||
{
|
||||
SHAPE_POLY_SET polyset;
|
||||
|
||||
|
@ -190,7 +185,7 @@ void D_PAD::addPadPrimitivesToPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER
|
|||
}
|
||||
}
|
||||
|
||||
void D_PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER_ID aLayer ) const
|
||||
void PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
BOARD* board = GetBoard();
|
||||
int maxError = board ? board->GetDesignSettings().m_MaxError: ARC_HIGH_DEF;
|
||||
|
@ -219,7 +214,7 @@ void D_PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, PCB_LAYER_
|
|||
}
|
||||
|
||||
|
||||
bool D_PAD::GetBestAnchorPosition( VECTOR2I& aPos )
|
||||
bool PAD::GetBestAnchorPosition( VECTOR2I& aPos )
|
||||
{
|
||||
SHAPE_POLY_SET poly;
|
||||
addPadPrimitivesToPolygon( &poly, UNDEFINED_LAYER, ARC_LOW_DEF, ERROR_INSIDE );
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "pad_naming.h"
|
||||
|
||||
bool PAD_NAMING::PadCanHaveName( const D_PAD& aPad )
|
||||
bool PAD_NAMING::PadCanHaveName( const PAD& aPad )
|
||||
{
|
||||
// Aperture pads don't get a number
|
||||
if( aPad.IsAperturePad() )
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
/**
|
||||
* The PAD_NAMING namespace contains helper functions for common operations
|
||||
* to do with naming of #D_PAD objects.
|
||||
* to do with naming of #PAD objects.
|
||||
*/
|
||||
namespace PAD_NAMING
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ namespace PAD_NAMING
|
|||
* @param aPad the pad to check
|
||||
* @return true if the pad gets a name
|
||||
*/
|
||||
bool PadCanHaveName( const D_PAD& aPad );
|
||||
bool PadCanHaveName( const PAD& aPad );
|
||||
|
||||
} // namespace PAD_NAMING
|
||||
|
||||
|
|
|
@ -969,7 +969,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
|||
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
|
||||
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool
|
||||
{
|
||||
if( D_PAD* pad = dynamic_cast<D_PAD*>( aItem ) )
|
||||
if( PAD* pad = dynamic_cast<PAD*>( aItem ) )
|
||||
{
|
||||
// Round-corner rects are expensive to draw, but are mostly found on
|
||||
// SMD pads which only need redrawing on an active-to-not-active
|
||||
|
|
|
@ -39,7 +39,7 @@ class BOARD_ITEM_CONTAINER;
|
|||
class MODULE;
|
||||
class TRACK;
|
||||
class VIA;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class PCB_TARGET;
|
||||
class PCB_GROUP;
|
||||
class DIMENSION_BASE;
|
||||
|
|
|
@ -124,7 +124,7 @@ static void isPlated( LIBEVAL::CONTEXT* aCtx, void* self )
|
|||
|
||||
PCB_EXPR_VAR_REF* vref = static_cast<PCB_EXPR_VAR_REF*>( self );
|
||||
BOARD_ITEM* item = vref ? vref->GetObject( aCtx ) : nullptr;
|
||||
D_PAD* pad = dynamic_cast<D_PAD*>( item );
|
||||
PAD* pad = dynamic_cast<PAD*>( item );
|
||||
|
||||
if( pad && pad->GetAttribute() == PAD_ATTRIB_PTH )
|
||||
result->Set( 1.0 );
|
||||
|
@ -230,7 +230,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
|
|||
{
|
||||
if( item->Type() == PCB_PAD_T )
|
||||
{
|
||||
D_PAD* pad = static_cast<D_PAD*>( item );
|
||||
PAD* pad = static_cast<PAD*>( item );
|
||||
const SHAPE_SEGMENT* holeShape = pad->GetEffectiveHoleShape();
|
||||
|
||||
return zone->Outline()->Collide( holeShape );
|
||||
|
|
|
@ -253,7 +253,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
|||
return color.Brightened( m_selectFactor ).WithAlpha( 0.8 );
|
||||
|
||||
// Don't let pads that *should* be NPTHs get lost
|
||||
if( item->Type() == PCB_PAD_T && dyn_cast<const D_PAD*>( item )->PadShouldBeNPTH() )
|
||||
if( item->Type() == PCB_PAD_T && dyn_cast<const PAD*>( item )->PadShouldBeNPTH() )
|
||||
aLayer = LAYER_MOD_TEXT_INVISIBLE;
|
||||
|
||||
if( item->IsSelected() )
|
||||
|
@ -331,7 +331,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
|
|||
}
|
||||
else if( item->Type() == PCB_PAD_T )
|
||||
{
|
||||
isActive = static_cast<const D_PAD*>( item )->IsOnLayer( primary );
|
||||
isActive = static_cast<const PAD*>( item )->IsOnLayer( primary );
|
||||
}
|
||||
else if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
|
||||
{
|
||||
|
@ -382,13 +382,13 @@ int PCB_PAINTER::getLineThickness( int aActualThickness ) const
|
|||
}
|
||||
|
||||
|
||||
int PCB_PAINTER::getDrillShape( const D_PAD* aPad ) const
|
||||
int PCB_PAINTER::getDrillShape( const PAD* aPad ) const
|
||||
{
|
||||
return aPad->GetDrillShape();
|
||||
}
|
||||
|
||||
|
||||
VECTOR2D PCB_PAINTER::getDrillSize( const D_PAD* aPad ) const
|
||||
VECTOR2D PCB_PAINTER::getDrillSize( const PAD* aPad ) const
|
||||
{
|
||||
return VECTOR2D( aPad->GetDrillSize() );
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
|
|||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
draw( static_cast<const D_PAD*>( item ), aLayer );
|
||||
draw( static_cast<const PAD*>( item ), aLayer );
|
||||
break;
|
||||
|
||||
case PCB_SHAPE_T:
|
||||
|
@ -770,7 +770,7 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
|
|||
}
|
||||
|
||||
|
||||
void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
||||
void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
||||
{
|
||||
// Draw description layer
|
||||
if( IsNetnameLayer( aLayer ) )
|
||||
|
@ -934,7 +934,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
|||
|
||||
if( margin.x != margin.y )
|
||||
{
|
||||
const_cast<D_PAD*>( aPad )->SetSize( pad_size + margin + margin );
|
||||
const_cast<PAD*>( aPad )->SetSize( pad_size + margin + margin );
|
||||
margin.x = margin.y = 0;
|
||||
}
|
||||
|
||||
|
@ -943,7 +943,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
|||
{
|
||||
// Reset the stored pad size
|
||||
if( aPad->GetSize() != pad_size )
|
||||
const_cast<D_PAD*>( aPad )->SetSize( pad_size );
|
||||
const_cast<PAD*>( aPad )->SetSize( pad_size );
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1054,7 +1054,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
|||
}
|
||||
|
||||
if( aPad->GetSize() != pad_size )
|
||||
const_cast<D_PAD*>( aPad )->SetSize( pad_size );
|
||||
const_cast<PAD*>( aPad )->SetSize( pad_size );
|
||||
}
|
||||
|
||||
// Clearance outlines
|
||||
|
|
|
@ -40,7 +40,7 @@ class ARC;
|
|||
class BOARD;
|
||||
class VIA;
|
||||
class TRACK;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class PCB_SHAPE;
|
||||
class PCB_GROUP;
|
||||
class MODULE;
|
||||
|
@ -284,7 +284,7 @@ protected:
|
|||
void draw( const TRACK* aTrack, int aLayer );
|
||||
void draw( const ARC* aArc, int aLayer );
|
||||
void draw( const VIA* aVia, int aLayer );
|
||||
void draw( const D_PAD* aPad, int aLayer );
|
||||
void draw( const PAD* aPad, int aLayer );
|
||||
void draw( const PCB_SHAPE* aSegment, int aLayer );
|
||||
void draw( const PCB_TEXT* aText, int aLayer );
|
||||
void draw( const FP_TEXT* aText, int aLayer );
|
||||
|
@ -307,12 +307,12 @@ protected:
|
|||
/**
|
||||
* Return drill shape of a pad.
|
||||
*/
|
||||
virtual int getDrillShape( const D_PAD* aPad ) const;
|
||||
virtual int getDrillShape( const PAD* aPad ) const;
|
||||
|
||||
/**
|
||||
* Return drill size for a pad (internal units).
|
||||
*/
|
||||
virtual VECTOR2D getDrillSize( const D_PAD* aPad ) const;
|
||||
virtual VECTOR2D getDrillSize( const PAD* aPad ) const;
|
||||
|
||||
/**
|
||||
* Return drill diameter for a via (internal units).
|
||||
|
|
|
@ -285,13 +285,13 @@ KIGFX::PCB_PRINT_PAINTER::PCB_PRINT_PAINTER( GAL* aGal )
|
|||
}
|
||||
|
||||
|
||||
int KIGFX::PCB_PRINT_PAINTER::getDrillShape( const D_PAD* aPad ) const
|
||||
int KIGFX::PCB_PRINT_PAINTER::getDrillShape( const PAD* aPad ) const
|
||||
{
|
||||
return m_drillMarkReal ? KIGFX::PCB_PAINTER::getDrillShape( aPad ) : PAD_DRILL_SHAPE_CIRCLE;
|
||||
}
|
||||
|
||||
|
||||
VECTOR2D KIGFX::PCB_PRINT_PAINTER::getDrillSize( const D_PAD* aPad ) const
|
||||
VECTOR2D KIGFX::PCB_PRINT_PAINTER::getDrillSize( const PAD* aPad ) const
|
||||
{
|
||||
// TODO should it depend on the pad size?
|
||||
return m_drillMarkReal ? KIGFX::PCB_PAINTER::getDrillSize( aPad ) :
|
||||
|
|
|
@ -99,9 +99,9 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
int getDrillShape( const D_PAD* aPad ) const override;
|
||||
int getDrillShape( const PAD* aPad ) const override;
|
||||
|
||||
VECTOR2D getDrillSize( const D_PAD* aPad ) const override;
|
||||
VECTOR2D getDrillSize( const PAD* aPad ) const override;
|
||||
|
||||
int getDrillSize( const VIA* aVia ) const override;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
class PLOTTER;
|
||||
class PCB_TEXT;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class PCB_SHAPE;
|
||||
class DIMENSION_BASE;
|
||||
class MODULE;
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
* and be drawn as a non filled item although the plot mode is filled
|
||||
* color and plot mode are needed by this function
|
||||
*/
|
||||
void PlotPad( D_PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode );
|
||||
void PlotPad( PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode );
|
||||
|
||||
/**
|
||||
* plot items like text and graphics,
|
||||
|
|
|
@ -231,7 +231,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
{
|
||||
aPlotter->StartBlock( NULL );
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
OUTLINE_MODE padPlotMode = plotMode;
|
||||
|
||||
|
@ -335,7 +335,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
{
|
||||
// inflate/deflate a custom shape is a bit complex.
|
||||
// so build a similar pad shape, and inflate/deflate the polygonal shape
|
||||
D_PAD dummy( *pad );
|
||||
PAD dummy( *pad );
|
||||
SHAPE_POLY_SET shape;
|
||||
pad->MergePrimitivesAsPolygon( &shape, UNDEFINED_LAYER );
|
||||
// Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
|
||||
|
@ -634,7 +634,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
|
||||
for( MODULE* module : aBoard->Modules() )
|
||||
{
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
for( PAD* pad : module->Pads() )
|
||||
{
|
||||
wxSize hole = pad->GetDrillSize();
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@
|
|||
#include <pcb_shape.h>
|
||||
#include <fp_shape.h>
|
||||
#include <footprint.h>
|
||||
#include <fp_text.h> // for FP_TEXT
|
||||
#include <fp_text.h>
|
||||
#include <track.h>
|
||||
#include <pad.h> // for D_PAD
|
||||
#include <pad.h>
|
||||
#include <pcb_target.h>
|
||||
#include <pcb_text.h>
|
||||
#include <zone.h>
|
||||
|
@ -85,7 +85,7 @@ COLOR4D BRDITEMS_PLOTTER::getColor( LAYER_NUM aLayer )
|
|||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode )
|
||||
void BRDITEMS_PLOTTER::PlotPad( PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode )
|
||||
{
|
||||
wxPoint shape_pos = aPad->ShapePos();
|
||||
GBR_METADATA gbr_metadata;
|
||||
|
|
|
@ -1699,7 +1699,7 @@ void ALTIUM_PCB::ParsePads6Data( const CFB::CompoundFileReader& aReader,
|
|||
module = m_components.at( elem.component );
|
||||
}
|
||||
|
||||
D_PAD* pad = new D_PAD( module );
|
||||
PAD* pad = new PAD( module );
|
||||
module->Add( pad, ADD_MODE::APPEND );
|
||||
|
||||
pad->SetName( elem.name );
|
||||
|
@ -1834,14 +1834,14 @@ void ALTIUM_PCB::ParsePads6Data( const CFB::CompoundFileReader& aReader,
|
|||
{
|
||||
case ALTIUM_LAYER::TOP_LAYER:
|
||||
pad->SetLayer( F_Cu );
|
||||
pad->SetLayerSet( D_PAD::SMDMask() );
|
||||
pad->SetLayerSet( PAD::SMDMask() );
|
||||
break;
|
||||
case ALTIUM_LAYER::BOTTOM_LAYER:
|
||||
pad->SetLayer( B_Cu );
|
||||
pad->SetLayerSet( FlipLayerMask( D_PAD::SMDMask() ) );
|
||||
pad->SetLayerSet( FlipLayerMask( PAD::SMDMask() ) );
|
||||
break;
|
||||
case ALTIUM_LAYER::MULTI_LAYER:
|
||||
pad->SetLayerSet( elem.plated ? D_PAD::PTHMask() : D_PAD::UnplatedHoleMask() );
|
||||
pad->SetLayerSet( elem.plated ? PAD::PTHMask() : PAD::UnplatedHoleMask() );
|
||||
break;
|
||||
default:
|
||||
PCB_LAYER_ID klayer = GetKicadLayer( elem.layer );
|
||||
|
|
|
@ -703,7 +703,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryPads( const SYMDEF_PCB& aComponent,
|
|||
{
|
||||
for( std::pair<PAD_ID, COMPONENT_PAD> padPair : aComponent.ComponentPads )
|
||||
{
|
||||
D_PAD* pad = getKiCadPad( padPair.second, aModule );
|
||||
PAD* pad = getKiCadPad( padPair.second, aModule );
|
||||
aModule->Add( pad,
|
||||
ADD_MODE::INSERT ); // insert so that we get correct behaviour when finding pads
|
||||
// in the module by PAD_ID - see loadNets()
|
||||
|
@ -711,11 +711,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryPads( const SYMDEF_PCB& aComponent,
|
|||
}
|
||||
|
||||
|
||||
D_PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, MODULE* aParent )
|
||||
PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad, MODULE* aParent )
|
||||
{
|
||||
PADCODE csPadcode = getPadCode( aCadstarPad.PadCodeID );
|
||||
|
||||
D_PAD* pad = new D_PAD( aParent );
|
||||
PAD* pad = new PAD( aParent );
|
||||
|
||||
switch( aCadstarPad.Side )
|
||||
{
|
||||
|
@ -1226,7 +1226,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponents()
|
|||
csPad.Side = padEx.Side;
|
||||
|
||||
//Find the pad in the module definition
|
||||
D_PAD* kiPad = m->Pads().at( padEx.ID - (long) 1 );
|
||||
PAD* kiPad = m->Pads().at( padEx.ID - (long) 1 );
|
||||
|
||||
if( kiPad )
|
||||
delete kiPad;
|
||||
|
|
|
@ -338,7 +338,7 @@ private:
|
|||
|
||||
// Helper Functions for obtaining individual elements as KiCad elements:
|
||||
double getHatchCodeAngleDegrees( const HATCHCODE_ID& aCadstarHatchcodeID );
|
||||
D_PAD* getKiCadPad( const COMPONENT_PAD& aCadstarPad, MODULE* aParent );
|
||||
PAD* getKiCadPad( const COMPONENT_PAD& aCadstarPad, MODULE* aParent );
|
||||
MODULE* getModuleFromCadstarID( const COMPONENT_ID& aCadstarComponentID );
|
||||
int getKiCadHatchCodeThickness( const HATCHCODE_ID& aCadstarHatchcodeID );
|
||||
int getKiCadHatchCodeGap( const HATCHCODE_ID& aCadstarHatchcodeID );
|
||||
|
|
|
@ -1040,7 +1040,7 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
|
|||
m_board->Add( m, ADD_MODE::APPEND );
|
||||
|
||||
// update the nets within the pads of the clone
|
||||
for( D_PAD* pad : m->Pads() )
|
||||
for( PAD* pad : m->Pads() )
|
||||
{
|
||||
wxString pn_key = makeKey( e.name, pad->GetName() );
|
||||
|
||||
|
@ -1671,7 +1671,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree )
|
|||
int shape = EPAD::UNDEF;
|
||||
int eagleDrillz = e.drill.ToPcbUnits();
|
||||
|
||||
D_PAD* pad = new D_PAD( aModule );
|
||||
PAD* pad = new PAD( aModule );
|
||||
aModule->Add( pad );
|
||||
transferPad( e, pad );
|
||||
|
||||
|
@ -1706,7 +1706,7 @@ void EAGLE_PLUGIN::packagePad( MODULE* aModule, wxXmlNode* aTree )
|
|||
case EPAD::OCTAGON:
|
||||
// no KiCad octagonal pad shape, use PAD_CIRCLE for now.
|
||||
// pad->SetShape( PAD_OCTAGON );
|
||||
wxASSERT( pad->GetShape() == PAD_SHAPE_CIRCLE ); // verify set in D_PAD constructor
|
||||
wxASSERT( pad->GetShape() == PAD_SHAPE_CIRCLE ); // verify set in PAD constructor
|
||||
pad->SetShape( PAD_SHAPE_CHAMFERED_RECT );
|
||||
pad->SetChamferPositions( RECT_CHAMFER_ALL );
|
||||
pad->SetChamferRectRatio( 0.25 );
|
||||
|
@ -2134,7 +2134,7 @@ void EAGLE_PLUGIN::packageHole( MODULE* aModule, wxXmlNode* aTree, bool aCenter
|
|||
EHOLE e( aTree );
|
||||
|
||||
// we add a PAD_ATTRIB_NPTH pad to this module.
|
||||
D_PAD* pad = new D_PAD( aModule );
|
||||
PAD* pad = new PAD( aModule );
|
||||
aModule->Add( pad );
|
||||
|
||||
pad->SetShape( PAD_SHAPE_CIRCLE );
|
||||
|
@ -2176,7 +2176,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const
|
|||
if( !IsCopperLayer( layer ) )
|
||||
return;
|
||||
|
||||
D_PAD* pad = new D_PAD( aModule );
|
||||
PAD* pad = new PAD( aModule );
|
||||
aModule->Add( pad );
|
||||
transferPad( e, pad );
|
||||
|
||||
|
@ -2240,7 +2240,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const
|
|||
}
|
||||
|
||||
|
||||
void EAGLE_PLUGIN::transferPad( const EPAD_COMMON& aEaglePad, D_PAD* aPad ) const
|
||||
void EAGLE_PLUGIN::transferPad( const EPAD_COMMON& aEaglePad, PAD* aPad ) const
|
||||
{
|
||||
aPad->SetName( FROM_UTF8( aEaglePad.name.c_str() ) );
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <tuple>
|
||||
#include <wx/xml/xml.h>
|
||||
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class FP_TEXT;
|
||||
class ZONE;
|
||||
|
||||
|
@ -307,7 +307,7 @@ private:
|
|||
void packageSMD( MODULE* aModule, wxXmlNode* aTree ) const;
|
||||
|
||||
///> Handles common pad properties
|
||||
void transferPad( const EPAD_COMMON& aEaglePad, D_PAD* aPad ) const;
|
||||
void transferPad( const EPAD_COMMON& aEaglePad, PAD* aPad ) const;
|
||||
|
||||
///> Deletes the footprint templates list
|
||||
void deleteTemplates();
|
||||
|
|
|
@ -539,7 +539,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
|
|||
aLineReader->LineNumber(), 0 );
|
||||
}
|
||||
|
||||
D_PAD* pad = new D_PAD( module.get() );
|
||||
PAD* pad = new PAD( module.get() );
|
||||
|
||||
static const LSET pad_front( 3, F_Cu, F_Mask, F_Paste );
|
||||
static const LSET pad_back( 3, B_Cu, B_Mask, B_Paste );
|
||||
|
@ -627,7 +627,7 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader )
|
|||
aLineReader->LineNumber(), 0 );
|
||||
}
|
||||
|
||||
D_PAD* pad = new D_PAD( module.get() );
|
||||
PAD* pad = new PAD( module.get() );
|
||||
|
||||
pad->SetShape( PAD_SHAPE_CIRCLE );
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
|
|||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
format( static_cast<D_PAD*>( aItem ), aNestLevel );
|
||||
format( static_cast<PAD*>( aItem ), aNestLevel );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
|
@ -1077,14 +1077,14 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
|
|||
Format( (BOARD_ITEM*) &aModule->Reference(), aNestLevel+1 );
|
||||
Format( (BOARD_ITEM*) &aModule->Value(), aNestLevel+1 );
|
||||
|
||||
std::set<D_PAD*, MODULE::cmp_pads> sorted_pads( aModule->Pads().begin(),
|
||||
aModule->Pads().end() );
|
||||
std::set<PAD*, MODULE::cmp_pads> sorted_pads( aModule->Pads().begin(),
|
||||
aModule->Pads().end() );
|
||||
std::set<BOARD_ITEM*, MODULE::cmp_drawings> sorted_drawings( aModule->GraphicalItems().begin(),
|
||||
aModule->GraphicalItems().end() );
|
||||
aModule->GraphicalItems().end() );
|
||||
std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_zones( aModule->Zones().begin(),
|
||||
aModule->Zones().end() );
|
||||
aModule->Zones().end() );
|
||||
std::set<BOARD_ITEM*, PCB_GROUP::ptr_cmp> sorted_groups( aModule->Groups().begin(),
|
||||
aModule->Groups().end() );
|
||||
aModule->Groups().end() );
|
||||
|
||||
// Save drawing elements.
|
||||
|
||||
|
@ -1092,7 +1092,7 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
|
|||
Format( gr, aNestLevel+1 );
|
||||
|
||||
// Save pads.
|
||||
for( D_PAD* pad : sorted_pads )
|
||||
for( PAD* pad : sorted_pads )
|
||||
Format( pad, aNestLevel+1 );
|
||||
|
||||
// Save zones.
|
||||
|
@ -1229,7 +1229,7 @@ void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const
|
|||
}
|
||||
|
||||
|
||||
void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
|
||||
void PCB_IO::format( PAD* aPad, int aNestLevel ) const
|
||||
{
|
||||
const char* shape;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class DIMENSION_BASE;
|
|||
class FP_SHAPE;
|
||||
class PCB_SHAPE;
|
||||
class PCB_TARGET;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class FP_TEXT;
|
||||
class PCB_GROUP;
|
||||
class TRACK;
|
||||
|
@ -270,7 +270,7 @@ private:
|
|||
|
||||
void format( MODULE* aModule, int aNestLevel = 0 ) const;
|
||||
|
||||
void format( D_PAD* aPad, int aNestLevel = 0 ) const;
|
||||
void format( PAD* aPad, int aNestLevel = 0 ) const;
|
||||
|
||||
void format( PCB_TEXT* aText, int aNestLevel = 0 ) const;
|
||||
|
||||
|
|
|
@ -3041,8 +3041,8 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
|
|||
|
||||
case T_pad:
|
||||
{
|
||||
D_PAD* pad = parseD_PAD( module.get() );
|
||||
pt = pad->GetPos0();
|
||||
PAD* pad = parsePAD( module.get() );
|
||||
pt = pad->GetPos0();
|
||||
|
||||
RotatePoint( &pt, module->GetOrientation() );
|
||||
pad->SetPosition( pt + module->GetPosition() );
|
||||
|
@ -3412,15 +3412,15 @@ FP_SHAPE* PCB_PARSER::parseFP_SHAPE()
|
|||
}
|
||||
|
||||
|
||||
D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
||||
PAD* PCB_PARSER::parsePAD( MODULE* aParent )
|
||||
{
|
||||
wxCHECK_MSG( CurTok() == T_pad, NULL,
|
||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as D_PAD." ) );
|
||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as PAD." ) );
|
||||
|
||||
wxSize sz;
|
||||
wxPoint pt;
|
||||
|
||||
std::unique_ptr<D_PAD> pad = std::make_unique<D_PAD>( aParent );
|
||||
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aParent );
|
||||
|
||||
// File only contains a token if KeepTopBottom is true
|
||||
pad->SetKeepTopBottom( false );
|
||||
|
@ -3439,7 +3439,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
|||
case T_smd:
|
||||
pad->SetAttribute( PAD_ATTRIB_SMD );
|
||||
|
||||
// Default D_PAD object is thru hole with drill.
|
||||
// Default PAD object is thru hole with drill.
|
||||
// SMD pads have no hole
|
||||
pad->SetDrillSize( wxSize( 0, 0 ) );
|
||||
break;
|
||||
|
@ -3447,7 +3447,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
|||
case T_connect:
|
||||
pad->SetAttribute( PAD_ATTRIB_CONN );
|
||||
|
||||
// Default D_PAD object is thru hole with drill.
|
||||
// Default PAD object is thru hole with drill.
|
||||
// CONN pads have no hole
|
||||
pad->SetDrillSize( wxSize( 0, 0 ) );
|
||||
break;
|
||||
|
@ -3584,10 +3584,10 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
|||
}
|
||||
}
|
||||
|
||||
// This fixes a bug caused by setting the default D_PAD drill size to a value
|
||||
// other than 0 used to fix a bunch of debug assertions even though it is defined
|
||||
// as a through hole pad. Wouldn't a though hole pad with no drill be a surface
|
||||
// mount pad (or a conn pad which is a smd pad with no solder paste)?
|
||||
// This fixes a bug caused by setting the default PAD drill size to a value other
|
||||
// than 0 used to fix a bunch of debug assertions even though it is defined as a
|
||||
// through hole pad. Wouldn't a though hole pad with no drill be a surface mount
|
||||
// pad (or a conn pad which is a smd pad with no solder paste)?
|
||||
if( ( pad->GetAttribute() != PAD_ATTRIB_SMD ) && ( pad->GetAttribute() != PAD_ATTRIB_CONN ) )
|
||||
pad->SetDrillSize( drillSize );
|
||||
else
|
||||
|
@ -3787,7 +3787,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
|||
break;
|
||||
|
||||
case T_options:
|
||||
parseD_PAD_option( pad.get() );
|
||||
parsePAD_option( pad.get() );
|
||||
break;
|
||||
|
||||
case T_primitives:
|
||||
|
@ -3881,7 +3881,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
|||
}
|
||||
|
||||
|
||||
bool PCB_PARSER::parseD_PAD_option( D_PAD* aPad )
|
||||
bool PCB_PARSER::parsePAD_option( PAD* aPad )
|
||||
{
|
||||
// Parse only the (option ...) inside a pad description
|
||||
for( T token = NextTok(); token != T_RIGHT; token = NextTok() )
|
||||
|
|
|
@ -43,7 +43,7 @@ class ARC;
|
|||
class BOARD;
|
||||
class BOARD_ITEM;
|
||||
class BOARD_ITEM_CONTAINER;
|
||||
class D_PAD;
|
||||
class PAD;
|
||||
class BOARD_DESIGN_SETTINGS;
|
||||
class DIMENSION_BASE;
|
||||
class PCB_SHAPE;
|
||||
|
@ -173,9 +173,9 @@ class PCB_PARSER : public PCB_LEXER
|
|||
MODULE* parseMODULE_unchecked( wxArrayString* aInitialComments = 0 );
|
||||
FP_TEXT* parseFP_TEXT();
|
||||
FP_SHAPE* parseFP_SHAPE();
|
||||
D_PAD* parseD_PAD( MODULE* aParent = NULL );
|
||||
PAD* parsePAD( MODULE* aParent = NULL );
|
||||
// Parse only the (option ...) inside a pad description
|
||||
bool parseD_PAD_option( D_PAD* aPad );
|
||||
bool parsePAD_option( PAD* aPad );
|
||||
ARC* parseARC();
|
||||
TRACK* parseTRACK();
|
||||
VIA* parseVIA();
|
||||
|
|
|
@ -1398,9 +1398,9 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule )
|
|||
|
||||
void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
|
||||
{
|
||||
std::unique_ptr<D_PAD> pad = std::make_unique<D_PAD>( aModule );
|
||||
char* line;
|
||||
char* saveptr;
|
||||
std::unique_ptr<PAD> pad = std::make_unique<PAD>( aModule );
|
||||
char* line;
|
||||
char* saveptr;
|
||||
|
||||
while( ( line = READLINE( m_reader ) ) != NULL )
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue