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 The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
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
62namespace KIFONT {
63class OUTLINE_FONT;
64}
65
67{
69 INCLUDE_NPTH = true
70};
71
78{
80 FP_SMD = 0x0002,
83 FP_BOARD_ONLY = 0x0010, // Footprint has no corresponding symbol
84 FP_JUST_ADDED = 0x0020, // Footprint just added by netlist update
87 FP_DNP = 0x0100
88};
89
91{
92public:
94 // Initialize with sensible values
95 m_Scale { 1, 1, 1 },
96 m_Rotation { 0, 0, 0 },
97 m_Offset { 0, 0, 0 },
98 m_Opacity( 1.0 ),
99 m_Show( true )
100 {
101 }
102
106 double m_Opacity;
107 wxString m_Filename;
108 bool m_Show;
109
110 bool operator==( const FP_3DMODEL& aOther ) const
111 {
112 return m_Scale == aOther.m_Scale
113 && m_Rotation == aOther.m_Rotation
114 && m_Offset == aOther.m_Offset
115 && m_Opacity == aOther.m_Opacity
116 && m_Filename == aOther.m_Filename
117 && m_Show == aOther.m_Show;
118 }
119};
120
121
123{
124public:
125 FOOTPRINT( BOARD* parent );
126
127 FOOTPRINT( const FOOTPRINT& aFootprint );
128
129 // Move constructor and operator needed due to std containers inside the footprint
130 FOOTPRINT( FOOTPRINT&& aFootprint );
131
132 ~FOOTPRINT();
133
134 FOOTPRINT& operator=( const FOOTPRINT& aOther );
135 FOOTPRINT& operator=( FOOTPRINT&& aOther );
136
137 void Serialize( google::protobuf::Any &aContainer ) const override;
138 bool Deserialize( const google::protobuf::Any &aContainer ) override;
139
140 static inline bool ClassOf( const EDA_ITEM* aItem )
141 {
142 return aItem && aItem->Type() == PCB_FOOTPRINT_T;
143 }
144
146 void SetPrivateLayers( LSET aLayers ) { m_privateLayers = aLayers; }
147
149 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
150 bool aSkipConnectivity = false ) override;
151
153 void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
154
162 void ClearAllNets();
163
171 bool FixUuids();
172
183
190
191 bool TextOnly() const;
192
193 // Virtual function
194 const BOX2I GetBoundingBox() const override;
195 const BOX2I GetBoundingBox( bool aIncludeText ) const;
196
200 const BOX2I GetLayerBoundingBox( LSET aLayers ) const;
201
202 VECTOR2I GetCenter() const override { return GetBoundingBox( false ).GetCenter(); }
203
204 std::deque<PAD*>& Pads() { return m_pads; }
205 const std::deque<PAD*>& Pads() const { return m_pads; }
206
207 DRAWINGS& GraphicalItems() { return m_drawings; }
208 const DRAWINGS& GraphicalItems() const { return m_drawings; }
209
210 ZONES& Zones() { return m_zones; }
211 const ZONES& Zones() const { return m_zones; }
212
213 GROUPS& Groups() { return m_groups; }
214 const GROUPS& Groups() const { return m_groups; }
215
216 bool HasThroughHolePads() const;
217
218 std::vector<FP_3DMODEL>& Models() { return m_3D_Drawings; }
219 const std::vector<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
220
221 void SetPosition( const VECTOR2I& aPos ) override;
222 VECTOR2I GetPosition() const override { return m_pos; }
223
224 void SetOrientation( const EDA_ANGLE& aNewAngle );
226
231 void SetLayerAndFlip( PCB_LAYER_ID aLayer );
232
233 // to make property magic work
234 PCB_LAYER_ID GetLayer() const override { return BOARD_ITEM::GetLayer(); }
235
236 // For property system:
237 void SetOrientationDegrees( double aOrientation )
238 {
239 SetOrientation( EDA_ANGLE( aOrientation, DEGREES_T ) );
240 }
242 {
243 return m_orient.AsDegrees();
244 }
245
246 const LIB_ID& GetFPID() const { return m_fpid; }
247 void SetFPID( const LIB_ID& aFPID )
248 {
249 m_fpid = aFPID;
250 }
251
252 wxString GetFPIDAsString() const { return m_fpid.Format(); }
253 void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); }
254
255 wxString GetLibDescription() const { return m_libDescription; }
256 void SetLibDescription( const wxString& aDesc ) { m_libDescription = aDesc; }
257
258 wxString GetKeywords() const { return m_keywords; }
259 void SetKeywords( const wxString& aKeywords ) { m_keywords = aKeywords; }
260
261 const KIID_PATH& GetPath() const { return m_path; }
262 void SetPath( const KIID_PATH& aPath ) { m_path = aPath; }
263
264 wxString GetSheetname() const { return m_sheetname; }
265 void SetSheetname( const wxString& aSheetname ) { m_sheetname = aSheetname; }
266
267 wxString GetSheetfile() const { return m_sheetfile; }
268 void SetSheetfile( const wxString& aSheetfile ) { m_sheetfile = aSheetfile; }
269
270 wxString GetFilters() const { return m_filters; }
271 void SetFilters( const wxString& aFilters ) { m_filters = aFilters; }
272
273 std::optional<int> GetLocalClearance() const { return m_clearance; }
274 void SetLocalClearance( std::optional<int> aClearance ) { m_clearance = aClearance; }
275
276 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
277 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
278
279 std::optional<int> GetLocalSolderPasteMargin() const { return m_solderPasteMargin; }
280 void SetLocalSolderPasteMargin( std::optional<int> aMargin ) { m_solderPasteMargin = aMargin; }
281
282 std::optional<double> GetLocalSolderPasteMarginRatio() const { return m_solderPasteMarginRatio; }
283 void SetLocalSolderPasteMarginRatio( std::optional<double> aRatio ) { m_solderPasteMarginRatio = aRatio; }
284
287
288 int GetAttributes() const { return m_attributes; }
289 void SetAttributes( int aAttributes ) { m_attributes = aAttributes; }
290
291 void SetFlag( int aFlag ) { m_arflag = aFlag; }
292 void IncrementFlag() { m_arflag += 1; }
293 int GetFlag() const { return m_arflag; }
294
295 bool IsNetTie() const
296 {
297 for( const wxString& group : m_netTiePadGroups )
298 {
299 if( !group.IsEmpty() )
300 return true;
301 }
302
303 return false;
304 }
305
306 std::optional<int> GetLocalClearance( wxString* aSource ) const
307 {
308 if( m_clearance.has_value() && aSource )
309 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
310
311 return m_clearance;
312 }
313
320 std::optional<int> GetClearanceOverrides( wxString* aSource ) const
321 {
322 return GetLocalClearance( aSource );
323 }
324
326 {
327 if( m_zoneConnection != ZONE_CONNECTION::INHERITED && aSource )
328 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
329
330 return m_zoneConnection;
331 }
332
337 const std::vector<wxString>& GetNetTiePadGroups() const { return m_netTiePadGroups; }
338
340 {
341 m_netTiePadGroups.clear();
342 }
343
344 void AddNetTiePadGroup( const wxString& aGroup )
345 {
346 m_netTiePadGroups.emplace_back( aGroup );
347 }
348
353 std::map<wxString, int> MapPadNumbersToNetTieGroups() const;
354
358 std::vector<PAD*> GetNetTiePads( PAD* aPad ) const;
359
365 int GetLikelyAttribute() const;
366
367 void Move( const VECTOR2I& aMoveVector ) override;
368
369 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
370
371 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
372
384 void MoveAnchorPosition( const VECTOR2I& aMoveVector );
385
389 bool IsFlipped() const { return GetLayer() == B_Cu; }
390
395 PCB_LAYER_ID GetSide() const;
396
400 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
401
402// m_footprintStatus bits:
403#define FP_is_LOCKED 0x01
404#define FP_is_PLACED 0x02
405#define FP_to_PLACE 0x04
406#define FP_PADS_are_LOCKED 0x08
407
408
409 bool IsLocked() const override
410 {
411 return ( m_fpStatus & FP_is_LOCKED ) != 0;
412 }
413
419 void SetLocked( bool isLocked ) override
420 {
421 if( isLocked )
423 else
424 m_fpStatus &= ~FP_is_LOCKED;
425 }
426
430 bool IsConflicting() const;
431
432 bool IsPlaced() const { return m_fpStatus & FP_is_PLACED; }
433 void SetIsPlaced( bool isPlaced )
434 {
435 if( isPlaced )
437 else
438 m_fpStatus &= ~FP_is_PLACED;
439 }
440
441 bool NeedsPlaced() const { return m_fpStatus & FP_to_PLACE; }
442 void SetNeedsPlaced( bool needsPlaced )
443 {
444 if( needsPlaced )
446 else
447 m_fpStatus &= ~FP_to_PLACE;
448 }
449
451
462 void CheckFootprintAttributes( const std::function<void( const wxString& )>& aErrorHandler );
463
470 void CheckPads( UNITS_PROVIDER* aUnitsProvider,
471 const std::function<void( const PAD*, int, const wxString& )>& aErrorHandler );
472
478 void CheckShortingPads( const std::function<void( const PAD*, const PAD*, int aErrorCode,
479 const VECTOR2I& )>& aErrorHandler );
480
487 void CheckNetTies( const std::function<void( const BOARD_ITEM* aItem,
488 const BOARD_ITEM* bItem,
489 const BOARD_ITEM* cItem,
490 const VECTOR2I& )>& aErrorHandler );
491
498 void CheckNetTiePadGroups( const std::function<void( const wxString& )>& aErrorHandler );
499
503 void BuildNetTieCache();
504
508 const std::set<int>& GetNetTieCache( const BOARD_ITEM* aItem ) const
509 {
510 static const std::set<int> emptySet;
511
512 auto it = m_netTieCache.find( aItem );
513
514 if( it == m_netTieCache.end() )
515 return emptySet;
516
517 return it->second;
518 }
519
540 void TransformPadsToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
541 int aMaxError, ERROR_LOC aErrorLoc,
542 bool aSkipNPTHPadsWihNoCopper = false,
543 bool aSkipPlatedPads = false,
544 bool aSkipNonPlatedPads = false ) const;
545
560 void TransformFPShapesToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
561 int aError, ERROR_LOC aErrorLoc,
562 bool aIncludeText = true,
563 bool aIncludeShapes = true,
564 bool aIncludePrivateItems = false ) const;
565
569 void TransformFPTextToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
570 int aError, ERROR_LOC aErrorLoc ) const
571 {
572 TransformFPShapesToPolySet( aBuffer, aLayer, aClearance, aError, aErrorLoc, true, false );
573 }
574
578 void GetContextualTextVars( wxArrayString* aVars ) const;
579
585 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
586
588 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
589
590 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
591
601 bool HitTestAccurate( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
602
603 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
604
613 bool HitTestOnLayer( const VECTOR2I& aPosition, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
614
615 bool HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
616
620 const wxString& GetReference() const { return Reference().GetText(); }
621
626 void SetReference( const wxString& aReference ) { Reference().SetText( aReference ); }
627
628 // Property system doesn't like const references
629 wxString GetReferenceAsString() const
630 {
631 return GetReference();
632 }
633
637 void IncrementReference( int aDelta );
638
642 const wxString& GetValue() const { return Value().GetText(); }
643
647 void SetValue( const wxString& aValue ) { Value().SetText( aValue ); }
648
649 // Property system doesn't like const references
650 wxString GetValueAsString() const
651 {
652 return GetValue();
653 }
654
658
660 const PCB_FIELD& Value() const { return *GetField( VALUE_FIELD ); }
661 const PCB_FIELD& Reference() const { return *GetField( REFERENCE_FIELD ); }
662
663 //-----<Fields>-----------------------------------------------------------
664
673 PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldType );
674 const PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldNdx ) const;
675
683 PCB_FIELD* GetFieldById( int aFieldId );
684
692 PCB_FIELD* GetFieldByName( const wxString& aFieldName );
693
694 bool HasFieldByName( const wxString& aFieldName ) const;
695
701 wxString GetFieldText( const wxString& aFieldName ) const;
702
709 void GetFields( std::vector<PCB_FIELD*>& aVector, bool aVisibleOnly ) const;
710
716 std::vector<PCB_FIELD*> GetFields( bool aVisibleOnly = false ) const;
717
721 void ClearFields() { m_fields.clear(); }
722
730 PCB_FIELD* AddField( const PCB_FIELD& aField );
731
737 void RemoveField( const wxString& aFieldName );
738
742 int GetNextFieldId() const { return m_fields.size(); }
743
751 void ApplyDefaultSettings( const BOARD& board, bool aStyleFields, bool aStyleText,
752 bool aStyleShapes );
753
754 bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
755 void SetBoardOnly( bool aIsBoardOnly = true )
756 {
757 if( aIsBoardOnly )
759 else
760 m_attributes &= ~FP_BOARD_ONLY;
761 }
762
764 void SetExcludedFromPosFiles( bool aExclude = true )
765 {
766 if( aExclude )
768 else
769 m_attributes &= ~FP_EXCLUDE_FROM_POS_FILES;
770 }
771
773 void SetExcludedFromBOM( bool aExclude = true )
774 {
775 if( aExclude )
777 else
778 m_attributes &= ~FP_EXCLUDE_FROM_BOM;
779 }
780
782 void SetAllowMissingCourtyard( bool aAllow = true )
783 {
784 if( aAllow )
786 else
787 m_attributes &= ~FP_ALLOW_MISSING_COURTYARD;
788 }
789
790 bool IsDNP() const { return m_attributes & FP_DNP; }
791 void SetDNP( bool aDNP = true )
792 {
793 if( aDNP )
795 else
796 m_attributes &= ~FP_DNP;
797 }
798
799 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
801
811 PAD* FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe = nullptr ) const;
812
820 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
821
822 std::vector<const PAD*> GetPads( const wxString& aPadNumber,
823 const PAD* aIgnore = nullptr ) const;
824
832 unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
833
844 unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
845
849 std::set<wxString>
851
859 wxString GetNextPadNumber( const wxString& aLastPadName ) const;
860
864 void AutoPositionFields();
865
870 wxString GetTypeName() const;
871
872 double GetArea( int aPadding = 0 ) const;
873
874 KIID GetLink() const { return m_link; }
875 void SetLink( const KIID& aLink ) { m_link = aLink; }
876
877 BOARD_ITEM* Duplicate() const override;
878
884 BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
885
891 void Add3DModel( FP_3DMODEL* a3DModel );
892
893 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
894 const std::vector<KICAD_T>& aScanTypes ) override;
895
896 wxString GetClass() const override
897 {
898 return wxT( "FOOTPRINT" );
899 }
900
901 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
902
903 BITMAPS GetMenuImage() const override;
904
905 EDA_ITEM* Clone() const override;
906
908 void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const override;
909
911 void RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction,
912 int aDepth = 0 ) const override;
913
914 virtual std::vector<int> ViewGetLayers() const override;
915
916 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
917
918 virtual const BOX2I ViewBBox() const override;
919
927 static bool IsLibNameValid( const wxString& aName );
928
938 static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
939
943 bool FootprintNeedsUpdate( const FOOTPRINT* aLibFP, int aCompareFlags = 0,
944 REPORTER* aReporter = nullptr );
945
960 void SetInitialComments( wxArrayString* aInitialComments )
961 {
962 delete m_initial_comments;
963 m_initial_comments = aInitialComments;
964 }
965
972 double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
973
974 static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
975
977 const wxArrayString* GetInitialComments() const { return m_initial_comments; }
978
984 const SHAPE_POLY_SET& GetCourtyard( PCB_LAYER_ID aLayer ) const;
985
991 const SHAPE_POLY_SET& GetCachedCourtyard( PCB_LAYER_ID aLayer ) const;
992
999 void BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
1000
1001 // @copydoc BOARD_ITEM::GetEffectiveShape
1002 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
1003 FLASHING aFlash = FLASHING::DEFAULT ) const override;
1004
1006 {
1007 return static_cast<EMBEDDED_FILES*>( this );
1008 }
1009
1011 {
1012 return static_cast<const EMBEDDED_FILES*>( this );
1013 }
1014
1018 std::set<KIFONT::OUTLINE_FONT*> GetFonts() const override;
1019
1020 void EmbedFonts() override;
1021
1022 double Similarity( const BOARD_ITEM& aOther ) const override;
1023
1024 void SetComponentClass( const COMPONENT_CLASS* aClass ) { m_componentClass = aClass; }
1025
1027
1028 wxString GetComponentClassAsString() const;
1029
1030
1031 bool operator==( const BOARD_ITEM& aOther ) const override;
1032 bool operator==( const FOOTPRINT& aOther ) const;
1033
1034#if defined(DEBUG)
1035 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1036#endif
1037
1039 {
1040 bool operator()( const BOARD_ITEM* itemA, const BOARD_ITEM* itemB ) const;
1041 };
1042
1044 {
1045 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1046 };
1047 // TODO(JE) padstacks -- this code isn't used anywhere though
1048#if 0
1049 struct cmp_padstack
1050 {
1051 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1052 };
1053#endif
1055 {
1056 bool operator()( const ZONE* aFirst, const ZONE* aSecond ) const;
1057 };
1058
1059protected:
1060 virtual void swapData( BOARD_ITEM* aImage ) override;
1061
1062private:
1063 PCB_FIELDS m_fields;
1064 DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
1065 std::deque<PAD*> m_pads; // PAD items, owned by pointer
1066 ZONES m_zones; // PCB_ZONE items, owned by pointer
1067 GROUPS m_groups; // PCB_GROUP items, owned by pointer
1068
1069 EDA_ANGLE m_orient; // Orientation
1070 VECTOR2I m_pos; // Position of footprint on the board in internal units.
1071 LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
1072 int m_attributes; // Flag bits (see FOOTPRINT_ATTR_T)
1073 int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
1075
1076 // Bounding box caching strategy:
1077 // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
1078 // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
1079 // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
1080 // counter, and storing that as a timestamp for the various caches.
1081 // This means caches will get regenerated often -- but still far less often than if we had no
1082 // caches at all. The principal opitmization would be to change to dirty flag and make sure
1083 // that any edit that could affect the bounding boxes (including edits to the footprint
1084 // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
1085 // fragile.
1092
1093 // A list of pad groups, each of which is allowed to short nets within their group.
1094 // A pad group is a comma-separated list of pad numbers.
1095 std::vector<wxString> m_netTiePadGroups;
1096
1097 // A list of 1:N footprint item to allowed net numbers
1098 std::map<const BOARD_ITEM*, std::set<int>> m_netTieCache;
1099
1100 // Optional overrides
1102 std::optional<int> m_clearance;
1103 std::optional<int> m_solderMaskMargin; // Solder mask margin
1104 std::optional<int> m_solderPasteMargin; // Solder paste margin absolute value
1105 std::optional<double> m_solderPasteMarginRatio; // Solder mask margin ratio of pad size
1106 // The final margin is the sum of these 2 values
1107
1108 wxString m_libDescription; // File name and path for documentation file.
1109 wxString m_keywords; // Search keywords to find footprint in library.
1110 KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
1111 wxString m_sheetname; // Name of the sheet containing the symbol for this footprint
1112 wxString m_sheetfile; // File of the sheet containing the symbol for this footprint
1113 wxString m_filters; // Footprint filters from symbol
1115 int m_arflag; // Use to trace ratsnest and auto routing.
1116 KIID m_link; // Temporary logical link used during editing
1117 LSET m_privateLayers; // Layers visible only in the footprint editor
1118
1119 std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
1120 wxArrayString* m_initial_comments; // s-expression comments in the footprint,
1121 // lazily allocated only if needed for speed
1122
1123 SHAPE_POLY_SET m_courtyard_cache_front; // Note that a footprint can have both front and back
1124 SHAPE_POLY_SET m_courtyard_cache_back; // courtyards populated.
1127 mutable std::mutex m_courtyard_cache_mutex;
1128
1130};
1131
1132#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:239
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:295
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:268
bool FixUuids()
Old footprints do not always have a valid UUID (some can be set to null uuid) However null UUIDs,...
Definition: footprint.cpp:731
std::optional< int > GetClearanceOverrides(wxString *aSource) const
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
Definition: footprint.h:320
void EmbedFonts() override
Definition: footprint.cpp:3991
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:2451
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:247
LIB_ID m_fpid
Definition: footprint.h:1071
wxString GetLibDescription() const
Definition: footprint.h:255
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:286
const COMPONENT_CLASS * m_componentClass
Definition: footprint.h:1129
void SetLink(const KIID &aLink)
Definition: footprint.h:875
KIID_PATH m_path
Definition: footprint.h:1110
bool IsBoardOnly() const
Definition: footprint.h:754
BOX2I m_cachedTextExcludedBBox
Definition: footprint.h:1088
const std::deque< PAD * > & Pads() const
Definition: footprint.h:205
bool IsDNP() const
Definition: footprint.h:790
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:419
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: footprint.h:202
HASH_128 m_courtyard_cache_back_hash
Definition: footprint.h:1126
std::vector< PAD * > GetNetTiePads(PAD *aPad) const
Definition: footprint.cpp:3225
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:1002
EDA_ANGLE GetOrientation() const
Definition: footprint.h:225
bool HasFieldByName(const wxString &aFieldName) const
Definition: footprint.cpp:604
ZONES & Zones()
Definition: footprint.h:210
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: footprint.cpp:405
void SetComponentClass(const COMPONENT_CLASS *aClass)
Definition: footprint.h:1024
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:1142
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:433
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:1101
BOX2I m_cachedBoundingBox
Definition: footprint.h:1086
static double GetCoverageArea(const BOARD_ITEM *aItem, const GENERAL_COLLECTOR &aCollector)
Definition: footprint.cpp:2785
bool IsExcludedFromBOM() const
Definition: footprint.h:772
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:2539
void SetFlag(int aFlag)
Definition: footprint.h:291
std::optional< double > m_solderPasteMarginRatio
Definition: footprint.h:1105
PCB_FIELD * GetFieldByName(const wxString &aFieldName)
Return a field in this symbol.
Definition: footprint.cpp:615
void SetDNP(bool aDNP=true)
Definition: footprint.h:791
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:2316
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1958
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
Definition: footprint.h:283
void IncrementFlag()
Definition: footprint.h:292
const BOX2I GetLayerBoundingBox(LSET aLayers) const
Return the bounding box of the footprint on a given set of layers.
Definition: footprint.cpp:1495
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: footprint.cpp:2260
std::optional< int > m_clearance
Definition: footprint.h:1102
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:673
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:3359
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:3272
void SetExcludedFromBOM(bool aExclude=true)
Definition: footprint.h:773
wxString GetSheetname() const
Definition: footprint.h:264
int m_fpStatus
Definition: footprint.h:1073
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:262
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:1090
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:1977
void SetFilters(const wxString &aFilters)
Definition: footprint.h:271
void SetAllowMissingCourtyard(bool aAllow=true)
Definition: footprint.h:782
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:259
const DRAWINGS & GraphicalItems() const
Definition: footprint.h:208
void SetInitialComments(wxArrayString *aInitialComments)
Take ownership of caller's heap allocated aInitialComments block.
Definition: footprint.h:960
int m_attributes
Definition: footprint.h:1072
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:1712
std::vector< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:1119
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:2878
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:2583
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:2942
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2135
void SetAttributes(int aAttributes)
Definition: footprint.h:289
void SetSheetfile(const wxString &aSheetfile)
Definition: footprint.h:268
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: footprint.cpp:2123
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2164
std::optional< int > GetLocalSolderPasteMargin() const
Definition: footprint.h:279
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:3814
wxArrayString * m_initial_comments
Definition: footprint.h:1120
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2129
BOX2I GetFpPadsLocalBbox() const
Return the bounding box containing pads when the footprint is on the front side, orientation 0,...
Definition: footprint.cpp:1309
PCB_FIELD & Value()
read/write accessors:
Definition: footprint.h:656
const EMBEDDED_FILES * GetEmbeddedFiles() const
Definition: footprint.h:1010
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:2354
std::optional< int > m_solderPasteMargin
Definition: footprint.h:1104
void SetFileFormatVersionAtLoad(int aVersion)
Definition: footprint.h:799
std::mutex m_courtyard_cache_mutex
Definition: footprint.h:1127
void SetExcludedFromPosFiles(bool aExclude=true)
Definition: footprint.h:764
void SetOrientationDegrees(double aOrientation)
Definition: footprint.h:237
int GetNextFieldId() const
Return the next ID for a field for this footprint.
Definition: footprint.h:742
void SetPrivateLayers(LSET aLayers)
Adds an item to the container.
Definition: footprint.h:146
void ApplyDefaultSettings(const BOARD &board, bool aStyleFields, bool aStyleText, bool aStyleShapes)
Apply default board settings to the footprint field text properties.
Definition: footprint.cpp:695
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:3170
std::optional< int > GetLocalClearance() const
Definition: footprint.h:273
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:3585
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:569
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
Definition: footprint.cpp:2485
FOOTPRINT & operator=(const FOOTPRINT &aOther)
Definition: footprint.cpp:871
int m_arflag
Definition: footprint.h:1115
double GetOrientationDegrees() const
Definition: footprint.h:241
BOARD_ITEM * Duplicate() const override
Create a copy of this BOARD_ITEM.
Definition: footprint.cpp:2570
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:2025
std::deque< PAD * > & Pads()
Definition: footprint.h:204
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition: footprint.cpp:289
int GetAttributes() const
Definition: footprint.h:288
std::optional< int > GetLocalClearance(wxString *aSource) const
Definition: footprint.h:306
const COMPONENT_CLASS * GetComponentClass() const
Definition: footprint.h:1026
void SetLocalZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:285
void ClearNetTiePadGroups()
Definition: footprint.h:339
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:234
LSET GetPrivateLayers() const
Definition: footprint.h:145
wxString GetFPIDAsString() const
Definition: footprint.h:252
wxString GetValueAsString() const
Definition: footprint.h:650
bool AllowMissingCourtyard() const
Definition: footprint.h:781
const ZONES & Zones() const
Definition: footprint.h:211
wxString GetComponentClassAsString() const
Definition: footprint.cpp:4003
bool IsFlipped() const
Definition: footprint.h:389
wxString GetSheetfile() const
Definition: footprint.h:267
SHAPE_POLY_SET GetBoundingHull() const
Return a bounding polygon for the shapes and pads in the footprint.
Definition: footprint.cpp:1540
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:3905
wxString GetTypeName() const
Get the type of footprint.
Definition: footprint.cpp:1297
DRAWINGS m_drawings
Definition: footprint.h:1064
bool NeedsPlaced() const
Definition: footprint.h:441
PCB_FIELD * GetFieldById(int aFieldId)
Return a field in this symbol.
Definition: footprint.cpp:593
SHAPE_POLY_SET m_courtyard_cache_back
Definition: footprint.h:1124
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:1089
const std::vector< wxString > & GetNetTiePadGroups() const
Definition: footprint.h:337
const LIB_ID & GetFPID() const
Definition: footprint.h:246
void SetReference(const wxString &aReference)
Definition: footprint.h:626
bool IsLocked() const override
Definition: footprint.h:409
const GROUPS & Groups() const
Definition: footprint.h:214
bool IsExcludedFromPosFiles() const
Definition: footprint.h:763
void SetLayerAndFlip(PCB_LAYER_ID aLayer)
Used as Layer property setter – performs a flip if necessary to set the footprint layer.
Definition: footprint.cpp:2380
ZONES m_zones
Definition: footprint.h:1066
int m_hullCacheTimeStamp
Definition: footprint.h:1091
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:2008
void AddNetTiePadGroup(const wxString &aGroup)
Definition: footprint.h:344
bool LegacyPadsLocked() const
Definition: footprint.h:450
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: footprint.cpp:2301
LSET m_privateLayers
Definition: footprint.h:1117
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:508
int GetLikelyAttribute() const
Returns the most likely attribute based on pads Either FP_THROUGH_HOLE/FP_SMD/OTHER(0)
Definition: footprint.cpp:1244
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: footprint.cpp:2344
static bool ClassOf(const EDA_ITEM *aItem)
Definition: footprint.h:140
wxString m_libDescription
Definition: footprint.h:1108
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:1774
VECTOR2I m_pos
Definition: footprint.h:1070
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource) const
Definition: footprint.h:325
std::vector< wxString > m_netTiePadGroups
Definition: footprint.h:1095
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Get a pad at aPosition on aLayerMask in the footprint.
Definition: footprint.cpp:1926
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
Definition: footprint.cpp:2204
std::set< KIFONT::OUTLINE_FONT * > GetFonts() const override
Get a list of outline fonts referenced in the footprint.
Definition: footprint.cpp:3962
void Add3DModel(FP_3DMODEL *a3DModel)
Add a3DModel definition to the end of the 3D model list.
Definition: footprint.cpp:2014
void SetValue(const wxString &aValue)
Definition: footprint.h:647
GROUPS m_groups
Definition: footprint.h:1067
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:1627
PCB_FIELD & Reference()
Definition: footprint.h:657
const PCB_FIELD & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:660
wxString GetReferenceAsString() const
Definition: footprint.h:629
wxString m_sheetfile
Definition: footprint.h:1112
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars for this footprint.
Definition: footprint.cpp:988
std::optional< int > m_solderMaskMargin
Definition: footprint.h:1103
SHAPE_POLY_SET m_courtyard_cache_front
Definition: footprint.h:1123
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:1079
std::vector< const PAD * > GetPads(const wxString &aPadNumber, const PAD *aIgnore=nullptr) const
Definition: footprint.cpp:1942
void AutoPositionFields()
Position Reference and Value fields at the top and bottom of footprint's bounding box.
Definition: footprint.cpp:2730
wxString m_keywords
Definition: footprint.h:1109
const PCB_FIELD & Reference() const
Definition: footprint.h:661
void ClearAllNets()
Clear (i.e.
Definition: footprint.cpp:1070
std::deque< PAD * > m_pads
Definition: footprint.h:1065
bool HasThroughHolePads() const
Definition: footprint.cpp:3517
void BuildCourtyardCaches(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Build complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:3001
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: footprint.cpp:1743
wxString GetFieldText(const wxString &aFieldName) const
Search for a field named aFieldName and returns text associated with this field.
Definition: footprint.cpp:630
EDA_ANGLE m_orient
Definition: footprint.h:1069
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1849
bool IsNetTie() const
Definition: footprint.h:295
wxString GetClass() const override
Return the class name.
Definition: footprint.h:896
void IncrementReference(int aDelta)
Bump the current reference by aDelta.
Definition: footprint.cpp:2758
int GetFileFormatVersionAtLoad() const
Definition: footprint.h:800
std::optional< double > GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:282
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
Definition: footprint.cpp:2389
KIID m_link
Definition: footprint.h:1116
void RemoveField(const wxString &aFieldName)
Remove a user field from the footprint.
Definition: footprint.cpp:682
GROUPS & Groups()
Definition: footprint.h:213
wxString GetFilters() const
Definition: footprint.h:270
void SetSheetname(const wxString &aSheetname)
Definition: footprint.h:265
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: footprint.h:977
KIID GetLink() const
Definition: footprint.h:874
void GetFields(std::vector< PCB_FIELD * > &aVector, bool aVisibleOnly) const
Populate a std::vector with PCB_TEXTs.
Definition: footprint.cpp:667
void BuildNetTieCache()
Cache the pads that are allowed to connect to each other in the footprint.
Definition: footprint.cpp:3103
bool IsConflicting() const
Definition: footprint.cpp:982
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:218
const SHAPE_POLY_SET & GetCachedCourtyard(PCB_LAYER_ID aLayer) const
Return the cached courtyard area.
Definition: footprint.cpp:2992
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:2327
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:256
bool TextOnly() const
Definition: footprint.cpp:1334
const wxString & GetValue() const
Definition: footprint.h:642
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:3290
double GetArea(int aPadding=0) const
Definition: footprint.cpp:1234
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:442
wxString m_filters
Definition: footprint.h:1113
const wxString & GetReference() const
Definition: footprint.h:620
void CheckNetTiePadGroups(const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition: footprint.cpp:3472
void SetFPIDAsString(const wxString &aFPID)
Definition: footprint.h:253
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: footprint.cpp:2112
void SetBoardOnly(bool aIsBoardOnly=true)
Definition: footprint.h:755
const std::vector< FP_3DMODEL > & Models() const
Definition: footprint.h:219
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition: footprint.h:277
PCB_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: footprint.cpp:575
timestamp_t m_lastEditTime
Definition: footprint.h:1114
const SHAPE_POLY_SET & GetCourtyard(PCB_LAYER_ID aLayer) const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.cpp:2978
int GetFlag() const
Definition: footprint.h:293
std::map< const BOARD_ITEM *, std::set< int > > m_netTieCache
Definition: footprint.h:1098
wxString m_sheetname
Definition: footprint.h:1111
int m_fileFormatVersionAtLoad
Definition: footprint.h:1074
void SetLocalClearance(std::optional< int > aClearance)
Definition: footprint.h:274
const KIID_PATH & GetPath() const
Definition: footprint.h:261
std::optional< int > GetLocalSolderMaskMargin() const
Definition: footprint.h:276
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
Definition: footprint.h:280
wxString GetKeywords() const
Definition: footprint.h:258
bool operator==(const BOARD_ITEM &aOther) const override
Definition: footprint.cpp:3529
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: footprint.h:1005
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:3247
virtual void swapData(BOARD_ITEM *aImage) override
Definition: footprint.cpp:3495
wxString GetNextPadNumber(const wxString &aLastPadName) const
Return the next available pad number in the footprint.
Definition: footprint.cpp:2710
bool IsPlaced() const
Definition: footprint.h:432
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:1087
VECTOR2I GetPosition() const override
Definition: footprint.h:222
DRAWINGS & GraphicalItems()
Definition: footprint.h:207
PCB_FIELDS m_fields
Definition: footprint.h:1063
void ClearFields()
Clears all fields from the footprint.
Definition: footprint.h:721
HASH_128 m_courtyard_cache_front_hash
Definition: footprint.h:1125
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:1842
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1906
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1349
bool operator==(const FP_3DMODEL &aOther) const
Definition: footprint.h:110
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:105
double m_Opacity
Definition: footprint.h:106
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:104
FP_3DMODEL()
Definition: footprint.h:93
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:103
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:107
bool m_Show
Include model in rendering.
Definition: footprint.h:108
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:67
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:37
static LSET AllLayersMask()
Definition: lset.cpp:587
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
std::function passed to nested users by ref, avoids copying std::function.
Definition: eda_item.h:82
INCLUDE_NPTH_T
Definition: footprint.h:67
@ INCLUDE_NPTH
Definition: footprint.h:69
@ DO_NOT_INCLUDE_NPTH
Definition: footprint.h:68
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:78
@ FP_SMD
Definition: footprint.h:80
@ FP_DNP
Definition: footprint.h:87
@ FP_ALLOW_MISSING_COURTYARD
Definition: footprint.h:86
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:81
@ FP_BOARD_ONLY
Definition: footprint.h:83
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:82
@ FP_JUST_ADDED
Definition: footprint.h:84
@ FP_THROUGH_HOLE
Definition: footprint.h:79
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:85
#define FP_is_PLACED
In autoplace: footprint automatically placed.
Definition: footprint.h:404
#define FP_is_LOCKED
footprint LOCKED: no autoplace allowed
Definition: footprint.h:403
#define FP_PADS_are_LOCKED
Definition: footprint.h:406
#define FP_to_PLACE
In autoplace: footprint waiting for autoplace.
Definition: footprint.h:405
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:3608
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3685
bool operator()(const ZONE *aFirst, const ZONE *aSecond) const
Definition: footprint.cpp:3788
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