56 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
62 const wxString& aActualConversion )
67 wxString propValue, str, emsg;
71 lNode =
FindNode( aNode, wxT(
"padNum" ) );
75 lNode->GetNodeContent().ToLong( &num );
79 lNode =
FindNode( aNode, wxT(
"padStyleRef" ) );
83 lNode->GetAttribute( wxT(
"Name" ), &propValue );
84 propValue.Trim(
false );
88 lNode =
FindNode( aNode, wxT(
"pt" ) );
96 lNode =
FindNode( aNode, wxT(
"rotation" ) );
100 str = lNode->GetNodeContent();
105 lNode =
FindNode( aNode, wxT(
"netNameRef" ) );
109 lNode->GetAttribute( wxT(
"Name" ), &propValue );
110 propValue.Trim(
false );
111 propValue.Trim(
true );
116 lNode =
FindNode( aNode, wxT(
"defaultPinDes" ) );
120 lNode->GetAttribute( wxT(
"Name" ), &propValue );
128 while( lNode && lNode->GetName() != wxT(
"www.lura.sk" ) )
131 lNode =
FindNode( lNode, wxT(
"library" ) );
136 lNode =
FindNode( lNode, wxT(
"padStyleDef" ) );
140 lNode->GetAttribute( wxT(
"Name" ), &propValue );
151 cNode =
FindNode( lNode, wxT(
"holeDiam" ) );
154 SetWidth( cNode->GetNodeContent(), aDefaultUnits, &
m_Hole, aActualConversion );
156 if(
FindNodeGetContent( lNode, wxT(
"isHolePlated" ) ).IsSameAs( wxT(
"False" ),
false ) )
159 cNode =
FindNode( lNode, wxT(
"padShape" ) );
163 if( cNode->GetName().IsSameAs( wxT(
"padShape" ),
false ) )
167 if(
FindNode( cNode, wxT(
"layerNumRef" ) ) )
170 padShape->
Parse( cNode, aDefaultUnits, aActualConversion );
189 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
195 bool aEncapsulatedPad )
198 wxString padShapeName = wxT(
"Ellipse" );
210 pad->SetAttribute( PAD_ATTRIB::NPTH );
212 pad->SetDrillShape( PAD_DRILL_SHAPE::CIRCLE );
218 if(
m_Shapes.GetCount() &&
m_Shapes[0]->m_Shape.IsSameAs( wxT(
"MtHole" ),
false ) )
221 pad->SetLocalSolderMaskMargin( sm_margin );
229 (
m_Hole ) ? padType = PAD_ATTRIB::PTH : padType = PAD_ATTRIB::SMD;
232 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
241 padShapeName = padShape->
m_Shape;
256 if( width == 0 || height == 0 )
262 if( padType == PAD_ATTRIB::PTH )
268 if( padShapeName.IsSameAs( wxT(
"Oval" ),
false )
269 || padShapeName.IsSameAs( wxT(
"Ellipse" ),
false )
270 || padShapeName.IsSameAs( wxT(
"MtHole" ),
false ) )
272 if( width != height )
277 else if( padShapeName.IsSameAs( wxT(
"Rect" ),
false ) )
281 else if( padShapeName.IsSameAs( wxT(
"RndRect" ),
false ) )
285 else if( padShapeName.IsSameAs( wxT(
"Polygon" ),
false ) )
294 pad->SetDrillShape( PAD_DRILL_SHAPE::CIRCLE );
298 pad->SetAttribute( padType );
303 if( netinfo ==
nullptr )
313 if( !aEncapsulatedPad )
334 for( i = 0; i < (int)
m_Shapes.GetCount(); i++ )
351 if( width == 0 || height == 0 )
363 via->SetViaType( VIATYPE::THROUGH );
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
virtual void Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion)
void AddToFootprint(FOOTPRINT *aFootprint, const EDA_ANGLE &aRotation, bool aEncapsulatedPad)
PCAD_PAD_SHAPES_ARRAY m_Shapes
PCAD_PAD(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
void AddToBoard(FOOTPRINT *aFootprint=nullptr) override
virtual void Flip() override
virtual void Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion)
PCAD_CALLBACKS * m_callbacks
int GetNetCode(const wxString &aNetName) const
PCB_LAYER_ID m_KiCadLayer
Hold an XML or S-expression element.
XNODE * GetParent() const
static constexpr EDA_ANGLE ANGLE_0
#define THROW_IO_ERROR(msg)
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
int StrToInt1Units(const wxString &aStr)
void SetWidth(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aWidth, const wxString &aActualConversion)
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
wxString FindNodeGetContent(XNODE *aChild, const wxString &aTag)
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I