KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_track.h
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) 2004 Jean-Pierre Charras, [email protected]
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, see <https://www.gnu.org/licenses/>.
19 */
20
30
31#pragma once
32
33#include <array>
34#include <optional>
35#include <mutex>
36
38#include <base_units.h>
40#include <core/minoptmax.h>
41#include <core/arraydim.h>
42#include <lset.h>
43#include <padstack.h>
44#include <pcb_track_types.h>
45
46class PAD;
47class MSG_PANEL_ITEM;
48class SHAPE_POLY_SET;
49class SHAPE_ARC;
50
51
52// Used for tracks and vias for algorithmic safety, not to enforce constraints
53#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
54
55
57{
58public:
59 static inline bool ClassOf( const EDA_ITEM* aItem )
60 {
61 return aItem && PCB_TRACE_T == aItem->Type();
62 }
63
64 PCB_TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
65
66 // Do not create a copy constructor. The one generated by the compiler is adequate.
67
68 void CopyFrom( const BOARD_ITEM* aOther ) override;
69
70 void Move( const VECTOR2I& aMoveVector ) override
71 {
72 m_Start += aMoveVector;
73 m_End += aMoveVector;
74 }
75
76 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
77
78 virtual void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
79
80 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
81
82 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
83 VECTOR2I GetPosition() const override { return m_Start; }
84 const VECTOR2I GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
85
86 virtual void SetWidth( int aWidth ) { m_width = aWidth; }
87 virtual int GetWidth() const { return m_width; }
88
89 void SetEnd( const VECTOR2I& aEnd ) { m_End = aEnd; }
90 const VECTOR2I& GetEnd() const { return m_End; }
91
92 void SetStart( const VECTOR2I& aStart ) { m_Start = aStart; }
93 const VECTOR2I& GetStart() const { return m_Start; }
94
95 void SetStartX( int aX ) { m_Start.x = aX; }
96 void SetStartY( int aY ) { m_Start.y = aY; }
97
98 int GetStartX() const { return m_Start.x; }
99 int GetStartY() const { return m_Start.y; }
100
101 void SetEndX( int aX ) { m_End.x = aX; }
102 void SetEndY( int aY ) { m_End.y = aY; }
103
104 int GetEndX() const { return m_End.x; }
105 int GetEndY() const { return m_End.y; }
106
108 const VECTOR2I& GetEndPoint( ENDPOINT_T aEndPoint ) const
109 {
110 if( aEndPoint == ENDPOINT_START )
111 return m_Start;
112 else
113 return m_End;
114 }
115
116 void SetHasSolderMask( bool aVal ) { m_hasSolderMask = aVal; }
117 bool HasSolderMask() const { return m_hasSolderMask; }
118
119 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
120 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
121
122 int GetSolderMaskExpansion() const;
123
124 // Virtual function
125 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
126
127 virtual LSET GetLayerSet() const override;
128 virtual void SetLayerSet( const LSET& aLayers ) override;
129
130 const BOX2I GetBoundingBox() const override;
131
137 virtual double GetLength() const;
138
144 virtual double GetDelay() const;
145
157 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
158 int aError, ERROR_LOC aErrorLoc,
159 bool ignoreLineWidth = false ) const override;
160
161 // @copydoc BOARD_ITEM::GetEffectiveShape
162 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
163 FLASHING aFlash = FLASHING::DEFAULT ) const override;
164
172 EDA_ITEM_FLAGS IsPointOnEnds( const VECTOR2I& point, int min_dist = 0 ) const;
173
177 bool IsNull() const
178 {
179 return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
180 }
181
182 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
183 wxString GetFriendlyName() const override;
184
185 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
186 const std::vector<KICAD_T>& aScanTypes ) override;
187
188 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
189 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
190 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
191
192 bool ApproxCollinear( const PCB_TRACK& aTrack );
193
194 wxString GetClass() const override
195 {
196 return wxT( "PCB_TRACK" );
197 }
198
199 virtual MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const;
200
201 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
202
203 BITMAPS GetMenuImage() const override;
204
205 virtual EDA_ITEM* Clone() const override;
206
207 virtual std::vector<int> ViewGetLayers() const override;
208
209 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
210
211 const BOX2I ViewBBox() const override;
212
216 bool IsOnCopperLayer() const override
217 {
218 return true;
219 }
220
221 virtual double Similarity( const BOARD_ITEM& aOther ) const override;
222
223 virtual bool operator==( const BOARD_ITEM& aOther ) const override;
224 virtual bool operator==( const PCB_TRACK& aOther ) const;
225
227 {
228 bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
229 };
230
231 void Serialize( google::protobuf::Any &aContainer ) const override;
232 bool Deserialize( const google::protobuf::Any &aContainer ) override;
233
234#if defined (DEBUG)
235 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
236#endif
237
238protected:
239 virtual void swapData( BOARD_ITEM* aImage ) override;
240
242 std::vector<MSG_PANEL_ITEM>& aList ) const;
243
244protected:
247
249 std::optional<int> m_solderMaskMargin;
250
251private:
253};
254
255
256class PCB_ARC : public PCB_TRACK
257{
258public:
259 PCB_ARC( BOARD_ITEM* aParent ) :
260 PCB_TRACK( aParent, PCB_ARC_T )
261 { }
262
263 PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
264
265 void CopyFrom( const BOARD_ITEM* aOther ) override;
266
267 static inline bool ClassOf( const EDA_ITEM *aItem )
268 {
269 return aItem && PCB_ARC_T == aItem->Type();
270 }
271
272 virtual void Move( const VECTOR2I& aMoveVector ) override
273 {
274 m_Start += aMoveVector;
275 m_Mid += aMoveVector;
276 m_End += aMoveVector;
277 }
278
279 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
280
281 void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
282
283 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
284
285 void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
286 const VECTOR2I& GetMid() const { return m_Mid; }
287
288 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
289
290 virtual VECTOR2I GetPosition() const override;
291 const VECTOR2I GetFocusPosition() const override { return m_Mid; }
292
293 virtual VECTOR2I GetCenter() const override { return GetPosition(); }
294
295 double GetRadius() const;
296 EDA_ANGLE GetAngle() const;
298 EDA_ANGLE GetArcAngleEnd() const; // Called by Python; ignore CLion's claim that it's unused
299 virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
300
301 virtual bool HitTest( const BOX2I& aRect, bool aContained = true,
302 int aAccuracy = 0 ) const override;
303
304 bool IsCCW() const;
305
306 wxString GetClass() const override
307 {
308 return wxT( "PCB_ARC" );
309 }
310
311 // @copydoc BOARD_ITEM::GetEffectiveShape
312 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
313 FLASHING aFlash = FLASHING::DEFAULT ) const override;
314
320 virtual double GetLength() const override
321 {
322 return GetRadius() * std::abs( GetAngle().AsRadians() );
323 }
324
325 EDA_ITEM* Clone() const override;
326
333 bool IsDegenerated( int aThreshold = 5 ) const;
334
335 double Similarity( const BOARD_ITEM& aOther ) const override;
336
337 bool operator==( const PCB_ARC& aOther ) const;
338 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
339
340 void Serialize( google::protobuf::Any &aContainer ) const override;
341 bool Deserialize( const google::protobuf::Any &aContainer ) override;
342
343protected:
344 virtual void swapData( BOARD_ITEM* aImage ) override;
345
346private:
347 // Silence GCC warning about overriding the base class method
348 bool operator==( const PCB_TRACK& aOther ) const override;
349
351};
352
353
354class PCB_VIA : public PCB_TRACK
355{
356public:
357 PCB_VIA( BOARD_ITEM* aParent );
358
359 static inline bool ClassOf( const EDA_ITEM *aItem )
360 {
361 return aItem && PCB_VIA_T == aItem->Type();
362 }
363
364 PCB_VIA( const PCB_VIA& aOther );
365 PCB_VIA& operator=( const PCB_VIA &aOther );
366
367 void CopyFrom( const BOARD_ITEM* aOther ) override;
368
369 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
370 {
371 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
372 return true;
373
374 for( KICAD_T scanType : aScanTypes )
375 {
376 if( scanType == PCB_LOCATE_STDVIA_T && m_viaType == VIATYPE::THROUGH )
377 return true;
378 else if( scanType == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
379 return true;
380 else if( scanType == PCB_LOCATE_BLINDVIA_T && m_viaType == VIATYPE::BLIND )
381 return true;
382 else if( scanType == PCB_LOCATE_BURIEDVIA_T && m_viaType == VIATYPE::BURIED )
383 return true;
384 }
385
386 return false;
387 }
388
392 bool HasValidLayerPair( int aCopperLayerCount );
393
394 VIATYPE GetViaType() const { return m_viaType; }
395 void SetViaType( VIATYPE aViaType )
396 {
397 m_viaType = aViaType;
398 // If someone updates a VIA to TH, we want to kick out any non-outer layers
400 }
401
402 const PADSTACK& Padstack() const { return m_padStack; }
404 void SetPadstack( const PADSTACK& aPadstack ) { m_padStack = aPadstack; }
405
406 BACKDRILL_MODE GetBackdrillMode() const { return m_padStack.GetBackdrillMode(); }
407 void SetBackdrillMode( BACKDRILL_MODE aMode ) { m_padStack.SetBackdrillMode( aMode ); }
408
409 std::optional<int> GetBottomBackdrillSize() const { return m_padStack.GetBackdrillSize( false ); }
410 void SetBottomBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( false, aSize ); }
411
412 PCB_LAYER_ID GetBottomBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( false ); }
413 void SetBottomBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( false, aLayer ); }
414
415 std::optional<int> GetTopBackdrillSize() const { return m_padStack.GetBackdrillSize( true ); }
416 void SetTopBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( true, aSize ); }
417
418 PCB_LAYER_ID GetTopBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( true ); }
419 void SetTopBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( true, aLayer ); }
420
421 bool IsMicroVia() const;
422 bool IsBlindVia() const;
423 bool IsBuriedVia() const;
424
445
446 static std::optional<VIA_PARAMETER_ERROR>
447 ValidateViaParameters( std::optional<int> aDiameter,
448 std::optional<int> aPrimaryDrill,
449 std::optional<PCB_LAYER_ID> aPrimaryStartLayer = std::nullopt,
450 std::optional<PCB_LAYER_ID> aPrimaryEndLayer = std::nullopt,
451 std::optional<int> aSecondaryDrill = std::nullopt,
452 std::optional<PCB_LAYER_ID> aSecondaryStartLayer = std::nullopt,
453 std::optional<PCB_LAYER_ID> aSecondaryEndLayer = std::nullopt,
454 std::optional<int> aTertiaryDrill = std::nullopt,
455 std::optional<PCB_LAYER_ID> aTertiaryStartLayer = std::nullopt,
456 std::optional<PCB_LAYER_ID> aTertiaryEndLayer = std::nullopt,
457 int aCopperLayerCount = 0 );
458
459 const BOX2I GetBoundingBox() const override;
460 const BOX2I GetBoundingBox( PCB_LAYER_ID aLayer ) const;
461
462 void SetWidth( int aWidth ) override;
463 int GetWidth() const override;
464
465 void SetWidth( PCB_LAYER_ID aLayer, int aWidth );
466 int GetWidth( PCB_LAYER_ID aLayer ) const;
467
468 // For properties panel
469 void SetFrontWidth( int aWidth ) { SetWidth( F_Cu, aWidth ); }
470 int GetFrontWidth() const { return GetWidth( F_Cu ); }
471
472 bool HasHole() const override
473 {
474 return true;
475 }
476
477 bool HasDrilledHole() const override
478 {
480 }
481
482 std::shared_ptr<SHAPE_SEGMENT> GetEffectiveHoleShape() const override;
483
484 MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const override;
485 MINOPTMAX<int> GetDrillConstraint( wxString* aSource = nullptr ) const;
486
487 void SetFrontTentingMode( TENTING_MODE aMode );
489 void SetBackTentingMode( TENTING_MODE aMode );
491
496
501
502 void SetCappingMode( CAPPING_MODE aMode );
504
505 void SetFillingMode( FILLING_MODE aMode );
507
508 bool IsTented( PCB_LAYER_ID aLayer ) const override;
509 int GetSolderMaskExpansion() const;
510
511 PCB_LAYER_ID GetLayer() const override;
512 void SetLayer( PCB_LAYER_ID aLayer ) override;
513
514 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
515
516 virtual LSET GetLayerSet() const override;
517
522 virtual void SetLayerSet( const LSET& aLayers ) override;
523
530 void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
531
532 void SetBottomLayer( PCB_LAYER_ID aLayer );
533 void SetTopLayer( PCB_LAYER_ID aLayer );
534
542 void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
543
544 PCB_LAYER_ID TopLayer() const;
546
551 void SanitizeLayers();
552
553 VECTOR2I GetPosition() const override { return m_Start; }
554 void SetPosition( const VECTOR2I& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
555
556 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
557
558 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
559 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
560
561 wxString GetClass() const override
562 {
563 return wxT( "PCB_VIA" );
564 }
565
566 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
567
568 BITMAPS GetMenuImage() const override;
569
570 EDA_ITEM* Clone() const override;
571
572 std::vector<int> ViewGetLayers() const override;
573
574 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
575
576 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
577
578#if defined (DEBUG)
579 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
580#endif
581
582 int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
583
589 void SetRemoveUnconnected( bool aSet )
590 {
591 m_padStack.SetUnconnectedLayerMode( aSet ? UNCONNECTED_LAYER_MODE::REMOVE_ALL
593 }
594
596 {
597 return m_padStack.UnconnectedLayerMode() != UNCONNECTED_LAYER_MODE::KEEP_ALL;
598 }
599
604 void SetKeepStartEnd( bool aSet )
605 {
608 }
609
610 bool GetKeepStartEnd() const
611 {
613 }
614
616 {
617 switch( m_padStack.UnconnectedLayerMode() )
618 {
620 return false;
621
623 return true;
624
627 return aLayer != m_padStack.Drill().start && aLayer != m_padStack.Drill().end;
628 }
629
630 return true;
631 }
632
639 bool FlashLayer( int aLayer ) const;
640
648 bool FlashLayer( const LSET& aLayers ) const;
649
656 PCB_LAYER_ID* aBottommost ) const;
657
663 void SetPrimaryDrillSize( const VECTOR2I& aSize );
664 const VECTOR2I& GetPrimaryDrillSize() const { return m_padStack.Drill().size; }
665
667 PAD_DRILL_SHAPE GetPrimaryDrillShape() const { return m_padStack.Drill().shape; }
668
670 PCB_LAYER_ID GetPrimaryDrillStartLayer() const { return m_padStack.Drill().start; }
671
673 PCB_LAYER_ID GetPrimaryDrillEndLayer() const { return m_padStack.Drill().end; }
674
675 void SetFrontPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
676 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetFrontPostMachining() const { return m_padStack.FrontPostMachining().mode; }
677
679 {
680 m_padStack.FrontPostMachining().mode = aMode;
681 }
682
687
688 void SetFrontPostMachiningSize( int aSize ) { m_padStack.FrontPostMachining().size = aSize; }
689 int GetFrontPostMachiningSize() const { return m_padStack.FrontPostMachining().size; }
690 void SetFrontPostMachiningDepth( int aDepth ) { m_padStack.FrontPostMachining().depth = aDepth; }
691 int GetFrontPostMachiningDepth() const { return m_padStack.FrontPostMachining().depth; }
692 void SetFrontPostMachiningAngle( int aAngle ) { m_padStack.FrontPostMachining().angle = aAngle; }
693 int GetFrontPostMachiningAngle() const { return m_padStack.FrontPostMachining().angle; }
694
695 void SetBackPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
696 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetBackPostMachining() const { return m_padStack.BackPostMachining().mode; }
697
699 {
700 m_padStack.BackPostMachining().mode = aMode;
701 }
702
707
708 void SetBackPostMachiningSize( int aSize ) { m_padStack.BackPostMachining().size = aSize; }
709 int GetBackPostMachiningSize() const { return m_padStack.BackPostMachining().size; }
710 void SetBackPostMachiningDepth( int aDepth ) { m_padStack.BackPostMachining().depth = aDepth; }
711 int GetBackPostMachiningDepth() const { return m_padStack.BackPostMachining().depth; }
712 void SetBackPostMachiningAngle( int aAngle ) { m_padStack.BackPostMachining().angle = aAngle; }
713 int GetBackPostMachiningAngle() const { return m_padStack.BackPostMachining().angle; }
714
724 bool IsBackdrilledOrPostMachined( PCB_LAYER_ID aLayer ) const;
725
732 int GetPostMachiningKnockout( PCB_LAYER_ID aLayer ) const;
733
734 void SetPrimaryDrillFilled( const std::optional<bool>& aFilled );
735 void SetPrimaryDrillFilledFlag( bool aFilled );
736 std::optional<bool> GetPrimaryDrillFilled() const { return m_padStack.Drill().is_filled; }
737 bool GetPrimaryDrillFilledFlag() const { return m_padStack.Drill().is_filled.value_or( false ); }
738
739 void SetPrimaryDrillCapped( const std::optional<bool>& aCapped );
740 void SetPrimaryDrillCappedFlag( bool aCapped );
741 std::optional<bool> GetPrimaryDrillCapped() const { return m_padStack.Drill().is_capped; }
742 bool GetPrimaryDrillCappedFlag() const { return m_padStack.Drill().is_capped.value_or( false ); }
743
744 void SetDrill( int aDrill )
745 {
746 SetPrimaryDrillSize( { aDrill, aDrill } );
747 }
748
754 int GetDrill() const { return GetPrimaryDrillSize().x; }
755
761 int GetDrillValue() const;
762
770
771 void SetSecondaryDrillSize( const VECTOR2I& aSize );
773 void SetSecondaryDrillSize( const std::optional<int>& aDrill );
774 std::optional<int> GetSecondaryDrillSize() const;
775
777 PCB_LAYER_ID GetSecondaryDrillStartLayer() const { return m_padStack.SecondaryDrill().start; }
778
780 PCB_LAYER_ID GetSecondaryDrillEndLayer() const { return m_padStack.SecondaryDrill().end; }
781
783 PAD_DRILL_SHAPE GetSecondaryDrillShape() const { return m_padStack.SecondaryDrill().shape; }
784
785 void SetTertiaryDrillSize( const VECTOR2I& aSize );
787 void SetTertiaryDrillSize( const std::optional<int>& aDrill );
788 std::optional<int> GetTertiaryDrillSize() const;
789
791 PCB_LAYER_ID GetTertiaryDrillStartLayer() const { return m_padStack.TertiaryDrill().start; }
792
794 PCB_LAYER_ID GetTertiaryDrillEndLayer() const { return m_padStack.TertiaryDrill().end; }
795
797 PAD_DRILL_SHAPE GetTertiaryDrillShape() const { return m_padStack.TertiaryDrill().shape; }
798
806 bool GetIsFree() const { return m_isFree; }
807 void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
808
809 // @copydoc BOARD_ITEM::GetEffectiveShape
810 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
811 FLASHING aFlash = FLASHING::DEFAULT ) const override;
812
814
816
817 void SetZoneLayerOverride( PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride );
818
819 double Similarity( const BOARD_ITEM& aOther ) const override;
820
821 bool operator==( const PCB_VIA& aOther ) const;
822 bool operator==( const BOARD_ITEM& aOther ) const override;
823
824 void Serialize( google::protobuf::Any &aContainer ) const override;
825 bool Deserialize( const google::protobuf::Any &aContainer ) override;
826
827 wxString LayerMaskDescribe() const override;
828
829protected:
830 void swapData( BOARD_ITEM* aImage ) override;
831
832private:
833 // Silence GCC warning about hiding the PCB_TRACK base method
834 bool operator==( const PCB_TRACK& aOther ) const override;
835
837
839
840 bool m_isFree;
841
843 std::map<PCB_LAYER_ID, ZONE_LAYER_OVERRIDE> m_zoneLayerOverrides;
844};
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
ZONE_LAYER_OVERRIDE
Conditionally flashed vias and pads that interact with zones of different priority can be very squirr...
Definition board_item.h:69
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:83
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition eda_item.h:202
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
Definition padstack.h:157
Definition pad.h:61
virtual VECTOR2I GetPosition() const override
bool IsDegenerated(int aThreshold=5) const
virtual void swapData(BOARD_ITEM *aImage) override
bool IsCCW() const
virtual double GetLength() const override
Return the length of the arc track.
Definition pcb_track.h:320
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition pcb_track.cpp:91
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
EDA_ANGLE GetArcAngleStart() const
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
EDA_ANGLE GetArcAngleEnd() const
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition pcb_track.h:291
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_track.h:288
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition pcb_track.h:272
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:306
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetMid(const VECTOR2I &aMid)
Definition pcb_track.h:285
double GetRadius() const
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
Definition pcb_track.h:286
PCB_ARC(BOARD_ITEM *aParent)
Definition pcb_track.h:259
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
VECTOR2I m_Mid
Arc mid point, halfway between start and end.
Definition pcb_track.h:350
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_track.h:267
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
bool operator==(const PCB_ARC &aOther) const
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition pcb_track.h:293
void CopyFrom(const BOARD_ITEM *aOther) override
Definition pcb_track.cpp:97
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
virtual void SetLayerSet(const LSET &aLayers) override
int GetSolderMaskExpansion() const
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetEndY(int aY)
Definition pcb_track.h:102
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition pcb_track.h:84
bool IsOnCopperLayer() const override
Definition pcb_track.h:216
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition pcb_track.h:70
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:194
void SetHasSolderMask(bool aVal)
Definition pcb_track.h:116
virtual double GetLength() const
Get the length of the track using the hypotenuse calculation.
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
virtual void swapData(BOARD_ITEM *aImage) override
void SetEnd(const VECTOR2I &aEnd)
Definition pcb_track.h:89
bool HasSolderMask() const
Definition pcb_track.h:117
void SetStart(const VECTOR2I &aStart)
Definition pcb_track.h:92
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
int GetStartY() const
Definition pcb_track.h:99
int GetEndX() const
Definition pcb_track.h:104
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
virtual void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool ApproxCollinear(const PCB_TRACK &aTrack)
VECTOR2I m_End
Line end point.
Definition pcb_track.h:246
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_track.h:119
std::optional< int > m_solderMaskMargin
Definition pcb_track.h:249
void CopyFrom(const BOARD_ITEM *aOther) override
Definition pcb_track.cpp:75
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_track.h:82
std::optional< int > GetLocalSolderMaskMargin() const
Definition pcb_track.h:120
virtual double GetDelay() const
Get the time delay of the track.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
virtual EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition pcb_track.cpp:69
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the track shape to a closed polygon.
const VECTOR2I & GetStart() const
Definition pcb_track.h:93
virtual bool operator==(const BOARD_ITEM &aOther) const override
VECTOR2I m_Start
Line start point.
Definition pcb_track.h:245
int GetEndY() const
Definition pcb_track.h:105
wxString GetFriendlyName() const override
VECTOR2I GetPosition() const override
Definition pcb_track.h:83
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
const VECTOR2I & GetEndPoint(ENDPOINT_T aEndPoint) const
Return the selected endpoint (start or end)
Definition pcb_track.h:108
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_track.h:59
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
bool IsNull() const
Return true if segment length is zero.
Definition pcb_track.h:177
virtual double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
bool m_hasSolderMask
Definition pcb_track.h:248
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void SetStartX(int aX)
Definition pcb_track.h:95
const VECTOR2I & GetEnd() const
Definition pcb_track.h:90
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition pcb_track.cpp:61
void SetStartY(int aY)
Definition pcb_track.h:96
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
virtual MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const
void SetEndX(int aX)
Definition pcb_track.h:101
int GetStartX() const
Definition pcb_track.h:98
int m_width
Thickness of track (or arc) – no longer the width of a via.
Definition pcb_track.h:252
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
virtual void SetWidth(int aWidth)
Definition pcb_track.h:86
virtual int GetWidth() const
Definition pcb_track.h:87
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
void SetRemoveUnconnected(bool aSet)
Definition pcb_track.h:589
bool GetIsFree() const
Check if the via is a free via (as opposed to one created on a track by the router).
Definition pcb_track.h:806
int GetFrontPostMachiningSize() const
Definition pcb_track.h:689
PCB_LAYER_ID BottomLayer() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
PLUGGING_MODE GetFrontPluggingMode() const
VECTOR2I GetPosition() const override
Definition pcb_track.h:553
bool IsTented(PCB_LAYER_ID aLayer) const override
Checks if the given object is tented (its copper shape is covered by solder mask) on a given side of ...
void CopyFrom(const BOARD_ITEM *aOther) override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
PCB_LAYER_ID GetTopBackdrillLayer() const
Definition pcb_track.h:418
bool GetPrimaryDrillFilledFlag() const
Definition pcb_track.h:737
void SetFrontPostMachiningDepth(int aDepth)
Definition pcb_track.h:690
void SetCappingMode(CAPPING_MODE aMode)
void SetFrontCoveringMode(COVERING_MODE aMode)
wxString LayerMaskDescribe() const override
Return a string (to be shown to the user) describing a layer mask.
int GetBackPostMachiningDepth() const
Definition pcb_track.h:711
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetBackPostMachiningAngle(int aAngle)
Definition pcb_track.h:712
int GetBackPostMachiningAngle() const
Definition pcb_track.h:713
PCB_LAYER_ID GetTertiaryDrillEndLayer() const
Definition pcb_track.h:794
COVERING_MODE GetBackCoveringMode() const
std::optional< int > GetTertiaryDrillSize() const
bool GetRemoveUnconnected() const
Definition pcb_track.h:595
void SetTopBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:416
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
void SetKeepStartEnd(bool aSet)
Definition pcb_track.h:604
void SetBackPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:698
std::optional< int > GetTopBackdrillSize() const
Definition pcb_track.h:415
void SetBackdrillMode(BACKDRILL_MODE aMode)
Definition pcb_track.h:407
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition pcb_track.h:766
std::map< PCB_LAYER_ID, ZONE_LAYER_OVERRIDE > m_zoneLayerOverrides
Definition pcb_track.h:843
void SetBottomBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:410
void ClearZoneLayerOverrides()
CAPPING_MODE GetCappingMode() const
const PADSTACK & Padstack() const
Definition pcb_track.h:402
void SetFrontTentingMode(TENTING_MODE aMode)
int GetDrill() const
Return the local drill setting for this PCB_VIA.
Definition pcb_track.h:754
PAD_DRILL_SHAPE GetTertiaryDrillShape() const
Definition pcb_track.h:797
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition pcb_track.h:840
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
int GetFrontPostMachiningDepth() const
Definition pcb_track.h:691
bool IsBlindVia() const
PAD_DRILL_SHAPE GetPrimaryDrillShape() const
Definition pcb_track.h:667
TENTING_MODE GetFrontTentingMode() const
std::optional< bool > GetPrimaryDrillCapped() const
Definition pcb_track.h:741
int GetPostMachiningKnockout(PCB_LAYER_ID aLayer) const
Get the knockout diameter for a layer affected by post-machining.
void SetBottomLayer(PCB_LAYER_ID aLayer)
void SetPrimaryDrillSize(const VECTOR2I &aSize)
Set the drill value for vias.
bool IsBackdrilledOrPostMachined(PCB_LAYER_ID aLayer) const
Check if a layer is affected by backdrilling or post-machining operations.
std::optional< int > GetSecondaryDrillSize() const
void SetPrimaryDrillCappedFlag(bool aCapped)
PADSTACK & Padstack()
Definition pcb_track.h:403
int GetSolderMaskExpansion() const
void SetSecondaryDrillStartLayer(PCB_LAYER_ID aLayer)
void SetTertiaryDrillEndLayer(PCB_LAYER_ID aLayer)
std::optional< PAD_DRILL_POST_MACHINING_MODE > GetFrontPostMachining() const
Definition pcb_track.h:676
void ClearSecondaryDrillSize()
void SetBackPostMachiningDepth(int aDepth)
Definition pcb_track.h:710
void SetDrill(int aDrill)
Definition pcb_track.h:744
PLUGGING_MODE GetBackPluggingMode() const
void SetBackPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetSecondaryDrillEndLayer() const
Definition pcb_track.h:780
MINOPTMAX< int > GetDrillConstraint(wxString *aSource=nullptr) const
void SetBackTentingMode(TENTING_MODE aMode)
PAD_DRILL_SHAPE GetSecondaryDrillShape() const
Definition pcb_track.h:783
void SetIsFree(bool aFree=true)
Definition pcb_track.h:807
std::optional< bool > GetPrimaryDrillFilled() const
Definition pcb_track.h:736
void SetFrontPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetPrimaryDrillStartLayer() const
Definition pcb_track.h:670
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetFrontPostMachining(const std::optional< PAD_DRILL_POST_MACHINING_MODE > &aMode)
bool operator==(const PCB_VIA &aOther) const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void SetSecondaryDrillEndLayer(PCB_LAYER_ID aLayer)
int GetFrontPostMachiningAngle() const
Definition pcb_track.h:693
std::mutex m_zoneLayerOverridesMutex
Definition pcb_track.h:842
PCB_LAYER_ID GetPrimaryDrillEndLayer() const
Definition pcb_track.h:673
void SetFrontPostMachiningAngle(int aAngle)
Definition pcb_track.h:692
void SetTopLayer(PCB_LAYER_ID aLayer)
FILLING_MODE GetFillingMode() const
void SetPosition(const VECTOR2I &aPoint) override
Definition pcb_track.h:554
bool IsBuriedVia() const
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
int GetFrontWidth() const
Definition pcb_track.h:470
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
bool HasDrilledHole() const override
Definition pcb_track.h:477
PAD_DRILL_POST_MACHINING_MODE GetFrontPostMachiningMode() const
Definition pcb_track.h:683
void SetFrontPostMachiningSize(int aSize)
Definition pcb_track.h:688
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition pcb_track.h:369
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetTertiaryDrillStartLayer(PCB_LAYER_ID aLayer)
PCB_LAYER_ID GetBottomBackdrillLayer() const
Definition pcb_track.h:412
void SetPrimaryDrillShape(PAD_DRILL_SHAPE aShape)
static std::optional< VIA_PARAMETER_ERROR > ValidateViaParameters(std::optional< int > aDiameter, std::optional< int > aPrimaryDrill, std::optional< PCB_LAYER_ID > aPrimaryStartLayer=std::nullopt, std::optional< PCB_LAYER_ID > aPrimaryEndLayer=std::nullopt, std::optional< int > aSecondaryDrill=std::nullopt, std::optional< PCB_LAYER_ID > aSecondaryStartLayer=std::nullopt, std::optional< PCB_LAYER_ID > aSecondaryEndLayer=std::nullopt, std::optional< int > aTertiaryDrill=std::nullopt, std::optional< PCB_LAYER_ID > aTertiaryStartLayer=std::nullopt, std::optional< PCB_LAYER_ID > aTertiaryEndLayer=std::nullopt, int aCopperLayerCount=0)
bool IsMicroVia() const
void SetTertiaryDrillShape(PAD_DRILL_SHAPE aShape)
bool GetKeepStartEnd() const
Definition pcb_track.h:610
virtual void SetLayerSet(const LSET &aLayers) override
Note SetLayerSet() initialize the first and last copper layers connected by the via.
void GetOutermostConnectedLayers(PCB_LAYER_ID *aTopmost, PCB_LAYER_ID *aBottommost) const
Return the top-most and bottom-most connected layers.
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_track.h:359
void SetSecondaryDrillShape(PAD_DRILL_SHAPE aShape)
bool HasHole() const override
Definition pcb_track.h:472
void SanitizeLayers()
Check so that the layers are correct depending on the type of via, and so that the top actually is on...
int GetWidth() const override
void SetBackPostMachining(const std::optional< PAD_DRILL_POST_MACHINING_MODE > &aMode)
PCB_LAYER_ID GetTertiaryDrillStartLayer() const
Definition pcb_track.h:791
PCB_VIA & operator=(const PCB_VIA &aOther)
void swapData(BOARD_ITEM *aImage) override
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:561
const VECTOR2I & GetPrimaryDrillSize() const
Definition pcb_track.h:664
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetFillingMode(FILLING_MODE aMode)
PCB_VIA(BOARD_ITEM *aParent)
void SetPrimaryDrillFilledFlag(bool aFilled)
std::optional< int > GetBottomBackdrillSize() const
Definition pcb_track.h:409
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
Definition pcb_track.h:615
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void SetViaType(VIATYPE aViaType)
Definition pcb_track.h:395
int GetMinAnnulus(PCB_LAYER_ID aLayer, wxString *aSource) const
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
TENTING_MODE GetBackTentingMode() const
PCB_LAYER_ID TopLayer() const
void ClearTertiaryDrillSize()
VIATYPE m_viaType
through, blind/buried or micro
Definition pcb_track.h:836
void SetBottomBackdrillLayer(PCB_LAYER_ID aLayer)
Definition pcb_track.h:413
int GetBackPostMachiningSize() const
Definition pcb_track.h:709
void SetTertiaryDrillSize(const VECTOR2I &aSize)
PADSTACK m_padStack
Definition pcb_track.h:838
void SetSecondaryDrillSize(const VECTOR2I &aSize)
COVERING_MODE GetFrontCoveringMode() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
void SetZoneLayerOverride(PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride)
PAD_DRILL_POST_MACHINING_MODE GetBackPostMachiningMode() const
Definition pcb_track.h:703
void SetFrontWidth(int aWidth)
Definition pcb_track.h:469
VIATYPE GetViaType() const
Definition pcb_track.h:394
PCB_LAYER_ID GetSecondaryDrillStartLayer() const
Definition pcb_track.h:777
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
void SetPrimaryDrillCapped(const std::optional< bool > &aCapped)
MINOPTMAX< int > GetWidthConstraint(wxString *aSource=nullptr) const override
BACKDRILL_MODE GetBackdrillMode() const
Definition pcb_track.h:406
void SetWidth(int aWidth) override
std::optional< PAD_DRILL_POST_MACHINING_MODE > GetBackPostMachining() const
Definition pcb_track.h:696
void SetBackCoveringMode(COVERING_MODE aMode)
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
void SetPrimaryDrillFilled(const std::optional< bool > &aFilled)
void SetTopBackdrillLayer(PCB_LAYER_ID aLayer)
Definition pcb_track.h:419
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
bool HasValidLayerPair(int aCopperLayerCount)
void SetPadstack(const PADSTACK &aPadstack)
Definition pcb_track.h:404
void SetFrontPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:678
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool GetPrimaryDrillCappedFlag() const
Definition pcb_track.h:742
void SetBackPostMachiningSize(int aSize)
Definition pcb_track.h:708
void SetPrimaryDrillEndLayer(PCB_LAYER_ID aLayer)
void SetPrimaryDrillStartLayer(PCB_LAYER_ID aLayer)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
INSPECT_RESULT
Definition eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:89
std::uint32_t EDA_ITEM_FLAGS
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:180
@ DEFAULT
Flashing follows connectivity.
Definition layer_ids.h:181
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ F_Cu
Definition layer_ids.h:60
FLIP_DIRECTION
Definition mirror.h:23
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:400
PAD_DRILL_POST_MACHINING_MODE
Definition padstack.h:76
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition padstack.h:69
BACKDRILL_MODE
Definition padstack.h:84
Declarations of types for tracks and vias.
FILLING_MODE
VIATYPE
TENTING_MODE
COVERING_MODE
ENDPOINT_T
@ ENDPOINT_START
PLUGGING_MODE
#define UNDEFINED_DRILL_DIAMETER
CAPPING_MODE
bool operator()(const PCB_TRACK *aFirst, const PCB_TRACK *aSecond) const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:90
@ PCB_LOCATE_BLINDVIA_T
Definition typeinfo.h:121
@ PCB_LOCATE_STDVIA_T
Definition typeinfo.h:119
@ PCB_LOCATE_BURIEDVIA_T
Definition typeinfo.h:122
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:91
@ PCB_LOCATE_UVIA_T
Definition typeinfo.h:120
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:89
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683