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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
34
35#ifndef CLASS_TRACK_H
36#define CLASS_TRACK_H
37
38
39#include <mutex>
40#include <array>
42#include <base_units.h>
44#include <core/minoptmax.h>
45#include <core/arraydim.h>
46#include <lset.h>
47#include <padstack.h>
48#include <optional>
49
50class PCB_TRACK;
51class PCB_VIA;
52class PAD;
53class MSG_PANEL_ITEM;
54class SHAPE_POLY_SET;
55class SHAPE_ARC;
56
57
58// Flag used in locate routines (from which endpoint work)
59enum ENDPOINT_T : int
60{
63};
64
65// Note that this enum must be synchronized to GAL_LAYER_ID
66enum class VIATYPE : int
67{
68 THROUGH = 4, /* Always a through hole via */
69 BURIED = 3, /* this via can be on internal layers */
70 BLIND = 2, /* this via can be on internal layers */
71 MICROVIA = 1, /* this via which connect from an external layer
72 * to the near neighbor internal layer */
73 NOT_DEFINED = 0 /* not yet used */
74};
75
76enum class TENTING_MODE
77{
79 TENTED = 1,
81};
82
83enum class COVERING_MODE
84{
88};
89
90enum class PLUGGING_MODE
91{
95};
96
97enum class CAPPING_MODE
98{
102};
103
104enum class FILLING_MODE
105{
109};
110
111#define UNDEFINED_DRILL_DIAMETER -1 //< Undefined via drill diameter.
112
113// Used for tracks and vias for algorithmic safety, not to enforce constraints
114#define GEOMETRY_MIN_SIZE (int) ( 0.001 * pcbIUScale.IU_PER_MM )
115
116
118{
119public:
120 static inline bool ClassOf( const EDA_ITEM* aItem )
121 {
122 return aItem && PCB_TRACE_T == aItem->Type();
123 }
124
125 PCB_TRACK( BOARD_ITEM* aParent, KICAD_T idtype = PCB_TRACE_T );
126
127 // Do not create a copy constructor. The one generated by the compiler is adequate.
128
129 void CopyFrom( const BOARD_ITEM* aOther ) override;
130
131 void Move( const VECTOR2I& aMoveVector ) override
132 {
133 m_Start += aMoveVector;
134 m_End += aMoveVector;
135 }
136
137 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
138
139 virtual void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
140
141 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
142
143 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
144 VECTOR2I GetPosition() const override { return m_Start; }
145 const VECTOR2I GetFocusPosition() const override { return ( m_Start + m_End ) / 2; }
146
147 virtual void SetWidth( int aWidth ) { m_width = aWidth; }
148 virtual int GetWidth() const { return m_width; }
149
150 void SetEnd( const VECTOR2I& aEnd ) { m_End = aEnd; }
151 const VECTOR2I& GetEnd() const { return m_End; }
152
153 void SetStart( const VECTOR2I& aStart ) { m_Start = aStart; }
154 const VECTOR2I& GetStart() const { return m_Start; }
155
156 void SetStartX( int aX ) { m_Start.x = aX; }
157 void SetStartY( int aY ) { m_Start.y = aY; }
158
159 int GetStartX() const { return m_Start.x; }
160 int GetStartY() const { return m_Start.y; }
161
162 void SetEndX( int aX ) { m_End.x = aX; }
163 void SetEndY( int aY ) { m_End.y = aY; }
164
165 int GetEndX() const { return m_End.x; }
166 int GetEndY() const { return m_End.y; }
167
169 const VECTOR2I& GetEndPoint( ENDPOINT_T aEndPoint ) const
170 {
171 if( aEndPoint == ENDPOINT_START )
172 return m_Start;
173 else
174 return m_End;
175 }
176
177 void SetHasSolderMask( bool aVal ) { m_hasSolderMask = aVal; }
178 bool HasSolderMask() const { return m_hasSolderMask; }
179
180 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
181 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
182
183 int GetSolderMaskExpansion() const;
184
185 // Virtual function
186 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
187
188 virtual LSET GetLayerSet() const override;
189 virtual void SetLayerSet( const LSET& aLayers ) override;
190
191 const BOX2I GetBoundingBox() const override;
192
198 virtual double GetLength() const;
199
205 virtual double GetDelay() const;
206
218 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
219 int aError, ERROR_LOC aErrorLoc,
220 bool ignoreLineWidth = false ) const override;
221
222 // @copydoc BOARD_ITEM::GetEffectiveShape
223 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
224 FLASHING aFlash = FLASHING::DEFAULT ) const override;
225
233 EDA_ITEM_FLAGS IsPointOnEnds( const VECTOR2I& point, int min_dist = 0 ) const;
234
238 bool IsNull() const
239 {
240 return ( Type() == PCB_VIA_T ) || ( m_Start == m_End );
241 }
242
243 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
244 wxString GetFriendlyName() const override;
245
246 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
247 const std::vector<KICAD_T>& aScanTypes ) override;
248
249 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
250 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
251 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
252
253 bool ApproxCollinear( const PCB_TRACK& aTrack );
254
255 wxString GetClass() const override
256 {
257 return wxT( "PCB_TRACK" );
258 }
259
260 virtual MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const;
261
262 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
263
264 BITMAPS GetMenuImage() const override;
265
266 virtual EDA_ITEM* Clone() const override;
267
268 virtual std::vector<int> ViewGetLayers() const override;
269
270 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
271
272 const BOX2I ViewBBox() const override;
273
277 bool IsOnCopperLayer() const override
278 {
279 return true;
280 }
281
282 virtual double Similarity( const BOARD_ITEM& aOther ) const override;
283
284 virtual bool operator==( const BOARD_ITEM& aOther ) const override;
285 virtual bool operator==( const PCB_TRACK& aOther ) const;
286
288 {
289 bool operator()( const PCB_TRACK* aFirst, const PCB_TRACK* aSecond ) const;
290 };
291
292 void Serialize( google::protobuf::Any &aContainer ) const override;
293 bool Deserialize( const google::protobuf::Any &aContainer ) override;
294
295#if defined (DEBUG)
296 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
297#endif
298
299protected:
300 virtual void swapData( BOARD_ITEM* aImage ) override;
301
303 std::vector<MSG_PANEL_ITEM>& aList ) const;
304
305protected:
308
310 std::optional<int> m_solderMaskMargin;
311
312private:
314};
315
316
317class PCB_ARC : public PCB_TRACK
318{
319public:
320 PCB_ARC( BOARD_ITEM* aParent ) :
321 PCB_TRACK( aParent, PCB_ARC_T )
322 { }
323
324 PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
325
326 void CopyFrom( const BOARD_ITEM* aOther ) override;
327
328 static inline bool ClassOf( const EDA_ITEM *aItem )
329 {
330 return aItem && PCB_ARC_T == aItem->Type();
331 }
332
333 virtual void Move( const VECTOR2I& aMoveVector ) override
334 {
335 m_Start += aMoveVector;
336 m_Mid += aMoveVector;
337 m_End += aMoveVector;
338 }
339
340 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
341
342 void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
343
344 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
345
346 void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
347 const VECTOR2I& GetMid() const { return m_Mid; }
348
349 void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
350
351 virtual VECTOR2I GetPosition() const override;
352 const VECTOR2I GetFocusPosition() const override { return m_Mid; }
353
354 virtual VECTOR2I GetCenter() const override { return GetPosition(); }
355
356 double GetRadius() const;
357 EDA_ANGLE GetAngle() const;
359 EDA_ANGLE GetArcAngleEnd() const; // Called by Python; ignore CLion's claim that it's unused
360 virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
361
362 virtual bool HitTest( const BOX2I& aRect, bool aContained = true,
363 int aAccuracy = 0 ) const override;
364
365 bool IsCCW() const;
366
367 wxString GetClass() const override
368 {
369 return wxT( "PCB_ARC" );
370 }
371
372 // @copydoc BOARD_ITEM::GetEffectiveShape
373 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
374 FLASHING aFlash = FLASHING::DEFAULT ) const override;
375
381 virtual double GetLength() const override
382 {
383 return GetRadius() * std::abs( GetAngle().AsRadians() );
384 }
385
386 EDA_ITEM* Clone() const override;
387
394 bool IsDegenerated( int aThreshold = 5 ) const;
395
396 double Similarity( const BOARD_ITEM& aOther ) const override;
397
398 bool operator==( const PCB_ARC& aOther ) const;
399 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
400
401 void Serialize( google::protobuf::Any &aContainer ) const override;
402 bool Deserialize( const google::protobuf::Any &aContainer ) override;
403
404protected:
405 virtual void swapData( BOARD_ITEM* aImage ) override;
406
407private:
408 // Silence GCC warning about overriding the base class method
409 bool operator==( const PCB_TRACK& aOther ) const override;
410
412};
413
414
415class PCB_VIA : public PCB_TRACK
416{
417public:
418 PCB_VIA( BOARD_ITEM* aParent );
419
420 static inline bool ClassOf( const EDA_ITEM *aItem )
421 {
422 return aItem && PCB_VIA_T == aItem->Type();
423 }
424
425 PCB_VIA( const PCB_VIA& aOther );
426 PCB_VIA& operator=( const PCB_VIA &aOther );
427
428 void CopyFrom( const BOARD_ITEM* aOther ) override;
429
430 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
431 {
432 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
433 return true;
434
435 for( KICAD_T scanType : aScanTypes )
436 {
437 if( scanType == PCB_LOCATE_STDVIA_T && m_viaType == VIATYPE::THROUGH )
438 return true;
439 else if( scanType == PCB_LOCATE_UVIA_T && m_viaType == VIATYPE::MICROVIA )
440 return true;
441 else if( scanType == PCB_LOCATE_BLINDVIA_T && m_viaType == VIATYPE::BLIND )
442 return true;
443 else if( scanType == PCB_LOCATE_BURIEDVIA_T && m_viaType == VIATYPE::BURIED )
444 return true;
445 }
446
447 return false;
448 }
449
453 bool HasValidLayerPair( int aCopperLayerCount );
454
455 VIATYPE GetViaType() const { return m_viaType; }
456 void SetViaType( VIATYPE aViaType )
457 {
458 m_viaType = aViaType;
459 // If someone updates a VIA to TH, we want to kick out any non-outer layers
461 }
462
463 const PADSTACK& Padstack() const { return m_padStack; }
465 void SetPadstack( const PADSTACK& aPadstack ) { m_padStack = aPadstack; }
466
467 BACKDRILL_MODE GetBackdrillMode() const { return m_padStack.GetBackdrillMode(); }
468 void SetBackdrillMode( BACKDRILL_MODE aMode ) { m_padStack.SetBackdrillMode( aMode ); }
469
470 std::optional<int> GetBottomBackdrillSize() const { return m_padStack.GetBackdrillSize( false ); }
471 void SetBottomBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( false, aSize ); }
472
473 PCB_LAYER_ID GetBottomBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( false ); }
474 void SetBottomBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( false, aLayer ); }
475
476 std::optional<int> GetTopBackdrillSize() const { return m_padStack.GetBackdrillSize( true ); }
477 void SetTopBackdrillSize( std::optional<int> aSize ) { m_padStack.SetBackdrillSize( true, aSize ); }
478
479 PCB_LAYER_ID GetTopBackdrillLayer() const { return m_padStack.GetBackdrillEndLayer( true ); }
480 void SetTopBackdrillLayer( PCB_LAYER_ID aLayer ) { m_padStack.SetBackdrillEndLayer( true, aLayer ); }
481
482 bool IsMicroVia() const;
483 bool IsBlindVia() const;
484 bool IsBuriedVia() const;
485
506
507 static std::optional<VIA_PARAMETER_ERROR>
508 ValidateViaParameters( std::optional<int> aDiameter,
509 std::optional<int> aPrimaryDrill,
510 std::optional<PCB_LAYER_ID> aPrimaryStartLayer = std::nullopt,
511 std::optional<PCB_LAYER_ID> aPrimaryEndLayer = std::nullopt,
512 std::optional<int> aSecondaryDrill = std::nullopt,
513 std::optional<PCB_LAYER_ID> aSecondaryStartLayer = std::nullopt,
514 std::optional<PCB_LAYER_ID> aSecondaryEndLayer = std::nullopt,
515 std::optional<int> aTertiaryDrill = std::nullopt,
516 std::optional<PCB_LAYER_ID> aTertiaryStartLayer = std::nullopt,
517 std::optional<PCB_LAYER_ID> aTertiaryEndLayer = std::nullopt,
518 int aCopperLayerCount = 0 );
519
520 const BOX2I GetBoundingBox() const override;
521 const BOX2I GetBoundingBox( PCB_LAYER_ID aLayer ) const;
522
523 void SetWidth( int aWidth ) override;
524 int GetWidth() const override;
525
526 void SetWidth( PCB_LAYER_ID aLayer, int aWidth );
527 int GetWidth( PCB_LAYER_ID aLayer ) const;
528
529 // For properties panel
530 void SetFrontWidth( int aWidth ) { SetWidth( F_Cu, aWidth ); }
531 int GetFrontWidth() const { return GetWidth( F_Cu ); }
532
533 bool HasHole() const override
534 {
535 return true;
536 }
537
538 bool HasDrilledHole() const override
539 {
541 }
542
543 std::shared_ptr<SHAPE_SEGMENT> GetEffectiveHoleShape() const override;
544
545 MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const override;
546 MINOPTMAX<int> GetDrillConstraint( wxString* aSource = nullptr ) const;
547
548 void SetFrontTentingMode( TENTING_MODE aMode );
550 void SetBackTentingMode( TENTING_MODE aMode );
552
557
562
563 void SetCappingMode( CAPPING_MODE aMode );
565
566 void SetFillingMode( FILLING_MODE aMode );
568
569 bool IsTented( PCB_LAYER_ID aLayer ) const override;
570 int GetSolderMaskExpansion() const;
571
572 PCB_LAYER_ID GetLayer() const override;
573 void SetLayer( PCB_LAYER_ID aLayer ) override;
574
575 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
576
577 virtual LSET GetLayerSet() const override;
578
583 virtual void SetLayerSet( const LSET& aLayers ) override;
584
591 void SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer );
592
593 void SetBottomLayer( PCB_LAYER_ID aLayer );
594 void SetTopLayer( PCB_LAYER_ID aLayer );
595
603 void LayerPair( PCB_LAYER_ID* top_layer, PCB_LAYER_ID* bottom_layer ) const;
604
605 PCB_LAYER_ID TopLayer() const;
607
612 void SanitizeLayers();
613
614 VECTOR2I GetPosition() const override { return m_Start; }
615 void SetPosition( const VECTOR2I& aPoint ) override { m_Start = aPoint; m_End = aPoint; }
616
617 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
618
619 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
620 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
621
622 wxString GetClass() const override
623 {
624 return wxT( "PCB_VIA" );
625 }
626
627 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
628
629 BITMAPS GetMenuImage() const override;
630
631 EDA_ITEM* Clone() const override;
632
633 std::vector<int> ViewGetLayers() const override;
634
635 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
636
637 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
638
639#if defined (DEBUG)
640 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
641#endif
642
643 int GetMinAnnulus( PCB_LAYER_ID aLayer, wxString* aSource ) const;
644
650 void SetRemoveUnconnected( bool aSet )
651 {
652 m_padStack.SetUnconnectedLayerMode( aSet ? UNCONNECTED_LAYER_MODE::REMOVE_ALL
654 }
655
657 {
658 return m_padStack.UnconnectedLayerMode() != UNCONNECTED_LAYER_MODE::KEEP_ALL;
659 }
660
665 void SetKeepStartEnd( bool aSet )
666 {
669 }
670
671 bool GetKeepStartEnd() const
672 {
674 }
675
677 {
678 switch( m_padStack.UnconnectedLayerMode() )
679 {
681 return false;
682
684 return true;
685
688 return aLayer != m_padStack.Drill().start && aLayer != m_padStack.Drill().end;
689 }
690
691 return true;
692 }
693
700 bool FlashLayer( int aLayer ) const;
701
709 bool FlashLayer( const LSET& aLayers ) const;
710
717 PCB_LAYER_ID* aBottommost ) const;
718
724 void SetPrimaryDrillSize( const VECTOR2I& aSize );
725 const VECTOR2I& GetPrimaryDrillSize() const { return m_padStack.Drill().size; }
726
728 PAD_DRILL_SHAPE GetPrimaryDrillShape() const { return m_padStack.Drill().shape; }
729
731 PCB_LAYER_ID GetPrimaryDrillStartLayer() const { return m_padStack.Drill().start; }
732
734 PCB_LAYER_ID GetPrimaryDrillEndLayer() const { return m_padStack.Drill().end; }
735
736 void SetFrontPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
737 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetFrontPostMachining() const { return m_padStack.FrontPostMachining().mode; }
738
740 {
741 m_padStack.FrontPostMachining().mode = aMode;
742 }
743
748
749 void SetFrontPostMachiningSize( int aSize ) { m_padStack.FrontPostMachining().size = aSize; }
750 int GetFrontPostMachiningSize() const { return m_padStack.FrontPostMachining().size; }
751 void SetFrontPostMachiningDepth( int aDepth ) { m_padStack.FrontPostMachining().depth = aDepth; }
752 int GetFrontPostMachiningDepth() const { return m_padStack.FrontPostMachining().depth; }
753 void SetFrontPostMachiningAngle( int aAngle ) { m_padStack.FrontPostMachining().angle = aAngle; }
754 int GetFrontPostMachiningAngle() const { return m_padStack.FrontPostMachining().angle; }
755
756 void SetBackPostMachining( const std::optional<PAD_DRILL_POST_MACHINING_MODE>& aMode );
757 std::optional<PAD_DRILL_POST_MACHINING_MODE> GetBackPostMachining() const { return m_padStack.BackPostMachining().mode; }
758
760 {
761 m_padStack.BackPostMachining().mode = aMode;
762 }
763
768
769 void SetBackPostMachiningSize( int aSize ) { m_padStack.BackPostMachining().size = aSize; }
770 int GetBackPostMachiningSize() const { return m_padStack.BackPostMachining().size; }
771 void SetBackPostMachiningDepth( int aDepth ) { m_padStack.BackPostMachining().depth = aDepth; }
772 int GetBackPostMachiningDepth() const { return m_padStack.BackPostMachining().depth; }
773 void SetBackPostMachiningAngle( int aAngle ) { m_padStack.BackPostMachining().angle = aAngle; }
774 int GetBackPostMachiningAngle() const { return m_padStack.BackPostMachining().angle; }
775
785 bool IsBackdrilledOrPostMachined( PCB_LAYER_ID aLayer ) const;
786
793 int GetPostMachiningKnockout( PCB_LAYER_ID aLayer ) const;
794
795 void SetPrimaryDrillFilled( const std::optional<bool>& aFilled );
796 void SetPrimaryDrillFilledFlag( bool aFilled );
797 std::optional<bool> GetPrimaryDrillFilled() const { return m_padStack.Drill().is_filled; }
798 bool GetPrimaryDrillFilledFlag() const { return m_padStack.Drill().is_filled.value_or( false ); }
799
800 void SetPrimaryDrillCapped( const std::optional<bool>& aCapped );
801 void SetPrimaryDrillCappedFlag( bool aCapped );
802 std::optional<bool> GetPrimaryDrillCapped() const { return m_padStack.Drill().is_capped; }
803 bool GetPrimaryDrillCappedFlag() const { return m_padStack.Drill().is_capped.value_or( false ); }
804
805 void SetDrill( int aDrill )
806 {
807 SetPrimaryDrillSize( { aDrill, aDrill } );
808 }
809
815 int GetDrill() const { return GetPrimaryDrillSize().x; }
816
822 int GetDrillValue() const;
823
831
832 void SetSecondaryDrillSize( const VECTOR2I& aSize );
834 void SetSecondaryDrillSize( const std::optional<int>& aDrill );
835 std::optional<int> GetSecondaryDrillSize() const;
836
838 PCB_LAYER_ID GetSecondaryDrillStartLayer() const { return m_padStack.SecondaryDrill().start; }
839
841 PCB_LAYER_ID GetSecondaryDrillEndLayer() const { return m_padStack.SecondaryDrill().end; }
842
844 PAD_DRILL_SHAPE GetSecondaryDrillShape() const { return m_padStack.SecondaryDrill().shape; }
845
846 void SetTertiaryDrillSize( const VECTOR2I& aSize );
848 void SetTertiaryDrillSize( const std::optional<int>& aDrill );
849 std::optional<int> GetTertiaryDrillSize() const;
850
852 PCB_LAYER_ID GetTertiaryDrillStartLayer() const { return m_padStack.TertiaryDrill().start; }
853
855 PCB_LAYER_ID GetTertiaryDrillEndLayer() const { return m_padStack.TertiaryDrill().end; }
856
858 PAD_DRILL_SHAPE GetTertiaryDrillShape() const { return m_padStack.TertiaryDrill().shape; }
859
867 bool GetIsFree() const { return m_isFree; }
868 void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
869
870 // @copydoc BOARD_ITEM::GetEffectiveShape
871 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
872 FLASHING aFlash = FLASHING::DEFAULT ) const override;
873
875
877
878 void SetZoneLayerOverride( PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride );
879
880 double Similarity( const BOARD_ITEM& aOther ) const override;
881
882 bool operator==( const PCB_VIA& aOther ) const;
883 bool operator==( const BOARD_ITEM& aOther ) const override;
884
885 void Serialize( google::protobuf::Any &aContainer ) const override;
886 bool Deserialize( const google::protobuf::Any &aContainer ) override;
887
888 wxString LayerMaskDescribe() const override;
889
890protected:
891 void swapData( BOARD_ITEM* aImage ) override;
892
893private:
894 // Silence GCC warning about hiding the PCB_TRACK base method
895 bool operator==( const PCB_TRACK& aOther ) const override;
896
898
900
901 bool m_isFree;
902
904 std::map<PCB_LAYER_ID, ZONE_LAYER_OVERRIDE> m_zoneLayerOverrides;
905};
906
907
908#endif // CLASS_TRACK_H
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:71
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
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:83
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:85
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:192
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:39
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:66
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:54
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:55
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:381
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
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:352
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_track.h:349
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition pcb_track.h:333
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:367
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:346
double GetRadius() const
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
Definition pcb_track.h:347
PCB_ARC(BOARD_ITEM *aParent)
Definition pcb_track.h:320
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:411
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_track.h:328
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:354
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:163
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
Definition pcb_track.h:145
bool IsOnCopperLayer() const override
Definition pcb_track.h:277
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition pcb_track.h:131
wxString GetClass() const override
Return the class name.
Definition pcb_track.h:255
void SetHasSolderMask(bool aVal)
Definition pcb_track.h:177
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:150
bool HasSolderMask() const
Definition pcb_track.h:178
void SetStart(const VECTOR2I &aStart)
Definition pcb_track.h:153
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
int GetStartY() const
Definition pcb_track.h:160
int GetEndX() const
Definition pcb_track.h:165
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:307
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_track.h:180
std::optional< int > m_solderMaskMargin
Definition pcb_track.h:310
void CopyFrom(const BOARD_ITEM *aOther) override
Definition pcb_track.cpp:77
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_track.h:143
std::optional< int > GetLocalSolderMaskMargin() const
Definition pcb_track.h:181
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:154
virtual bool operator==(const BOARD_ITEM &aOther) const override
VECTOR2I m_Start
Line start point.
Definition pcb_track.h:306
int GetEndY() const
Definition pcb_track.h:166
wxString GetFriendlyName() const override
VECTOR2I GetPosition() const override
Definition pcb_track.h:144
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:169
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:120
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:238
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:309
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:156
const VECTOR2I & GetEnd() const
Definition pcb_track.h:151
PCB_TRACK(BOARD_ITEM *aParent, KICAD_T idtype=PCB_TRACE_T)
Definition pcb_track.cpp:63
void SetStartY(int aY)
Definition pcb_track.h:157
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:162
int GetStartX() const
Definition pcb_track.h:159
int m_width
Thickness of track (or arc) – no longer the width of a via.
Definition pcb_track.h:313
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:147
virtual int GetWidth() const
Definition pcb_track.h:148
void GetMsgPanelInfoBase_Common(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) const
void SetRemoveUnconnected(bool aSet)
Definition pcb_track.h:650
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:867
int GetFrontPostMachiningSize() const
Definition pcb_track.h:750
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:614
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:479
bool GetPrimaryDrillFilledFlag() const
Definition pcb_track.h:798
void SetFrontPostMachiningDepth(int aDepth)
Definition pcb_track.h:751
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:772
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetBackPostMachiningAngle(int aAngle)
Definition pcb_track.h:773
int GetBackPostMachiningAngle() const
Definition pcb_track.h:774
PCB_LAYER_ID GetTertiaryDrillEndLayer() const
Definition pcb_track.h:855
COVERING_MODE GetBackCoveringMode() const
std::optional< int > GetTertiaryDrillSize() const
bool GetRemoveUnconnected() const
Definition pcb_track.h:656
void SetTopBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:477
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:665
void SetBackPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:759
std::optional< int > GetTopBackdrillSize() const
Definition pcb_track.h:476
void SetBackdrillMode(BACKDRILL_MODE aMode)
Definition pcb_track.h:468
void SetDrillDefault()
Set the drill value for vias to the default value UNDEFINED_DRILL_DIAMETER.
Definition pcb_track.h:827
std::map< PCB_LAYER_ID, ZONE_LAYER_OVERRIDE > m_zoneLayerOverrides
Definition pcb_track.h:904
void SetBottomBackdrillSize(std::optional< int > aSize)
Definition pcb_track.h:471
void ClearZoneLayerOverrides()
CAPPING_MODE GetCappingMode() const
const PADSTACK & Padstack() const
Definition pcb_track.h:463
void SetFrontTentingMode(TENTING_MODE aMode)
int GetDrill() const
Return the local drill setting for this PCB_VIA.
Definition pcb_track.h:815
PAD_DRILL_SHAPE GetTertiaryDrillShape() const
Definition pcb_track.h:858
bool m_isFree
"Free" vias don't get their nets auto-updated
Definition pcb_track.h:901
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:752
bool IsBlindVia() const
PAD_DRILL_SHAPE GetPrimaryDrillShape() const
Definition pcb_track.h:728
TENTING_MODE GetFrontTentingMode() const
std::optional< bool > GetPrimaryDrillCapped() const
Definition pcb_track.h:802
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:464
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:737
void ClearSecondaryDrillSize()
void SetBackPostMachiningDepth(int aDepth)
Definition pcb_track.h:771
void SetDrill(int aDrill)
Definition pcb_track.h:805
PLUGGING_MODE GetBackPluggingMode() const
void SetBackPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetSecondaryDrillEndLayer() const
Definition pcb_track.h:841
MINOPTMAX< int > GetDrillConstraint(wxString *aSource=nullptr) const
void SetBackTentingMode(TENTING_MODE aMode)
PAD_DRILL_SHAPE GetSecondaryDrillShape() const
Definition pcb_track.h:844
void SetIsFree(bool aFree=true)
Definition pcb_track.h:868
std::optional< bool > GetPrimaryDrillFilled() const
Definition pcb_track.h:797
void SetFrontPluggingMode(PLUGGING_MODE aMode)
PCB_LAYER_ID GetPrimaryDrillStartLayer() const
Definition pcb_track.h:731
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:754
std::mutex m_zoneLayerOverridesMutex
Definition pcb_track.h:903
PCB_LAYER_ID GetPrimaryDrillEndLayer() const
Definition pcb_track.h:734
void SetFrontPostMachiningAngle(int aAngle)
Definition pcb_track.h:753
void SetTopLayer(PCB_LAYER_ID aLayer)
FILLING_MODE GetFillingMode() const
void SetPosition(const VECTOR2I &aPoint) override
Definition pcb_track.h:615
bool IsBuriedVia() const
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
int GetFrontWidth() const
Definition pcb_track.h:531
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:538
PAD_DRILL_POST_MACHINING_MODE GetFrontPostMachiningMode() const
Definition pcb_track.h:744
void SetFrontPostMachiningSize(int aSize)
Definition pcb_track.h:749
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:430
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:473
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:671
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:420
void SetSecondaryDrillShape(PAD_DRILL_SHAPE aShape)
bool HasHole() const override
Definition pcb_track.h:533
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:852
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:622
const VECTOR2I & GetPrimaryDrillSize() const
Definition pcb_track.h:725
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:470
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
Definition pcb_track.h:676
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:456
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:897
void SetBottomBackdrillLayer(PCB_LAYER_ID aLayer)
Definition pcb_track.h:474
int GetBackPostMachiningSize() const
Definition pcb_track.h:770
void SetTertiaryDrillSize(const VECTOR2I &aSize)
PADSTACK m_padStack
Definition pcb_track.h:899
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:764
void SetFrontWidth(int aWidth)
Definition pcb_track.h:530
VIATYPE GetViaType() const
Definition pcb_track.h:455
PCB_LAYER_ID GetSecondaryDrillStartLayer() const
Definition pcb_track.h:838
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:467
void SetWidth(int aWidth) override
std::optional< PAD_DRILL_POST_MACHINING_MODE > GetBackPostMachining() const
Definition pcb_track.h:757
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:480
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:465
void SetFrontPostMachiningMode(PAD_DRILL_POST_MACHINING_MODE aMode)
Definition pcb_track.h:739
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool GetPrimaryDrillCappedFlag() const
Definition pcb_track.h:803
void SetBackPostMachiningSize(int aSize)
Definition pcb_track.h:769
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: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
static const bool NOT_FILLED
Definition gr_basic.cpp:31
static const bool FILLED
Definition gr_basic.cpp:30
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:184
@ DEFAULT
Flashing follows connectivity.
Definition layer_ids.h:185
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ UNDEFINED_LAYER
Definition layer_ids.h:61
@ F_Cu
Definition layer_ids.h:64
FLIP_DIRECTION
Definition mirror.h:27
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
FILLING_MODE
Definition pcb_track.h:105
VIATYPE
Definition pcb_track.h:67
@ THROUGH
Definition pcb_track.h:68
@ NOT_DEFINED
Definition pcb_track.h:73
@ MICROVIA
Definition pcb_track.h:71
TENTING_MODE
Definition pcb_track.h:77
COVERING_MODE
Definition pcb_track.h:84
ENDPOINT_T
Definition pcb_track.h:60
@ ENDPOINT_END
Definition pcb_track.h:62
@ ENDPOINT_START
Definition pcb_track.h:61
PLUGGING_MODE
Definition pcb_track.h:91
#define UNDEFINED_DRILL_DIAMETER
Definition pcb_track.h:111
CAPPING_MODE
Definition pcb_track.h:98
@ MICROVIA
Microvia.
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:78
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:97
@ PCB_LOCATE_BLINDVIA_T
Definition typeinfo.h:128
@ PCB_LOCATE_STDVIA_T
Definition typeinfo.h:126
@ PCB_LOCATE_BURIEDVIA_T
Definition typeinfo.h:129
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:98
@ PCB_LOCATE_UVIA_T
Definition typeinfo.h:127
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:96
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695