KiCad PCB EDA Suite
Loading...
Searching...
No Matches
odb_feature.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 * Author: SYSUEric <[email protected]>.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include "odb_feature.h"
22
23#include <sstream>
24#include <map>
25
26#include <wx/log.h>
27
28#include "footprint.h"
29#include "pad.h"
30#include "pcb_shape.h"
31#include "odb_defines.h"
32#include "pcb_track.h"
33#include "pcb_textbox.h"
34#include "pcb_table.h"
35#include "zone.h"
36#include "board.h"
38#include "geometry/eda_angle.h"
39#include "odb_eda_data.h"
40#include "pcb_io_odbpp.h"
41#include <callback_gal.h>
42#include <string_utils.h>
43
44
45void FEATURES_MANAGER::AddFeatureLine( const VECTOR2I& aStart, const VECTOR2I& aEnd,
46 uint64_t aWidth )
47{
48 AddFeature<ODB_LINE>( ODB::AddXY( aStart ), ODB::AddXY( aEnd ),
50}
51
52
53void FEATURES_MANAGER::AddFeatureArc( const VECTOR2I& aStart, const VECTOR2I& aEnd,
54 const VECTOR2I& aCenter, uint64_t aWidth,
55 ODB_DIRECTION aDirection )
56{
57 AddFeature<ODB_ARC>( ODB::AddXY( aStart ), ODB::AddXY( aEnd ), ODB::AddXY( aCenter ),
58 AddCircleSymbol( ODB::SymDouble2String( aWidth ) ), aDirection );
59}
60
61
62void FEATURES_MANAGER::AddPadCircle( const VECTOR2I& aCenter, uint64_t aDiameter,
63 const EDA_ANGLE& aAngle, bool aMirror,
64 double aResize /*= 1.0 */ )
65{
67 AddCircleSymbol( ODB::SymDouble2String( aDiameter ) ), aAngle, aMirror,
68 aResize );
69}
70
71
72bool FEATURES_MANAGER::AddContour( const SHAPE_POLY_SET& aPolySet, int aOutline /*= 0*/,
73 FILL_T aFillType /*= FILL_T::FILLED_SHAPE*/ )
74{
75 // todo: args modify aPolySet.Polygon( aOutline ) instead of aPolySet
76
77 if( aPolySet.OutlineCount() < ( aOutline + 1 ) )
78 return false;
79
80 AddFeatureSurface( aPolySet.Polygon( aOutline ), aFillType );
81
82 return true;
83}
84
85
87{
88 int stroke_width = aShape.GetWidth();
89
90 switch( aShape.GetShape() )
91 {
92 case SHAPE_T::CIRCLE:
93 {
94 int diameter = aShape.GetRadius() * 2;
96 wxString innerDim = ODB::SymDouble2String( ( diameter - stroke_width / 2 ) );
97 wxString outerDim = ODB::SymDouble2String( ( stroke_width + diameter ) );
98
99 if( aShape.IsSolidFill() )
101 else
102 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundDonutSymbol( outerDim, innerDim ) );
103
104 break;
105 }
106
108 {
109 int width = std::abs( aShape.GetRectangleWidth() ) + stroke_width;
110 int height = std::abs( aShape.GetRectangleHeight() ) + stroke_width;
111 wxString rad = ODB::SymDouble2String( ( stroke_width / 2.0 ) );
113
114 if( aShape.IsSolidFill() )
115 {
118 ODB::SymDouble2String( height ), rad ) );
119 }
120 else
121 {
124 ODB::SymDouble2String( height ),
125 ODB::SymDouble2String( stroke_width ),
126 rad ) );
127 }
128
129 break;
130 }
131
132 case SHAPE_T::POLY:
133 {
134 int soldermask_min_thickness = 0;
135
136 // TODO: check if soldermask_min_thickness should be Stroke width
137
138 if( aLayer != UNDEFINED_LAYER && LSET( { F_Mask, B_Mask } ).Contains( aLayer ) )
139 soldermask_min_thickness = stroke_width;
140
141 int maxError = m_board->GetDesignSettings().m_MaxError;
142 SHAPE_POLY_SET poly_set;
143
144 if( soldermask_min_thickness == 0 )
145 {
146 poly_set = aShape.GetPolyShape().CloneDropTriangulation();
147 poly_set.Fracture();
148 }
149 else
150 {
151 SHAPE_POLY_SET initialPolys;
152
153 // add shapes inflated by aMinThickness/2 in areas
154 aShape.TransformShapeToPolygon( initialPolys, aLayer, 0, maxError, ERROR_OUTSIDE );
155 aShape.TransformShapeToPolygon( poly_set, aLayer, soldermask_min_thickness / 2 - 1,
156 maxError, ERROR_OUTSIDE );
157
158 poly_set.Simplify();
159 poly_set.Deflate( soldermask_min_thickness / 2 - 1,
161 poly_set.BooleanAdd( initialPolys );
162 poly_set.Fracture();
163 }
164
165 // ODB++ surface features can only represent closed polygons. We add a surface for
166 // the fill of the shape, if present, and add line segments for the outline, if present.
167 if( aShape.IsSolidFill() )
168 {
169 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
170 {
171 AddContour( poly_set, ii, FILL_T::FILLED_SHAPE );
172
173 if( stroke_width != 0 )
174 {
175 for( int jj = 0; jj < poly_set.COutline( ii ).SegmentCount(); ++jj )
176 {
177 const SEG& seg = poly_set.COutline( ii ).CSegment( jj );
178 AddFeatureLine( seg.A, seg.B, stroke_width );
179 }
180 }
181 }
182 }
183 else
184 {
185 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
186 {
187 for( int jj = 0; jj < poly_set.COutline( ii ).SegmentCount(); ++jj )
188 {
189 const SEG& seg = poly_set.COutline( ii ).CSegment( jj );
190 AddFeatureLine( seg.A, seg.B, stroke_width );
191 }
192 }
193 }
194
195 break;
196 }
197
198 case SHAPE_T::ARC:
199 {
201
202 AddFeatureArc( aShape.GetStart(), aShape.GetEnd(), aShape.GetCenter(), stroke_width, dir );
203 break;
204 }
205
206 case SHAPE_T::BEZIER:
207 {
208 const std::vector<VECTOR2I>& points = aShape.GetBezierPoints();
209
210 for( size_t i = 0; i < points.size() - 1; i++ )
211 AddFeatureLine( points[i], points[i + 1], stroke_width );
212
213 break;
214 }
215
216 case SHAPE_T::SEGMENT:
217 AddFeatureLine( aShape.GetStart(), aShape.GetEnd(), stroke_width );
218 break;
219
220 default:
221 wxLogError( wxT( "Unknown shape when adding ODB++ layer feature" ) );
222 break;
223 }
224
225 if( aShape.IsHatchedFill() )
226 {
227 for( int ii = 0; ii < aShape.GetHatching().OutlineCount(); ++ii )
229 }
230}
231
232
234 FILL_T aFillType /*= FILL_T::FILLED_SHAPE */ )
235{
236 AddFeature<ODB_SURFACE>( aPolygon, aFillType );
237}
238
239
241{
242 FOOTPRINT* fp = aPad.GetParentFootprint();
243 bool mirror = false;
244
245 if( aPad.GetOrientation() != ANGLE_0 )
246 {
247 if( fp && fp->IsFlipped() )
248 mirror = true;
249 }
250
251 int maxError = m_board->GetDesignSettings().m_MaxError;
252
253 VECTOR2I expansion{ 0, 0 };
254
255 if( aLayer != UNDEFINED_LAYER && LSET( { F_Mask, B_Mask } ).Contains( aLayer ) )
256 expansion.x = expansion.y = aPad.GetSolderMaskExpansion( aLayer );
257
258 if( aLayer != UNDEFINED_LAYER && LSET( { F_Paste, B_Paste } ).Contains( aLayer ) )
259 expansion = aPad.GetSolderPasteMargin( aLayer );
260
261 int mask_clearance = expansion.x;
262
263 VECTOR2I plotSize = aPad.GetSize( aLayer ) + 2 * expansion;
264
265 VECTOR2I center = aPad.ShapePos( aLayer );
266
267 wxString width = ODB::SymDouble2String( std::abs( plotSize.x ) );
268 wxString height = ODB::SymDouble2String( std::abs( plotSize.y ) );
269
270 switch( aPad.GetShape( aLayer ) )
271 {
273 {
274 wxString diam = ODB::SymDouble2String( plotSize.x );
275
277 mirror );
278
279 break;
280 }
282 {
283 if( mask_clearance > 0 )
284 {
285 wxString rad = ODB::SymDouble2String( mask_clearance );
286
287 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundRectSymbol( width, height, rad ),
288 aPad.GetOrientation(), mirror );
289 }
290 else
291 {
293 aPad.GetOrientation(), mirror );
294 }
295
296 break;
297 }
298 case PAD_SHAPE::OVAL:
299 {
301 aPad.GetOrientation(), mirror );
302 break;
303 }
305 {
306 wxString rad = ODB::SymDouble2String( aPad.GetRoundRectCornerRadius( aLayer ) );
307
308 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundRectSymbol( width, height, rad ),
309 aPad.GetOrientation(), mirror );
310
311 break;
312 }
314 {
315 int shorterSide = std::min( plotSize.x, plotSize.y );
316 int chamfer = std::max(
317 0, KiROUND( aPad.GetChamferRectRatio( aLayer ) * shorterSide ) );
318 wxString rad = ODB::SymDouble2String( chamfer );
319 int positions = aPad.GetChamferPositions( aLayer );
320
322 AddChamferRectSymbol( width, height, rad, positions ),
323 aPad.GetOrientation(), mirror );
324
325 break;
326 }
328 {
329 SHAPE_POLY_SET outline;
330
331 aPad.TransformShapeToPolygon( outline, aLayer, 0, maxError, ERROR_INSIDE );
332
333 // Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
334 // which can create bad shapes if margin.x is < 0
335
336 if( mask_clearance )
337 {
339 maxError );
340 }
341
342 for( int ii = 0; ii < outline.OutlineCount(); ++ii )
343 AddContour( outline, ii );
344
345 break;
346 }
348 {
349 SHAPE_POLY_SET shape;
350 aPad.MergePrimitivesAsPolygon( aLayer, &shape );
351
352 // as for custome shape, odb++ don't rotate the polygon,
353 // so we rotate the polygon in kicad anticlockwise
354
355 shape.Rotate( aPad.GetOrientation() );
356 shape.Move( center );
357
358 if( expansion != VECTOR2I( 0, 0 ) )
359 {
360 shape.InflateWithLinkedHoles( std::max( expansion.x, expansion.y ),
362 }
363
364 for( int ii = 0; ii < shape.OutlineCount(); ++ii )
365 AddContour( shape, ii );
366
367 break;
368 }
369 default: wxLogError( wxT( "Unknown pad type" ) ); break;
370 }
371}
372
373
374void FEATURES_MANAGER::InitFeatureList( PCB_LAYER_ID aLayer, std::vector<BOARD_ITEM*>& aItems )
375{
376 auto add_track = [&]( PCB_TRACK* track )
377 {
378 auto iter = GetODBPlugin()->GetViaTraceSubnetMap().find( track );
379
380 if( iter == GetODBPlugin()->GetViaTraceSubnetMap().end() )
381 {
382 wxLogError( wxT( "Failed to get subnet track data" ) );
383 return;
384 }
385
386 auto subnet = iter->second;
387
388 if( track->Type() == PCB_TRACE_T )
389 {
390 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
391 shape.SetStart( track->GetStart() );
392 shape.SetEnd( track->GetEnd() );
393 shape.SetWidth( track->GetWidth() );
394
395 AddShape( shape );
396 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
397 m_featuresList.size() - 1 );
398 }
399 else if( track->Type() == PCB_ARC_T )
400 {
401 PCB_ARC* arc = static_cast<PCB_ARC*>( track );
402 PCB_SHAPE shape( nullptr, SHAPE_T::ARC );
403 shape.SetArcGeometry( arc->GetStart(), arc->GetMid(), arc->GetEnd() );
404 shape.SetWidth( arc->GetWidth() );
405
406 AddShape( shape );
407
408 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
409 m_featuresList.size() - 1 );
410 }
411 else
412 {
413 // add via
414 PCB_VIA* via = static_cast<PCB_VIA*>( track );
415
416 bool hole = false;
417
418 if( aLayer != PCB_LAYER_ID::UNDEFINED_LAYER )
419 {
420 hole = m_layerName.Contains( "plugging" );
421 }
422 else
423 {
424 hole = m_layerName.Contains( "drill" ) || m_layerName.Contains( "filling" )
425 || m_layerName.Contains( "capping" );
426 }
427
428 if( hole )
429 {
430 AddViaDrillHole( via, aLayer );
431 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::HOLE, m_layerName,
432 m_featuresList.size() - 1 );
433
434 // TODO: confirm TOOLING_HOLE
435 // AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::PAD_USAGE::TOOLING_HOLE );
436
437 if( !m_featuresList.empty() )
438 {
441 *m_featuresList.back(),
442 ODB_ATTR::GEOMETRY{ "VIA_RoundD" + std::to_string( via->GetWidth( aLayer ) ) } );
443 }
444 }
445 else
446 {
447 // to draw via copper shape on copper layer
448 AddVia( via, aLayer );
449 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
450 m_featuresList.size() - 1 );
451
452 if( !m_featuresList.empty() )
453 {
456 *m_featuresList.back(),
457 ODB_ATTR::GEOMETRY{ "VIA_RoundD" + std::to_string( via->GetWidth( aLayer ) ) } );
458 }
459 }
460 }
461 };
462
463 auto add_zone = [&]( ZONE* zone )
464 {
465 SHAPE_POLY_SET zone_shape = zone->GetFilledPolysList( aLayer )->CloneDropTriangulation();
466
467 for( int ii = 0; ii < zone_shape.OutlineCount(); ++ii )
468 {
469 AddContour( zone_shape, ii );
470
471 auto iter = GetODBPlugin()->GetPlaneSubnetMap().find( std::make_pair( aLayer, zone ) );
472
473 if( iter == GetODBPlugin()->GetPlaneSubnetMap().end() )
474 {
475 wxLogError( wxT( "Failed to get subnet plane data" ) );
476 return;
477 }
478
479 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
480 m_featuresList.size() - 1 );
481
482 if( zone->IsTeardropArea() && !m_featuresList.empty() )
483 AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::TEAR_DROP{ true } );
484 }
485 };
486
487 auto add_text = [&]( BOARD_ITEM* item )
488 {
489 EDA_TEXT* text_item = nullptr;
490
491 if( PCB_TEXT* tmp_text = dynamic_cast<PCB_TEXT*>( item ) )
492 text_item = static_cast<EDA_TEXT*>( tmp_text );
493 else if( PCB_TEXTBOX* tmp_textbox = dynamic_cast<PCB_TEXTBOX*>( item ) )
494 text_item = static_cast<EDA_TEXT*>( tmp_textbox );
495
496 if( !text_item || !text_item->IsVisible() || text_item->GetShownText( false ).empty() )
497 return;
498
499 auto plot_text = [&]( const VECTOR2I& aPos, const wxString& aTextString,
500 const TEXT_ATTRIBUTES& aAttributes, KIFONT::FONT* aFont,
501 const KIFONT::METRICS& aFontMetrics )
502 {
504
505 TEXT_ATTRIBUTES attributes = aAttributes;
506 int penWidth = attributes.m_StrokeWidth;
507
508 if( penWidth == 0 && attributes.m_Bold ) // Use default values if aPenWidth == 0
509 penWidth =
510 GetPenSizeForBold( std::min( attributes.m_Size.x, attributes.m_Size.y ) );
511
512 if( penWidth < 0 )
513 penWidth = -penWidth;
514
515 attributes.m_StrokeWidth = penWidth;
516
517 std::list<VECTOR2I> pts;
518
519 auto push_pts = [&]()
520 {
521 if( pts.size() < 2 )
522 return;
523
524 // Polylines are only allowed for more than 3 points.
525 // Otherwise, we have to use a line
526
527 if( pts.size() < 3 )
528 {
529 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
530 shape.SetStart( pts.front() );
531 shape.SetEnd( pts.back() );
532 shape.SetWidth( attributes.m_StrokeWidth );
533
534 AddShape( shape );
536 ODB_ATTR::STRING{ aTextString.ToStdString() } );
537 }
538 else
539 {
540 for( auto it = pts.begin(); std::next( it ) != pts.end(); ++it )
541 {
542 auto it2 = std::next( it );
543 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
544 shape.SetStart( *it );
545 shape.SetEnd( *it2 );
546 shape.SetWidth( attributes.m_StrokeWidth );
547 AddShape( shape );
548
549 if( !m_featuresList.empty() )
550 {
552 ODB_ATTR::STRING{ aTextString.ToStdString() } );
553 }
554 }
555 }
556
557 pts.clear();
558 };
559
560 CALLBACK_GAL callback_gal(
561 empty_opts,
562 // Stroke callback
563 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
564 {
565 if( !pts.empty() )
566 {
567 if( aPt1 == pts.back() )
568 pts.push_back( aPt2 );
569 else if( aPt2 == pts.front() )
570 pts.push_front( aPt1 );
571 else if( aPt1 == pts.front() )
572 pts.push_front( aPt2 );
573 else if( aPt2 == pts.back() )
574 pts.push_back( aPt1 );
575 else
576 {
577 push_pts();
578 pts.push_back( aPt1 );
579 pts.push_back( aPt2 );
580 }
581 }
582 else
583 {
584 pts.push_back( aPt1 );
585 pts.push_back( aPt2 );
586 }
587 },
588 // Polygon callback
589 [&]( const SHAPE_LINE_CHAIN& aPoly )
590 {
591 if( aPoly.PointCount() < 3 )
592 return;
593
594 SHAPE_POLY_SET poly_set;
595 poly_set.AddOutline( aPoly );
596
597 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
598 {
599 AddContour( poly_set, ii, FILL_T::FILLED_SHAPE );
600
601 if( !m_featuresList.empty() )
602 {
604 ODB_ATTR::STRING{ aTextString.ToStdString() } );
605 }
606 }
607 } );
608
609 aFont->Draw( &callback_gal, aTextString, aPos, aAttributes, aFontMetrics );
610
611 if( !pts.empty() )
612 push_pts();
613 };
614
615 bool isKnockout = false;
616
617 if( item->Type() == PCB_TEXT_T || item->Type() == PCB_FIELD_T )
618 isKnockout = static_cast<PCB_TEXT*>( item )->IsKnockout();
619 else if( item->Type() == PCB_TEXTBOX_T )
620 isKnockout = static_cast<PCB_TEXTBOX*>( item )->IsKnockout();
621
622 const KIFONT::METRICS& fontMetrics = item->GetFontMetrics();
623 KIFONT::FONT* font = text_item->GetDrawFont( nullptr );
624 wxString shownText( text_item->GetShownText( true ) );
625
626 if( shownText.IsEmpty() )
627 return;
628
629 VECTOR2I pos = text_item->GetTextPos();
630
631 TEXT_ATTRIBUTES attrs = text_item->GetAttributes();
632 attrs.m_StrokeWidth = text_item->GetEffectiveTextPenWidth();
633 attrs.m_Angle = text_item->GetDrawRotation();
634 attrs.m_Multiline = false;
635
636 if( isKnockout )
637 {
638 PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
639 SHAPE_POLY_SET finalpolyset;
640
641 text->TransformTextToPolySet( finalpolyset, 0, m_board->GetDesignSettings().m_MaxError,
642 ERROR_INSIDE );
643 finalpolyset.Fracture();
644
645 for( int ii = 0; ii < finalpolyset.OutlineCount(); ++ii )
646 {
647 AddContour( finalpolyset, ii, FILL_T::FILLED_SHAPE );
648
649 if( !m_featuresList.empty() )
650 {
652 ODB_ATTR::STRING{ shownText.ToStdString() } );
653 }
654 }
655 }
656 else if( text_item->IsMultilineAllowed() )
657 {
658 std::vector<VECTOR2I> positions;
659 wxArrayString strings_list;
660 wxStringSplit( shownText, strings_list, '\n' );
661 positions.reserve( strings_list.Count() );
662
663 text_item->GetLinePositions( nullptr, positions, strings_list.Count() );
664
665 for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
666 {
667 wxString& txt = strings_list.Item( ii );
668 plot_text( positions[ii], txt, attrs, font, fontMetrics );
669 }
670 }
671 else
672 {
673 plot_text( pos, shownText, attrs, font, fontMetrics );
674 }
675 };
676
677
678 auto add_shape = [&]( PCB_SHAPE* shape )
679 {
680 // FOOTPRINT* fp = shape->GetParentFootprint();
681 AddShape( *shape, aLayer );
682 };
683
684 auto add_pad = [&]( PAD* pad )
685 {
686 auto iter = GetODBPlugin()->GetPadSubnetMap().find( pad );
687
688 if( iter == GetODBPlugin()->GetPadSubnetMap().end() )
689 {
690 wxLogError( wxT( "Failed to get subnet top data" ) );
691 return;
692 }
693
694 if( aLayer != PCB_LAYER_ID::UNDEFINED_LAYER )
695 {
696 // FOOTPRINT* fp = pad->GetParentFootprint();
697
698 AddPadShape( *pad, aLayer );
699
700 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
701 m_featuresList.size() - 1 );
702 if( !m_featuresList.empty() )
704
705 if( !pad->HasHole() && !m_featuresList.empty() )
706 AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::SMD{ true } );
707 }
708 else
709 {
710 // drill layer round hole or slot hole
711 if( m_layerName.Contains( "drill" ) )
712 {
713 // here we exchange round hole or slot hole into pad to draw in drill layer
714 PAD dummy( *pad );
715 dummy.Padstack().SetMode( PADSTACK::MODE::NORMAL );
716
717 if( pad->GetDrillSizeX() == pad->GetDrillSizeY() )
718 dummy.SetShape( PADSTACK::ALL_LAYERS, PAD_SHAPE::CIRCLE ); // round hole shape
719 else
720 dummy.SetShape( PADSTACK::ALL_LAYERS, PAD_SHAPE::OVAL ); // slot hole shape
721
722 dummy.SetOffset( PADSTACK::ALL_LAYERS,
723 VECTOR2I( 0, 0 ) ); // use hole position not pad position
724 dummy.SetSize( PADSTACK::ALL_LAYERS, pad->GetDrillSize() );
725
726 AddPadShape( dummy, aLayer );
727
728 if( pad->GetAttribute() == PAD_ATTRIB::PTH )
729 {
730 // only plated holes link to subnet
731 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::HOLE, m_layerName,
732 m_featuresList.size() - 1 );
733
734 if( !m_featuresList.empty() )
736 }
737 else
738 {
739 if( !m_featuresList.empty() )
741 }
742 }
743 }
744 // AddSystemAttribute( *m_featuresList.back(),
745 // ODB_ATTR::GEOMETRY{ "PAD_xxxx" } );
746 };
747
748 for( BOARD_ITEM* item : aItems )
749 {
750 switch( item->Type() )
751 {
752 case PCB_TRACE_T:
753 case PCB_ARC_T:
754 case PCB_VIA_T:
755 add_track( static_cast<PCB_TRACK*>( item ) );
756 break;
757
758 case PCB_ZONE_T:
759 add_zone( static_cast<ZONE*>( item ) );
760 break;
761
762 case PCB_PAD_T:
763 add_pad( static_cast<PAD*>( item ) );
764 break;
765
766 case PCB_SHAPE_T:
767 add_shape( static_cast<PCB_SHAPE*>( item ) );
768 break;
769
770 case PCB_TEXT_T:
771 case PCB_FIELD_T:
772 add_text( item );
773 break;
774
775 case PCB_TEXTBOX_T:
776 add_text( item );
777
778 if( static_cast<PCB_TEXTBOX*>( item )->IsBorderEnabled() )
779 add_shape( static_cast<PCB_TEXTBOX*>( item ) );
780
781 break;
782
783 case PCB_TABLE_T:
784 {
785 PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
786
787 for( PCB_TABLECELL* cell : table->GetCells() )
788 add_text( cell );
789
790 table->DrawBorders(
791 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2, const STROKE_PARAMS& aStroke )
792 {
793 int lineWidth = aStroke.GetWidth();
794
795 if( lineWidth > 0 )
796 AddFeatureLine( aPt1, aPt2, lineWidth );
797 } );
798
799 break;
800 }
801
802 case PCB_DIMENSION_T:
803 case PCB_TARGET_T:
805 case PCB_DIM_LEADER_T:
806 case PCB_DIM_CENTER_T:
807 case PCB_DIM_RADIAL_T:
809 //TODO: Add support for dimensions
810 break;
811
812 case PCB_BARCODE_T:
813 //TODO: Add support for barcodes
814 break;
815
816 default:
817 break;
818 }
819 }
820}
821
822
824{
825 if( !aVia->FlashLayer( aLayer ) )
826 return;
827
828 PAD dummy( nullptr ); // default pad shape is circle
829 dummy.SetPadstack( aVia->Padstack() );
830 dummy.SetPosition( aVia->GetStart() );
831
832 AddPadShape( dummy, aLayer );
833}
834
835
837{
838 PAD dummy( nullptr ); // default pad shape is circle
839 int hole = aVia->GetDrillValue();
840 dummy.SetPosition( aVia->GetStart() );
841 dummy.SetSize( PADSTACK::ALL_LAYERS, VECTOR2I( hole, hole ) );
842
843 AddPadShape( dummy, aLayer );
844}
845
846
847void FEATURES_MANAGER::GenerateProfileFeatures( std::ostream& ost ) const
848{
849 ost << "UNITS=" << PCB_IO_ODBPP::m_unitsStr << std::endl;
850 ost << "#\n#Num Features\n#" << std::endl;
851 ost << "F " << m_featuresList.size() << std::endl;
852
853 if( m_featuresList.empty() )
854 return;
855
856 ost << "#\n#Layer features\n#" << std::endl;
857
858 for( const auto& feat : m_featuresList )
859 {
860 feat->WriteFeatures( ost );
861 }
862}
863
864
865void FEATURES_MANAGER::GenerateFeatureFile( std::ostream& ost ) const
866{
867 ost << "UNITS=" << PCB_IO_ODBPP::m_unitsStr << std::endl;
868 ost << "#\n#Num Features\n#" << std::endl;
869 ost << "F " << m_featuresList.size() << std::endl << std::endl;
870
871 if( m_featuresList.empty() )
872 return;
873
874 ost << "#\n#Feature symbol names\n#" << std::endl;
875
876 for( const auto& [n, name] : m_allSymMap )
877 {
878 ost << "$" << n << " " << name << std::endl;
879 }
880
881 WriteAttributes( ost );
882
883 ost << "#\n#Layer features\n#" << std::endl;
884
885 for( const auto& feat : m_featuresList )
886 {
887 feat->WriteFeatures( ost );
888 }
889}
890
891
892void ODB_FEATURE::WriteFeatures( std::ostream& ost )
893{
894 switch( GetFeatureType() )
895 {
896 case FEATURE_TYPE::LINE: ost << "L "; break;
897
898 case FEATURE_TYPE::ARC: ost << "A "; break;
899
900 case FEATURE_TYPE::PAD: ost << "P "; break;
901
902 case FEATURE_TYPE::SURFACE: ost << "S "; break;
903 default: return;
904 }
905
906 WriteRecordContent( ost );
907 ost << std::endl;
908}
909
910
911void ODB_LINE::WriteRecordContent( std::ostream& ost )
912{
913 ost << m_start.first << " " << m_start.second << " " << m_end.first << " " << m_end.second
914 << " " << m_symIndex << " P 0";
915
916 WriteAttributes( ost );
917}
918
919
920void ODB_ARC::WriteRecordContent( std::ostream& ost )
921{
922 ost << m_start.first << " " << m_start.second << " " << m_end.first << " " << m_end.second
923 << " " << m_center.first << " " << m_center.second << " " << m_symIndex << " P 0 "
924 << ( m_direction == ODB_DIRECTION::CW ? "Y" : "N" );
925
926 WriteAttributes( ost );
927}
928
929
930void ODB_PAD::WriteRecordContent( std::ostream& ost )
931{
932 ost << m_center.first << " " << m_center.second << " ";
933
934 // TODO: support resize symbol
935 // ost << "-1" << " " << m_symIndex << " "
936 // << m_resize << " P 0 ";
937
938 ost << m_symIndex << " P 0 ";
939
940 if( m_mirror )
941 ost << "9 " << ODB::Double2String( m_angle.Normalize().AsDegrees() );
942 else
943 ost << "8 " << ODB::Double2String( ( ANGLE_360 - m_angle ).Normalize().AsDegrees() );
944
945 WriteAttributes( ost );
946}
947
948
949ODB_SURFACE::ODB_SURFACE( uint32_t aIndex, const SHAPE_POLY_SET::POLYGON& aPolygon,
950 FILL_T aFillType /*= FILL_T::FILLED_SHAPE*/ ) : ODB_FEATURE( aIndex )
951{
952 if( !aPolygon.empty() && aPolygon[0].PointCount() >= 3 )
953 {
954 m_surfaces = std::make_unique<ODB_SURFACE_DATA>( aPolygon );
955 if( aFillType != FILL_T::NO_FILL )
956 {
957 m_surfaces->AddPolygonHoles( aPolygon );
958 }
959 }
960 else
961 {
962 delete this;
963 }
964}
965
966
967void ODB_SURFACE::WriteRecordContent( std::ostream& ost )
968{
969 ost << "P 0";
970 WriteAttributes( ost );
971 ost << std::endl;
972 m_surfaces->WriteData( ost );
973 ost << "SE";
974}
975
976
978{
979 const std::vector<VECTOR2I>& pts = aPolygon[0].CPoints();
980 if( !pts.empty() )
981 {
982 if( m_polygons.empty() )
983 {
984 m_polygons.resize( 1 );
985 }
986
987 m_polygons.at( 0 ).reserve( pts.size() );
988 m_polygons.at( 0 ).emplace_back( pts.back() );
989
990 for( size_t jj = 0; jj < pts.size(); ++jj )
991 {
992 m_polygons.at( 0 ).emplace_back( pts.at( jj ) );
993 }
994 }
995}
996
997
999{
1000 for( size_t ii = 1; ii < aPolygon.size(); ++ii )
1001 {
1002 wxCHECK2( aPolygon[ii].PointCount() >= 3, continue );
1003
1004 const std::vector<VECTOR2I>& hole = aPolygon[ii].CPoints();
1005
1006 if( hole.empty() )
1007 continue;
1008
1009 if( m_polygons.size() <= ii )
1010 {
1011 m_polygons.resize( ii + 1 );
1012
1013 m_polygons[ii].reserve( hole.size() );
1014 }
1015
1016 m_polygons.at( ii ).emplace_back( hole.back() );
1017
1018 for( size_t jj = 0; jj < hole.size(); ++jj )
1019 {
1020 m_polygons.at( ii ).emplace_back( hole[jj] );
1021 }
1022 }
1023}
1024
1025
1026void ODB_SURFACE_DATA::WriteData( std::ostream& ost ) const
1027{
1028 ODB::CHECK_ONCE is_island;
1029
1030 for( const auto& contour : m_polygons )
1031 {
1032 if( contour.empty() )
1033 continue;
1034
1035 ost << "OB " << ODB::AddXY( contour.back().m_end ).first << " "
1036 << ODB::AddXY( contour.back().m_end ).second << " ";
1037
1038 if( is_island() )
1039 ost << "I";
1040 else
1041 ost << "H";
1042 ost << std::endl;
1043
1044 for( const auto& line : contour )
1045 {
1046 if( SURFACE_LINE::LINE_TYPE::SEGMENT == line.m_type )
1047 ost << "OS " << ODB::AddXY( line.m_end ).first << " "
1048 << ODB::AddXY( line.m_end ).second << std::endl;
1049 else
1050 ost << "OC " << ODB::AddXY( line.m_end ).first << " "
1051 << ODB::AddXY( line.m_end ).second << " " << ODB::AddXY( line.m_center ).first
1052 << " " << ODB::AddXY( line.m_center ).second << " "
1053 << ( line.m_direction == ODB_DIRECTION::CW ? "Y" : "N" ) << std::endl;
1054 }
1055 ost << "OE" << std::endl;
1056 }
1057}
const char * name
@ ERROR_OUTSIDE
@ ERROR_INSIDE
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:990
void WriteAttributes(std::ostream &ost, const std::string &prefix="") const
void AddSystemAttribute(Tr &r, Ta v)
void WriteAttributes(std::ostream &ost) const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
FOOTPRINT * GetParentFootprint() const
const SHAPE_POLY_SET & GetHatching() const
Definition eda_shape.h:148
int GetRectangleWidth() const
SHAPE_POLY_SET & GetPolyShape()
Definition eda_shape.h:337
int GetRadius() const
SHAPE_T GetShape() const
Definition eda_shape.h:169
bool IsHatchedFill() const
Definition eda_shape.h:124
bool IsSolidFill() const
Definition eda_shape.h:117
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:216
void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:178
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:174
const std::vector< VECTOR2I > & GetBezierPoints() const
Definition eda_shape.h:321
void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:220
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
int GetRectangleHeight() const
bool IsClockwiseArc() const
void SetWidth(int aWidth)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:80
const VECTOR2I & GetTextPos() const
Definition eda_text.h:273
bool IsMultilineAllowed() const
Definition eda_text.h:197
virtual bool IsVisible() const
Definition eda_text.h:187
virtual EDA_ANGLE GetDrawRotation() const
Definition eda_text.h:379
virtual KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const
Definition eda_text.cpp:661
const TEXT_ATTRIBUTES & GetAttributes() const
Definition eda_text.h:231
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition eda_text.cpp:479
void GetLinePositions(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition eda_text.cpp:925
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition eda_text.h:109
void AddPadShape(const PAD &aPad, PCB_LAYER_ID aLayer)
uint32_t AddRoundRectDonutSymbol(const wxString &aOuterWidth, const wxString &aOuterHeight, const wxString &aLineWidth, const wxString &aRadius)
void AddShape(const PCB_SHAPE &aShape, PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
uint32_t AddRectSymbol(const wxString &aWidth, const wxString &aHeight)
void AddVia(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
PCB_IO_ODBPP * GetODBPlugin()
void InitFeatureList(PCB_LAYER_ID aLayer, std::vector< BOARD_ITEM * > &aItems)
void AddFeatureLine(const VECTOR2I &aStart, const VECTOR2I &aEnd, uint64_t aWidth)
void AddFeatureArc(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, uint64_t aWidth, ODB_DIRECTION aDirection)
std::map< uint32_t, wxString > m_allSymMap
void GenerateFeatureFile(std::ostream &ost) const
void AddViaDrillHole(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
void AddPadCircle(const VECTOR2I &aCenter, uint64_t aDiameter, const EDA_ANGLE &aAngle, bool aMirror, double aResize=1.0)
void AddFeatureSurface(const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE)
uint32_t AddRoundRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius)
wxString m_layerName
uint32_t AddOvalSymbol(const wxString &aWidth, const wxString &aHeight)
void GenerateProfileFeatures(std::ostream &ost) const
std::list< std::unique_ptr< ODB_FEATURE > > m_featuresList
void AddFeature(Args &&... args)
uint32_t AddCircleSymbol(const wxString &aDiameter)
Definition odb_feature.h:96
uint32_t AddChamferRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius, int aPositions)
uint32_t AddRoundDonutSymbol(const wxString &aOuterDim, const wxString &aInnerDim)
bool AddContour(const SHAPE_POLY_SET &aPolySet, int aOutline=0, FILL_T aFillType=FILL_T::FILLED_SHAPE)
bool IsFlipped() const
Definition footprint.h:524
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:98
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Definition lset.h:63
std::pair< wxString, wxString > m_end
std::pair< wxString, wxString > m_start
uint32_t m_symIndex
virtual void WriteRecordContent(std::ostream &ost) override
ODB_DIRECTION m_direction
std::pair< wxString, wxString > m_center
virtual void WriteRecordContent(std::ostream &ost)=0
virtual void WriteFeatures(std::ostream &ost)
virtual FEATURE_TYPE GetFeatureType()=0
ODB_FEATURE(uint32_t aIndex)
virtual void WriteRecordContent(std::ostream &ost) override
std::pair< wxString, wxString > m_start
std::pair< wxString, wxString > m_end
uint32_t m_symIndex
uint32_t m_symIndex
virtual void WriteRecordContent(std::ostream &ost) override
bool m_mirror
EDA_ANGLE m_angle
std::pair< wxString, wxString > m_center
void WriteData(std::ostream &ost) const
std::vector< std::vector< SURFACE_LINE > > m_polygons
ODB_SURFACE_DATA(const SHAPE_POLY_SET::POLYGON &aPolygon)
void AddPolygonHoles(const SHAPE_POLY_SET::POLYGON &aPolygon)
std::unique_ptr< ODB_SURFACE_DATA > m_surfaces
virtual void WriteRecordContent(std::ostream &ost) override
ODB_SURFACE(uint32_t aIndex, const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE)
@ NORMAL
Shape is the same on all layers.
Definition padstack.h:171
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
void MergePrimitivesAsPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
Definition pad.cpp:3216
int GetRoundRectCornerRadius(PCB_LAYER_ID aLayer) const
Definition pad.cpp:891
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
Definition pad.h:196
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition pad.cpp:2550
int GetSolderMaskExpansion(PCB_LAYER_ID aLayer) const
Definition pad.cpp:1639
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition pad.h:420
int GetChamferPositions(PCB_LAYER_ID aLayer) const
Definition pad.h:836
double GetChamferRectRatio(PCB_LAYER_ID aLayer) const
Definition pad.h:819
VECTOR2I GetSolderPasteMargin(PCB_LAYER_ID aLayer) const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
Definition pad.cpp:1702
VECTOR2I ShapePos(PCB_LAYER_ID aLayer) const
Definition pad.cpp:1536
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Definition pad.h:264
const VECTOR2I & GetMid() const
Definition pcb_track.h:290
std::map< std::pair< PCB_LAYER_ID, ZONE * >, EDA_DATA::SUB_NET_PLANE * > & GetPlaneSubnetMap()
std::map< PCB_TRACK *, EDA_DATA::SUB_NET * > & GetViaTraceSubnetMap()
std::map< const PAD *, EDA_DATA::SUB_NET_TOEPRINT * > & GetPadSubnetMap()
static std::string m_unitsStr
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition pcb_shape.h:81
int GetWidth() const override
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
const VECTOR2I & GetStart() const
Definition pcb_track.h:97
const VECTOR2I & GetEnd() const
Definition pcb_track.h:94
virtual int GetWidth() const
Definition pcb_track.h:91
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
const PADSTACK & Padstack() const
Definition pcb_track.h:406
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
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...
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void BooleanAdd(const SHAPE_POLY_SET &b)
Perform boolean polyset union.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
POLYGON & Polygon(int aIndex)
Return the aIndex-th subpolygon in the set.
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
void Deflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError)
int OutlineCount() const
Return the number of outlines in the set.
void InflateWithLinkedHoles(int aFactor, CORNER_STRATEGY aCornerStrategy, int aMaxError)
Perform outline inflation/deflation, using round corners.
void Move(const VECTOR2I &aVector) override
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
SHAPE_POLY_SET CloneDropTriangulation() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Simple container to manage line stroke parameters.
int GetWidth() const
Handle a list of polygons defining a copper zone.
Definition zone.h:73
@ CHAMFER_ALL_CORNERS
All angles are chamfered.
@ ROUND_ALL_CORNERS
All angles are rounded.
static constexpr EDA_ANGLE ANGLE_0
Definition eda_angle.h:411
static constexpr EDA_ANGLE ANGLE_360
Definition eda_angle.h:417
@ SEGMENT
Definition eda_shape.h:45
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Definition eda_shape.h:46
FILL_T
Definition eda_shape.h:56
@ FILLED_SHAPE
Fill with object color.
Definition eda_shape.h:58
int GetPenSizeForBold(int aTextSize)
Definition gr_text.cpp:37
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ F_Paste
Definition layer_ids.h:104
@ B_Mask
Definition layer_ids.h:98
@ F_Mask
Definition layer_ids.h:97
@ B_Paste
Definition layer_ids.h:105
@ UNDEFINED_LAYER
Definition layer_ids.h:61
std::pair< wxString, wxString > AddXY(const VECTOR2I &aVec)
Definition odb_util.cpp:191
wxString Double2String(double aVal)
Definition odb_util.cpp:151
wxString SymDouble2String(double aVal)
Definition odb_util.cpp:179
VECTOR2I GetShapePosition(const PCB_SHAPE &aShape)
Definition odb_util.cpp:202
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:400
ODB_DIRECTION
Definition odb_feature.h:34
@ PTH
Plated through hole pad.
Definition padstack.h:98
@ CHAMFERED_RECT
Definition padstack.h:60
@ ROUNDRECT
Definition padstack.h:57
@ TRAPEZOID
Definition padstack.h:56
@ RECTANGLE
Definition padstack.h:54
std::vector< FAB_LAYER_COLOR > dummy
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
VECTOR2I center
VECTOR2I end
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:88
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:106
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:103
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:97
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:104
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:93
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:108
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:92
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:90
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:101
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition typeinfo.h:107
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:102
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition typeinfo.h:87
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:98
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition typeinfo.h:100
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:94
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:96
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:105
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695