KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcad_footprint.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2007, 2008 Lubo Racko <[email protected]>
5 * Copyright (C) 2007, 2008, 2012-2013 Alexander Lunev <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <pcad/pcad_arc.h>
28#include <pcad/pcad_cutout.h>
29#include <pcad/pcad_plane.h>
30#include <pcad/pcad_line.h>
31#include <pcad/pcad_footprint.h>
32#include <pcad/pcad_pad.h>
33#include <pcad/pcad_polygon.h>
34#include <pcad/pcad_text.h>
35#include <pcad/pcad_via.h>
36
37#include <board.h>
38#include <footprint.h>
39#include <pcb_text.h>
40#include <trigo.h>
41#include <xnode.h>
42
43#include <wx/string.h>
44
45namespace PCAD2KICAD {
46
47
49 PCAD_PCB_COMPONENT( aCallbacks, aBoard )
50{
52 m_Mirror = 0;
53 m_ObjType = wxT( 'M' ); // FOOTPRINT
54 m_KiCadLayer = F_SilkS; // default
55}
56
57
59{
60 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
61 delete m_FootprintItems[i];
62}
63
64
65XNODE* PCAD_FOOTPRINT::FindModulePatternDefName( XNODE* aNode, const wxString& aName )
66{
67 XNODE* result, * lNode;
68 wxString propValue1, propValue2;
69
70 result = nullptr;
71 lNode = FindNode( aNode, wxT( "patternDef" ) );
72
73 while( lNode )
74 {
75 if( lNode->GetName() == wxT( "patternDef" ) )
76 {
77 lNode->GetAttribute( wxT( "Name" ), &propValue1 );
78 if( XNODE* originalNameNode = FindNode( lNode, wxT( "originalName" ) ) )
79 originalNameNode->GetAttribute( wxT( "Name" ), &propValue2 );
80
81 if( ValidateName( propValue1 ) == aName || ValidateName( propValue2 ) == aName )
82 {
83 result = lNode;
84 lNode = nullptr;
85 }
86 }
87
88 if( lNode )
89 lNode = lNode->GetNext();
90 }
91
92 if( result == nullptr )
93 {
94 lNode = FindNode( aNode, wxT( "patternDefExtended" ) ); // New file format
95
96 while( lNode )
97 {
98 if( lNode->GetName() == wxT( "patternDefExtended" ) )
99 {
100 lNode->GetAttribute( wxT( "Name" ), &propValue1 );
101
102 if( ValidateName( propValue1 ) == aName )
103 {
104 result = lNode;
105 lNode = nullptr;
106 }
107 }
108
109 if( lNode )
110 lNode = lNode->GetNext();
111 }
112 }
113
114 return result;
115}
116
117
118XNODE* PCAD_FOOTPRINT::FindPatternMultilayerSection( XNODE* aNode, wxString* aPatGraphRefName )
119{
120 XNODE* result, * pNode, * lNode;
121 wxString propValue, patName;
122
123 result = nullptr;
124 pNode = aNode; // pattern;
125 lNode = aNode;
126
127 // calling from library conversion we need to find pattern
128 if( lNode->GetName() == wxT( "compDef" ) )
129 {
130 lNode->GetAttribute( wxT( "Name" ), &propValue );
131 propValue.Trim( false );
132 patName = ValidateName( propValue );
133
134 if( XNODE* patternNode = FindNode( lNode, wxT( "attachedPattern" ) ) )
135 {
136 if( XNODE* patternNameNode = FindNode( patternNode, wxT( "patternName" ) ) )
137 patternNameNode->GetAttribute( wxT( "Name" ), &propValue );
138
139 propValue.Trim( false );
140 propValue.Trim( true );
141 patName = ValidateName( propValue );
142 }
143
144 lNode = FindModulePatternDefName( lNode->GetParent(), patName );
145 pNode = lNode; // pattern;
146 }
147
148 lNode = nullptr;
149
150 if( pNode )
151 lNode = FindNode( pNode, wxT( "multiLayer" ) ); // Old file format
152
153 if( lNode )
154 {
155 *aPatGraphRefName = wxEmptyString; // default
156 result = lNode;
157 }
158 else
159 {
160 // New file format
161
162 if( *aPatGraphRefName == wxEmptyString ) // default
163 {
164 if( XNODE* nameRefNode = FindNode( aNode, wxT( "patternGraphicsNameRef" ) ) )
165 nameRefNode->GetAttribute( wxT( "Name" ), aPatGraphRefName );
166 }
167
168 if( FindNode( aNode, wxT( "patternGraphicsDef" ) ) )
169 lNode = FindNode( aNode, wxT( "patternGraphicsDef" ) );
170 else if( pNode )
171 lNode = FindNode( pNode, wxT( "patternGraphicsDef" ) );
172
173 if( *aPatGraphRefName == wxEmptyString ) // no pattern detection, the first is actual...
174 {
175 if( lNode )
176 {
177 result = FindNode( lNode, wxT( "multiLayer" ) );
178 lNode = nullptr;
179 }
180 }
181
182 while( lNode ) // selected by name
183 {
184 if( lNode->GetName() == wxT( "patternGraphicsDef" ) )
185 {
186 if( XNODE* nameDefNode = FindNode( lNode, wxT( "patternGraphicsNameDef" ) ) )
187 nameDefNode->GetAttribute( wxT( "Name" ), &propValue );
188
189 if( propValue == *aPatGraphRefName )
190 {
191 result = FindNode( lNode, wxT( "multiLayer" ) );
192 lNode = nullptr;
193 }
194 else
195 {
196 lNode = lNode->GetNext();
197 }
198 }
199 else
200 {
201 lNode = lNode->GetNext();
202 }
203 }
204 }
205
206 return result;
207}
208
209static bool HasLine( std::vector<PCAD_LINE*>& vector, PCAD_LINE* line )
210{
211 auto it = std::find_if( vector.begin(), vector.end(),
212 [line]( PCAD_LINE* l2 )
213 {
214 return line->m_PositionX == l2->m_PositionX && line->m_PositionY == l2->m_PositionY
215 && line->m_ToX == l2->m_ToX && line->m_ToY == l2->m_ToY;
216 } );
217 return it != vector.end();
218}
219
221 PCAD_COMPONENTS_ARRAY* aList, wxStatusBar* aStatusBar,
222 const wxString& aDefaultMeasurementUnit,
223 const wxString& aActualConversion )
224{
225 PCAD_ARC* arc = nullptr;
226 PCAD_POLYGON* polygon = nullptr;
227 PCAD_POLYGON* plane_layer = nullptr;
228 PCAD_COPPER_POUR* copperPour = nullptr;
229 PCAD_CUTOUT* cutout = nullptr;
230 PCAD_PLANE* plane = nullptr;
231 VERTICES_ARRAY* plane_layer_polygon = nullptr;
232 PCAD_LINE* line = nullptr;
233 PCAD_TEXT* text = nullptr;
234 XNODE* lNode = nullptr;
235 XNODE* tNode = nullptr;
236 XNODE* pNode = nullptr;
237 wxString propValue;
238 long long i = 0;
239 int PCadLayer = 0;
240 long num = 0;
241 int width = 0;
242 int x = 0, y = 0;
243 int LastX = 0, LastY = 0;
244 int FirstX = 0, FirstY = 0;
245 bool IsFirstPoint = false;
246 bool IsBoardLayer = false;
247 std::vector<PCAD_LINE*> lines;
248
249 // aStatusBar->SetStatusText( wxT( "Processing LAYER CONTENT OBJECTS " ) );
250 if( FindNode( aNode, wxT( "layerNumRef" ) ) )
251 FindNode( aNode, wxT( "layerNumRef" ) )->GetNodeContent().ToLong( &num );
252
253 PCadLayer = (int) num;
254 IsBoardLayer = ( PCadLayer == 3 );
255
256 if( m_callbacks->GetLayerType( PCadLayer ) == LAYER_TYPE_PLANE )
257 {
258 plane_layer = new PCAD_POLYGON( m_callbacks, m_board, PCadLayer );
259 plane_layer->AssignNet( m_callbacks->GetLayerNetNameRef( PCadLayer ) );
260 plane_layer->SetOutline( &m_BoardOutline );
261 aList->Add( plane_layer );
262
263 // fill the polygon with the same contour as its outline is
264 //plane_layer->AddIsland( &m_boardOutline );
265 }
266
267 lNode = aNode->GetChildren();
268
269 while( lNode )
270 {
271 i++;
272
273 if( lNode->GetName() == wxT( "line" ) )
274 {
275 line = new PCAD_LINE( m_callbacks, m_board );
276 line->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
277 if( IsBoardLayer )
278 {
279 if( !HasLine( lines, line ) )
280 {
281 lines.push_back( line );
282 aList->Add( line );
283 }
284 }
285 else
286 {
287 aList->Add( line );
288 }
289 }
290
291 if( lNode->GetName() == wxT( "text" ) )
292 {
294 text->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
295 aList->Add( text );
296 }
297
298 // added as Sergeys request 02/2008
299 if( lNode->GetName() == wxT( "attr" ) )
300 {
301 // assign fonts to Module Name,Value,Type,....s
302 lNode->GetAttribute( wxT( "Name" ), &propValue );
303 propValue.Trim( false );
304 propValue.Trim( true );
305
306 if( propValue == wxT( "RefDes" ) )
307 {
308 tNode = FindNode( lNode, wxT( "textStyleRef" ) );
309
310 if( tNode && aFootprint )
311 {
312 // TODO: to understand and may be repair
313 // Alexander Lunev: originally in Delphi version of the project there was
314 // a strange access to pcbModule->m_Name (it was global variable). This access
315 // is necessary when the function DoLayerContentsObjects() is called from
316 // function CreatePCBModule(). However it is not clear whether the access is
317 // required when the function DoLayerContentsObjects() is called from
318 // function ProcessXMLtoPCBLib().
319 SetFontProperty( tNode, &aFootprint->m_Name, aDefaultMeasurementUnit,
320 aActualConversion );
321 }
322 }
323 }
324
325 // added as Sergeys request 02/2008
326 if( lNode->GetName() == wxT( "arc" ) || lNode->GetName() == wxT( "triplePointArc" ) )
327 {
328 arc = new PCAD_ARC( m_callbacks, m_board );
329 arc->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
330 aList->Add( arc );
331 }
332
333 if( lNode->GetName() == wxT( "pcbPoly" ) )
334 {
335 if( m_callbacks->GetLayerType( PCadLayer ) == LAYER_TYPE_PLANE )
336 {
337 if( plane_layer )
338 {
339 plane_layer_polygon = new VERTICES_ARRAY;
340 plane_layer->FormPolygon( lNode, plane_layer_polygon, aDefaultMeasurementUnit,
341 aActualConversion );
342 plane_layer->m_Cutouts.Add( plane_layer_polygon );
343 }
344 }
345 else
346 {
347 polygon = new PCAD_POLYGON( m_callbacks, m_board, PCadLayer );
348
349 if( polygon->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
350 aList->Add( polygon );
351 else
352 delete polygon;
353 }
354 }
355
356 if( lNode->GetName() == wxT( "copperPour95" ) )
357 {
358 copperPour = new PCAD_COPPER_POUR( m_callbacks, m_board, PCadLayer );
359
360 if( copperPour->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
361 aList->Add( copperPour );
362 else
363 delete copperPour;
364 }
365
366 if( lNode->GetName() == wxT( "polyCutOut" ) )
367 {
368 cutout = new PCAD_CUTOUT( m_callbacks, m_board, PCadLayer );
369
370 if( cutout->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
371 aList->Add( cutout );
372 else
373 delete cutout;
374 }
375
376 if( lNode->GetName() == wxT( "planeObj" ) )
377 {
378 plane = new PCAD_PLANE( m_callbacks, m_board, PCadLayer );
379
380 if( plane->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
381 aList->Add( plane );
382 else
383 delete plane;
384 }
385
386 if( lNode->GetName() == wxT( "boardOutlineObj" ) && IsBoardLayer )
387 {
388 LastX = 0;
389 LastY = 0;
390 FirstX = 0;
391 FirstY = 0;
392 IsFirstPoint = true;
393
394 pNode = FindNode( lNode, wxT( "width" ) );
395
396 if( pNode )
397 {
398 SetWidth( pNode->GetNodeContent(), aDefaultMeasurementUnit, &width, aActualConversion );
399
400 pNode = FindNode( lNode, wxT( "enhancedPolygon" ) );
401
402 if( pNode )
403 {
404 pNode = pNode->GetChildren();
405
406 while( pNode )
407 {
408 if( pNode->GetName() == wxT( "polyPoint" ) )
409 {
410 SetPosition( pNode->GetNodeContent(), aDefaultMeasurementUnit, &x, &y, aActualConversion );
411 if( IsFirstPoint )
412 {
413 IsFirstPoint = false;
414 FirstX = x;
415 FirstY = y;
416 }
417 else
418 {
419 line = new PCAD_LINE( m_callbacks, m_board );
420 line->m_PositionX = LastX;
421 line->m_PositionY = LastY;
422 line->m_ToX = x;
423 line->m_ToY = y;
424 line->m_Width = width;
425 line->m_PCadLayer = PCadLayer;
426 line->m_KiCadLayer = line->GetKiCadLayer();
427 if( !HasLine( lines, line ) )
428 {
429 lines.push_back( line );
430 aList->Add( line );
431 }
432 }
433 LastX = x;
434 LastY = y;
435 }
436
437 pNode = pNode->GetNext();
438 }
439
440 if( LastX != FirstX || LastY != FirstY )
441 {
442 line = new PCAD_LINE( m_callbacks, m_board );
443 line->m_PositionX = LastX;
444 line->m_PositionY = LastY;
445 line->m_ToX = FirstX;
446 line->m_ToY = FirstY;
447 line->m_Width = width;
448 line->m_PCadLayer = PCadLayer;
449 line->m_KiCadLayer = line->GetKiCadLayer();
450 if( !HasLine( lines, line ) )
451 {
452 lines.push_back( line );
453 aList->Add( line );
454 }
455 }
456 }
457 }
458 }
459
460 lNode = lNode->GetNext();
461 }
462}
463
464
465void PCAD_FOOTPRINT::SetName( const wxString& aPin, const wxString& aName )
466{
467 long num;
468 aPin.ToLong( &num );
469
470 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
471 {
472 if( m_FootprintItems[i]->m_ObjType == wxT( 'P' ) )
473 {
474 if( ( (PCAD_PAD*) m_FootprintItems[i] )->m_Number == num )
475 ( (PCAD_PAD*) m_FootprintItems[i] )->m_Name.text = aName;
476 }
477 }
478}
479
480
481void PCAD_FOOTPRINT::Parse( XNODE* aNode, wxStatusBar* aStatusBar,
482 const wxString& aDefaultMeasurementUnit,
483 const wxString& aActualConversion )
484{
485 XNODE* lNode = nullptr;
486 XNODE* tNode = nullptr;;
487 XNODE* mNode = nullptr;
488 PCAD_PAD* pad = nullptr;
489 PCAD_VIA* via = nullptr;
490 wxString propValue, str;
491
492 FindNode( aNode, wxT( "originalName" ) )->GetAttribute( wxT( "Name" ), &propValue );
493 propValue.Trim( false );
494 m_Name.text = propValue;
495
496 // aStatusBar->SetStatusText( wxT( "Creating Component : " ) + m_Name.text );
497 lNode = aNode;
499
500 if( lNode )
501 {
502 tNode = lNode;
503 tNode = tNode->GetChildren();
504
505 while( tNode )
506 {
507 if( tNode->GetName() == wxT( "pad" ) )
508 {
510 pad->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
511 m_FootprintItems.Add( pad );
512 }
513
514 if( tNode->GetName() == wxT( "via" ) )
515 {
517 via->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
518 m_FootprintItems.Add( via );
519 }
520
521 tNode = tNode->GetNext();
522 }
523
524 lNode = lNode->GetParent();
525 }
526
527 if( lNode )
528 lNode = FindNode( lNode, wxT( "layerContents" ) );
529
530 while( lNode )
531 {
532 if( lNode->GetName() == wxT( "layerContents" ) )
533 {
534 DoLayerContentsObjects( lNode, this, &m_FootprintItems, aStatusBar,
535 aDefaultMeasurementUnit, aActualConversion );
536 }
537
538 lNode = lNode->GetNext();
539 }
540
541 // map pins
542 lNode = FindPinMap( aNode );
543
544 if( lNode )
545 {
546 mNode = lNode->GetChildren();
547
548 while( mNode )
549 {
550 if( mNode->GetName() == wxT( "padNum" ) )
551 {
552 str = mNode->GetNodeContent();
553 mNode = mNode->GetNext();
554
555 if( !mNode )
556 break;
557
558 mNode->GetAttribute( wxT( "Name" ), &propValue );
559 SetName( str, propValue );
560 mNode = mNode->GetNext();
561 }
562 else
563 {
564 mNode = mNode->GetNext();
565
566 if( !mNode )
567 break;
568
569 mNode = mNode->GetNext();
570 }
571 }
572 }
573}
574
575
577{
578 // No nested footprints....
579 wxCHECK( aFootprint == nullptr, /* void */ );
580
581 EDA_ANGLE r;
582
583 // transform text positions
585 RotatePoint( &m_Name.correctedPositionX, &m_Name.correctedPositionY, -m_Rotation );
586
588 RotatePoint( &m_Value.correctedPositionX, &m_Value.correctedPositionY, -m_Rotation );
589
590 FOOTPRINT* footprint = new FOOTPRINT( m_board );
591 m_board->Add( footprint, ADD_MODE::APPEND );
592
594 footprint->SetLayer( m_Mirror ? B_Cu : F_Cu );
595 footprint->SetOrientation( m_Rotation );
596
597 LIB_ID fpID;
598 fpID.Parse( m_CompRef, true );
599 footprint->SetFPID( fpID );
600
601 // reference text
602 PCB_FIELD* ref_text = &footprint->Reference();
603
604 ref_text->SetText( ValidateReference( m_Name.text ) );
605
606 ref_text->SetFPRelativePosition( VECTOR2I( m_Name.correctedPositionX,
607 m_Name.correctedPositionY ) );
608
609 if( m_Name.isTrueType )
610 SetTextSizeFromTrueTypeFontHeight( ref_text, m_Name.textHeight );
611 else
612 SetTextSizeFromStrokeFontHeight( ref_text, m_Name.textHeight );
613
614 r = m_Name.textRotation - m_Rotation;
615 ref_text->SetTextAngle( r );
616 ref_text->SetKeepUpright( false );
617
618 ref_text->SetItalic( m_Name.isItalic );
619 ref_text->SetTextThickness( m_Name.textstrokeWidth );
620
621 ref_text->SetMirrored( m_Name.mirror );
622 ref_text->SetVisible( m_Name.textIsVisible );
623
624 ref_text->SetLayer( m_Mirror ? m_board->FlipLayer( m_KiCadLayer ) : m_KiCadLayer );
625
626 // value text
627 PCB_FIELD* val_text = &footprint->Value();
628
629 val_text->SetText( m_Value.text );
630
631 val_text->SetFPRelativePosition( VECTOR2I( m_Value.correctedPositionX,
632 m_Value.correctedPositionY ) );
633
634 if( m_Value.isTrueType )
635 SetTextSizeFromTrueTypeFontHeight( val_text, m_Value.textHeight );
636 else
637 SetTextSizeFromStrokeFontHeight( val_text, m_Value.textHeight );
638
639 r = m_Value.textRotation - m_Rotation;
640 val_text->SetTextAngle( r );
641 val_text->SetKeepUpright( false );
642
643 val_text->SetItalic( m_Value.isItalic );
644 val_text->SetTextThickness( m_Value.textstrokeWidth );
645
646 val_text->SetMirrored( m_Value.mirror );
647 val_text->SetVisible( m_Value.textIsVisible );
648
649 val_text->SetLayer( m_Value.mirror ? m_board->FlipLayer( m_KiCadLayer ) : m_KiCadLayer );
650
651 // TEXTS
652 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
653 {
654 if( m_FootprintItems[i]->m_ObjType == wxT( 'T' ) )
655 m_FootprintItems[ i ]->AddToBoard( footprint );
656 }
657
658 // FOOTPRINT LINES
659 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
660 {
661 if( m_FootprintItems[i]->m_ObjType == wxT( 'L' ) )
662 m_FootprintItems[ i ]->AddToBoard( footprint );
663 }
664
665 // FOOTPRINT ARCS
666 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
667 {
668 if( m_FootprintItems[i]->m_ObjType == wxT( 'A' ) )
669 m_FootprintItems[ i ]->AddToBoard( footprint );
670 }
671
672 // FOOTPRINT POLYGONS
673 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
674 {
675 if( m_FootprintItems[i]->m_ObjType == wxT( 'Z' ) )
676 m_FootprintItems[ i ]->AddToBoard( footprint );
677 }
678
679 // PADS
680 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
681 {
682 if( m_FootprintItems[i]->m_ObjType == wxT( 'P' ) )
683 ((PCAD_PAD*) m_FootprintItems[ i ] )->AddToFootprint( footprint, m_Rotation, false );
684 }
685
686 // VIAS
687 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
688 {
689 if( m_FootprintItems[i]->m_ObjType == wxT( 'V' ) )
690 ((PCAD_VIA*) m_FootprintItems[ i ] )->AddToFootprint( footprint, m_Rotation, false );
691 }
692}
693
694
696{
697 if( m_Mirror == 1 )
698 {
700
701 for( int i = 0; i < (int) m_FootprintItems.GetCount(); i++ )
702 {
703 if( m_FootprintItems[i]->m_ObjType == wxT( 'L' ) || // lines
704 m_FootprintItems[i]->m_ObjType == wxT( 'A' ) || // arcs
705 m_FootprintItems[i]->m_ObjType == wxT( 'Z' ) || // polygons
706 m_FootprintItems[i]->m_ObjType == wxT( 'P' ) || // pads
707 m_FootprintItems[i]->m_ObjType == wxT( 'V' ) ) // vias
708 {
709 m_FootprintItems[i]->Flip();
710 }
711 }
712 }
713}
714
715} // namespace PCAD2KICAD
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition board_item.h:280
void SetFPRelativePosition(const VECTOR2I &aPos)
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
void SetMirrored(bool isMirrored)
Definition eda_text.cpp:404
virtual void SetVisible(bool aVisible)
Definition eda_text.cpp:397
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition eda_text.cpp:295
void SetKeepUpright(bool aKeepUpright)
Definition eda_text.cpp:436
virtual void SetText(const wxString &aText)
Definition eda_text.cpp:281
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition eda_text.cpp:310
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
Definition eda_text.cpp:318
void SetPosition(const VECTOR2I &aPos) override
void SetFPID(const LIB_ID &aFPID)
Definition footprint.h:270
void SetOrientation(const EDA_ANGLE &aNewAngle)
PCB_FIELD & Value()
read/write accessors:
Definition footprint.h:697
PCB_FIELD & Reference()
Definition footprint.h:698
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition lib_id.cpp:52
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultUnits, const wxString &aActualConversion)
Definition pcad_arc.cpp:55
virtual bool Parse(XNODE *aNode, const wxString &aDefaultUnits, const wxString &aActualConversion) override
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &actualConversion) override
PCAD_FOOTPRINT(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
void DoLayerContentsObjects(XNODE *aNode, PCAD_FOOTPRINT *aFootprint, PCAD_COMPONENTS_ARRAY *aList, wxStatusBar *aStatusBar, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
PCAD_COMPONENTS_ARRAY m_FootprintItems
XNODE * FindPatternMultilayerSection(XNODE *aNode, wxString *aPatGraphRefName)
virtual void Flip() override
void AddToBoard(FOOTPRINT *aFootprint=nullptr) override
XNODE * FindModulePatternDefName(XNODE *aNode, const wxString &aName)
void SetName(const wxString &aPin, const wxString &aName)
virtual void Parse(XNODE *aNode, wxStatusBar *aStatusBar, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultUnits, const wxString &aActualConversion)
Definition pcad_line.cpp:54
PCAD_PCB_COMPONENT(PCAD_CALLBACKS *aCallbacks, BOARD *aBoard)
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)
An extension of wxXmlNode that can format its contents as KiCad-style s-expressions.
Definition xnode.h:71
XNODE * GetParent() const
Definition xnode.h:111
XNODE * GetChildren() const
Definition xnode.h:101
XNODE * GetNext() const
Definition xnode.h:106
@ B_Cu
Definition layer_ids.h:65
@ F_SilkS
Definition layer_ids.h:100
@ F_Cu
Definition layer_ids.h:64
wxString ValidateName(const wxString &aName)
void SetWidth(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aWidth, const wxString &aActualConversion)
static bool HasLine(std::vector< PCAD_LINE * > &vector, PCAD_LINE *line)
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
wxString ValidateReference(const wxString &aRef)
void SetTextSizeFromStrokeFontHeight(EDA_TEXT *aText, int aTextHeight)
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
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)
@ LAYER_TYPE_PLANE
wxString result
Test unit parsing edge cases and error handling.
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.
Definition trigo.cpp:229
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695