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>
35#include <embedded_files.h>
36#include <layer_ids.h> // ALL_LAYERS definition.
37#include <lset.h>
38#include <lib_id.h>
39#include <list>
40
41#include <zones.h>
43#include <pcb_item_containers.h>
44#include <pcb_text.h>
45#include <pcb_field.h>
46#include <functional>
47#include <math/vector3.h>
48
49class LINE_READER;
50class EDA_3D_CANVAS;
51class PAD;
52class BOARD;
53class MSG_PANEL_ITEM;
54class SHAPE;
55class REPORTER;
56
57namespace KIGFX {
58class VIEW;
59}
60
62{
64 INCLUDE_NPTH = true
65};
66
73{
75 FP_SMD = 0x0002,
78 FP_BOARD_ONLY = 0x0010, // Footprint has no corresponding symbol
79 FP_JUST_ADDED = 0x0020, // Footprint just added by netlist update
82 FP_DNP = 0x0100
83};
84
86{
87public:
89 // Initialize with sensible values
90 m_Scale { 1, 1, 1 },
91 m_Rotation { 0, 0, 0 },
92 m_Offset { 0, 0, 0 },
93 m_Opacity( 1.0 ),
94 m_Show( true )
95 {
96 }
97
101 double m_Opacity;
102 wxString m_Filename;
103 bool m_Show;
104
105 bool operator==( const FP_3DMODEL& aOther ) const
106 {
107 return m_Scale == aOther.m_Scale
108 && m_Rotation == aOther.m_Rotation
109 && m_Offset == aOther.m_Offset
110 && m_Opacity == aOther.m_Opacity
111 && m_Filename == aOther.m_Filename
112 && m_Show == aOther.m_Show;
113 }
114};
115
116
118{
119public:
120 FOOTPRINT( BOARD* parent );
121
122 FOOTPRINT( const FOOTPRINT& aFootprint );
123
124 // Move constructor and operator needed due to std containers inside the footprint
125 FOOTPRINT( FOOTPRINT&& aFootprint );
126
127 ~FOOTPRINT();
128
129 FOOTPRINT& operator=( const FOOTPRINT& aOther );
130 FOOTPRINT& operator=( FOOTPRINT&& aOther );
131
132 void Serialize( google::protobuf::Any &aContainer ) const override;
133 bool Deserialize( const google::protobuf::Any &aContainer ) override;
134
135 static inline bool ClassOf( const EDA_ITEM* aItem )
136 {
137 return aItem && aItem->Type() == PCB_FOOTPRINT_T;
138 }
139
141 void SetPrivateLayers( LSET aLayers ) { m_privateLayers = aLayers; }
142
144 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
145 bool aSkipConnectivity = false ) override;
146
148 void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
149
157 void ClearAllNets();
158
166 bool FixUuids();
167
178
185
186 bool TextOnly() const;
187
188 // Virtual function
189 const BOX2I GetBoundingBox() const override;
190 const BOX2I GetBoundingBox( bool aIncludeText, bool aIncludeInvisibleText ) const;
191
195 const BOX2I GetLayerBoundingBox( LSET aLayers ) const;
196
197 VECTOR2I GetCenter() const override
198 {
199 return GetBoundingBox( false, false ).GetCenter();
200 }
201
202 PCB_FIELDS& Fields() { return m_fields; }
203 const PCB_FIELDS& Fields() const { return m_fields; }
204
205 std::deque<PAD*>& Pads() { return m_pads; }
206 const std::deque<PAD*>& Pads() const { return m_pads; }
207
208 DRAWINGS& GraphicalItems() { return m_drawings; }
209 const DRAWINGS& GraphicalItems() const { return m_drawings; }
210
211 ZONES& Zones() { return m_zones; }
212 const ZONES& Zones() const { return m_zones; }
213
214 GROUPS& Groups() { return m_groups; }
215 const GROUPS& Groups() const { return m_groups; }
216
217 bool HasThroughHolePads() const;
218
219 std::vector<FP_3DMODEL>& Models() { return m_3D_Drawings; }
220 const std::vector<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
221
222 void SetPosition( const VECTOR2I& aPos ) override;
223 VECTOR2I GetPosition() const override { return m_pos; }
224
225 void SetOrientation( const EDA_ANGLE& aNewAngle );
227
232 void SetLayerAndFlip( PCB_LAYER_ID aLayer );
233
234 // to make property magic work
235 PCB_LAYER_ID GetLayer() const override { return BOARD_ITEM::GetLayer(); }
236
237 // For property system:
238 void SetOrientationDegrees( double aOrientation )
239 {
240 SetOrientation( EDA_ANGLE( aOrientation, DEGREES_T ) );
241 }
243 {
244 return m_orient.AsDegrees();
245 }
246
247 const LIB_ID& GetFPID() const { return m_fpid; }
248 void SetFPID( const LIB_ID& aFPID )
249 {
250 m_fpid = aFPID;
251 }
252
253 wxString GetFPIDAsString() const { return m_fpid.Format(); }
254 void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); }
255
256 wxString GetLibDescription() const { return m_libDescription; }
257 void SetLibDescription( const wxString& aDesc ) { m_libDescription = aDesc; }
258
259 wxString GetKeywords() const { return m_keywords; }
260 void SetKeywords( const wxString& aKeywords ) { m_keywords = aKeywords; }
261
262 const KIID_PATH& GetPath() const { return m_path; }
263 void SetPath( const KIID_PATH& aPath ) { m_path = aPath; }
264
265 wxString GetSheetname() const { return m_sheetname; }
266 void SetSheetname( const wxString& aSheetname ) { m_sheetname = aSheetname; }
267
268 wxString GetSheetfile() const { return m_sheetfile; }
269 void SetSheetfile( const wxString& aSheetfile ) { m_sheetfile = aSheetfile; }
270
271 wxString GetFilters() const { return m_filters; }
272 void SetFilters( const wxString& aFilters ) { m_filters = aFilters; }
273
274 std::optional<int> GetLocalClearance() const { return m_clearance; }
275 void SetLocalClearance( std::optional<int> aClearance ) { m_clearance = aClearance; }
276
277 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
278 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
279
280 std::optional<int> GetLocalSolderPasteMargin() const { return m_solderPasteMargin; }
281 void SetLocalSolderPasteMargin( std::optional<int> aMargin ) { m_solderPasteMargin = aMargin; }
282
283 std::optional<double> GetLocalSolderPasteMarginRatio() const { return m_solderPasteMarginRatio; }
284 void SetLocalSolderPasteMarginRatio( std::optional<double> aRatio ) { m_solderPasteMarginRatio = aRatio; }
285
288
289 int GetAttributes() const { return m_attributes; }
290 void SetAttributes( int aAttributes ) { m_attributes = aAttributes; }
291
292 void SetFlag( int aFlag ) { m_arflag = aFlag; }
293 void IncrementFlag() { m_arflag += 1; }
294 int GetFlag() const { return m_arflag; }
295
296 bool IsNetTie() const
297 {
298 for( const wxString& group : m_netTiePadGroups )
299 {
300 if( !group.IsEmpty() )
301 return true;
302 }
303
304 return false;
305 }
306
307 std::optional<int> GetLocalClearance( wxString* aSource ) const
308 {
309 if( m_clearance.has_value() && aSource )
310 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
311
312 return m_clearance;
313 }
314
321 std::optional<int> GetClearanceOverrides( wxString* aSource ) const
322 {
323 return GetLocalClearance( aSource );
324 }
325
327 {
328 if( m_zoneConnection != ZONE_CONNECTION::INHERITED && aSource )
329 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
330
331 return m_zoneConnection;
332 }
333
338 const std::vector<wxString>& GetNetTiePadGroups() const { return m_netTiePadGroups; }
339
341 {
342 m_netTiePadGroups.clear();
343 }
344
345 void AddNetTiePadGroup( const wxString& aGroup )
346 {
347 m_netTiePadGroups.emplace_back( aGroup );
348 }
349
354 std::map<wxString, int> MapPadNumbersToNetTieGroups() const;
355
359 std::vector<PAD*> GetNetTiePads( PAD* aPad ) const;
360
366 int GetLikelyAttribute() const;
367
368 void Move( const VECTOR2I& aMoveVector ) override;
369
370 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
371
372 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
373
385 void MoveAnchorPosition( const VECTOR2I& aMoveVector );
386
390 bool IsFlipped() const { return GetLayer() == B_Cu; }
391
396 PCB_LAYER_ID GetSide() const;
397
401 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
402
403// m_footprintStatus bits:
404#define FP_is_LOCKED 0x01
405#define FP_is_PLACED 0x02
406#define FP_to_PLACE 0x04
407#define FP_PADS_are_LOCKED 0x08
408
409
410 bool IsLocked() const override
411 {
412 return ( m_fpStatus & FP_is_LOCKED ) != 0;
413 }
414
420 void SetLocked( bool isLocked ) override
421 {
422 if( isLocked )
424 else
425 m_fpStatus &= ~FP_is_LOCKED;
426 }
427
431 bool IsConflicting() const;
432
433 bool IsPlaced() const { return m_fpStatus & FP_is_PLACED; }
434 void SetIsPlaced( bool isPlaced )
435 {
436 if( isPlaced )
438 else
439 m_fpStatus &= ~FP_is_PLACED;
440 }
441
442 bool NeedsPlaced() const { return m_fpStatus & FP_to_PLACE; }
443 void SetNeedsPlaced( bool needsPlaced )
444 {
445 if( needsPlaced )
447 else
448 m_fpStatus &= ~FP_to_PLACE;
449 }
450
452
463 void CheckFootprintAttributes( const std::function<void( const wxString& )>& aErrorHandler );
464
471 void CheckPads( UNITS_PROVIDER* aUnitsProvider,
472 const std::function<void( const PAD*, int, const wxString& )>& aErrorHandler );
473
479 void CheckShortingPads( const std::function<void( const PAD*, const PAD*, int aErrorCode,
480 const VECTOR2I& )>& aErrorHandler );
481
488 void CheckNetTies( const std::function<void( const BOARD_ITEM* aItem,
489 const BOARD_ITEM* bItem,
490 const BOARD_ITEM* cItem,
491 const VECTOR2I& )>& aErrorHandler );
492
499 void CheckNetTiePadGroups( const std::function<void( const wxString& )>& aErrorHandler );
500
521 void TransformPadsToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
522 int aMaxError, ERROR_LOC aErrorLoc,
523 bool aSkipNPTHPadsWihNoCopper = false,
524 bool aSkipPlatedPads = false,
525 bool aSkipNonPlatedPads = false ) const;
526
541 void TransformFPShapesToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
542 int aError, ERROR_LOC aErrorLoc,
543 bool aIncludeText = true,
544 bool aIncludeShapes = true,
545 bool aIncludePrivateItems = false ) const;
546
550 void TransformFPTextToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
551 int aError, ERROR_LOC aErrorLoc ) const
552 {
553 TransformFPShapesToPolySet( aBuffer, aLayer, aClearance, aError, aErrorLoc, true, false );
554 }
555
559 void GetContextualTextVars( wxArrayString* aVars ) const;
560
566 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
567
569 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
570
571 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
572
582 bool HitTestAccurate( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
583
584 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
585
594 bool HitTestOnLayer( const VECTOR2I& aPosition, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
595
596 bool HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
597
601 const wxString& GetReference() const { return Reference().GetText(); }
602
607 void SetReference( const wxString& aReference ) { Reference().SetText( aReference ); }
608
609 // Property system doesn't like const references
610 wxString GetReferenceAsString() const
611 {
612 return GetReference();
613 }
614
618 void IncrementReference( int aDelta );
619
623 const wxString& GetValue() const { return Value().GetText(); }
624
628 void SetValue( const wxString& aValue ) { Value().SetText( aValue ); }
629
630 // Property system doesn't like const references
631 wxString GetValueAsString() const
632 {
633 return GetValue();
634 }
635
640
642 const PCB_FIELD& Value() const { return *GetField( VALUE_FIELD ); }
643 const PCB_FIELD& Reference() const { return *GetField( REFERENCE_FIELD ); }
644 const PCB_FIELD& Footprint() const { return *GetField( FOOTPRINT_FIELD ); }
645
646 //-----<Fields>-----------------------------------------------------------
647
656 PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldType );
657 const PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldNdx ) const;
658
666 PCB_FIELD* GetFieldById( int aFieldId );
667
675 PCB_FIELD* GetFieldByName( const wxString& aFieldName );
676
677 bool HasFieldByName( const wxString& aFieldName ) const;
678
684 wxString GetFieldText( const wxString& aFieldName ) const;
685
692 void GetFields( std::vector<PCB_FIELD*>& aVector, bool aVisibleOnly );
693
697 PCB_FIELDS GetFields() { return m_fields; }
698 const PCB_FIELDS& GetFields() const { return m_fields; }
699
707 PCB_FIELD* AddField( const PCB_FIELD& aField );
708
714 void RemoveField( const wxString& aFieldName );
715
719 int GetFieldCount() const { return (int) m_fields.size(); }
720
728 void ApplyDefaultSettings( const BOARD& board, bool aStyleFields, bool aStyleText,
729 bool aStyleShapes );
730
731 bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
732 void SetBoardOnly( bool aIsBoardOnly = true )
733 {
734 if( aIsBoardOnly )
736 else
737 m_attributes &= ~FP_BOARD_ONLY;
738 }
739
741 void SetExcludedFromPosFiles( bool aExclude = true )
742 {
743 if( aExclude )
745 else
746 m_attributes &= ~FP_EXCLUDE_FROM_POS_FILES;
747 }
748
750 void SetExcludedFromBOM( bool aExclude = true )
751 {
752 if( aExclude )
754 else
755 m_attributes &= ~FP_EXCLUDE_FROM_BOM;
756 }
757
759 void SetAllowMissingCourtyard( bool aAllow = true )
760 {
761 if( aAllow )
763 else
764 m_attributes &= ~FP_ALLOW_MISSING_COURTYARD;
765 }
766
767 bool IsDNP() const { return m_attributes & FP_DNP; }
768 void SetDNP( bool aDNP = true )
769 {
770 if( aDNP )
772 else
773 m_attributes &= ~FP_DNP;
774 }
775
776 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
778
788 PAD* FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe = nullptr ) const;
789
797 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
798
799 std::vector<const PAD*> GetPads( const wxString& aPadNumber,
800 const PAD* aIgnore = nullptr ) const;
801
809 unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
810
821 unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
822
826 std::set<wxString>
828
836 wxString GetNextPadNumber( const wxString& aLastPadName ) const;
837
841 void AutoPositionFields();
842
847 wxString GetTypeName() const;
848
849 double GetArea( int aPadding = 0 ) const;
850
851 KIID GetLink() const { return m_link; }
852 void SetLink( const KIID& aLink ) { m_link = aLink; }
853
854 BOARD_ITEM* Duplicate() const override;
855
861 BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
862
868 void Add3DModel( FP_3DMODEL* a3DModel );
869
870 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
871 const std::vector<KICAD_T>& aScanTypes ) override;
872
873 wxString GetClass() const override
874 {
875 return wxT( "FOOTPRINT" );
876 }
877
878 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
879
880 BITMAPS GetMenuImage() const override;
881
882 EDA_ITEM* Clone() const override;
883
885 void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const override;
886
888 void RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction,
889 int aDepth = 0 ) const override;
890
891 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
892
893 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
894
895 virtual const BOX2I ViewBBox() const override;
896
904 static bool IsLibNameValid( const wxString& aName );
905
915 static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
916
920 bool FootprintNeedsUpdate( const FOOTPRINT* aLibFP, int aCompareFlags = 0,
921 REPORTER* aReporter = nullptr );
922
937 void SetInitialComments( wxArrayString* aInitialComments )
938 {
939 delete m_initial_comments;
940 m_initial_comments = aInitialComments;
941 }
942
949 double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
950
951 static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
952
954 const wxArrayString* GetInitialComments() const { return m_initial_comments; }
955
961 const SHAPE_POLY_SET& GetCourtyard( PCB_LAYER_ID aLayer ) const;
962
968 const SHAPE_POLY_SET& GetCachedCourtyard( PCB_LAYER_ID aLayer ) const;
969
976 void BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
977
978 // @copydoc BOARD_ITEM::GetEffectiveShape
979 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
980 FLASHING aFlash = FLASHING::DEFAULT ) const override;
981
983 {
984 return static_cast<EMBEDDED_FILES*>( this );
985 }
986
988 {
989 return static_cast<const EMBEDDED_FILES*>( this );
990 }
991
992 void EmbedFonts() override;
993
994 double Similarity( const BOARD_ITEM& aOther ) const override;
995
996 bool operator==( const BOARD_ITEM& aOther ) const override;
997 bool operator==( const FOOTPRINT& aOther ) const;
998
999#if defined(DEBUG)
1000 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
1001#endif
1002
1004 {
1005 bool operator()( const BOARD_ITEM* itemA, const BOARD_ITEM* itemB ) const;
1006 };
1007
1009 {
1010 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1011 };
1012
1014 {
1015 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1016 };
1017
1019 {
1020 bool operator()( const ZONE* aFirst, const ZONE* aSecond ) const;
1021 };
1022
1023protected:
1024 virtual void swapData( BOARD_ITEM* aImage ) override;
1025
1026private:
1027 PCB_FIELDS m_fields;
1028 DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
1029 std::deque<PAD*> m_pads; // PAD items, owned by pointer
1030 ZONES m_zones; // PCB_ZONE items, owned by pointer
1031 GROUPS m_groups; // PCB_GROUP items, owned by pointer
1032
1033 EDA_ANGLE m_orient; // Orientation
1034 VECTOR2I m_pos; // Position of footprint on the board in internal units.
1035 LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
1036 int m_attributes; // Flag bits (see FOOTPRINT_ATTR_T)
1037 int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
1039
1040 // Bounding box caching strategy:
1041 // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
1042 // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
1043 // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
1044 // counter, and storing that as a timestamp for the various caches.
1045 // This means caches will get regenerated often -- but still far less often than if we had no
1046 // caches at all. The principal opitmization would be to change to dirty flag and make sure
1047 // that any edit that could affect the bounding boxes (including edits to the footprint
1048 // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
1049 // fragile.
1058
1059 // A list of pad groups, each of which is allowed to short nets within their group.
1060 // A pad group is a comma-separated list of pad numbers.
1061 std::vector<wxString> m_netTiePadGroups;
1062
1063 // Optional overrides
1065 std::optional<int> m_clearance;
1066 std::optional<int> m_solderMaskMargin; // Solder mask margin
1067 std::optional<int> m_solderPasteMargin; // Solder paste margin absolute value
1068 std::optional<double> m_solderPasteMarginRatio; // Solder mask margin ratio of pad size
1069 // The final margin is the sum of these 2 values
1070
1071 wxString m_libDescription; // File name and path for documentation file.
1072 wxString m_keywords; // Search keywords to find footprint in library.
1073 KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
1074 wxString m_sheetname; // Name of the sheet containing the symbol for this footprint
1075 wxString m_sheetfile; // File of the sheet containing the symbol for this footprint
1076 wxString m_filters; // Footprint filters from symbol
1078 int m_arflag; // Use to trace ratsnest and auto routing.
1079 KIID m_link; // Temporary logical link used during editing
1080 LSET m_privateLayers; // Layers visible only in the footprint editor
1081
1082 std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
1083 wxArrayString* m_initial_comments; // s-expression comments in the footprint,
1084 // lazily allocated only if needed for speed
1085
1086 SHAPE_POLY_SET m_courtyard_cache_front; // Note that a footprint can have both front and back
1087 SHAPE_POLY_SET m_courtyard_cache_back; // courtyards populated.
1090 mutable std::mutex m_courtyard_cache_mutex;
1091};
1092
1093#endif // FOOTPRINT_H
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:240
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:289
const Vec GetCenter() const
Definition: box2.h:220
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:49
double AsDegrees() const
Definition: eda_angle.h:113
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:94
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:182
bool FixUuids()
Old footprints do not always have a valid UUID (some can be set to null uuid) However null UUIDs,...
Definition: footprint.cpp:650
std::optional< int > GetClearanceOverrides(wxString *aSource) const
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
Definition: footprint.h:321
void EmbedFonts() override
Definition: footprint.cpp:3719
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:2348
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:248
LIB_ID m_fpid
Definition: footprint.h:1035
wxString GetLibDescription() const
Definition: footprint.h:256
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:287
void SetLink(const KIID &aLink)
Definition: footprint.h:852
KIID_PATH m_path
Definition: footprint.h:1073
bool IsBoardOnly() const
Definition: footprint.h:731
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: footprint.h:719
BOX2I m_cachedTextExcludedBBox
Definition: footprint.h:1054
const std::deque< PAD * > & Pads() const
Definition: footprint.h:206
bool IsDNP() const
Definition: footprint.h:767
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:420
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: footprint.h:197
HASH_128 m_courtyard_cache_back_hash
Definition: footprint.h:1089
std::vector< PAD * > GetNetTiePads(PAD *aPad) const
Definition: footprint.cpp:3027
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:906
EDA_ANGLE GetOrientation() const
Definition: footprint.h:226
bool HasFieldByName(const wxString &aFieldName) const
Definition: footprint.cpp:542
ZONES & Zones()
Definition: footprint.h:211
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: footprint.cpp:377
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:1046
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:434
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:1064
BOX2I m_cachedBoundingBox
Definition: footprint.h:1050
static double GetCoverageArea(const BOARD_ITEM *aItem, const GENERAL_COLLECTOR &aCollector)
Definition: footprint.cpp:2664
bool IsExcludedFromBOM() const
Definition: footprint.h:749
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:2420
void SetFlag(int aFlag)
Definition: footprint.h:292
std::optional< double > m_solderPasteMarginRatio
Definition: footprint.h:1068
PCB_FIELD * GetFieldByName(const wxString &aFieldName)
Return a field in this symbol.
Definition: footprint.cpp:553
void SetDNP(bool aDNP=true)
Definition: footprint.h:768
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:2214
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1866
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
Definition: footprint.h:284
void IncrementFlag()
Definition: footprint.h:293
const BOX2I GetLayerBoundingBox(LSET aLayers) const
Return the bounding box of the footprint on a given set of layers.
Definition: footprint.cpp:1413
std::optional< int > m_clearance
Definition: footprint.h:1065
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:595
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:3157
void CheckPads(UNITS_PROVIDER *aUnitsProvider, const std::function< void(const PAD *, int, const wxString &)> &aErrorHandler)
Run non-board-specific DRC checks on footprint's pads.
Definition: footprint.cpp:3074
void SetExcludedFromBOM(bool aExclude=true)
Definition: footprint.h:750
wxString GetSheetname() const
Definition: footprint.h:265
int m_fpStatus
Definition: footprint.h:1037
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:263
PCB_FIELDS GetFields()
Return a vector of fields from the symbol.
Definition: footprint.h:697
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: footprint.cpp:2158
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:1056
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:1885
void SetFilters(const wxString &aFilters)
Definition: footprint.h:272
void SetAllowMissingCourtyard(bool aAllow=true)
Definition: footprint.h:759
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:260
const DRAWINGS & GraphicalItems() const
Definition: footprint.h:209
void SetInitialComments(wxArrayString *aInitialComments)
Take ownership of caller's heap allocated aInitialComments block.
Definition: footprint.h:937
int m_attributes
Definition: footprint.h:1036
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:1620
PCB_FIELD & Footprint()
Definition: footprint.h:639
std::vector< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:1082
double CoverageRatio(const GENERAL_COLLECTOR &aCollector) const
Calculate the ratio of total area of the footprint pads and graphical items to the area of the footpr...
Definition: footprint.cpp:2747
BOARD_ITEM * DuplicateItem(const BOARD_ITEM *aItem, bool aAddToFootprint=false)
Duplicate a given item within the footprint, optionally adding it to the board.
Definition: footprint.cpp:2460
bool FootprintNeedsUpdate(const FOOTPRINT *aLibFP, int aCompareFlags=0, REPORTER *aReporter=nullptr)
Return true if a board footprint differs from the library version.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: footprint.cpp:2811
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2043
void SetAttributes(int aAttributes)
Definition: footprint.h:290
void SetSheetfile(const wxString &aSheetfile)
Definition: footprint.h:269
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: footprint.cpp:2031
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2069
std::optional< int > GetLocalSolderPasteMargin() const
Definition: footprint.h:280
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:3589
wxArrayString * m_initial_comments
Definition: footprint.h:1083
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2037
BOX2I m_cachedVisibleBBox
Definition: footprint.h:1052
BOX2I GetFpPadsLocalBbox() const
Return the bounding box containing pads when the footprint is on the front side, orientation 0,...
Definition: footprint.cpp:1213
int m_visibleBBoxCacheTimeStamp
Definition: footprint.h:1053
PCB_FIELD & Value()
read/write accessors:
Definition: footprint.h:637
const EMBEDDED_FILES * GetEmbeddedFiles() const
Definition: footprint.h:987
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:2252
std::optional< int > m_solderPasteMargin
Definition: footprint.h:1067
void SetFileFormatVersionAtLoad(int aVersion)
Definition: footprint.h:776
std::mutex m_courtyard_cache_mutex
Definition: footprint.h:1090
void SetExcludedFromPosFiles(bool aExclude=true)
Definition: footprint.h:741
const PCB_FIELD & Footprint() const
Definition: footprint.h:644
void SetOrientationDegrees(double aOrientation)
Definition: footprint.h:238
void SetPrivateLayers(LSET aLayers)
Adds an item to the container.
Definition: footprint.h:141
void ApplyDefaultSettings(const BOARD &board, bool aStyleFields, bool aStyleText, bool aStyleShapes)
Apply default board settings to the footprint field text properties.
Definition: footprint.cpp:617
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:2972
std::optional< int > GetLocalClearance() const
Definition: footprint.h:274
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:3380
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:550
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
Definition: footprint.cpp:2375
FOOTPRINT & operator=(const FOOTPRINT &aOther)
Definition: footprint.cpp:782
int m_arflag
Definition: footprint.h:1078
double GetOrientationDegrees() const
Definition: footprint.h:242
BOARD_ITEM * Duplicate() const override
Create a copy of this BOARD_ITEM.
Definition: footprint.cpp:2447
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:1933
std::deque< PAD * > & Pads()
Definition: footprint.h:205
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:289
std::optional< int > GetLocalClearance(wxString *aSource) const
Definition: footprint.h:307
void SetLocalZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:286
void ClearNetTiePadGroups()
Definition: footprint.h:340
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:235
LSET GetPrivateLayers() const
Definition: footprint.h:140
wxString GetFPIDAsString() const
Definition: footprint.h:253
wxString GetValueAsString() const
Definition: footprint.h:631
bool AllowMissingCourtyard() const
Definition: footprint.h:758
const ZONES & Zones() const
Definition: footprint.h:212
bool IsFlipped() const
Definition: footprint.h:390
wxString GetSheetfile() const
Definition: footprint.h:268
SHAPE_POLY_SET GetBoundingHull() const
Return a bounding polygon for the shapes and pads in the footprint.
Definition: footprint.cpp:1458
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:3662
wxString GetTypeName() const
Get the type of footprint.
Definition: footprint.cpp:1201
DRAWINGS m_drawings
Definition: footprint.h:1028
bool NeedsPlaced() const
Definition: footprint.h:442
PCB_FIELD * GetFieldById(int aFieldId)
Return a field in this symbol.
Definition: footprint.cpp:531
SHAPE_POLY_SET m_courtyard_cache_back
Definition: footprint.h:1087
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:1055
const std::vector< wxString > & GetNetTiePadGroups() const
Definition: footprint.h:338
const LIB_ID & GetFPID() const
Definition: footprint.h:247
void SetReference(const wxString &aReference)
Definition: footprint.h:607
bool IsLocked() const override
Definition: footprint.h:410
const GROUPS & Groups() const
Definition: footprint.h:215
bool IsExcludedFromPosFiles() const
Definition: footprint.h:740
void SetLayerAndFlip(PCB_LAYER_ID aLayer)
Used as Layer property setter – performs a flip if necessary to set the footprint layer.
Definition: footprint.cpp:2280
ZONES m_zones
Definition: footprint.h:1030
int m_hullCacheTimeStamp
Definition: footprint.h:1057
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:1916
void AddNetTiePadGroup(const wxString &aGroup)
Definition: footprint.h:345
bool LegacyPadsLocked() const
Definition: footprint.h:451
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: footprint.cpp:2199
LSET m_privateLayers
Definition: footprint.h:1080
int GetLikelyAttribute() const
Returns the most likely attribute based on pads Either FP_THROUGH_HOLE/FP_SMD/OTHER(0)
Definition: footprint.cpp:1148
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: footprint.cpp:2242
static bool ClassOf(const EDA_ITEM *aItem)
Definition: footprint.h:135
wxString m_libDescription
Definition: footprint.h:1071
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:1682
VECTOR2I m_pos
Definition: footprint.h:1034
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource) const
Definition: footprint.h:326
std::vector< wxString > m_netTiePadGroups
Definition: footprint.h:1061
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Get a pad at aPosition on aLayerMask in the footprint.
Definition: footprint.cpp:1834
void Add3DModel(FP_3DMODEL *a3DModel)
Add a3DModel definition to the end of the 3D model list.
Definition: footprint.cpp:1922
void SetValue(const wxString &aValue)
Definition: footprint.h:628
GROUPS m_groups
Definition: footprint.h:1031
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:1540
PCB_FIELD & Reference()
Definition: footprint.h:638
const PCB_FIELD & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:642
wxString GetReferenceAsString() const
Definition: footprint.h:610
wxString m_sheetfile
Definition: footprint.h:1075
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars for this footprint.
Definition: footprint.cpp:892
std::optional< int > m_solderMaskMargin
Definition: footprint.h:1066
SHAPE_POLY_SET m_courtyard_cache_front
Definition: footprint.h:1086
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:983
std::vector< const PAD * > GetPads(const wxString &aPadNumber, const PAD *aIgnore=nullptr) const
Definition: footprint.cpp:1850
void AutoPositionFields()
Position Reference and Value fields at the top and bottom of footprint's bounding box.
Definition: footprint.cpp:2609
wxString m_keywords
Definition: footprint.h:1072
const PCB_FIELD & Reference() const
Definition: footprint.h:643
void ClearAllNets()
Clear (i.e.
Definition: footprint.cpp:974
std::deque< PAD * > m_pads
Definition: footprint.h:1029
bool HasThroughHolePads() const
Definition: footprint.cpp:3315
void BuildCourtyardCaches(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Build complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:2870
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: footprint.cpp:1651
wxString GetFieldText(const wxString &aFieldName) const
Search for a field named aFieldName and returns text associated with this field.
Definition: footprint.cpp:568
EDA_ANGLE m_orient
Definition: footprint.h:1033
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1757
bool IsNetTie() const
Definition: footprint.h:296
wxString GetClass() const override
Return the class name.
Definition: footprint.h:873
const PCB_FIELDS & Fields() const
Definition: footprint.h:203
void IncrementReference(int aDelta)
Bump the current reference by aDelta.
Definition: footprint.cpp:2637
int GetFileFormatVersionAtLoad() const
Definition: footprint.h:777
std::optional< double > GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:283
KIID m_link
Definition: footprint.h:1079
void RemoveField(const wxString &aFieldName)
Remove a user field from the footprint.
Definition: footprint.cpp:604
GROUPS & Groups()
Definition: footprint.h:214
wxString GetFilters() const
Definition: footprint.h:271
void SetSheetname(const wxString &aSheetname)
Definition: footprint.h:266
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: footprint.h:954
KIID GetLink() const
Definition: footprint.h:851
bool IsConflicting() const
Definition: footprint.cpp:886
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:219
const SHAPE_POLY_SET & GetCachedCourtyard(PCB_LAYER_ID aLayer) const
Return the cached courtyard area.
Definition: footprint.cpp:2861
PCB_FIELDS & Fields()
Definition: footprint.h:202
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:2225
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:257
bool TextOnly() const
Definition: footprint.cpp:1238
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:2289
const wxString & GetValue() const
Definition: footprint.h:623
void CheckShortingPads(const std::function< void(const PAD *, const PAD *, int aErrorCode, const VECTOR2I &)> &aErrorHandler)
Check for overlapping, different-numbered, non-net-tie pads.
Definition: footprint.cpp:3092
double GetArea(int aPadding=0) const
Definition: footprint.cpp:1138
const PCB_FIELDS & GetFields() const
Definition: footprint.h:698
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:443
wxString m_filters
Definition: footprint.h:1076
const wxString & GetReference() const
Definition: footprint.h:601
void CheckNetTiePadGroups(const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition: footprint.cpp:3270
void SetFPIDAsString(const wxString &aFPID)
Definition: footprint.h:254
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: footprint.cpp:2020
void SetBoardOnly(bool aIsBoardOnly=true)
Definition: footprint.h:732
const std::vector< FP_3DMODEL > & Models() const
Definition: footprint.h:220
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition: footprint.h:278
PCB_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: footprint.cpp:519
timestamp_t m_lastEditTime
Definition: footprint.h:1077
const SHAPE_POLY_SET & GetCourtyard(PCB_LAYER_ID aLayer) const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.cpp:2847
int GetFlag() const
Definition: footprint.h:294
wxString m_sheetname
Definition: footprint.h:1074
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: footprint.cpp:2106
int m_fileFormatVersionAtLoad
Definition: footprint.h:1038
void SetLocalClearance(std::optional< int > aClearance)
Definition: footprint.h:275
const KIID_PATH & GetPath() const
Definition: footprint.h:262
std::optional< int > GetLocalSolderMaskMargin() const
Definition: footprint.h:277
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
Definition: footprint.h:281
wxString GetKeywords() const
Definition: footprint.h:259
bool operator==(const BOARD_ITEM &aOther) const override
Definition: footprint.cpp:3327
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: footprint.h:982
void CheckFootprintAttributes(const std::function< void(const wxString &)> &aErrorHandler)
Test if footprint attributes for type (SMD/Through hole/Other) match the expected type based on the p...
Definition: footprint.cpp:3049
virtual void swapData(BOARD_ITEM *aImage) override
Definition: footprint.cpp:3293
wxString GetNextPadNumber(const wxString &aLastPadName) const
Return the next available pad number in the footprint.
Definition: footprint.cpp:2589
bool IsPlaced() const
Definition: footprint.h:433
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:1051
VECTOR2I GetPosition() const override
Definition: footprint.h:223
DRAWINGS & GraphicalItems()
Definition: footprint.h:208
PCB_FIELDS m_fields
Definition: footprint.h:1027
HASH_128 m_courtyard_cache_front_hash
Definition: footprint.h:1088
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:1750
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1814
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1253
bool operator==(const FP_3DMODEL &aOther) const
Definition: footprint.h:105
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:100
double m_Opacity
Definition: footprint.h:101
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:99
FP_3DMODEL()
Definition: footprint.h:88
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:98
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:102
bool m_Show
Include model in rendering.
Definition: footprint.h:103
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:207
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:35
static LSET AllLayersMask()
Definition: lset.cpp:767
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:71
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:62
@ INCLUDE_NPTH
Definition: footprint.h:64
@ DO_NOT_INCLUDE_NPTH
Definition: footprint.h:63
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:73
@ FP_SMD
Definition: footprint.h:75
@ FP_DNP
Definition: footprint.h:82
@ FP_ALLOW_MISSING_COURTYARD
Definition: footprint.h:81
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:76
@ FP_BOARD_ONLY
Definition: footprint.h:78
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:77
@ FP_JUST_ADDED
Definition: footprint.h:79
@ FP_THROUGH_HOLE
Definition: footprint.h:74
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:80
#define FP_is_PLACED
In autoplace: footprint automatically placed.
Definition: footprint.h:405
#define FP_is_LOCKED
footprint LOCKED: no autoplace allowed
Definition: footprint.h:404
#define FP_PADS_are_LOCKED
Definition: footprint.h:407
#define FP_to_PLACE
In autoplace: footprint waiting for autoplace.
Definition: footprint.h:406
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
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:149
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:95
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
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:3403
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3480
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3508
bool operator()(const ZONE *aFirst, const ZONE *aSecond) const
Definition: footprint.cpp:3563
A storage class for 128-bit hash value.
Definition: hash_128.h:36
MANDATORY_FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:47