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 <atomic>
35#include <optional>
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,
164 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
165
173 EDA_ITEM_FLAGS IsPointOnEnds( const VECTOR2I& point, int min_dist = 0 ) const;
174
178 bool IsNull() const
179 {
180 return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
181 }
182
183 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
184 wxString GetFriendlyName() const override;
185
186 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
187 const std::vector<KICAD_T>& aScanTypes ) override;
188
189 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
190 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
191 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
192
193 bool ApproxCollinear( const PCB_TRACK& aTrack );
194
195 wxString GetClass() const override
196 {
197 return wxT( "PCB_TRACK" );
198 }
199
200 virtual MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const;
201
202 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
203
204 BITMAPS GetMenuImage() const override;
205
206 virtual EDA_ITEM* Clone() const override;
207
208 virtual std::vector<int> ViewGetLayers() const override;
209
210 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
211
212 const BOX2I ViewBBox() const override;
213
217 bool IsOnCopperLayer() const override
218 {
219 return true;
220 }
221
222 virtual double Similarity( const BOARD_ITEM& aOther ) const override;
223
224 virtual bool operator==( const BOARD_ITEM& aOther ) const override;
225 virtual bool operator==( const PCB_TRACK& aOther ) const;
226
228 {
229 bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
230 };
231
232 void Serialize( google::protobuf::Any &aContainer ) const override;
233 bool Deserialize( const google::protobuf::Any &aContainer ) override;
234
235#if defined (DEBUG)
236 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
237#endif
238
239protected:
240 virtual void swapData( BOARD_ITEM* aImage ) override;
241
243 std::vector<MSG_PANEL_ITEM>& aList ) const;
244
245protected:
248
250 std::optional<int> m_solderMaskMargin;
251
252private:
254};
255
256
257class PCB_ARC : public PCB_TRACK
258{
259public:
260 PCB_ARC( BOARD_ITEM* aParent ) :
261 PCB_TRACK( aParent, PCB_ARC_T )
262 { }
263
264 PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
265
266 void CopyFrom( const BOARD_ITEM* aOther ) override;
267
268 static inline bool ClassOf( const EDA_ITEM *aItem )
269 {
270 return aItem && PCB_ARC_T == aItem->Type();
271 }
272
273 virtual void Move( const VECTOR2I& aMoveVector ) override
274 {
275 m_Start += aMoveVector;
276 m_Mid += aMoveVector;
277 m_End += aMoveVector;
278 }
279
280 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
281
282 void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
283
284 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
285
286 void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
287 const VECTOR2I& GetMid() const { return m_Mid; }
288
289 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
290
291 virtual VECTOR2I GetPosition() const override;
292 const VECTOR2I GetFocusPosition() const override { return m_Mid; }
293
294 virtual VECTOR2I GetCenter() const override { return GetPosition(); }
295
296 double GetRadius() const;
297 EDA_ANGLE GetAngle() const;
299 EDA_ANGLE GetArcAngleEnd() const; // Called by Python; ignore CLion's claim that it's unused
300 virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
301
302 virtual bool HitTest( const BOX2I& aRect, bool aContained = true,
303 int aAccuracy = 0 ) const override;
304
305 bool IsCCW() const;
306
307 wxString GetClass() const override
308 {
309 return wxT( "PCB_ARC" );
310 }
311
312 // @copydoc BOARD_ITEM::GetEffectiveShape
313 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
315 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
316
322 virtual double GetLength() const override
323 {
324 return GetRadius() * std::abs( GetAngle().AsRadians() );
325 }
326
327 EDA_ITEM* Clone() const override;
328
335 bool IsDegenerated( int aThreshold = 5 ) const;
336
337 double Similarity( const BOARD_ITEM& aOther ) const override;
338
339 bool operator==( const PCB_ARC& aOther ) const;
340 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
341
342 void Serialize( google::protobuf::Any &aContainer ) const override;
343 bool Deserialize( const google::protobuf::Any &aContainer ) override;
344
345protected:
346 virtual void swapData( BOARD_ITEM* aImage ) override;
347
348private:
349 // Silence GCC warning about overriding the base class method
350 bool operator==( const PCB_TRACK& aOther ) const override;
351
353};
354
355
356class PCB_VIA : public PCB_TRACK
357{
358public:
359 PCB_VIA( BOARD_ITEM* aParent );
360
361 static inline bool ClassOf( const EDA_ITEM *aItem )
362 {
363 return aItem && PCB_VIA_T == aItem->Type();
364 }
365
366 PCB_VIA( const PCB_VIA& aOther );
367 PCB_VIA& operator=( const PCB_VIA &aOther );
368
373 static std::vector<std::vector<PCB_VIA*>> CollectMicroviaColumns( BOARD* aBoard );
374
375 void CopyFrom( const BOARD_ITEM* aOther ) override;
376
377 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
378 {
379 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
380 return true;
381
382 for( KICAD_T scanType : aScanTypes )
383 {
384 if( scanType == PCB_LOCATE_STDVIA_T && m_viaType == VIATYPE::THROUGH )
385 return true;
386 else if( scanType == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
387 return true;
388 else if( scanType == PCB_LOCATE_BLINDVIA_T && m_viaType == VIATYPE::BLIND )
389 return true;
390 else if( scanType == PCB_LOCATE_BURIEDVIA_T && m_viaType == VIATYPE::BURIED )
391 return true;
392 }
393
394 return false;
395 }
396
400 bool HasValidLayerPair( int aCopperLayerCount ) const;
401
404 bool FitsEnabledLayers( const LSET& aEnabledLayers, int aCopperLayerCount ) const override
405 {
406 return BOARD_ITEM::FitsEnabledLayers( aEnabledLayers, aCopperLayerCount )
407 && HasValidLayerPair( aCopperLayerCount );
408 }
409
410 VIATYPE GetViaType() const { return m_viaType; }
411 void SetViaType( VIATYPE aViaType )
412 {
413 m_viaType = aViaType;
414 // If someone updates a VIA to TH, we want to kick out any non-outer layers
416 }
417
418 const PADSTACK& Padstack() const { return m_padStack; }
420 void SetPadstack( const PADSTACK& aPadstack ) { m_padStack = aPadstack; }
421
422 // A micro, blind, or buried via with a Front/Inner/Back padstack definition is an odd beast as it might
423 // not exist on F_Cu or B_Cu.
424 bool IsGhostLayer( PCB_LAYER_ID aLayer ) const;
425
426 BACKDRILL_MODE GetBackdrillMode() const { return m_padStack.GetBackdrillMode(); }
427 void SetBackdrillMode( BACKDRILL_MODE aMode ) { m_padStack.SetBackdrillMode( aMode ); }
428
429 std::optional<int> GetBottomBackdrillSize() const { return m_padStack.GetBackdrillSize( false ); }
430 void SetBottomBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( false, aSize ); }
431
432 PCB_LAYER_ID GetBottomBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( false ); }
433 void SetBottomBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( false, aLayer ); }
434
435 std::optional<int> GetTopBackdrillSize() const { return m_padStack.GetBackdrillSize( true ); }
436 void SetTopBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( true, aSize ); }
437
438 PCB_LAYER_ID GetTopBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( true ); }
439 void SetTopBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( true, aLayer ); }
440
441 bool IsMicroVia() const;
442 bool IsBlindVia() const;
443 bool IsBuriedVia() const;
444
465
466 static std::optional<VIA_PARAMETER_ERROR>
467 ValidateViaParameters( std::optional<int> aDiameter,
468 std::optional<int> aPrimaryDrill,
469 std::optional<PCB_LAYER_ID> aPrimaryStartLayer = std::nullopt,
470 std::optional<PCB_LAYER_ID> aPrimaryEndLayer = std::nullopt,
471 std::optional<int> aSecondaryDrill = std::nullopt,
472 std::optional<PCB_LAYER_ID> aSecondaryStartLayer = std::nullopt,
473 std::optional<PCB_LAYER_ID> aSecondaryEndLayer = std::nullopt,
474 std::optional<int> aTertiaryDrill = std::nullopt,
475 std::optional<PCB_LAYER_ID> aTertiaryStartLayer = std::nullopt,
476 std::optional<PCB_LAYER_ID> aTertiaryEndLayer = std::nullopt,
477 int aCopperLayerCount = 0 );
478
479 const BOX2I GetBoundingBox() const override;
480 const BOX2I GetBoundingBox( PCB_LAYER_ID aLayer ) const;
481
482 void SetPadstackMode( PADSTACK::MODE aMode ) { m_padStack.SetMode( aMode ); }
483
484 void SetWidth( int aWidth ) override;
485 int GetWidth() const override;
486
487 void SetWidth( PCB_LAYER_ID aLayer, int aWidth );
488 int GetWidth( PCB_LAYER_ID aLayer ) const;
489
490 // For properties panel
491 void SetFrontWidth( int aWidth ) { SetWidth( F_Cu, aWidth ); }
492 int GetFrontWidth() const { return GetWidth( F_Cu ); }
493
494 bool HasHole() const override
495 {
496 return true;
497 }
498
499 bool HasDrilledHole() const override
500 {
502 }
503
504 std::shared_ptr<SHAPE_SEGMENT> GetEffectiveHoleShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
505 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
506
507 MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const override;
508 MINOPTMAX<int> GetDrillConstraint( wxString* aSource = nullptr ) const;
509
510 void SetFrontTentingMode( TENTING_MODE aMode );
512 void SetBackTentingMode( TENTING_MODE aMode );
514
519
524
525 void SetCappingMode( CAPPING_MODE aMode );
527
528 void SetFillingMode( FILLING_MODE aMode );
530
531 bool IsTented( PCB_LAYER_ID aLayer ) const override;
532 int GetSolderMaskExpansion() const;
533
535
536 PCB_LAYER_ID GetLayer() const override;
537 void SetLayer( PCB_LAYER_ID aLayer ) override;
538
539 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
540
541 bool IsOnCopperLayer() const override;
542
543 virtual LSET GetLayerSet() const override;
544
549 virtual void SetLayerSet( const LSET& aLayers ) override;
550
557 void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
558
559 void SetBottomLayer( PCB_LAYER_ID aLayer );
560 void SetTopLayer( PCB_LAYER_ID aLayer );
561
569 void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
570
571 PCB_LAYER_ID TopLayer() const;
573
578 void SanitizeLayers();
579
580 VECTOR2I GetPosition() const override { return m_Start; }
581 void SetPosition( const VECTOR2I& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
582
583 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
584
585 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
586 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
587
588 wxString GetClass() const override
589 {
590 return wxT( "PCB_VIA" );
591 }
592
593 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
594
595 BITMAPS GetMenuImage() const override;
596
597 EDA_ITEM* Clone() const override;
598
599 std::vector<int> ViewGetLayers() const override;
600
601 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
602
603 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
604
605#if defined (DEBUG)
606 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
607#endif
608
609 int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
610
616 void SetRemoveUnconnected( bool aSet )
617 {
618 m_padStack.SetUnconnectedLayerMode( aSet ? UNCONNECTED_LAYER_MODE::REMOVE_ALL
620 }
621
623 {
624 return m_padStack.UnconnectedLayerMode() != UNCONNECTED_LAYER_MODE::KEEP_ALL;
625 }
626
631 void SetKeepStartEnd( bool aSet )
632 {
635 }
636
637 bool GetKeepStartEnd() const
638 {
640 }
641
643 {
644 switch( m_padStack.UnconnectedLayerMode() )
645 {
647 return false;
648
650 return true;
651
654 return aLayer != m_padStack.Drill().start && aLayer != m_padStack.Drill().end;
655 }
656
657 return true;
658 }
659
666 bool FlashLayer( int aLayer ) const;
667
675 bool FlashLayer( const LSET& aLayers ) const;
676
683 PCB_LAYER_ID* aBottommost ) const;
684
690 void SetPrimaryDrillSize( const VECTOR2I& aSize );
691 const VECTOR2I& GetPrimaryDrillSize() const { return m_padStack.Drill().size; }
692
694 PAD_DRILL_SHAPE GetPrimaryDrillShape() const { return m_padStack.Drill().shape; }
695
697 PCB_LAYER_ID GetPrimaryDrillStartLayer() const { return m_padStack.Drill().start; }
698
700 PCB_LAYER_ID GetPrimaryDrillEndLayer() const { return m_padStack.Drill().end; }
701
702 void SetFrontPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
703 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetFrontPostMachining() const { return m_padStack.FrontPostMachining().mode; }
704
706 {
707 m_padStack.FrontPostMachining().mode = aMode;
708 }
709
714
715 void SetFrontPostMachiningSize( int aSize ) { m_padStack.FrontPostMachining().size = aSize; }
716 int GetFrontPostMachiningSize() const { return m_padStack.FrontPostMachining().size; }
717 void SetFrontPostMachiningDepth( int aDepth ) { m_padStack.FrontPostMachining().depth = aDepth; }
718 int GetFrontPostMachiningDepth() const { return m_padStack.FrontPostMachining().depth; }
719 void SetFrontPostMachiningAngle( int aAngle ) { m_padStack.FrontPostMachining().angle = aAngle; }
720 int GetFrontPostMachiningAngle() const { return m_padStack.FrontPostMachining().angle; }
721
722 void SetBackPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
723 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetBackPostMachining() const { return m_padStack.BackPostMachining().mode; }
724
726 {
727 m_padStack.BackPostMachining().mode = aMode;
728 }
729
734
735 void SetBackPostMachiningSize( int aSize ) { m_padStack.BackPostMachining().size = aSize; }
736 int GetBackPostMachiningSize() const { return m_padStack.BackPostMachining().size; }
737 void SetBackPostMachiningDepth( int aDepth ) { m_padStack.BackPostMachining().depth = aDepth; }
738 int GetBackPostMachiningDepth() const { return m_padStack.BackPostMachining().depth; }
739 void SetBackPostMachiningAngle( int aAngle ) { m_padStack.BackPostMachining().angle = aAngle; }
740 int GetBackPostMachiningAngle() const { return m_padStack.BackPostMachining().angle; }
741
751 bool IsBackdrilledOrPostMachined( PCB_LAYER_ID aLayer ) const;
752
759 int GetPostMachiningKnockout( PCB_LAYER_ID aLayer ) const;
760
761 void SetPrimaryDrillFilled( const std::optional<bool>& aFilled );
762 void SetPrimaryDrillFilledFlag( bool aFilled );
763 std::optional<bool> GetPrimaryDrillFilled() const { return m_padStack.Drill().is_filled; }
764 bool GetPrimaryDrillFilledFlag() const { return m_padStack.Drill().is_filled.value_or( false ); }
765
766 void SetPrimaryDrillCapped( const std::optional<bool>& aCapped );
767 void SetPrimaryDrillCappedFlag( bool aCapped );
768 std::optional<bool> GetPrimaryDrillCapped() const { return m_padStack.Drill().is_capped; }
769 bool GetPrimaryDrillCappedFlag() const { return m_padStack.Drill().is_capped.value_or( false ); }
770
771 void SetDrill( int aDrill )
772 {
773 SetPrimaryDrillSize( { aDrill, aDrill } );
774 }
775
781 int GetDrill() const { return GetPrimaryDrillSize().x; }
782
788 int GetDrillValue() const;
789
797
798 void SetSecondaryDrillSize( const VECTOR2I& aSize );
800 void SetSecondaryDrillSize( const std::optional<int>& aDrill );
801 std::optional<int> GetSecondaryDrillSize() const;
802
804 PCB_LAYER_ID GetSecondaryDrillStartLayer() const { return m_padStack.SecondaryDrill().start; }
805
807 PCB_LAYER_ID GetSecondaryDrillEndLayer() const { return m_padStack.SecondaryDrill().end; }
808
810 PAD_DRILL_SHAPE GetSecondaryDrillShape() const { return m_padStack.SecondaryDrill().shape; }
811
812 void SetTertiaryDrillSize( const VECTOR2I& aSize );
814 void SetTertiaryDrillSize( const std::optional<int>& aDrill );
815 std::optional<int> GetTertiaryDrillSize() const;
816
818 PCB_LAYER_ID GetTertiaryDrillStartLayer() const { return m_padStack.TertiaryDrill().start; }
819
821 PCB_LAYER_ID GetTertiaryDrillEndLayer() const { return m_padStack.TertiaryDrill().end; }
822
824 PAD_DRILL_SHAPE GetTertiaryDrillShape() const { return m_padStack.TertiaryDrill().shape; }
825
833 bool GetIsFree() const { return m_isFree; }
834 void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
835
836 // For property manager:
837 bool GetIsNotFree() const { return !m_isFree; }
838 void SetIsNotFree( bool aNotFree ) { m_isFree = !aNotFree; }
839
840 // @copydoc BOARD_ITEM::GetEffectiveShape
841 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
843 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
844
846
851
852 void SetZoneLayerOverride( PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride );
853
854 double Similarity( const BOARD_ITEM& aOther ) const override;
855
856 bool operator==( const PCB_VIA& aOther ) const;
857 bool operator==( const BOARD_ITEM& aOther ) const override;
858
859 void Serialize( google::protobuf::Any &aContainer ) const override;
860 bool Deserialize( const google::protobuf::Any &aContainer ) override;
861
862 wxString LayerMaskDescribe() const override;
863
864protected:
865 void swapData( BOARD_ITEM* aImage ) override;
866
867private:
868 // Silence GCC warning about hiding the PCB_TRACK base method
869 bool operator==( const PCB_TRACK& aOther ) const override;
870
871 bool sameZoneLayerOverrides( const PCB_VIA& aOther ) const;
872
873private:
875
877
878 bool m_isFree;
879
880 // These are used in zone filling, so use a fixed size to avoid undefined behavior
881 std::array<std::atomic<ZONE_LAYER_OVERRIDE>, MAX_CU_LAYERS> m_zoneLayerOverrides;
882};
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:72
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
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:84
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:86
virtual bool FitsEnabledLayers(const LSET &aEnabledLayers, int aCopperLayerCount) const
Check if a board offering aEnabledLayers can hold this item.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
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:98
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition eda_item.h:214
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
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:156
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
Definition padstack.h:169
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:322
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:93
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
EDA_ANGLE GetArcAngleStart() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
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:292
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_track.h:289
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition pcb_track.h:273
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:307
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:286
double GetRadius() const
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
Definition pcb_track.h:287
PCB_ARC(BOARD_ITEM *aParent)
Definition pcb_track.h:260
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:352
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_track.h:268
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
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:294
void CopyFrom(const BOARD_ITEM *aOther) override
Definition pcb_track.cpp:99
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:217
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:195
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:247
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_track.h:119
std::optional< int > m_solderMaskMargin
Definition pcb_track.h:250
void CopyFrom(const BOARD_ITEM *aOther) override
Definition pcb_track.cpp:77
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:71
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:246
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:178
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:249
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:63
void SetStartY(int aY)
Definition pcb_track.h:96
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
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:253
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:616
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:833
int GetFrontPostMachiningSize() const
Definition pcb_track.h:716
PCB_LAYER_ID BottomLayer() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
PLUGGING_MODE GetFrontPluggingMode() const
VECTOR2I GetPosition() const override
Definition pcb_track.h:580
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
bool FitsEnabledLayers(const LSET &aEnabledLayers, int aCopperLayerCount) const override
Check if a board offering aEnabledLayers can hold this item.
Definition pcb_track.h:404
PCB_LAYER_ID GetTopBackdrillLayer() const
Definition pcb_track.h:438
bool IsGhostLayer(PCB_LAYER_ID aLayer) const
bool GetPrimaryDrillFilledFlag() const
Definition pcb_track.h:764
PCB_LAYER_ID GetPrincipalLayer() const
void SetFrontPostMachiningDepth(int aDepth)
Definition pcb_track.h:717
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:738
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetBackPostMachiningAngle(int aAngle)
Definition pcb_track.h:739
int GetBackPostMachiningAngle() const
Definition pcb_track.h:740
PCB_LAYER_ID GetTertiaryDrillEndLayer() const
Definition pcb_track.h:821
COVERING_MODE GetBackCoveringMode() const
std::optional< int > GetTertiaryDrillSize() const
bool GetRemoveUnconnected() const
Definition pcb_track.h:622
void SetTopBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:436
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
ZONE_LAYER_OVERRIDE GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
void SetKeepStartEnd(bool aSet)
Definition pcb_track.h:631
void SetBackPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:725
std::optional< int > GetTopBackdrillSize() const
Definition pcb_track.h:435
void SetBackdrillMode(BACKDRILL_MODE aMode)
Definition pcb_track.h:427
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition pcb_track.h:793
void SetBottomBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:430
void ClearZoneLayerOverrides()
CAPPING_MODE GetCappingMode() const
const PADSTACK & Padstack() const
Definition pcb_track.h:418
void SetFrontTentingMode(TENTING_MODE aMode)
int GetDrill() const
Return the local drill setting for this PCB_VIA.
Definition pcb_track.h:781
PAD_DRILL_SHAPE GetTertiaryDrillShape() const
Definition pcb_track.h:824
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition pcb_track.h:878
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:718
bool IsBlindVia() const
static std::vector< std::vector< PCB_VIA * > > CollectMicroviaColumns(BOARD *aBoard)
Runs of microvias that land on one another, each ordered from its outermost hop down.
PAD_DRILL_SHAPE GetPrimaryDrillShape() const
Definition pcb_track.h:694
TENTING_MODE GetFrontTentingMode() const
std::optional< bool > GetPrimaryDrillCapped() const
Definition pcb_track.h:768
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:419
int GetSolderMaskExpansion() const
void SetSecondaryDrillStartLayer(PCB_LAYER_ID aLayer)
void SetTertiaryDrillEndLayer(PCB_LAYER_ID aLayer)
bool HasValidLayerPair(int aCopperLayerCount) const
std::optional< PAD_DRILL_POST_MACHINING_MODE > GetFrontPostMachining() const
Definition pcb_track.h:703
void ClearSecondaryDrillSize()
void SetBackPostMachiningDepth(int aDepth)
Definition pcb_track.h:737
void SetDrill(int aDrill)
Definition pcb_track.h:771
PLUGGING_MODE GetBackPluggingMode() const
void SetBackPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetSecondaryDrillEndLayer() const
Definition pcb_track.h:807
MINOPTMAX< int > GetDrillConstraint(wxString *aSource=nullptr) const
void SetPadstackMode(PADSTACK::MODE aMode)
Definition pcb_track.h:482
void SetBackTentingMode(TENTING_MODE aMode)
PAD_DRILL_SHAPE GetSecondaryDrillShape() const
Definition pcb_track.h:810
void SetIsFree(bool aFree=true)
Definition pcb_track.h:834
std::optional< bool > GetPrimaryDrillFilled() const
Definition pcb_track.h:763
void SetFrontPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetPrimaryDrillStartLayer() const
Definition pcb_track.h:697
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:720
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
PCB_LAYER_ID GetPrimaryDrillEndLayer() const
Definition pcb_track.h:700
void SetFrontPostMachiningAngle(int aAngle)
Definition pcb_track.h:719
void SetTopLayer(PCB_LAYER_ID aLayer)
FILLING_MODE GetFillingMode() const
void SetPosition(const VECTOR2I &aPoint) override
Definition pcb_track.h:581
bool IsBuriedVia() const
int GetFrontWidth() const
Definition pcb_track.h:492
std::array< std::atomic< ZONE_LAYER_OVERRIDE >, MAX_CU_LAYERS > m_zoneLayerOverrides
Definition pcb_track.h:881
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:499
PAD_DRILL_POST_MACHINING_MODE GetFrontPostMachiningMode() const
Definition pcb_track.h:710
bool IsOnCopperLayer() const override
void SetFrontPostMachiningSize(int aSize)
Definition pcb_track.h:715
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:377
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:432
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:637
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:361
void SetSecondaryDrillShape(PAD_DRILL_SHAPE aShape)
bool HasHole() const override
Definition pcb_track.h:494
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:818
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:588
const VECTOR2I & GetPrimaryDrillSize() const
Definition pcb_track.h:691
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetFillingMode(FILLING_MODE aMode)
bool GetIsNotFree() const
Definition pcb_track.h:837
PCB_VIA(BOARD_ITEM *aParent)
void SetPrimaryDrillFilledFlag(bool aFilled)
std::optional< int > GetBottomBackdrillSize() const
Definition pcb_track.h:429
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
Definition pcb_track.h:642
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:411
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:874
void SetBottomBackdrillLayer(PCB_LAYER_ID aLayer)
Definition pcb_track.h:433
int GetBackPostMachiningSize() const
Definition pcb_track.h:736
void SetTertiaryDrillSize(const VECTOR2I &aSize)
void SetIsNotFree(bool aNotFree)
Definition pcb_track.h:838
PADSTACK m_padStack
Definition pcb_track.h:876
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)
bool sameZoneLayerOverrides(const PCB_VIA &aOther) const
PAD_DRILL_POST_MACHINING_MODE GetBackPostMachiningMode() const
Definition pcb_track.h:730
void SetFrontWidth(int aWidth)
Definition pcb_track.h:491
VIATYPE GetViaType() const
Definition pcb_track.h:410
PCB_LAYER_ID GetSecondaryDrillStartLayer() const
Definition pcb_track.h:804
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:426
void SetWidth(int aWidth) override
std::optional< PAD_DRILL_POST_MACHINING_MODE > GetBackPostMachining() const
Definition pcb_track.h:723
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:439
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)
void SetPadstack(const PADSTACK &aPadstack)
Definition pcb_track.h:420
void SetFrontPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:705
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool GetPrimaryDrillCappedFlag() const
Definition pcb_track.h:769
void SetBackPostMachiningSize(int aSize)
Definition pcb_track.h:735
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.
DRC_CONSTRAINT_T
Definition drc_rule.h:49
@ NULL_CONSTRAINT
Definition drc_rule.h:50
INSPECT_RESULT
Definition eda_item.h:44
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:91
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
#define MAX_CU_LAYERS
Definition layer_ids.h:172
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:411
PAD_DRILL_POST_MACHINING_MODE
Definition padstack.h:75
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition padstack.h:68
BACKDRILL_MODE
Definition padstack.h:83
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:70
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:89
@ PCB_LOCATE_BLINDVIA_T
Definition typeinfo.h:120
@ PCB_LOCATE_STDVIA_T
Definition typeinfo.h:118
@ PCB_LOCATE_BURIEDVIA_T
Definition typeinfo.h:121
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:90
@ PCB_LOCATE_UVIA_T
Definition typeinfo.h:119
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:88
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683