KiCad PCB EDA Suite
Loading...
Searching...
No Matches
export_hyperlynx.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) 2019 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <cstdio>
26#include <vector>
27
28#include <wx/log.h>
29#include <wx/filedlg.h>
30#include <kiplatform/ui.h>
31
32#include <kiface_base.h>
33#include <macros.h>
34#include <pcb_edit_frame.h>
35#include <board.h>
37#include <board_item.h>
38#include <footprint.h>
39#include <pad.h>
40#include <pcb_track.h>
41#include <zone.h>
42#include <ki_exception.h>
43#include <locale_io.h>
44#include <reporter.h>
45#include <richio.h>
46#include <string_utils.h>
50
51
52static double iu2hyp( double iu )
53{
54 return iu / 1e9 / 0.0254;
55}
56
57
59
61{
62public:
63 friend class HYPERLYNX_EXPORTER;
64
65 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad );
66 HYPERLYNX_PAD_STACK( BOARD* aBoard, const PCB_VIA* aVia );
68
69 bool IsThrough() const
70 {
72 }
73
74 bool operator==( const HYPERLYNX_PAD_STACK& other ) const
75 {
76 if( m_shape != other.m_shape )
77 return false;
78
79 if( m_type != other.m_type )
80 return false;
81
82 if( IsThrough() && other.IsThrough() && m_drill != other.m_drill )
83 return false;
84
85 if( m_sx != other.m_sx )
86 return false;
87
88 if( m_sy != other.m_sy )
89 return false;
90
91 if( m_layers != other.m_layers )
92 return false;
93
94 if( m_angle != other.m_angle )
95 return false;
96
97 return true;
98 }
99
100 void SetId( int id )
101 {
102 m_id = id;
103 }
104
105 int GetId() const
106 {
107 return m_id;
108 }
109
110 bool IsEmpty() const
111 {
112 LSET outLayers = m_layers & LSET::AllCuMask( m_board->GetCopperLayerCount() );
113
114 return outLayers.none();
115 }
116
117private:
119 int m_id;
122 int m_sx, m_sy;
123 double m_angle;
126};
127
128
130{
131public:
133 {
134 }
135
137
138 virtual bool Run() override;
139
140private:
142 {
144 {
145 if( *p == stack )
146 return p;
147 }
148
149 stack.SetId( m_padStacks.size() );
150 m_padStacks.push_back( new HYPERLYNX_PAD_STACK( stack ) );
151
152 return m_padStacks.back();
153 }
154
155 const std::string formatPadShape( const HYPERLYNX_PAD_STACK& aStack )
156 {
157 int shapeId = 0;
158 char buf[1024];
159
160 switch( aStack.m_shape )
161 {
163 case PAD_SHAPE::OVAL:
164 shapeId = 0;
165 break;
166
168 shapeId = 2;
169 break;
170
172 shapeId = 1;
173 break;
174
175 default:
176 if( m_reporter )
177 {
178 m_reporter->Report( _( "File contains pad shapes that are not supported by the "
179 "Hyperlynx exporter (supported shapes are oval, rectangle, "
180 "rounded rectangle, and circle)." ),
182 m_reporter->Report( _( "They have been exported as oval pads." ),
184 }
185
186 shapeId = 0;
187 break;
188 }
189
190 snprintf( buf, sizeof( buf ), "%d, %.9f, %.9f, %.1f, M",
191 shapeId,
192 iu2hyp( aStack.m_sx ),
193 iu2hyp( aStack.m_sy ),
194 aStack.m_angle );
195
196 return buf;
197 }
198
199 bool generateHeaders();
200 bool writeBoardInfo();
201 bool writeStackupInfo();
202 bool writeDevices();
203 bool writePadStacks();
204 bool writeNets();
205 bool writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects );
206
207
209
210 const std::vector<BOARD_ITEM*> collectNetObjects( int netcode );
211
212private:
213 std::vector<HYPERLYNX_PAD_STACK*> m_padStacks;
214 std::map<BOARD_ITEM*, HYPERLYNX_PAD_STACK*> m_padMap;
215
216 std::shared_ptr<FILE_OUTPUTFORMATTER> m_out;
218};
219
220
222{
223 // TODO(JE) padstacks
224 m_board = aBoard;
227 m_angle = 180.0 - aPad->GetOrientation().AsDegrees();
228
229 if( m_angle < 0.0 )
230 m_angle += 360.0;
231
232 m_layers = aPad->GetLayerSet();
233 m_drill = aPad->GetDrillSize().x;
236 m_id = 0;
237}
238
239
241{
242 m_board = aBoard;
243 // TODO(JE) padstacks
245 m_angle = 0;
246 m_layers = aVia->GetLayerSet();
247 m_drill = aVia->GetDrillValue();
250 m_id = 0;
251}
252
253
255{
256 m_out->Print( 0, "{VERSION=2.14}\n" );
257 m_out->Print( 0, "{UNITS=ENGLISH LENGTH}\n\n" );
258 return true;
259}
260
261
263{
264 LSET layerMask = LSET::AllCuMask( m_board->GetCopperLayerCount() );
265 LSET outLayers = aStack.m_layers & layerMask;
266
267 if( outLayers.none() )
268 return;
269
270 m_out->Print( 0, "{PADSTACK=%d, %.9f\n", aStack.m_id, iu2hyp( aStack.m_drill ) );
271
272 if( outLayers == layerMask )
273 {
274 m_out->Print( 1, "(\"MDEF\", %s)\n", formatPadShape( aStack ).c_str() );
275 }
276 else
277 {
278 for( PCB_LAYER_ID l : outLayers.Seq() )
279 {
280 m_out->Print( 1, "(\"%s\", %s)\n",
281 (const char*) m_board->GetLayerName( l ).c_str(),
282 formatPadShape( aStack ).c_str() );
283 }
284 }
285
286 m_out->Print( 0, "}\n\n" );
287}
288
289
291{
292 SHAPE_POLY_SET outlines;
293
294 m_out->Print( 0, "{BOARD \"%s\"\n", (const char*) m_board->GetFileName().c_str() );
295
296 if( !m_board->GetBoardPolygonOutlines( outlines, false ) )
297 {
298 wxLogError( _( "Board outline is malformed. Run DRC for a full analysis." ) );
299 return false;
300 }
301
302 for( int o = 0; o < outlines.OutlineCount(); o++ )
303 {
304 const SHAPE_LINE_CHAIN& outl = outlines.COutline( o );
305
306 for( int i = 0; i < outl.SegmentCount(); i++ )
307 {
308 const SEG& s = outl.CSegment( i );
309 m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
310 iu2hyp( s.A.x ),
311 iu2hyp( -s.A.y ),
312 iu2hyp( s.B.x ),
313 iu2hyp( -s.B.y ) );
314 }
315 }
316
317 m_out->Print( 0, "}\n\n" );
318
319 return true;
320}
321
322
324{
325 /* Format:
326 * {STACKUP
327 * (SIGNAL T=thickness [P=plating_thickness] [C=resistivity] L=layer_name [M=material_name])
328 * (DIELECTRIC T=thickness [C=dielectric_constant] [L=layer_name] [M=material_name])
329 * }
330 * C parameter: bulk resistivity (ohm-m) for SIGNAL, epsilon_r for DIELECTRIC
331 * Layer name length is <= 20 chars
332 */
333
334 LSEQ layers = m_board->GetDesignSettings().GetEnabledLayers().CuStack();
335
336 // Get the board physical stackup structure
337 const BOARD_STACKUP& stackup = m_board->GetDesignSettings().GetStackupDescriptor();
338
339 m_out->Print( 0, "{STACKUP\n" );
340
341 wxString layer_name; // The last copper layer name used in stackup
342
343 for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
344 {
345 if( item->GetType() == BS_ITEM_TYPE_COPPER )
346 {
347 layer_name = m_board->GetLayerName( item->GetBrdLayerId() );
348 int plating_thickness = 0;
349 double resistivity = 1.724e-8; // Copper bulk resistivity in ohm-meters
350 m_out->Print( 1, "(SIGNAL T=%g P=%g C=%g L=\"%.20s\" M=COPPER)\n",
351 iu2hyp( item->GetThickness( 0 ) ),
352 iu2hyp( plating_thickness ),
353 resistivity,
354 TO_UTF8( layer_name ) );
355 }
356 else if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
357 {
358 if( item->GetSublayersCount() < 2 )
359 {
360 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE_%.17s\" M=\"%.20s\")\n",
361 iu2hyp( item->GetThickness( 0 ) ),
362 item->GetEpsilonR( 0 ),
363 TO_UTF8( layer_name ),
364 TO_UTF8( item->GetMaterial( 0 ) ) );
365 }
366 else for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
367 {
368 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"DE%d_%.16s\" M=\"%.20s\")\n",
369 iu2hyp( item->GetThickness( idx ) ),
370 item->GetEpsilonR( idx ),
371 idx,
372 TO_UTF8( layer_name ),
373 TO_UTF8( item->GetMaterial( idx ) ) );
374 }
375 }
376 else if( item->GetType() == BS_ITEM_TYPE_SOLDERMASK )
377 {
378 // Soldermask uses its KiCad layer name directly (e.g., "F.Mask") rather than
379 // a constructed name like core dielectrics, since these names are already unique.
380 wxString maskLayerName = m_board->GetLayerName( item->GetBrdLayerId() );
381 wxString material = item->GetMaterial( 0 );
382
383 if( !IsPrmSpecified( material ) )
384 material = wxT( "Solder Mask" );
385
386 m_out->Print( 1, "(DIELECTRIC T=%g C=%g L=\"%.20s\" M=\"%.20s\")\n",
387 iu2hyp( item->GetThickness( 0 ) ),
388 item->GetEpsilonR( 0 ),
389 TO_UTF8( maskLayerName ),
390 TO_UTF8( material ) );
391 }
392 }
393
394 m_out->Print( 0, "}\n\n" );
395
396 return true;
397}
398
399
401{
402 m_out->Print( 0, "{DEVICES\n" );
403
404 for( FOOTPRINT* footprint : m_board->Footprints() )
405 {
406 wxString ref = footprint->GetReference();
407 wxString layerName = m_board->GetLayerName( footprint->GetLayer() );
408
409 if( ref.IsEmpty() )
410 ref = wxT( "EMPTY" );
411
412 m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n",
413 (const char*) ref.c_str(),
414 (const char*) layerName.c_str() );
415 }
416 m_out->Print( 0, "}\n\n" );
417
418 return true;
419}
420
421
423{
424 for( FOOTPRINT* footprint : m_board->Footprints() )
425 {
426 for( PAD* pad : footprint->Pads() )
427 {
429 m_padMap[pad] = ps;
430 }
431 }
432
433 for( PCB_TRACK* track : m_board->Tracks() )
434 {
435 if( PCB_VIA* via = dyn_cast<PCB_VIA*>( track ) )
436 {
438 m_padMap[via] = ps;
439 }
440 }
441
442 for( HYPERLYNX_PAD_STACK* pstack : m_padStacks )
443 writeSinglePadStack( *pstack );
444
445 return true;
446}
447
448
449bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjects )
450{
451 for( BOARD_ITEM* item : aObjects )
452 {
453 if( PAD* pad = dyn_cast<PAD*>( item ) )
454 {
455 auto pstackIter = m_padMap.find( pad );
456
457 if( pstackIter != m_padMap.end() )
458 {
459 wxString ref = pad->GetParentFootprint()->GetReference();
460
461 if( ref.IsEmpty() )
462 ref = wxT( "EMPTY" );
463
464 wxString padName = pad->GetNumber();
465
466 if( padName.IsEmpty() )
467 padName = wxT( "1" );
468
469
470 m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
471 iu2hyp( pad->GetPosition().x ),
472 iu2hyp( -pad->GetPosition().y ),
473 (const char*) ref.c_str(),
474 (const char*) padName.c_str(),
475 pstackIter->second->GetId() );
476 }
477 }
478 else if( PCB_VIA* via = dyn_cast<PCB_VIA*>( item ) )
479 {
480 auto pstackIter = m_padMap.find( via );
481
482 if( pstackIter != m_padMap.end() )
483 {
484 m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n",
485 iu2hyp( via->GetPosition().x ),
486 iu2hyp( -via->GetPosition().y ),
487 pstackIter->second->GetId() );
488 }
489 }
490 else if( PCB_TRACK* track = dyn_cast<PCB_TRACK*>( item ) )
491 {
492 const wxString layerName = m_board->GetLayerName( track->GetLayer() );
493
494 m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
495 iu2hyp( track->GetStart().x ),
496 iu2hyp( -track->GetStart().y ),
497 iu2hyp( track->GetEnd().x ),
498 iu2hyp( -track->GetEnd().y ),
499 iu2hyp( track->GetWidth() ),
500 (const char*) layerName.c_str() );
501 }
502 else if( PCB_ARC* arc = dyn_cast<PCB_ARC*>( item ) )
503 {
504 const wxString layerName = m_board->GetLayerName( arc->GetLayer() );
505 VECTOR2I start = arc->GetStart();
506 VECTOR2I end = arc->GetEnd();
507
508 if( !arc->IsCCW() )
509 std::swap( start, end );
510
511 m_out->Print( 1, "(ARC X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f XC=%.10f YC=%.10f R=%.10f W=%.10f L=\"%s\")\n",
512 iu2hyp( start.x ),
513 iu2hyp( -start.y ),
514 iu2hyp( end.x ),
515 iu2hyp( -end.y ),
516 iu2hyp( arc->GetCenter().x ),
517 iu2hyp( -arc->GetCenter().y ),
518 iu2hyp( arc->GetRadius() ),
519 iu2hyp( arc->GetWidth() ),
520 (const char*) layerName.c_str() );
521 }
522 else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
523 {
524 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
525 {
526 const wxString layerName = m_board->GetLayerName( layer );
527 SHAPE_POLY_SET fill = zone->GetFilledPolysList( layer )->CloneDropTriangulation();
528
529 fill.Simplify();
530
531 for( int i = 0; i < fill.OutlineCount(); i++ )
532 {
533 const SHAPE_LINE_CHAIN& outl = fill.COutline( i );
534 const VECTOR2I p0 = outl.CPoint( 0 );
535
536 m_out->Print( 1, "{POLYGON T=POUR L=\"%s\" ID=%d X=%.10f Y=%.10f\n",
537 (const char*) layerName.c_str(),
538 m_polyId,
539 iu2hyp( p0.x ),
540 iu2hyp( -p0.y ) );
541
542 for( int v = 0; v < outl.PointCount(); v++ )
543 {
544 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
545 iu2hyp( outl.CPoint( v ).x ),
546 iu2hyp( -outl.CPoint( v ).y ) );
547 }
548
549 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( -p0.y ) );
550 m_out->Print( 1, "}\n" );
551
552 for( int h = 0; h < fill.HoleCount( i ); h++ )
553 {
554 const SHAPE_LINE_CHAIN& holeShape = fill.CHole( i, h );
555 const VECTOR2I ph0 = holeShape.CPoint( 0 );
556
557 m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n",
558 m_polyId,
559 iu2hyp( ph0.x ),
560 iu2hyp( -ph0.y ) );
561
562 for( int v = 0; v < holeShape.PointCount(); v++ )
563 {
564 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
565 iu2hyp( holeShape.CPoint( v ).x ),
566 iu2hyp( -holeShape.CPoint( v ).y ) );
567 }
568
569 m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
570 iu2hyp( ph0.x ),
571 iu2hyp( -ph0.y ) );
572 m_out->Print( 1, "}\n" );
573 }
574
575 m_polyId++;
576 }
577 }
578 }
579 }
580
581 return true;
582}
583
584
585const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcode )
586{
587 std::vector<BOARD_ITEM*> rv;
588
589 auto check =
590 [&]( BOARD_CONNECTED_ITEM* item ) -> bool
591 {
592 if( ( item->GetLayerSet() & LSET::AllCuMask() ).none() )
593 return false;
594
595 if( item->GetNetCode() == netcode || ( netcode < 0 && item->GetNetCode() <= 0 ) )
596 return true;
597
598 return false;
599 };
600
601 for( FOOTPRINT* footprint : m_board->Footprints() )
602 {
603 for( PAD* pad : footprint->Pads() )
604 {
605 if( check( pad ) )
606 rv.push_back( pad );
607 }
608 }
609
610 for( PCB_TRACK* item : m_board->Tracks() )
611 {
612 if( check( item ) )
613 rv.push_back( item );
614 }
615
616 for( ZONE* zone : m_board->Zones() )
617 {
618 if( check( zone ) )
619 rv.push_back( zone );
620 }
621
622 return rv;
623}
624
625
627{
628 m_polyId = 1;
629
630 for( const NETINFO_ITEM* netInfo : m_board->GetNetInfo() )
631 {
632 int netcode = netInfo->GetNetCode();
633 bool isNullNet = netInfo->GetNetCode() <= 0 || netInfo->GetNetname().IsEmpty();
634
635 if( isNullNet )
636 continue;
637
638 const std::vector<BOARD_ITEM*> netObjects = collectNetObjects( netcode );
639
640 if( netObjects.size() )
641 {
642 m_out->Print( 0, "{NET=\"%s\"\n", (const char*) netInfo->GetNetname().c_str() );
643 writeNetObjects( netObjects );
644 m_out->Print( 0, "}\n\n" );
645 }
646 }
647
648 const std::vector<BOARD_ITEM*> nullNetObjects = collectNetObjects( -1 );
649
650 int idx = 0;
651
652 for( BOARD_ITEM* item : nullNetObjects )
653 {
654 m_out->Print( 0, "{NET=\"EmptyNet%d\"\n", idx );
655 writeNetObjects( { item } );
656 m_out->Print( 0, "}\n\n" );
657 idx++;
658 }
659
660 return true;
661}
662
663
665{
666 LOCALE_IO toggle; // toggles on, then off, the C locale.
667
668 try
669 {
670 m_out.reset( new FILE_OUTPUTFORMATTER( m_outputFilePath.GetFullPath() ) );
671
675 writeDevices();
677 writeNets();
678 }
679 catch( IO_ERROR& )
680 {
681 return false;
682 }
683
684 return true;
685}
686
687
689{
690 wxString wildcard = wxT( "*.hyp" );
691 BOARD* board = m_frame->GetBoard();
692 wxFileName fn = board->GetFileName();
693
694 fn.SetExt( wxT("hyp") );
695
696 wxFileDialog dlg( m_frame, _( "Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(),
697 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
698
700
701 if( dlg.ShowModal() != wxID_OK )
702 return 0;
703
704 fn = dlg.GetPath();
705
706 // always enforce filename extension, user may not have entered it.
707 fn.SetExt( wxT( "hyp" ) );
708
709 HYPERLYNX_EXPORTER exporter;
710 exporter.SetBoard( board );
711 exporter.SetOutputFilename( fn );
712 exporter.Run();
713
714 return 0;
715}
bool IsPrmSpecified(const wxString &aPrmValue)
@ BS_ITEM_TYPE_COPPER
@ BS_ITEM_TYPE_DIELECTRIC
@ BS_ITEM_TYPE_SOLDERMASK
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
int ExportHyperlynx(const TOOL_EVENT &aEvent)
void SetOutputFilename(const wxFileName &aPath)
void SetBoard(BOARD *aBoard)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
Manage one layer needed to make a physical board.
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
double AsDegrees() const
Definition eda_angle.h:116
Used for text file output.
Definition richio.h:469
virtual bool Run() override
void writeSinglePadStack(HYPERLYNX_PAD_STACK &aStack)
const std::string formatPadShape(const HYPERLYNX_PAD_STACK &aStack)
std::vector< HYPERLYNX_PAD_STACK * > m_padStacks
std::map< BOARD_ITEM *, HYPERLYNX_PAD_STACK * > m_padMap
bool writeNetObjects(const std::vector< BOARD_ITEM * > &aObjects)
HYPERLYNX_PAD_STACK * addPadStack(HYPERLYNX_PAD_STACK stack)
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
const std::vector< BOARD_ITEM * > collectNetObjects(int netcode)
friend class HYPERLYNX_EXPORTER
HYPERLYNX_PAD_STACK(BOARD *aBoard, const PAD *aPad)
bool operator==(const HYPERLYNX_PAD_STACK &other) const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition locale_io.h:41
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition lseq.h:47
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition lset.cpp:313
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition lset.cpp:599
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
Definition lset.cpp:608
Handle the data for a net.
Definition netinfo.h:54
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition padstack.h:177
Definition pad.h:55
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition pad.h:560
const VECTOR2I & GetDrillSize() const
Definition pad.h:317
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
Definition pad.h:196
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition pad.h:420
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Definition pad.h:264
BOARD * board() const
int GetWidth() const override
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition seg.h:42
VECTOR2I A
Definition seg.h:49
VECTOR2I B
Definition seg.h:50
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a set of closed polygons.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Return the number of outlines in the set.
SHAPE_POLY_SET CloneDropTriangulation() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Generic, UI-independent tool event.
Definition tool_event.h:171
Handle a list of polygons defining a copper zone.
Definition zone.h:74
#define _(s)
static double iu2hyp(double iu)
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
This file contains miscellaneous commonly used macros and functions.
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:717
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
Definition padstack.h:97
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition padstack.h:103
@ PTH
Plated through hole pad.
Definition padstack.h:98
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition padstack.h:52
@ ROUNDRECT
Definition padstack.h:57
@ RECTANGLE
Definition padstack.h:54
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_INFO
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
VECTOR2I end
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
Definition typeinfo.h:61
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695