KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef FOOTPRINT_H
26#define FOOTPRINT_H
27
28#include <deque>
29
30#include <template_fieldnames.h>
31
33#include <board_item.h>
34#include <collectors.h>
36#include <embedded_files.h>
37#include <layer_ids.h> // ALL_LAYERS definition.
38#include <lset.h>
39#include <lib_id.h>
40#include <list>
41
42#include <zones.h>
44#include <pcb_item_containers.h>
45#include <pcb_text.h>
46#include <pcb_field.h>
47#include <functional>
48#include <math/vector3.h>
49
50class LINE_READER;
51class EDA_3D_CANVAS;
52class PAD;
53class BOARD;
54class MSG_PANEL_ITEM;
55class SHAPE;
56class REPORTER;
57
58namespace KIGFX {
59class VIEW;
60}
61
63{
65 INCLUDE_NPTH = true
66};
67
74{
76 FP_SMD = 0x0002,
79 FP_BOARD_ONLY = 0x0010, // Footprint has no corresponding symbol
80 FP_JUST_ADDED = 0x0020, // Footprint just added by netlist update
83 FP_DNP = 0x0100
84};
85
87{
88public:
90 // Initialize with sensible values
91 m_Scale { 1, 1, 1 },
92 m_Rotation { 0, 0, 0 },
93 m_Offset { 0, 0, 0 },
94 m_Opacity( 1.0 ),
95 m_Show( true )
96 {
97 }
98
102 double m_Opacity;
103 wxString m_Filename;
104 bool m_Show;
105
106 bool operator==( const FP_3DMODEL& aOther ) const
107 {
108 return m_Scale == aOther.m_Scale
109 && m_Rotation == aOther.m_Rotation
110 && m_Offset == aOther.m_Offset
111 && m_Opacity == aOther.m_Opacity
112 && m_Filename == aOther.m_Filename
113 && m_Show == aOther.m_Show;
114 }
115};
116
117
119{
120public:
121 FOOTPRINT( BOARD* parent );
122
123 FOOTPRINT( const FOOTPRINT& aFootprint );
124
125 // Move constructor and operator needed due to std containers inside the footprint
126 FOOTPRINT( FOOTPRINT&& aFootprint );
127
128 ~FOOTPRINT();
129
130 FOOTPRINT& operator=( const FOOTPRINT& aOther );
131 FOOTPRINT& operator=( FOOTPRINT&& aOther );
132
133 void Serialize( google::protobuf::Any &aContainer ) const override;
134 bool Deserialize( const google::protobuf::Any &aContainer ) override;
135
136 static inline bool ClassOf( const EDA_ITEM* aItem )
137 {
138 return aItem && aItem->Type() == PCB_FOOTPRINT_T;
139 }
140
142 void SetPrivateLayers( LSET aLayers ) { m_privateLayers = aLayers; }
143
145 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
146 bool aSkipConnectivity = false ) override;
147
149 void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
150
158 void ClearAllNets();
159
167 bool FixUuids();
168
179
186
187 bool TextOnly() const;
188
189 // Virtual function
190 const BOX2I GetBoundingBox() const override;
191 const BOX2I GetBoundingBox( bool aIncludeText ) const;
192
196 const BOX2I GetLayerBoundingBox( LSET aLayers ) const;
197
198 VECTOR2I GetCenter() const override
199 {
200 return GetBoundingBox( false ).GetCenter();
201 }
202
203 PCB_FIELDS& Fields() { return m_fields; }
204 const PCB_FIELDS& Fields() const { return m_fields; }
205
206 std::deque<PAD*>& Pads() { return m_pads; }
207 const std::deque<PAD*>& Pads() const { return m_pads; }
208
209 DRAWINGS& GraphicalItems() { return m_drawings; }
210 const DRAWINGS& GraphicalItems() const { return m_drawings; }
211
212 ZONES& Zones() { return m_zones; }
213 const ZONES& Zones() const { return m_zones; }
214
215 GROUPS& Groups() { return m_groups; }
216 const GROUPS& Groups() const { return m_groups; }
217
218 bool HasThroughHolePads() const;
219
220 std::vector<FP_3DMODEL>& Models() { return m_3D_Drawings; }
221 const std::vector<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
222
223 void SetPosition( const VECTOR2I& aPos ) override;
224 VECTOR2I GetPosition() const override { return m_pos; }
225
226 void SetOrientation( const EDA_ANGLE& aNewAngle );
228
233 void SetLayerAndFlip( PCB_LAYER_ID aLayer );
234
235 // to make property magic work
236 PCB_LAYER_ID GetLayer() const override { return BOARD_ITEM::GetLayer(); }
237
238 // For property system:
239 void SetOrientationDegrees( double aOrientation )
240 {
241 SetOrientation( EDA_ANGLE( aOrientation, DEGREES_T ) );
242 }
244 {
245 return m_orient.AsDegrees();
246 }
247
248 const LIB_ID& GetFPID() const { return m_fpid; }
249 void SetFPID( const LIB_ID& aFPID )
250 {
251 m_fpid = aFPID;
252 }
253
254 wxString GetFPIDAsString() const { return m_fpid.Format(); }
255 void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); }
256
257 wxString GetLibDescription() const { return m_libDescription; }
258 void SetLibDescription( const wxString& aDesc ) { m_libDescription = aDesc; }
259
260 wxString GetKeywords() const { return m_keywords; }
261 void SetKeywords( const wxString& aKeywords ) { m_keywords = aKeywords; }
262
263 const KIID_PATH& GetPath() const { return m_path; }
264 void SetPath( const KIID_PATH& aPath ) { m_path = aPath; }
265
266 wxString GetSheetname() const { return m_sheetname; }
267 void SetSheetname( const wxString& aSheetname ) { m_sheetname = aSheetname; }
268
269 wxString GetSheetfile() const { return m_sheetfile; }
270 void SetSheetfile( const wxString& aSheetfile ) { m_sheetfile = aSheetfile; }
271
272 wxString GetFilters() const { return m_filters; }
273 void SetFilters( const wxString& aFilters ) { m_filters = aFilters; }
274
275 std::optional<int> GetLocalClearance() const { return m_clearance; }
276 void SetLocalClearance( std::optional<int> aClearance ) { m_clearance = aClearance; }
277
278 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
279 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
280
281 std::optional<int> GetLocalSolderPasteMargin() const { return m_solderPasteMargin; }
282 void SetLocalSolderPasteMargin( std::optional<int> aMargin ) { m_solderPasteMargin = aMargin; }
283
284 std::optional<double> GetLocalSolderPasteMarginRatio() const { return m_solderPasteMarginRatio; }
285 void SetLocalSolderPasteMarginRatio( std::optional<double> aRatio ) { m_solderPasteMarginRatio = aRatio; }
286
289
290 int GetAttributes() const { return m_attributes; }
291 void SetAttributes( int aAttributes ) { m_attributes = aAttributes; }
292
293 void SetFlag( int aFlag ) { m_arflag = aFlag; }
294 void IncrementFlag() { m_arflag += 1; }
295 int GetFlag() const { return m_arflag; }
296
297 bool IsNetTie() const
298 {
299 for( const wxString& group : m_netTiePadGroups )
300 {
301 if( !group.IsEmpty() )
302 return true;
303 }
304
305 return false;
306 }
307
308 std::optional<int> GetLocalClearance( wxString* aSource ) const
309 {
310 if( m_clearance.has_value() && aSource )
311 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
312
313 return m_clearance;
314 }
315
322 std::optional<int> GetClearanceOverrides( wxString* aSource ) const
323 {
324 return GetLocalClearance( aSource );
325 }
326
328 {
329 if( m_zoneConnection != ZONE_CONNECTION::INHERITED && aSource )
330 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
331
332 return m_zoneConnection;
333 }
334
339 const std::vector<wxString>& GetNetTiePadGroups() const { return m_netTiePadGroups; }
340
342 {
343 m_netTiePadGroups.clear();
344 }
345
346 void AddNetTiePadGroup( const wxString& aGroup )
347 {
348 m_netTiePadGroups.emplace_back( aGroup );
349 }
350
355 std::map<wxString, int> MapPadNumbersToNetTieGroups() const;
356
360 std::vector<PAD*> GetNetTiePads( PAD* aPad ) const;
361
367 int GetLikelyAttribute() const;
368
369 void Move( const VECTOR2I& aMoveVector ) override;
370
371 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
372
373 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
374
386 void MoveAnchorPosition( const VECTOR2I& aMoveVector );
387
391 bool IsFlipped() const { return GetLayer() == B_Cu; }
392
397 PCB_LAYER_ID GetSide() const;
398
402 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
403
404// m_footprintStatus bits:
405#define FP_is_LOCKED 0x01
406#define FP_is_PLACED 0x02
407#define FP_to_PLACE 0x04
408#define FP_PADS_are_LOCKED 0x08
409
410
411 bool IsLocked() const override
412 {
413 return ( m_fpStatus & FP_is_LOCKED ) != 0;
414 }
415
421 void SetLocked( bool isLocked ) override
422 {
423 if( isLocked )
425 else
426 m_fpStatus &= ~FP_is_LOCKED;
427 }
428
432 bool IsConflicting() const;
433
434 bool IsPlaced() const { return m_fpStatus & FP_is_PLACED; }
435 void SetIsPlaced( bool isPlaced )
436 {
437 if( isPlaced )
439 else
440 m_fpStatus &= ~FP_is_PLACED;
441 }
442
443 bool NeedsPlaced() const { return m_fpStatus & FP_to_PLACE; }
444 void SetNeedsPlaced( bool needsPlaced )
445 {
446 if( needsPlaced )
448 else
449 m_fpStatus &= ~FP_to_PLACE;
450 }
451
453
464 void CheckFootprintAttributes( const std::function<void( const wxString& )>& aErrorHandler );
465
472 void CheckPads( UNITS_PROVIDER* aUnitsProvider,
473 const std::function<void( const PAD*, int, const wxString& )>& aErrorHandler );
474
480 void CheckShortingPads( const std::function<void( const PAD*, const PAD*, int aErrorCode,
481 const VECTOR2I& )>& aErrorHandler );
482
489 void CheckNetTies( const std::function<void( const BOARD_ITEM* aItem,
490 const BOARD_ITEM* bItem,
491 const BOARD_ITEM* cItem,
492 const VECTOR2I& )>& aErrorHandler );
493
500 void CheckNetTiePadGroups( const std::function<void( const wxString& )>& aErrorHandler );
501
522 void TransformPadsToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
523 int aMaxError, ERROR_LOC aErrorLoc,
524 bool aSkipNPTHPadsWihNoCopper = false,
525 bool aSkipPlatedPads = false,
526 bool aSkipNonPlatedPads = false ) const;
527
542 void TransformFPShapesToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
543 int aError, ERROR_LOC aErrorLoc,
544 bool aIncludeText = true,
545 bool aIncludeShapes = true,
546 bool aIncludePrivateItems = false ) const;
547
551 void TransformFPTextToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
552 int aError, ERROR_LOC aErrorLoc ) const
553 {
554 TransformFPShapesToPolySet( aBuffer, aLayer, aClearance, aError, aErrorLoc, true, false );
555 }
556
560 void GetContextualTextVars( wxArrayString* aVars ) const;
561
567 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
568
570 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
571
572 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
573
583 bool HitTestAccurate( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
584
585 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
586
595 bool HitTestOnLayer( const VECTOR2I& aPosition, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
596
597 bool HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
598
602 const wxString& GetReference() const { return Reference().GetText(); }
603
608 void SetReference( const wxString& aReference ) { Reference().SetText( aReference ); }
609
610 // Property system doesn't like const references
611 wxString GetReferenceAsString() const
612 {
613 return GetReference();
614 }
615
619 void IncrementReference( int aDelta );
620
624 const wxString& GetValue() const { return Value().GetText(); }
625
629 void SetValue( const wxString& aValue ) { Value().SetText( aValue ); }
630
631 // Property system doesn't like const references
632 wxString GetValueAsString() const
633 {
634 return GetValue();
635 }
636
641
643 const PCB_FIELD& Value() const { return *GetField( VALUE_FIELD ); }
644 const PCB_FIELD& Reference() const { return *GetField( REFERENCE_FIELD ); }
645 const PCB_FIELD& Footprint() const { return *GetField( FOOTPRINT_FIELD ); }
646
647 //-----<Fields>-----------------------------------------------------------
648
657 PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldType );
658 const PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldNdx ) const;
659
667 PCB_FIELD* GetFieldById( int aFieldId );
668
676 PCB_FIELD* GetFieldByName( const wxString& aFieldName );
677
678 bool HasFieldByName( const wxString& aFieldName ) const;
679
685 wxString GetFieldText( const wxString& aFieldName ) const;
686
693 void GetFields( std::vector<PCB_FIELD*>& aVector, bool aVisibleOnly );
694
698 PCB_FIELDS GetFields() { return m_fields; }
699 const PCB_FIELDS& GetFields() const { return m_fields; }
700
708 PCB_FIELD* AddField( const PCB_FIELD& aField );
709
715 void RemoveField( const wxString& aFieldName );
716
720 int GetFieldCount() const { return (int) m_fields.size(); }
721
729 void ApplyDefaultSettings( const BOARD& board, bool aStyleFields, bool aStyleText,
730 bool aStyleShapes );
731
732 bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
733 void SetBoardOnly( bool aIsBoardOnly = true )
734 {
735 if( aIsBoardOnly )
737 else
738 m_attributes &= ~FP_BOARD_ONLY;
739 }
740
742 void SetExcludedFromPosFiles( bool aExclude = true )
743 {
744 if( aExclude )
746 else
747 m_attributes &= ~FP_EXCLUDE_FROM_POS_FILES;
748 }
749
751 void SetExcludedFromBOM( bool aExclude = true )
752 {
753 if( aExclude )
755 else
756 m_attributes &= ~FP_EXCLUDE_FROM_BOM;
757 }
758
760 void SetAllowMissingCourtyard( bool aAllow = true )
761 {
762 if( aAllow )
764 else
765 m_attributes &= ~FP_ALLOW_MISSING_COURTYARD;
766 }
767
768 bool IsDNP() const { return m_attributes & FP_DNP; }
769 void SetDNP( bool aDNP = true )
770 {
771 if( aDNP )
773 else
774 m_attributes &= ~FP_DNP;
775 }
776
777 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
779
789 PAD* FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe = nullptr ) const;
790
798 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
799
800 std::vector<const PAD*> GetPads( const wxString& aPadNumber,
801 const PAD* aIgnore = nullptr ) const;
802
810 unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
811
822 unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
823
827 std::set<wxString>
829
837 wxString GetNextPadNumber( const wxString& aLastPadName ) const;
838
842 void AutoPositionFields();
843
848 wxString GetTypeName() const;
849
850 double GetArea( int aPadding = 0 ) const;
851
852 KIID GetLink() const { return m_link; }
853 void SetLink( const KIID& aLink ) { m_link = aLink; }
854
855 BOARD_ITEM* Duplicate() const override;
856
862 BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
863
869 void Add3DModel( FP_3DMODEL* a3DModel );
870
871 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
872 const std::vector<KICAD_T>& aScanTypes ) override;
873
874 wxString GetClass() const override
875 {
876 return wxT( "FOOTPRINT" );
877 }
878
879 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
880
881 BITMAPS GetMenuImage() const override;
882
883 EDA_ITEM* Clone() const override;
884
886 void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const override;
887
889 void RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction,
890 int aDepth = 0 ) const override;
891
892 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
893
894 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
895
896 virtual const BOX2I ViewBBox() const override;
897
905 static bool IsLibNameValid( const wxString& aName );
906
916 static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
917
921 bool FootprintNeedsUpdate( const FOOTPRINT* aLibFP, int aCompareFlags = 0,
922 REPORTER* aReporter = nullptr );
923
938 void SetInitialComments( wxArrayString* aInitialComments )
939 {
940 delete m_initial_comments;
941 m_initial_comments = aInitialComments;
942 }
943
950 double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
951
952 static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
953
955 const wxArrayString* GetInitialComments() const { return m_initial_comments; }
956
962 const SHAPE_POLY_SET& GetCourtyard( PCB_LAYER_ID aLayer ) const;
963
969 const SHAPE_POLY_SET& GetCachedCourtyard( PCB_LAYER_ID aLayer ) const;
970
977 void BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
978
979 // @copydoc BOARD_ITEM::GetEffectiveShape
980 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
981 FLASHING aFlash = FLASHING::DEFAULT ) const override;
982
984 {
985 return static_cast<EMBEDDED_FILES*>( this );
986 }
987
989 {
990 return static_cast<const EMBEDDED_FILES*>( this );
991 }
992
993 void EmbedFonts() override;
994
995 double Similarity( const BOARD_ITEM& aOther ) const override;
996
997 void SetComponentClass( const COMPONENT_CLASS* aClass ) { m_componentClass = aClass; }
998
1000
1001 wxString GetComponentClassAsString() const;
1002
1003
1004 bool operator==( const BOARD_ITEM& aOther ) const override;
1005 bool operator==( const FOOTPRINT& aOther ) const;
1006
1007#if defined(DEBUG)
1008 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1009#endif
1010
1012 {
1013 bool operator()( const BOARD_ITEM* itemA, const BOARD_ITEM* itemB ) const;
1014 };
1015
1017 {
1018 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1019 };
1020 // TODO(JE) padstacks -- this code isn't used anywhere though
1021#if 0
1022 struct cmp_padstack
1023 {
1024 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1025 };
1026#endif
1028 {
1029 bool operator()( const ZONE* aFirst, const ZONE* aSecond ) const;
1030 };
1031
1032protected:
1033 virtual void swapData( BOARD_ITEM* aImage ) override;
1034
1035private:
1036 PCB_FIELDS m_fields;
1037 DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
1038 std::deque<PAD*> m_pads; // PAD items, owned by pointer
1039 ZONES m_zones; // PCB_ZONE items, owned by pointer
1040 GROUPS m_groups; // PCB_GROUP items, owned by pointer
1041
1042 EDA_ANGLE m_orient; // Orientation
1043 VECTOR2I m_pos; // Position of footprint on the board in internal units.
1044 LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
1045 int m_attributes; // Flag bits (see FOOTPRINT_ATTR_T)
1046 int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
1048
1049 // Bounding box caching strategy:
1050 // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
1051 // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
1052 // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
1053 // counter, and storing that as a timestamp for the various caches.
1054 // This means caches will get regenerated often -- but still far less often than if we had no
1055 // caches at all. The principal opitmization would be to change to dirty flag and make sure
1056 // that any edit that could affect the bounding boxes (including edits to the footprint
1057 // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
1058 // fragile.
1065
1066 // A list of pad groups, each of which is allowed to short nets within their group.
1067 // A pad group is a comma-separated list of pad numbers.
1068 std::vector<wxString> m_netTiePadGroups;
1069
1070 // Optional overrides
1072 std::optional<int> m_clearance;
1073 std::optional<int> m_solderMaskMargin; // Solder mask margin
1074 std::optional<int> m_solderPasteMargin; // Solder paste margin absolute value
1075 std::optional<double> m_solderPasteMarginRatio; // Solder mask margin ratio of pad size
1076 // The final margin is the sum of these 2 values
1077
1078 wxString m_libDescription; // File name and path for documentation file.
1079 wxString m_keywords; // Search keywords to find footprint in library.
1080 KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
1081 wxString m_sheetname; // Name of the sheet containing the symbol for this footprint
1082 wxString m_sheetfile; // File of the sheet containing the symbol for this footprint
1083 wxString m_filters; // Footprint filters from symbol
1085 int m_arflag; // Use to trace ratsnest and auto routing.
1086 KIID m_link; // Temporary logical link used during editing
1087 LSET m_privateLayers; // Layers visible only in the footprint editor
1088
1089 std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
1090 wxArrayString* m_initial_comments; // s-expression comments in the footprint,
1091 // lazily allocated only if needed for speed
1092
1093 SHAPE_POLY_SET m_courtyard_cache_front; // Note that a footprint can have both front and back
1094 SHAPE_POLY_SET m_courtyard_cache_back; // courtyards populated.
1097 mutable std::mutex m_courtyard_cache_mutex;
1098
1100};
1101
1102#endif // FOOTPRINT_H
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Definition: approximation.h:32
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:237
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
constexpr const Vec GetCenter() const
Definition: box2.h:230
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:49
double AsDegrees() const
Definition: eda_angle.h:113
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:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:94
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:182
bool FixUuids()
Old footprints do not always have a valid UUID (some can be set to null uuid) However null UUIDs,...
Definition: footprint.cpp:649
std::optional< int > GetClearanceOverrides(wxString *aSource) const
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
Definition: footprint.h:322
void EmbedFonts() override
Definition: footprint.cpp:3761
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:2341
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:249
LIB_ID m_fpid
Definition: footprint.h:1044
wxString GetLibDescription() const
Definition: footprint.h:257
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:288
const COMPONENT_CLASS * m_componentClass
Definition: footprint.h:1099
void SetLink(const KIID &aLink)
Definition: footprint.h:853
KIID_PATH m_path
Definition: footprint.h:1080
bool IsBoardOnly() const
Definition: footprint.h:732
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: footprint.h:720
BOX2I m_cachedTextExcludedBBox
Definition: footprint.h:1061
const std::deque< PAD * > & Pads() const
Definition: footprint.h:207
bool IsDNP() const
Definition: footprint.h:768
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:421
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: footprint.h:198
HASH_128 m_courtyard_cache_back_hash
Definition: footprint.h:1096
std::vector< PAD * > GetNetTiePads(PAD *aPad) const
Definition: footprint.cpp:3027
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:905
EDA_ANGLE GetOrientation() const
Definition: footprint.h:227
bool HasFieldByName(const wxString &aFieldName) const
Definition: footprint.cpp:541
ZONES & Zones()
Definition: footprint.h:212
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: footprint.cpp:376
void SetComponentClass(const COMPONENT_CLASS *aClass)
Definition: footprint.h:997
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:1045
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:435
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:1071
BOX2I m_cachedBoundingBox
Definition: footprint.h:1059
static double GetCoverageArea(const BOARD_ITEM *aItem, const GENERAL_COLLECTOR &aCollector)
Definition: footprint.cpp:2654
bool IsExcludedFromBOM() const
Definition: footprint.h:750
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:2411
void SetFlag(int aFlag)
Definition: footprint.h:293
std::optional< double > m_solderPasteMarginRatio
Definition: footprint.h:1075
PCB_FIELD * GetFieldByName(const wxString &aFieldName)
Return a field in this symbol.
Definition: footprint.cpp:552
void SetDNP(bool aDNP=true)
Definition: footprint.h:769
static bool IsLibNameValid(const wxString &aName)
Test for validity of a name of a footprint to be used in a footprint library ( no spaces,...
Definition: footprint.cpp:2209
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1861
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
Definition: footprint.h:285
void IncrementFlag()
Definition: footprint.h:294
const BOX2I GetLayerBoundingBox(LSET aLayers) const
Return the bounding box of the footprint on a given set of layers.
Definition: footprint.cpp:1398
std::optional< int > m_clearance
Definition: footprint.h:1072
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:594
void CheckNetTies(const std::function< void(const BOARD_ITEM *aItem, const BOARD_ITEM *bItem, const BOARD_ITEM *cItem, const VECTOR2I &)> &aErrorHandler)
Check for un-allowed shorting of pads in net-tie footprints.
Definition: footprint.cpp:3161
void CheckPads(UNITS_PROVIDER *aUnitsProvider, const std::function< void(const PAD *, int, const wxString &)> &aErrorHandler)
Run non-board-specific DRC checks on footprint's pads.
Definition: footprint.cpp:3074
void SetExcludedFromBOM(bool aExclude=true)
Definition: footprint.h:751
wxString GetSheetname() const
Definition: footprint.h:266
int m_fpStatus
Definition: footprint.h:1046
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:264
PCB_FIELDS GetFields()
Return a vector of fields from the symbol.
Definition: footprint.h:698
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: footprint.cpp:2153
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:1063
std::set< wxString > GetUniquePadNumbers(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the names of the unique, non-blank pads.
Definition: footprint.cpp:1880
void SetFilters(const wxString &aFilters)
Definition: footprint.h:273
void SetAllowMissingCourtyard(bool aAllow=true)
Definition: footprint.h:760
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:261
const DRAWINGS & GraphicalItems() const
Definition: footprint.h:210
void SetInitialComments(wxArrayString *aInitialComments)
Take ownership of caller's heap allocated aInitialComments block.
Definition: footprint.h:938
int m_attributes
Definition: footprint.h:1045
PCB_LAYER_ID GetSide() const
Use instead of IsFlipped() when you also need to account for unsided footprints (those purely on user...
Definition: footprint.cpp:1615
PCB_FIELD & Footprint()
Definition: footprint.h:640
std::vector< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:1089
double CoverageRatio(const GENERAL_COLLECTOR &aCollector) const
Calculate the ratio of total area of the footprint pads and graphical items to the area of the footpr...
Definition: footprint.cpp:2747
BOARD_ITEM * DuplicateItem(const BOARD_ITEM *aItem, bool aAddToFootprint=false)
Duplicate a given item within the footprint, optionally adding it to the board.
Definition: footprint.cpp:2450
bool FootprintNeedsUpdate(const FOOTPRINT *aLibFP, int aCompareFlags=0, REPORTER *aReporter=nullptr)
Return true if a board footprint differs from the library version.
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.
Definition: footprint.cpp:2811
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2038
void SetAttributes(int aAttributes)
Definition: footprint.h:291
void SetSheetfile(const wxString &aSheetfile)
Definition: footprint.h:270
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: footprint.cpp:2026
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2064
std::optional< int > GetLocalSolderPasteMargin() const
Definition: footprint.h:281
void TransformPadsToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool aSkipNPTHPadsWihNoCopper=false, bool aSkipPlatedPads=false, bool aSkipNonPlatedPads=false) const
Generate pads shapes on layer aLayer as polygons and adds these polygons to aBuffer.
Definition: footprint.cpp:3613
wxArrayString * m_initial_comments
Definition: footprint.h:1090
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2032
BOX2I GetFpPadsLocalBbox() const
Return the bounding box containing pads when the footprint is on the front side, orientation 0,...
Definition: footprint.cpp:1212
PCB_FIELD & Value()
read/write accessors:
Definition: footprint.h:638
const EMBEDDED_FILES * GetEmbeddedFiles() const
Definition: footprint.h:988
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:2247
std::optional< int > m_solderPasteMargin
Definition: footprint.h:1074
void SetFileFormatVersionAtLoad(int aVersion)
Definition: footprint.h:777
std::mutex m_courtyard_cache_mutex
Definition: footprint.h:1097
void SetExcludedFromPosFiles(bool aExclude=true)
Definition: footprint.h:742
const PCB_FIELD & Footprint() const
Definition: footprint.h:645
void SetOrientationDegrees(double aOrientation)
Definition: footprint.h:239
void SetPrivateLayers(LSET aLayers)
Adds an item to the container.
Definition: footprint.h:142
void ApplyDefaultSettings(const BOARD &board, bool aStyleFields, bool aStyleText, bool aStyleShapes)
Apply default board settings to the footprint field text properties.
Definition: footprint.cpp:616
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:2972
std::optional< int > GetLocalClearance() const
Definition: footprint.h:275
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition: footprint.cpp:3384
void TransformFPTextToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc) const
This function is the same as TransformFPShapesToPolySet but only generates text.
Definition: footprint.h:551
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
Definition: footprint.cpp:2367
FOOTPRINT & operator=(const FOOTPRINT &aOther)
Definition: footprint.cpp:781
int m_arflag
Definition: footprint.h:1085
double GetOrientationDegrees() const
Definition: footprint.h:243
BOARD_ITEM * Duplicate() const override
Create a copy of this BOARD_ITEM.
Definition: footprint.cpp:2437
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...
Definition: footprint.cpp:1928
std::deque< PAD * > & Pads()
Definition: footprint.h:206
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition: footprint.cpp:271
int GetAttributes() const
Definition: footprint.h:290
std::optional< int > GetLocalClearance(wxString *aSource) const
Definition: footprint.h:308
const COMPONENT_CLASS * GetComponentClass() const
Definition: footprint.h:999
void SetLocalZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:287
void ClearNetTiePadGroups()
Definition: footprint.h:341
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:236
LSET GetPrivateLayers() const
Definition: footprint.h:141
wxString GetFPIDAsString() const
Definition: footprint.h:254
wxString GetValueAsString() const
Definition: footprint.h:632
bool AllowMissingCourtyard() const
Definition: footprint.h:759
const ZONES & Zones() const
Definition: footprint.h:213
wxString GetComponentClassAsString() const
Definition: footprint.cpp:3794
bool IsFlipped() const
Definition: footprint.h:391
wxString GetSheetfile() const
Definition: footprint.h:269
SHAPE_POLY_SET GetBoundingHull() const
Return a bounding polygon for the shapes and pads in the footprint.
Definition: footprint.cpp:1443
void TransformFPShapesToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIncludeText=true, bool aIncludeShapes=true, bool aIncludePrivateItems=false) const
Generate shapes of graphic items (outlines) on layer aLayer as polygons and adds these polygons to aB...
Definition: footprint.cpp:3704
wxString GetTypeName() const
Get the type of footprint.
Definition: footprint.cpp:1200
DRAWINGS m_drawings
Definition: footprint.h:1037
bool NeedsPlaced() const
Definition: footprint.h:443
PCB_FIELD * GetFieldById(int aFieldId)
Return a field in this symbol.
Definition: footprint.cpp:530
SHAPE_POLY_SET m_courtyard_cache_back
Definition: footprint.h:1094
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:1062
const std::vector< wxString > & GetNetTiePadGroups() const
Definition: footprint.h:339
const LIB_ID & GetFPID() const
Definition: footprint.h:248
void SetReference(const wxString &aReference)
Definition: footprint.h:608
bool IsLocked() const override
Definition: footprint.h:411
const GROUPS & Groups() const
Definition: footprint.h:216
bool IsExcludedFromPosFiles() const
Definition: footprint.h:741
void SetLayerAndFlip(PCB_LAYER_ID aLayer)
Used as Layer property setter – performs a flip if necessary to set the footprint layer.
Definition: footprint.cpp:2274
ZONES m_zones
Definition: footprint.h:1039
int m_hullCacheTimeStamp
Definition: footprint.h:1064
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:1911
void AddNetTiePadGroup(const wxString &aGroup)
Definition: footprint.h:346
bool LegacyPadsLocked() const
Definition: footprint.h:452
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: footprint.cpp:2194
LSET m_privateLayers
Definition: footprint.h:1087
int GetLikelyAttribute() const
Returns the most likely attribute based on pads Either FP_THROUGH_HOLE/FP_SMD/OTHER(0)
Definition: footprint.cpp:1147
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: footprint.cpp:2237
static bool ClassOf(const EDA_ITEM *aItem)
Definition: footprint.h:136
wxString m_libDescription
Definition: footprint.h:1078
bool HitTestOnLayer(const VECTOR2I &aPosition, PCB_LAYER_ID aLayer, int aAccuracy=0) const
Test if the point hits one or more of the footprint elements on a given layer.
Definition: footprint.cpp:1677
VECTOR2I m_pos
Definition: footprint.h:1043
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource) const
Definition: footprint.h:327
std::vector< wxString > m_netTiePadGroups
Definition: footprint.h:1068
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Get a pad at aPosition on aLayerMask in the footprint.
Definition: footprint.cpp:1829
void Add3DModel(FP_3DMODEL *a3DModel)
Add a3DModel definition to the end of the 3D model list.
Definition: footprint.cpp:1917
void SetValue(const wxString &aValue)
Definition: footprint.h:629
GROUPS m_groups
Definition: footprint.h:1040
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.
Definition: footprint.cpp:1530
PCB_FIELD & Reference()
Definition: footprint.h:639
const PCB_FIELD & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:643
wxString GetReferenceAsString() const
Definition: footprint.h:611
wxString m_sheetfile
Definition: footprint.h:1082
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars for this footprint.
Definition: footprint.cpp:891
std::optional< int > m_solderMaskMargin
Definition: footprint.h:1073
SHAPE_POLY_SET m_courtyard_cache_front
Definition: footprint.h:1093
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:982
std::vector< const PAD * > GetPads(const wxString &aPadNumber, const PAD *aIgnore=nullptr) const
Definition: footprint.cpp:1845
void AutoPositionFields()
Position Reference and Value fields at the top and bottom of footprint's bounding box.
Definition: footprint.cpp:2599
wxString m_keywords
Definition: footprint.h:1079
const PCB_FIELD & Reference() const
Definition: footprint.h:644
void ClearAllNets()
Clear (i.e.
Definition: footprint.cpp:973
std::deque< PAD * > m_pads
Definition: footprint.h:1038
bool HasThroughHolePads() const
Definition: footprint.cpp:3319
void BuildCourtyardCaches(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Build complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:2870
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: footprint.cpp:1646
wxString GetFieldText(const wxString &aFieldName) const
Search for a field named aFieldName and returns text associated with this field.
Definition: footprint.cpp:567
EDA_ANGLE m_orient
Definition: footprint.h:1042
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1752
bool IsNetTie() const
Definition: footprint.h:297
wxString GetClass() const override
Return the class name.
Definition: footprint.h:874
const PCB_FIELDS & Fields() const
Definition: footprint.h:204
void IncrementReference(int aDelta)
Bump the current reference by aDelta.
Definition: footprint.cpp:2627
int GetFileFormatVersionAtLoad() const
Definition: footprint.h:778
std::optional< double > GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:284
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
Definition: footprint.cpp:2283
KIID m_link
Definition: footprint.h:1086
void RemoveField(const wxString &aFieldName)
Remove a user field from the footprint.
Definition: footprint.cpp:603
GROUPS & Groups()
Definition: footprint.h:215
wxString GetFilters() const
Definition: footprint.h:272
void SetSheetname(const wxString &aSheetname)
Definition: footprint.h:267
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: footprint.h:955
KIID GetLink() const
Definition: footprint.h:852
bool IsConflicting() const
Definition: footprint.cpp:885
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:220
const SHAPE_POLY_SET & GetCachedCourtyard(PCB_LAYER_ID aLayer) const
Return the cached courtyard area.
Definition: footprint.cpp:2861
PCB_FIELDS & Fields()
Definition: footprint.h:203
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
Test for validity of the name in a library of the footprint ( no spaces, dir separators ....
Definition: footprint.cpp:2220
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:258
bool TextOnly() const
Definition: footprint.cpp:1237
const wxString & GetValue() const
Definition: footprint.h:624
void CheckShortingPads(const std::function< void(const PAD *, const PAD *, int aErrorCode, const VECTOR2I &)> &aErrorHandler)
Check for overlapping, different-numbered, non-net-tie pads.
Definition: footprint.cpp:3092
double GetArea(int aPadding=0) const
Definition: footprint.cpp:1137
const PCB_FIELDS & GetFields() const
Definition: footprint.h:699
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:444
wxString m_filters
Definition: footprint.h:1083
const wxString & GetReference() const
Definition: footprint.h:602
void CheckNetTiePadGroups(const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition: footprint.cpp:3274
void SetFPIDAsString(const wxString &aFPID)
Definition: footprint.h:255
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: footprint.cpp:2015
void SetBoardOnly(bool aIsBoardOnly=true)
Definition: footprint.h:733
const std::vector< FP_3DMODEL > & Models() const
Definition: footprint.h:221
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition: footprint.h:279
PCB_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: footprint.cpp:518
timestamp_t m_lastEditTime
Definition: footprint.h:1084
const SHAPE_POLY_SET & GetCourtyard(PCB_LAYER_ID aLayer) const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.cpp:2847
int GetFlag() const
Definition: footprint.h:295
wxString m_sheetname
Definition: footprint.h:1081
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: footprint.cpp:2101
int m_fileFormatVersionAtLoad
Definition: footprint.h:1047
void SetLocalClearance(std::optional< int > aClearance)
Definition: footprint.h:276
const KIID_PATH & GetPath() const
Definition: footprint.h:263
std::optional< int > GetLocalSolderMaskMargin() const
Definition: footprint.h:278
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
Definition: footprint.h:282
wxString GetKeywords() const
Definition: footprint.h:260
bool operator==(const BOARD_ITEM &aOther) const override
Definition: footprint.cpp:3331
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: footprint.h:983
void CheckFootprintAttributes(const std::function< void(const wxString &)> &aErrorHandler)
Test if footprint attributes for type (SMD/Through hole/Other) match the expected type based on the p...
Definition: footprint.cpp:3049
virtual void swapData(BOARD_ITEM *aImage) override
Definition: footprint.cpp:3297
wxString GetNextPadNumber(const wxString &aLastPadName) const
Return the next available pad number in the footprint.
Definition: footprint.cpp:2579
bool IsPlaced() const
Definition: footprint.h:434
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:1060
VECTOR2I GetPosition() const override
Definition: footprint.h:224
DRAWINGS & GraphicalItems()
Definition: footprint.h:209
PCB_FIELDS m_fields
Definition: footprint.h:1036
HASH_128 m_courtyard_cache_front_hash
Definition: footprint.h:1095
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: footprint.cpp:1745
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1809
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1252
bool operator==(const FP_3DMODEL &aOther) const
Definition: footprint.h:106
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:101
double m_Opacity
Definition: footprint.h:102
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:100
FP_3DMODEL()
Definition: footprint.h:89
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:99
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:103
bool m_Show
Include model in rendering.
Definition: footprint.h:104
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:202
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
Definition: kiid.h:49
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:51
UTF8 Format() const
Definition: lib_id.cpp:118
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:36
static LSET AllLayersMask()
Definition: lset.cpp:701
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Definition: pad.h:54
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
Represent a set of closed polygons.
An abstract shape on 2D plane.
Definition: shape.h:126
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
#define _(s)
@ DEGREES_T
Definition: eda_angle.h:31
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:82
INCLUDE_NPTH_T
Definition: footprint.h:63
@ INCLUDE_NPTH
Definition: footprint.h:65
@ DO_NOT_INCLUDE_NPTH
Definition: footprint.h:64
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:74
@ FP_SMD
Definition: footprint.h:76
@ FP_DNP
Definition: footprint.h:83
@ FP_ALLOW_MISSING_COURTYARD
Definition: footprint.h:82
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:77
@ FP_BOARD_ONLY
Definition: footprint.h:79
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:78
@ FP_JUST_ADDED
Definition: footprint.h:80
@ FP_THROUGH_HOLE
Definition: footprint.h:75
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:81
#define FP_is_PLACED
In autoplace: footprint automatically placed.
Definition: footprint.h:406
#define FP_is_LOCKED
footprint LOCKED: no autoplace allowed
Definition: footprint.h:405
#define FP_PADS_are_LOCKED
Definition: footprint.h:408
#define FP_to_PLACE
In autoplace: footprint waiting for autoplace.
Definition: footprint.h:407
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: kiid.h:46
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:147
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:65
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
FLIP_DIRECTION
Definition: mirror.h:27
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247
std::vector< ZONE * > ZONES
Definition: pcb_io_eagle.h:47
bool operator()(const BOARD_ITEM *itemA, const BOARD_ITEM *itemB) const
Definition: footprint.cpp:3407
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3484
bool operator()(const ZONE *aFirst, const ZONE *aSecond) const
Definition: footprint.cpp:3587
A storage class for 128-bit hash value.
Definition: hash_128.h:36
MANDATORY_FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:47