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
505 void BuildNetTieCache();
506
510 const std::set<int>& GetNetTieCache( const BOARD_ITEM* aItem ) const
511 {
512 static const std::set<int> emptySet;
513
514 auto it = m_netTieCache.find( aItem );
515
516 if( it == m_netTieCache.end() )
517 return emptySet;
518
519 return it->second;
520 }
521
542 void TransformPadsToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
543 int aMaxError, ERROR_LOC aErrorLoc,
544 bool aSkipNPTHPadsWihNoCopper = false,
545 bool aSkipPlatedPads = false,
546 bool aSkipNonPlatedPads = false ) const;
547
562 void TransformFPShapesToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
563 int aError, ERROR_LOC aErrorLoc,
564 bool aIncludeText = true,
565 bool aIncludeShapes = true,
566 bool aIncludePrivateItems = false ) const;
567
571 void TransformFPTextToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
572 int aError, ERROR_LOC aErrorLoc ) const
573 {
574 TransformFPShapesToPolySet( aBuffer, aLayer, aClearance, aError, aErrorLoc, true, false );
575 }
576
580 void GetContextualTextVars( wxArrayString* aVars ) const;
581
587 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
588
590 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
591
592 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
593
603 bool HitTestAccurate( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
604
605 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
606
615 bool HitTestOnLayer( const VECTOR2I& aPosition, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
616
617 bool HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
618
622 const wxString& GetReference() const { return Reference().GetText(); }
623
628 void SetReference( const wxString& aReference ) { Reference().SetText( aReference ); }
629
630 // Property system doesn't like const references
631 wxString GetReferenceAsString() const
632 {
633 return GetReference();
634 }
635
639 void IncrementReference( int aDelta );
640
644 const wxString& GetValue() const { return Value().GetText(); }
645
649 void SetValue( const wxString& aValue ) { Value().SetText( aValue ); }
650
651 // Property system doesn't like const references
652 wxString GetValueAsString() const
653 {
654 return GetValue();
655 }
656
660
662 const PCB_FIELD& Value() const { return *GetField( VALUE_FIELD ); }
663 const PCB_FIELD& Reference() const { return *GetField( REFERENCE_FIELD ); }
664
665 //-----<Fields>-----------------------------------------------------------
666
675 PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldType );
676 const PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldNdx ) const;
677
685 PCB_FIELD* GetFieldById( int aFieldId );
686
694 PCB_FIELD* GetFieldByName( const wxString& aFieldName );
695
696 bool HasFieldByName( const wxString& aFieldName ) const;
697
703 wxString GetFieldText( const wxString& aFieldName ) const;
704
711 void GetFields( std::vector<PCB_FIELD*>& aVector, bool aVisibleOnly );
712
716 PCB_FIELDS GetFields() { return m_fields; }
717 const PCB_FIELDS& GetFields() const { return m_fields; }
718
726 PCB_FIELD* AddField( const PCB_FIELD& aField );
727
733 void RemoveField( const wxString& aFieldName );
734
738 int GetFieldCount() const { return (int) m_fields.size(); }
739
747 void ApplyDefaultSettings( const BOARD& board, bool aStyleFields, bool aStyleText,
748 bool aStyleShapes );
749
750 bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
751 void SetBoardOnly( bool aIsBoardOnly = true )
752 {
753 if( aIsBoardOnly )
755 else
756 m_attributes &= ~FP_BOARD_ONLY;
757 }
758
760 void SetExcludedFromPosFiles( bool aExclude = true )
761 {
762 if( aExclude )
764 else
765 m_attributes &= ~FP_EXCLUDE_FROM_POS_FILES;
766 }
767
769 void SetExcludedFromBOM( bool aExclude = true )
770 {
771 if( aExclude )
773 else
774 m_attributes &= ~FP_EXCLUDE_FROM_BOM;
775 }
776
778 void SetAllowMissingCourtyard( bool aAllow = true )
779 {
780 if( aAllow )
782 else
783 m_attributes &= ~FP_ALLOW_MISSING_COURTYARD;
784 }
785
786 bool IsDNP() const { return m_attributes & FP_DNP; }
787 void SetDNP( bool aDNP = true )
788 {
789 if( aDNP )
791 else
792 m_attributes &= ~FP_DNP;
793 }
794
795 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
797
807 PAD* FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe = nullptr ) const;
808
816 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
817
818 std::vector<const PAD*> GetPads( const wxString& aPadNumber,
819 const PAD* aIgnore = nullptr ) const;
820
828 unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
829
840 unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
841
845 std::set<wxString>
847
855 wxString GetNextPadNumber( const wxString& aLastPadName ) const;
856
860 void AutoPositionFields();
861
866 wxString GetTypeName() const;
867
868 double GetArea( int aPadding = 0 ) const;
869
870 KIID GetLink() const { return m_link; }
871 void SetLink( const KIID& aLink ) { m_link = aLink; }
872
873 BOARD_ITEM* Duplicate() const override;
874
880 BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
881
887 void Add3DModel( FP_3DMODEL* a3DModel );
888
889 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
890 const std::vector<KICAD_T>& aScanTypes ) override;
891
892 wxString GetClass() const override
893 {
894 return wxT( "FOOTPRINT" );
895 }
896
897 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
898
899 BITMAPS GetMenuImage() const override;
900
901 EDA_ITEM* Clone() const override;
902
904 void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const override;
905
907 void RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction,
908 int aDepth = 0 ) const override;
909
910 virtual std::vector<int> ViewGetLayers() const override;
911
912 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
913
914 virtual const BOX2I ViewBBox() const override;
915
923 static bool IsLibNameValid( const wxString& aName );
924
934 static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
935
939 bool FootprintNeedsUpdate( const FOOTPRINT* aLibFP, int aCompareFlags = 0,
940 REPORTER* aReporter = nullptr );
941
956 void SetInitialComments( wxArrayString* aInitialComments )
957 {
958 delete m_initial_comments;
959 m_initial_comments = aInitialComments;
960 }
961
968 double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
969
970 static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
971
973 const wxArrayString* GetInitialComments() const { return m_initial_comments; }
974
980 const SHAPE_POLY_SET& GetCourtyard( PCB_LAYER_ID aLayer ) const;
981
987 const SHAPE_POLY_SET& GetCachedCourtyard( PCB_LAYER_ID aLayer ) const;
988
995 void BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
996
997 // @copydoc BOARD_ITEM::GetEffectiveShape
998 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
999 FLASHING aFlash = FLASHING::DEFAULT ) const override;
1000
1002 {
1003 return static_cast<EMBEDDED_FILES*>( this );
1004 }
1005
1007 {
1008 return static_cast<const EMBEDDED_FILES*>( this );
1009 }
1010
1011 void EmbedFonts() override;
1012
1013 double Similarity( const BOARD_ITEM& aOther ) const override;
1014
1015 void SetComponentClass( const COMPONENT_CLASS* aClass ) { m_componentClass = aClass; }
1016
1018
1019 wxString GetComponentClassAsString() const;
1020
1021
1022 bool operator==( const BOARD_ITEM& aOther ) const override;
1023 bool operator==( const FOOTPRINT& aOther ) const;
1024
1025#if defined(DEBUG)
1026 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1027#endif
1028
1030 {
1031 bool operator()( const BOARD_ITEM* itemA, const BOARD_ITEM* itemB ) const;
1032 };
1033
1035 {
1036 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1037 };
1038 // TODO(JE) padstacks -- this code isn't used anywhere though
1039#if 0
1040 struct cmp_padstack
1041 {
1042 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1043 };
1044#endif
1046 {
1047 bool operator()( const ZONE* aFirst, const ZONE* aSecond ) const;
1048 };
1049
1050protected:
1051 virtual void swapData( BOARD_ITEM* aImage ) override;
1052
1053private:
1054 PCB_FIELDS m_fields;
1055 DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
1056 std::deque<PAD*> m_pads; // PAD items, owned by pointer
1057 ZONES m_zones; // PCB_ZONE items, owned by pointer
1058 GROUPS m_groups; // PCB_GROUP items, owned by pointer
1059
1060 EDA_ANGLE m_orient; // Orientation
1061 VECTOR2I m_pos; // Position of footprint on the board in internal units.
1062 LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
1063 int m_attributes; // Flag bits (see FOOTPRINT_ATTR_T)
1064 int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
1066
1067 // Bounding box caching strategy:
1068 // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
1069 // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
1070 // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
1071 // counter, and storing that as a timestamp for the various caches.
1072 // This means caches will get regenerated often -- but still far less often than if we had no
1073 // caches at all. The principal opitmization would be to change to dirty flag and make sure
1074 // that any edit that could affect the bounding boxes (including edits to the footprint
1075 // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
1076 // fragile.
1083
1084 // A list of pad groups, each of which is allowed to short nets within their group.
1085 // A pad group is a comma-separated list of pad numbers.
1086 std::vector<wxString> m_netTiePadGroups;
1087
1088 // A list of 1:N footprint item to allowed net numbers
1089 std::map<const BOARD_ITEM*, std::set<int>> m_netTieCache;
1090
1091 // Optional overrides
1093 std::optional<int> m_clearance;
1094 std::optional<int> m_solderMaskMargin; // Solder mask margin
1095 std::optional<int> m_solderPasteMargin; // Solder paste margin absolute value
1096 std::optional<double> m_solderPasteMarginRatio; // Solder mask margin ratio of pad size
1097 // The final margin is the sum of these 2 values
1098
1099 wxString m_libDescription; // File name and path for documentation file.
1100 wxString m_keywords; // Search keywords to find footprint in library.
1101 KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
1102 wxString m_sheetname; // Name of the sheet containing the symbol for this footprint
1103 wxString m_sheetfile; // File of the sheet containing the symbol for this footprint
1104 wxString m_filters; // Footprint filters from symbol
1106 int m_arflag; // Use to trace ratsnest and auto routing.
1107 KIID m_link; // Temporary logical link used during editing
1108 LSET m_privateLayers; // Layers visible only in the footprint editor
1109
1110 std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
1111 wxArrayString* m_initial_comments; // s-expression comments in the footprint,
1112 // lazily allocated only if needed for speed
1113
1114 SHAPE_POLY_SET m_courtyard_cache_front; // Note that a footprint can have both front and back
1115 SHAPE_POLY_SET m_courtyard_cache_back; // courtyards populated.
1118 mutable std::mutex m_courtyard_cache_mutex;
1119
1121};
1122
1123#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:51
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:98
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:269
bool FixUuids()
Old footprints do not always have a valid UUID (some can be set to null uuid) However null UUIDs,...
Definition: footprint.cpp:692
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:3873
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:2388
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:249
LIB_ID m_fpid
Definition: footprint.h:1062
wxString GetLibDescription() const
Definition: footprint.h:257
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:288
const COMPONENT_CLASS * m_componentClass
Definition: footprint.h:1120
void SetLink(const KIID &aLink)
Definition: footprint.h:871
KIID_PATH m_path
Definition: footprint.h:1101
bool IsBoardOnly() const
Definition: footprint.h:750
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: footprint.h:738
BOX2I m_cachedTextExcludedBBox
Definition: footprint.h:1079
const std::deque< PAD * > & Pads() const
Definition: footprint.h:207
bool IsDNP() const
Definition: footprint.h:786
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:1117
std::vector< PAD * > GetNetTiePads(PAD *aPad) const
Definition: footprint.cpp:3139
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:948
EDA_ANGLE GetOrientation() const
Definition: footprint.h:227
bool HasFieldByName(const wxString &aFieldName) const
Definition: footprint.cpp:578
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:385
void SetComponentClass(const COMPONENT_CLASS *aClass)
Definition: footprint.h:1015
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:1088
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:435
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:1092
BOX2I m_cachedBoundingBox
Definition: footprint.h:1077
static double GetCoverageArea(const BOARD_ITEM *aItem, const GENERAL_COLLECTOR &aCollector)
Definition: footprint.cpp:2699
bool IsExcludedFromBOM() const
Definition: footprint.h:768
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:2458
void SetFlag(int aFlag)
Definition: footprint.h:293
std::optional< double > m_solderPasteMarginRatio
Definition: footprint.h:1096
PCB_FIELD * GetFieldByName(const wxString &aFieldName)
Return a field in this symbol.
Definition: footprint.cpp:589
void SetDNP(bool aDNP=true)
Definition: footprint.h:787
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:2256
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1904
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:1441
std::optional< int > m_clearance
Definition: footprint.h:1093
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:637
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:3273
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:3186
void SetExcludedFromBOM(bool aExclude=true)
Definition: footprint.h:769
wxString GetSheetname() const
Definition: footprint.h:266
int m_fpStatus
Definition: footprint.h:1064
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:264
PCB_FIELDS GetFields()
Return a vector of fields from the symbol.
Definition: footprint.h:716
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: footprint.cpp:2200
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:1081
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:1923
void SetFilters(const wxString &aFilters)
Definition: footprint.h:273
void SetAllowMissingCourtyard(bool aAllow=true)
Definition: footprint.h:778
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:956
int m_attributes
Definition: footprint.h:1063
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:1658
std::vector< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:1110
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:2792
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:2497
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:2856
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2081
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:2069
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2107
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:3725
wxArrayString * m_initial_comments
Definition: footprint.h:1111
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2075
BOX2I GetFpPadsLocalBbox() const
Return the bounding box containing pads when the footprint is on the front side, orientation 0,...
Definition: footprint.cpp:1255
PCB_FIELD & Value()
read/write accessors:
Definition: footprint.h:658
const EMBEDDED_FILES * GetEmbeddedFiles() const
Definition: footprint.h:1006
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:2294
std::optional< int > m_solderPasteMargin
Definition: footprint.h:1095
void SetFileFormatVersionAtLoad(int aVersion)
Definition: footprint.h:795
std::mutex m_courtyard_cache_mutex
Definition: footprint.h:1118
void SetExcludedFromPosFiles(bool aExclude=true)
Definition: footprint.h:760
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:659
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:3084
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:3496
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:571
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
Definition: footprint.cpp:2414
FOOTPRINT & operator=(const FOOTPRINT &aOther)
Definition: footprint.cpp:824
int m_arflag
Definition: footprint.h:1106
double GetOrientationDegrees() const
Definition: footprint.h:243
BOARD_ITEM * Duplicate() const override
Create a copy of this BOARD_ITEM.
Definition: footprint.cpp:2484
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:1971
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:272
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:1017
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:652
bool AllowMissingCourtyard() const
Definition: footprint.h:777
const ZONES & Zones() const
Definition: footprint.h:213
wxString GetComponentClassAsString() const
Definition: footprint.cpp:3906
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:1486
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:3816
wxString GetTypeName() const
Get the type of footprint.
Definition: footprint.cpp:1243
DRAWINGS m_drawings
Definition: footprint.h:1055
bool NeedsPlaced() const
Definition: footprint.h:443
PCB_FIELD * GetFieldById(int aFieldId)
Return a field in this symbol.
Definition: footprint.cpp:567
SHAPE_POLY_SET m_courtyard_cache_back
Definition: footprint.h:1115
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:1080
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:628
bool IsLocked() const override
Definition: footprint.h:411
const GROUPS & Groups() const
Definition: footprint.h:216
bool IsExcludedFromPosFiles() const
Definition: footprint.h:759
void SetLayerAndFlip(PCB_LAYER_ID aLayer)
Used as Layer property setter – performs a flip if necessary to set the footprint layer.
Definition: footprint.cpp:2321
ZONES m_zones
Definition: footprint.h:1057
int m_hullCacheTimeStamp
Definition: footprint.h:1082
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:1954
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:2241
LSET m_privateLayers
Definition: footprint.h:1108
const std::set< int > & GetNetTieCache(const BOARD_ITEM *aItem) const
Get the set of net codes that are allowed to connect to a footprint item.
Definition: footprint.h:510
int GetLikelyAttribute() const
Returns the most likely attribute based on pads Either FP_THROUGH_HOLE/FP_SMD/OTHER(0)
Definition: footprint.cpp:1190
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: footprint.cpp:2284
static bool ClassOf(const EDA_ITEM *aItem)
Definition: footprint.h:136
wxString m_libDescription
Definition: footprint.h:1099
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:1720
VECTOR2I m_pos
Definition: footprint.h:1061
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource) const
Definition: footprint.h:327
std::vector< wxString > m_netTiePadGroups
Definition: footprint.h:1086
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Get a pad at aPosition on aLayerMask in the footprint.
Definition: footprint.cpp:1872
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
Definition: footprint.cpp:2144
void Add3DModel(FP_3DMODEL *a3DModel)
Add a3DModel definition to the end of the 3D model list.
Definition: footprint.cpp:1960
void SetValue(const wxString &aValue)
Definition: footprint.h:649
GROUPS m_groups
Definition: footprint.h:1058
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:1573
PCB_FIELD & Reference()
Definition: footprint.h:659
const PCB_FIELD & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:662
wxString GetReferenceAsString() const
Definition: footprint.h:631
wxString m_sheetfile
Definition: footprint.h:1103
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars for this footprint.
Definition: footprint.cpp:934
std::optional< int > m_solderMaskMargin
Definition: footprint.h:1094
SHAPE_POLY_SET m_courtyard_cache_front
Definition: footprint.h:1114
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:1025
std::vector< const PAD * > GetPads(const wxString &aPadNumber, const PAD *aIgnore=nullptr) const
Definition: footprint.cpp:1888
void AutoPositionFields()
Position Reference and Value fields at the top and bottom of footprint's bounding box.
Definition: footprint.cpp:2644
wxString m_keywords
Definition: footprint.h:1100
const PCB_FIELD & Reference() const
Definition: footprint.h:663
void ClearAllNets()
Clear (i.e.
Definition: footprint.cpp:1016
std::deque< PAD * > m_pads
Definition: footprint.h:1056
bool HasThroughHolePads() const
Definition: footprint.cpp:3431
void BuildCourtyardCaches(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Build complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:2915
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: footprint.cpp:1689
wxString GetFieldText(const wxString &aFieldName) const
Search for a field named aFieldName and returns text associated with this field.
Definition: footprint.cpp:604
EDA_ANGLE m_orient
Definition: footprint.h:1060
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1795
bool IsNetTie() const
Definition: footprint.h:297
wxString GetClass() const override
Return the class name.
Definition: footprint.h:892
const PCB_FIELDS & Fields() const
Definition: footprint.h:204
void IncrementReference(int aDelta)
Bump the current reference by aDelta.
Definition: footprint.cpp:2672
int GetFileFormatVersionAtLoad() const
Definition: footprint.h:796
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:2330
KIID m_link
Definition: footprint.h:1107
void RemoveField(const wxString &aFieldName)
Remove a user field from the footprint.
Definition: footprint.cpp:646
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:973
KIID GetLink() const
Definition: footprint.h:870
void BuildNetTieCache()
Cache the pads that are allowed to connect to each other in the footprint.
Definition: footprint.cpp:3017
bool IsConflicting() const
Definition: footprint.cpp:928
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:2906
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:2267
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:258
bool TextOnly() const
Definition: footprint.cpp:1280
const wxString & GetValue() const
Definition: footprint.h:644
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:3204
double GetArea(int aPadding=0) const
Definition: footprint.cpp:1180
const PCB_FIELDS & GetFields() const
Definition: footprint.h:717
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:444
wxString m_filters
Definition: footprint.h:1104
const wxString & GetReference() const
Definition: footprint.h:622
void CheckNetTiePadGroups(const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition: footprint.cpp:3386
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:2058
void SetBoardOnly(bool aIsBoardOnly=true)
Definition: footprint.h:751
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:555
timestamp_t m_lastEditTime
Definition: footprint.h:1105
const SHAPE_POLY_SET & GetCourtyard(PCB_LAYER_ID aLayer) const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.cpp:2892
int GetFlag() const
Definition: footprint.h:295
std::map< const BOARD_ITEM *, std::set< int > > m_netTieCache
Definition: footprint.h:1089
wxString m_sheetname
Definition: footprint.h:1102
int m_fileFormatVersionAtLoad
Definition: footprint.h:1065
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:3443
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: footprint.h:1001
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:3161
virtual void swapData(BOARD_ITEM *aImage) override
Definition: footprint.cpp:3409
wxString GetNextPadNumber(const wxString &aLastPadName) const
Return the next available pad number in the footprint.
Definition: footprint.cpp:2624
bool IsPlaced() const
Definition: footprint.h:434
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:1078
VECTOR2I GetPosition() const override
Definition: footprint.h:224
DRAWINGS & GraphicalItems()
Definition: footprint.h:209
PCB_FIELDS m_fields
Definition: footprint.h:1054
HASH_128 m_courtyard_cache_front_hash
Definition: footprint.h:1116
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:1788
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1852
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1295
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:711
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:3519
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3596
bool operator()(const ZONE *aFirst, const ZONE *aSecond) const
Definition: footprint.cpp:3699
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...
@ 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