KiCad PCB EDA Suite
pcb_module.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 <developer@lura.sk>
5  * Copyright (C) 2007, 2008, 2012-2013 Alexander Lunev <al.lunev@yahoo.com>
6  * Copyright (C) 2012-2020 KiCad Developers, see CHANGELOG.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 
30 #include <wx/wx.h>
31 
32 #include <common.h>
33 
34 #include <pcb_arc.h>
35 #include <pcb_copper_pour.h>
36 #include <pcb_cutout.h>
37 #include <pcb_plane.h>
38 #include <pcb_line.h>
39 #include <pcb_module.h>
40 #include <pcb_pad.h>
41 #include <pcb_polygon.h>
42 #include <pcb_text.h>
43 #include <pcb_via.h>
44 
45 #include <trigo.h>
46 
47 namespace PCAD2KICAD {
48 
49 PCB_MODULE::PCB_MODULE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ) : PCB_COMPONENT( aCallbacks,
50  aBoard )
51 {
53  m_mirror = 0;
54  m_objType = wxT( 'M' ); // MODULE
55  m_KiCadLayer = F_SilkS; // default
56 }
57 
58 
60 {
61  int i;
62 
63  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
64  {
65  delete m_moduleObjects[i];
66  }
67 }
68 
69 
70 XNODE* PCB_MODULE::FindModulePatternDefName( XNODE* aNode, const wxString& aName )
71 {
72  XNODE* result, * lNode;
73  wxString propValue1, propValue2;
74 
75  result = NULL;
76  lNode = FindNode( aNode, wxT( "patternDef" ) );
77 
78  while( lNode )
79  {
80  if( lNode->GetName() == wxT( "patternDef" ) )
81  {
82  lNode->GetAttribute( wxT( "Name" ), &propValue1 );
83  FindNode( lNode,
84  wxT( "originalName" ) )->GetAttribute( wxT( "Name" ), &propValue2 );
85 
86  if( ValidateName( propValue1 ) == aName
87  || ValidateName( propValue2 ) == aName )
88  {
89  result = lNode;
90  lNode = NULL;
91  }
92  }
93 
94  if( lNode )
95  lNode = lNode->GetNext();
96  }
97 
98  if( result == NULL )
99  {
100  lNode = FindNode( aNode, wxT( "patternDefExtended" ) ); // New file format
101 
102  while( lNode )
103  {
104  if( lNode->GetName() == wxT( "patternDefExtended" ) )
105  {
106  lNode->GetAttribute( wxT( "Name" ), &propValue1 );
107 
108  if( ValidateName( propValue1 ) == aName )
109  {
110  result = lNode;
111  lNode = NULL;
112  }
113  }
114 
115  if( lNode )
116  lNode = lNode->GetNext();
117  }
118  }
119 
120  return result;
121 }
122 
123 
124 XNODE* PCB_MODULE::FindPatternMultilayerSection( XNODE* aNode, wxString* aPatGraphRefName )
125 {
126  XNODE* result, * pNode, * lNode;
127  wxString propValue, patName;
128 
129  result = NULL;
130  pNode = aNode; // pattern;
131  lNode = aNode;
132 
133  // calling from library conversion we need to find pattern
134  if( lNode->GetName() == wxT( "compDef" ) )
135  {
136  lNode->GetAttribute( wxT( "Name" ), &propValue );
137  propValue.Trim( false );
138  patName = ValidateName( propValue );
139 
140  if( FindNode( lNode, wxT( "attachedPattern" ) ) )
141  {
142  FindNode( FindNode( lNode, wxT( "attachedPattern" ) ),
143  wxT( "patternName" ) )->GetAttribute( wxT( "Name" ), &propValue );
144  propValue.Trim( false );
145  propValue.Trim( true );
146  patName = ValidateName( propValue );
147  }
148 
149  lNode = FindModulePatternDefName( lNode->GetParent(), patName );
150  pNode = lNode; // pattern;
151  }
152 
153  lNode = NULL;
154 
155  if( pNode )
156  lNode = FindNode( pNode, wxT( "multiLayer" ) ); // Old file format
157 
158  if( lNode )
159  {
160  *aPatGraphRefName = wxEmptyString; // default
161  result = lNode;
162  }
163  else
164  {
165  // New file format
166 
167  if( *aPatGraphRefName == wxEmptyString ) // default
168  {
169  if( FindNode( aNode, wxT( "patternGraphicsNameRef" ) ) )
170  {
171  FindNode( aNode,
172  wxT( "patternGraphicsNameRef" ) )->GetAttribute( wxT( "Name" ),
173  aPatGraphRefName );
174  }
175  }
176 
177  if( FindNode( aNode, wxT( "patternGraphicsDef" ) ) )
178  lNode = FindNode( aNode, wxT( "patternGraphicsDef" ) );
179  else if( pNode )
180  lNode = FindNode( pNode, wxT( "patternGraphicsDef" ) );
181 
182  if( *aPatGraphRefName == wxEmptyString ) // no patern delection, the first is actual...
183  {
184  if( lNode )
185  {
186  result = FindNode( lNode, wxT( "multiLayer" ) );
187  lNode = NULL;
188  }
189  }
190 
191  while( lNode ) // selected by name
192  {
193  if( lNode->GetName() == wxT( "patternGraphicsDef" ) )
194  {
195  FindNode( lNode,
196  wxT( "patternGraphicsNameDef" ) )->GetAttribute( wxT( "Name" ),
197  &propValue );
198 
199  if( propValue == *aPatGraphRefName )
200  {
201  result = FindNode( lNode, wxT( "multiLayer" ) );
202  lNode = NULL;
203  }
204  else
205  lNode = lNode->GetNext();
206  }
207  else
208  lNode = lNode->GetNext();
209  }
210  }
211 
212  return result;
213 }
214 
215 
217  PCB_MODULE* aPCBModule,
218  PCB_COMPONENTS_ARRAY* aList,
219  wxStatusBar* aStatusBar,
220  const wxString& aDefaultMeasurementUnit,
221  const wxString& aActualConversion )
222 {
223  PCB_ARC* arc;
224  PCB_POLYGON* polygon;
225  PCB_POLYGON *plane_layer = NULL;
226  PCB_COPPER_POUR* copperPour;
227  PCB_CUTOUT* cutout;
228  PCB_PLANE* plane;
229  VERTICES_ARRAY* plane_layer_polygon;
230  PCB_LINE* line;
231  PCB_TEXT* text;
232  XNODE* lNode, * tNode;
233  wxString propValue;
234  long long i;
235  int PCadLayer;
236  long num = 0;
237 
238  i = 0;
239  // aStatusBar->SetStatusText( wxT( "Processing LAYER CONTENT OBJECTS " ) );
240  if( FindNode( aNode, wxT( "layerNumRef" ) ) )
241  FindNode( aNode, wxT( "layerNumRef" ) )->GetNodeContent().ToLong( &num );
242 
243  PCadLayer = (int) num;
244 
245  if( m_callbacks->GetLayerType( PCadLayer ) == LAYER_TYPE_PLANE )
246  {
247  plane_layer = new PCB_POLYGON( m_callbacks, m_board, PCadLayer );
248  plane_layer->AssignNet( m_callbacks->GetLayerNetNameRef( PCadLayer ) );
249  plane_layer->SetOutline( &m_boardOutline );
250  aList->Add( plane_layer );
251 
252  // fill the polygon with the same contour as its outline is
253  //plane_layer->AddIsland( &m_boardOutline );
254  }
255 
256  lNode = aNode->GetChildren();
257 
258  while( lNode )
259  {
260  i++;
261  // aStatusBar->SetStatusText( wxString::Format( "Processing LAYER CONTENT OBJECTS :%lld",
262  // i ) );
263 
264  if( lNode->GetName() == wxT( "line" ) )
265  {
266  line = new PCB_LINE( m_callbacks, m_board );
267  line->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
268  aList->Add( line );
269  }
270 
271  if( lNode->GetName() == wxT( "text" ) )
272  {
273  text = new PCB_TEXT( m_callbacks, m_board );
274  text->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
275  aList->Add( text );
276  }
277 
278  // added as Sergeys request 02/2008
279  if( lNode->GetName() == wxT( "attr" ) )
280  {
281  // assign fonts to Module Name,Value,Type,....s
282  lNode->GetAttribute( wxT( "Name" ), &propValue );
283  propValue.Trim( false );
284  propValue.Trim( true );
285 
286  if( propValue == wxT( "RefDes" ) )
287  {
288  tNode = FindNode( lNode, wxT( "textStyleRef" ) );
289 
290  if( tNode && aPCBModule )
291  {
292  // TODO: to understand and may be repair
293  // Alexander Lunev: originally in Delphi version of the project there was
294  // a strange access to pcbModule->m_name (it was global variable). This access
295  // is necessary when the function DoLayerContentsObjects() is called from
296  // function CreatePCBModule(). However it is not clear whether the access is
297  // required when the function DoLayerContentsObjects() is called from
298  // function ProcessXMLtoPCBLib().
299  SetFontProperty( tNode,
300  &aPCBModule->m_name,
301  aDefaultMeasurementUnit,
302  aActualConversion );
303  }
304  }
305  }
306 
307  // added as Sergeys request 02/2008
308  if( lNode->GetName() == wxT( "arc" ) || lNode->GetName() == wxT( "triplePointArc" ) )
309  {
310  arc = new PCB_ARC( m_callbacks, m_board );
311  arc->Parse( lNode, PCadLayer, aDefaultMeasurementUnit, aActualConversion );
312  aList->Add( arc );
313  }
314 
315  if( lNode->GetName() == wxT( "pcbPoly" ) )
316  {
317  if( m_callbacks->GetLayerType( PCadLayer ) == LAYER_TYPE_PLANE )
318  {
319  plane_layer_polygon = new VERTICES_ARRAY;
320  wxASSERT( plane_layer );
321  plane_layer->FormPolygon( lNode, plane_layer_polygon, aDefaultMeasurementUnit, aActualConversion );
322  plane_layer->m_cutouts.Add( plane_layer_polygon );
323  }
324  else
325  {
326  polygon = new PCB_POLYGON( m_callbacks, m_board, PCadLayer );
327  if( polygon->Parse( lNode,
328  aDefaultMeasurementUnit,
329  aActualConversion ) )
330  aList->Add( polygon );
331  else
332  delete polygon;
333  }
334  }
335 
336  if( lNode->GetName() == wxT( "copperPour95" ) )
337  {
338  copperPour = new PCB_COPPER_POUR( m_callbacks, m_board, PCadLayer );
339 
340  if( copperPour->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
341  aList->Add( copperPour );
342  else
343  delete copperPour;
344  }
345 
346  if( lNode->GetName() == wxT( "polyCutOut" ) )
347  {
348  cutout = new PCB_CUTOUT( m_callbacks, m_board, PCadLayer );
349 
350  if( cutout->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
351  aList->Add( cutout );
352  else
353  delete cutout;
354  }
355 
356  if( lNode->GetName() == wxT( "planeObj" ) )
357  {
358  plane = new PCB_PLANE( m_callbacks, m_board, PCadLayer );
359 
360  if( plane->Parse( lNode, aDefaultMeasurementUnit, aActualConversion ) )
361  aList->Add( plane );
362  else
363  delete plane;
364  }
365 
366  lNode = lNode->GetNext();
367  }
368 }
369 
370 
371 void PCB_MODULE::SetName( const wxString& aPin, const wxString& aName )
372 {
373  int i;
374  long num;
375 
376  aPin.ToLong( &num );
377 
378  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
379  {
380  if( m_moduleObjects[i]->m_objType == wxT( 'P' ) )
381  if( ( (PCB_PAD*) m_moduleObjects[i] )->m_number == num )
382  ( (PCB_PAD*) m_moduleObjects[i] )->m_name.text = aName;
383 
384 
385  }
386 }
387 
388 
389 void PCB_MODULE::Parse( XNODE* aNode, wxStatusBar* aStatusBar,
390  const wxString& aDefaultMeasurementUnit,
391  const wxString& aActualConversion )
392 {
393  XNODE* lNode, * tNode, * mNode;
394  PCB_PAD* pad;
395  PCB_VIA* via;
396  wxString propValue, str;
397 
398  FindNode( aNode, wxT( "originalName" ) )->GetAttribute( wxT( "Name" ),
399  &propValue );
400  propValue.Trim( false );
401  m_name.text = propValue;
402 
403  // aStatusBar->SetStatusText( wxT( "Creating Component : " ) + m_name.text );
404  lNode = aNode;
406 
407  if( lNode )
408  {
409  tNode = lNode;
410  tNode = tNode->GetChildren();
411 
412  while( tNode )
413  {
414  if( tNode->GetName() == wxT( "pad" ) )
415  {
416  pad = new PCB_PAD( m_callbacks, m_board );
417  pad->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
418  m_moduleObjects.Add( pad );
419  }
420 
421  if( tNode->GetName() == wxT( "via" ) )
422  {
423  via = new PCB_VIA( m_callbacks, m_board );
424  via->Parse( tNode, aDefaultMeasurementUnit, aActualConversion );
425  m_moduleObjects.Add( via );
426  }
427 
428  tNode = tNode->GetNext();
429  }
430  }
431 
432  if( lNode )
433  lNode = lNode->GetParent();
434 
435  if( lNode )
436  lNode = FindNode( lNode, wxT( "layerContents" ) );
437 
438  while( lNode )
439  {
440  if( lNode->GetName() == wxT( "layerContents" ) )
441  DoLayerContentsObjects( lNode, this, &m_moduleObjects, aStatusBar,
442  aDefaultMeasurementUnit, aActualConversion );
443 
444  lNode = lNode->GetNext();
445  }
446 
447  // map pins
448  lNode = FindPinMap( aNode );
449 
450  if( lNode )
451  {
452  mNode = lNode->GetChildren();
453 
454  while( mNode )
455  {
456  if( mNode->GetName() == wxT( "padNum" ) )
457  {
458  str = mNode->GetNodeContent();
459  mNode = mNode->GetNext();
460 
461  if( !mNode )
462  break;
463 
464  mNode->GetAttribute( wxT( "Name" ), &propValue );
465  SetName( str, propValue );
466  mNode = mNode->GetNext();
467  }
468  else
469  {
470  mNode = mNode->GetNext();
471 
472  if( !mNode )
473  break;
474 
475  mNode = mNode->GetNext();
476  }
477  }
478  }
479 }
480 
481 
482 wxString PCB_MODULE::ModuleLayer( int aMirror )
483 {
484  wxString result;
485 
486  // ///NOT ! {IntToStr(KiCadLayer)} NOT !
487  // / MODULES ARE HARD PLACED ON COMPONENT OR COPPER LAYER.
488  // / IsFLIPPED--> MIRROR attribute is decision Point!!!
489 
490  if( aMirror == 0 )
491  result = wxT( "15" ); // Components side
492  else
493  result = wxT( "0" ); // Copper side
494 
495  return result;
496 }
497 
498 
500 {
501  int i;
502  int r;
503 
504  // transform text positions
507  (double) -m_rotation );
508 
511  (double) -m_rotation );
512 
513  MODULE* module = new MODULE( m_board );
514  m_board->Add( module, ADD_MODE::APPEND );
515 
517  module->SetLayer( m_mirror ? B_Cu : F_Cu );
518  module->SetOrientation( m_rotation );
519  module->SetLastEditTime( 0 );
520 
521  LIB_ID fpID;
522  fpID.Parse( m_compRef, LIB_ID::ID_PCB, true );
523  module->SetFPID( fpID );
524 
525  module->SetAttributes( MOD_DEFAULT | MOD_CMS );
526 
527  // reference text
528  TEXTE_MODULE* ref_text = &module->Reference();
529 
530  ref_text->SetText( ValidateReference( m_name.text ) );
532 
534  if( m_name.isTrueType )
536  else
538 
540  ref_text->SetTextAngle( r );
541  ref_text->SetKeepUpright( false );
542 
543  ref_text->SetItalic( m_name.isItalic );
544  ref_text->SetThickness( m_name.textstrokeWidth );
545 
546  ref_text->SetMirrored( m_name.mirror );
547  ref_text->SetVisible( m_name.textIsVisible );
548 
550 
551  // Calculate the actual position.
552  ref_text->SetDrawCoord();
553 
554  // value text
555  TEXTE_MODULE* val_text = &module->Value();
556 
557  val_text->SetText( m_value.text );
559 
561  if( m_value.isTrueType )
563  else
565 
567  val_text->SetTextAngle( r );
568  val_text->SetKeepUpright( false );
569 
570  val_text->SetItalic( m_value.isItalic );
571  val_text->SetThickness( m_value.textstrokeWidth );
572 
573  val_text->SetMirrored( m_value.mirror );
574  val_text->SetVisible( m_value.textIsVisible );
575 
577 
578  // Calculate the actual position.
579  val_text->SetDrawCoord();
580 
581  // TEXTS
582  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
583  {
584  if( m_moduleObjects[i]->m_objType == wxT( 'T' ) )
585  {
586  ( (PCB_TEXT*) m_moduleObjects[i] )->m_tag = i + 2;
587  m_moduleObjects[i]->AddToModule( module );
588  }
589  }
590 
591  // MODULE LINES
592  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
593  {
594  if( m_moduleObjects[i]->m_objType == wxT( 'L' ) )
595  m_moduleObjects[i]->AddToModule( module );
596  }
597 
598  // MODULE Arcs
599  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
600  {
601  if( m_moduleObjects[i]->m_objType == wxT( 'A' ) )
602  m_moduleObjects[i]->AddToModule( module );
603  }
604 
605  // MODULE POLYGONS
606  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
607  {
608  if( m_moduleObjects[i]->m_objType == wxT( 'Z' ) )
609  m_moduleObjects[i]->AddToModule( module );
610  }
611 
612  // PADS
613  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
614  {
615  if( m_moduleObjects[i]->m_objType == wxT( 'P' ) )
616  ( (PCB_PAD*) m_moduleObjects[i] )->AddToModule( module, m_rotation, false );
617  }
618 
619  // VIAS
620  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
621  {
622  if( m_moduleObjects[i]->m_objType == wxT( 'V' ) )
623  ( (PCB_VIA*) m_moduleObjects[i] )->AddToModule( module, m_rotation, false );
624  }
625 
626  module->CalculateBoundingBox();
627 }
628 
629 
631 {
632  int i;
633 
634  if( m_mirror == 1 )
635  {
637 
638  for( i = 0; i < (int) m_moduleObjects.GetCount(); i++ )
639  {
640  if( m_moduleObjects[i]->m_objType == wxT( 'L' ) || // lines
641  m_moduleObjects[i]->m_objType == wxT( 'A' ) || // arcs
642  m_moduleObjects[i]->m_objType == wxT( 'Z' ) || // polygons
643  m_moduleObjects[i]->m_objType == wxT( 'P' ) || // pads
644  m_moduleObjects[i]->m_objType == wxT( 'V' ) ) // vias
645  {
646  m_moduleObjects[i]->Flip();
647  }
648  }
649  }
650 }
651 
652 } // namespace PCAD2KICAD
void SetMirrored(bool isMirrored)
Definition: eda_text.h:172
void SetKeepUpright(bool aKeepUpright)
TEXTE_MODULE & Reference()
Definition: class_module.h:477
wxString ModuleLayer(int aMirror)
Definition: pcb_module.cpp:482
void SetFontProperty(XNODE *aNode, TTEXTVALUE *aTextValue, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
void SetItalic(bool isItalic)
Definition: eda_text.h:163
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:485
void SetOutline(VERTICES_ARRAY *aOutline)
Definition: pcb_polygon.cpp:87
void SetVisible(bool aVisible)
Definition: eda_text.h:169
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:74
void SetName(const wxString &aPin, const wxString &aName)
Definition: pcb_module.cpp:371
virtual void Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_pad.cpp:58
XNODE * FindPatternMultilayerSection(XNODE *aNode, wxString *aPatGraphRefName)
Definition: pcb_module.cpp:124
ISLANDS_ARRAY m_cutouts
Definition: pcb_polygon.h:49
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &actualConversion) override
Definition: pcb_cutout.cpp:48
void SetTextSizeFromTrueTypeFontHeight(EDA_TEXT *aText, int aTextHeight)
virtual void AddToModule(MODULE *aModule)
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_text.cpp:50
XNODE * FindModulePatternDefName(XNODE *aNode, const wxString &aName)
Definition: pcb_module.cpp:70
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion) override
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
wxString ValidateName(wxString aName)
XNODE * GetChildren() const
Definition: xnode.h:63
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:111
#define NULL
PCB_MODULE(PCB_CALLBACKS *aCallbacks, BOARD *aBoard)
Definition: pcb_module.cpp:49
virtual void Flip() override
Definition: pcb_module.cpp:630
XNODE * GetParent() const
Definition: xnode.h:73
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:476
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:347
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_line.cpp:53
wxString ValidateReference(wxString aRef)
virtual void Parse(XNODE *aNode, wxStatusBar *aStatusBar, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_module.cpp:389
void SetPosition(const wxPoint &aPos) override
void SetType(TEXT_TYPE aType)
virtual wxString GetLayerNetNameRef(int aPCadLayer)=0
void SetPos0(const wxPoint &aPos)
default
Definition: class_module.h:73
XNODE holds an XML or S-expression element.
Definition: xnode.h:43
XNODE * GetNext() const
Definition: xnode.h:68
virtual LAYER_TYPE_T GetLayerType(int aPCadLayer)=0
virtual void Parse(XNODE *aNode, int aLayer, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_arc.cpp:55
void DoLayerContentsObjects(XNODE *aNode, PCB_MODULE *aPCBModule, PCB_COMPONENTS_ARRAY *aList, wxStatusBar *aStatusBar, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion)
Definition: pcb_module.cpp:216
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:163
void SetOrientation(double newangle)
void CorrectTextPosition(TTEXTVALUE *aValue)
void FormPolygon(XNODE *aNode, VERTICES_ARRAY *aPolygon, const wxString &aDefaultMeasurementUnit, const wxString &actualConversion)
void SetDrawCoord()
Set absolute coordinates.
PCB_COMPONENTS_ARRAY m_moduleObjects
Definition: pcb_module.h:44
XNODE * FindNode(XNODE *aChild, const wxString &aTag)
void InitTTextValue(TTEXTVALUE *aTextValue)
The common library.
PCB_CALLBACKS * m_callbacks
Definition: pcb_component.h:77
void SetTextSizeFromStrokeFontHeight(EDA_TEXT *aText, int aTextHeight)
void SetTextAngle(double aAngle)
virtual void Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion) override
Definition: pcb_via.cpp:48
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
XNODE * FindPinMap(XNODE *aNode)
virtual bool Parse(XNODE *aNode, const wxString &aDefaultMeasurementUnit, const wxString &aActualConversion) override
Definition: pcb_plane.cpp:51
void AssignNet(const wxString &aNetName)
Definition: pcb_polygon.cpp:81
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:220
void AddToBoard() override
Definition: pcb_module.cpp:499
void SetThickness(int aNewThickness)
Set the pen width.
Definition: eda_text.h:143
void SetAttributes(int aAttributes)
Definition: class_module.h:260
VERTICES_ARRAY m_boardOutline
Definition: pcb_module.h:46