67 XNODE* result, * lNode;
68 wxString propValue1, propValue2;
71 lNode =
FindNode( aNode, wxT(
"patternDef" ) );
75 if( lNode->GetName() == wxT(
"patternDef" ) )
77 lNode->GetAttribute( wxT(
"Name" ), &propValue1 );
78 if(
XNODE* originalNameNode =
FindNode( lNode, wxT(
"originalName" ) ) )
79 originalNameNode->GetAttribute( wxT(
"Name" ), &propValue2 );
92 if( result ==
nullptr )
94 lNode =
FindNode( aNode, wxT(
"patternDefExtended" ) );
98 if( lNode->GetName() == wxT(
"patternDefExtended" ) )
100 lNode->GetAttribute( wxT(
"Name" ), &propValue1 );
120 XNODE* result, * pNode, * lNode;
121 wxString propValue, patName;
128 if( lNode->GetName() == wxT(
"compDef" ) )
130 lNode->GetAttribute( wxT(
"Name" ), &propValue );
131 propValue.Trim(
false );
134 if(
XNODE* patternNode =
FindNode( lNode, wxT(
"attachedPattern" ) ) )
136 if(
XNODE* patternNameNode =
FindNode( patternNode, wxT(
"patternName" ) ) )
137 patternNameNode->GetAttribute( wxT(
"Name" ), &propValue );
139 propValue.Trim(
false );
140 propValue.Trim(
true );
151 lNode =
FindNode( pNode, wxT(
"multiLayer" ) );
155 *aPatGraphRefName = wxEmptyString;
162 if( *aPatGraphRefName == wxEmptyString )
164 if(
XNODE* nameRefNode =
FindNode( aNode, wxT(
"patternGraphicsNameRef" ) ) )
165 nameRefNode->GetAttribute( wxT(
"Name" ), aPatGraphRefName );
168 if(
FindNode( aNode, wxT(
"patternGraphicsDef" ) ) )
169 lNode =
FindNode( aNode, wxT(
"patternGraphicsDef" ) );
171 lNode =
FindNode( pNode, wxT(
"patternGraphicsDef" ) );
173 if( *aPatGraphRefName == wxEmptyString )
177 result =
FindNode( lNode, wxT(
"multiLayer" ) );
184 if( lNode->GetName() == wxT(
"patternGraphicsDef" ) )
186 if(
XNODE* nameDefNode =
FindNode( lNode, wxT(
"patternGraphicsNameDef" ) ) )
187 nameDefNode->GetAttribute( wxT(
"Name" ), &propValue );
189 if( propValue == *aPatGraphRefName )
191 result =
FindNode( lNode, wxT(
"multiLayer" ) );
211 PCAD_COMPONENTS_ARRAY* aList, wxStatusBar* aStatusBar,
212 const wxString& aDefaultMeasurementUnit,
213 const wxString& aActualConversion )
221 VERTICES_ARRAY* plane_layer_polygon =
nullptr;
224 XNODE* lNode =
nullptr;
225 XNODE* tNode =
nullptr;
232 if(
FindNode( aNode, wxT(
"layerNumRef" ) ) )
233 FindNode( aNode, wxT(
"layerNumRef" ) )->GetNodeContent().ToLong( &num );
235 PCadLayer = (int) num;
242 aList->Add( plane_layer );
254 if( lNode->GetName() == wxT(
"line" ) )
257 line->
Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
261 if( lNode->GetName() == wxT(
"text" ) )
264 text->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
269 if( lNode->GetName() == wxT(
"attr" ) )
272 lNode->GetAttribute( wxT(
"Name" ), &propValue );
273 propValue.Trim(
false );
274 propValue.Trim(
true );
276 if( propValue == wxT(
"RefDes" ) )
278 tNode =
FindNode( lNode, wxT(
"textStyleRef" ) );
280 if( tNode && aFootprint )
296 if( lNode->GetName() == wxT(
"arc" ) || lNode->GetName() == wxT(
"triplePointArc" ) )
299 arc->
Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
303 if( lNode->GetName() == wxT(
"pcbPoly" ) )
309 plane_layer_polygon =
new VERTICES_ARRAY;
310 plane_layer->
FormPolygon( lNode, plane_layer_polygon, aDefaultMeasurementUnit,
312 plane_layer->
m_Cutouts.Add( plane_layer_polygon );
319 if( polygon->
Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
320 aList->Add( polygon );
326 if( lNode->GetName() == wxT(
"copperPour95" ) )
330 if( copperPour->
Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
331 aList->Add( copperPour );
336 if( lNode->GetName() == wxT(
"polyCutOut" ) )
340 if( cutout->
Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
341 aList->Add( cutout );
346 if( lNode->GetName() == wxT(
"planeObj" ) )
350 if( plane->
Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
378 const wxString& aDefaultMeasurementUnit,
379 const wxString& aActualConversion )
381 XNODE* lNode =
nullptr;
382 XNODE* tNode =
nullptr;;
383 XNODE* mNode =
nullptr;
386 wxString propValue, str;
388 FindNode( aNode, wxT(
"originalName" ) )->GetAttribute( wxT(
"Name" ), &propValue );
389 propValue.Trim(
false );
403 if( tNode->GetName() == wxT(
"pad" ) )
406 pad->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
410 if( tNode->GetName() == wxT(
"via" ) )
413 via->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
424 lNode =
FindNode( lNode, wxT(
"layerContents" ) );
428 if( lNode->GetName() == wxT(
"layerContents" ) )
431 aDefaultMeasurementUnit, aActualConversion );
446 if( mNode->GetName() == wxT(
"padNum" ) )
448 str = mNode->GetNodeContent();
454 mNode->GetAttribute( wxT(
"Name" ), &propValue );
475 wxCHECK( aFootprint ==
nullptr, );
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
void SetFPRelativePosition(const VECTOR2I &aPos)
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.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayer) const
void SetMirrored(bool isMirrored)
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetKeepUpright(bool aKeepUpright)
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultUnits, const wxString &aActualConversion)
virtual LAYER_TYPE_T GetLayerType(int aPCadLayer) const =0
virtual wxString GetLayerNetNameRef(int aPCadLayer) const =0
virtual bool Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion) override
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &actualConversion) override
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultUnits, const wxString &aActualConversion)
PCAD_CALLBACKS * m_callbacks
wxString m_PatGraphRefName
PCB_LAYER_ID m_KiCadLayer
virtual bool Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion) override
void SetOutline(VERTICES_ARRAY *aOutline)
virtual bool Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion)
void FormPolygon(XNODE *aNode, VERTICES_ARRAY *aPolygon, const wxString &aDefaultUnits, const wxString &actualConversion)
void AssignNet(const wxString &aNetName)
Hold an XML or S-expression element.
XNODE * GetParent() const
XNODE * GetChildren() const
wxString ValidateName(const wxString &aName)
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
wxString ValidateReference(const wxString &aRef)
void SetTextSizeFromStrokeFontHeight(EDA_TEXT *aText, int aTextHeight)
XNODE * FindPinMap(XNODE *aNode)
void CorrectTextPosition(TTEXTVALUE *aValue)
void SetFontProperty(XNODE *aNode, TTEXTVALUE *aTextValue, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
void InitTTextValue(TTEXTVALUE *aTextValue)
void SetTextSizeFromTrueTypeFontHeight(EDA_TEXT *aText, int aTextHeight)
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