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
106
108{
109public:
110 FOOTPRINT( BOARD* parent );
111
112 FOOTPRINT( const FOOTPRINT& aFootprint );
113
114 // Move constructor and operator needed due to std containers inside the footprint
115 FOOTPRINT( FOOTPRINT&& aFootprint );
116
117 ~FOOTPRINT();
118
119 FOOTPRINT& operator=( const FOOTPRINT& aOther );
120 FOOTPRINT& operator=( FOOTPRINT&& aOther );
121
122 void Serialize( google::protobuf::Any &aContainer ) const override;
123 bool Deserialize( const google::protobuf::Any &aContainer ) override;
124
125 static inline bool ClassOf( const EDA_ITEM* aItem )
126 {
127 return aItem && aItem->Type() == PCB_FOOTPRINT_T;
128 }
129
131 void SetPrivateLayers( LSET aLayers ) { m_privateLayers = aLayers; }
132
134 void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
135 bool aSkipConnectivity = false ) override;
136
138 void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
139
147 void ClearAllNets();
148
156 bool FixUuids();
157
168
175
176 bool TextOnly() const;
177
178 // Virtual function
179 const BOX2I GetBoundingBox() const override;
180 const BOX2I GetBoundingBox( bool aIncludeText, bool aIncludeInvisibleText ) const;
181
185 const BOX2I GetLayerBoundingBox( LSET aLayers ) const;
186
187 VECTOR2I GetCenter() const override
188 {
189 return GetBoundingBox( false, false ).GetCenter();
190 }
191
192 PCB_FIELDS& Fields() { return m_fields; }
193 const PCB_FIELDS& Fields() const { return m_fields; }
194
195 PADS& Pads() { return m_pads; }
196 const PADS& Pads() const { return m_pads; }
197
198 DRAWINGS& GraphicalItems() { return m_drawings; }
199 const DRAWINGS& GraphicalItems() const { return m_drawings; }
200
201 ZONES& Zones() { return m_zones; }
202 const ZONES& Zones() const { return m_zones; }
203
204 GROUPS& Groups() { return m_groups; }
205 const GROUPS& Groups() const { return m_groups; }
206
207 bool HasThroughHolePads() const;
208
209 std::vector<FP_3DMODEL>& Models() { return m_3D_Drawings; }
210 const std::vector<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
211
212 void SetPosition( const VECTOR2I& aPos ) override;
213 VECTOR2I GetPosition() const override { return m_pos; }
214
215 void SetOrientation( const EDA_ANGLE& aNewAngle );
217
222 void SetLayerAndFlip( PCB_LAYER_ID aLayer );
223
224 // to make property magic work
225 PCB_LAYER_ID GetLayer() const override { return BOARD_ITEM::GetLayer(); }
226
227 // For property system:
228 void SetOrientationDegrees( double aOrientation )
229 {
230 SetOrientation( EDA_ANGLE( aOrientation, DEGREES_T ) );
231 }
233 {
234 return m_orient.AsDegrees();
235 }
236
237 const LIB_ID& GetFPID() const { return m_fpid; }
238 void SetFPID( const LIB_ID& aFPID )
239 {
240 m_fpid = aFPID;
241 }
242
243 wxString GetFPIDAsString() const { return m_fpid.Format(); }
244 void SetFPIDAsString( const wxString& aFPID ) { m_fpid.Parse( aFPID ); }
245
246 wxString GetLibDescription() const { return m_libDescription; }
247 void SetLibDescription( const wxString& aDesc ) { m_libDescription = aDesc; }
248
249 wxString GetKeywords() const { return m_keywords; }
250 void SetKeywords( const wxString& aKeywords ) { m_keywords = aKeywords; }
251
252 const KIID_PATH& GetPath() const { return m_path; }
253 void SetPath( const KIID_PATH& aPath ) { m_path = aPath; }
254
255 wxString GetSheetname() const { return m_sheetname; }
256 void SetSheetname( const wxString& aSheetname ) { m_sheetname = aSheetname; }
257
258 wxString GetSheetfile() const { return m_sheetfile; }
259 void SetSheetfile( const wxString& aSheetfile ) { m_sheetfile = aSheetfile; }
260
261 wxString GetFilters() const { return m_filters; }
262 void SetFilters( const wxString& aFilters ) { m_filters = aFilters; }
263
264 std::optional<int> GetLocalClearance() const { return m_clearance; }
265 void SetLocalClearance( std::optional<int> aClearance ) { m_clearance = aClearance; }
266
267 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
268 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
269
270 std::optional<int> GetLocalSolderPasteMargin() const { return m_solderPasteMargin; }
271 void SetLocalSolderPasteMargin( std::optional<int> aMargin ) { m_solderPasteMargin = aMargin; }
272
273 std::optional<double> GetLocalSolderPasteMarginRatio() const { return m_solderPasteMarginRatio; }
274 void SetLocalSolderPasteMarginRatio( std::optional<double> aRatio ) { m_solderPasteMarginRatio = aRatio; }
275
278
279 int GetAttributes() const { return m_attributes; }
280 void SetAttributes( int aAttributes ) { m_attributes = aAttributes; }
281
282 void SetFlag( int aFlag ) { m_arflag = aFlag; }
283 void IncrementFlag() { m_arflag += 1; }
284 int GetFlag() const { return m_arflag; }
285
286 bool IsNetTie() const
287 {
288 for( const wxString& group : m_netTiePadGroups )
289 {
290 if( !group.IsEmpty() )
291 return true;
292 }
293
294 return false;
295 }
296
297 std::optional<int> GetLocalClearance( wxString* aSource ) const
298 {
299 if( m_clearance.has_value() && aSource )
300 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
301
302 return m_clearance;
303 }
304
311 std::optional<int> GetClearanceOverrides( wxString* aSource ) const
312 {
313 return GetLocalClearance( aSource );
314 }
315
317 {
318 if( m_zoneConnection != ZONE_CONNECTION::INHERITED && aSource )
319 *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
320
321 return m_zoneConnection;
322 }
323
328 const std::vector<wxString>& GetNetTiePadGroups() const { return m_netTiePadGroups; }
329
331 {
332 m_netTiePadGroups.clear();
333 }
334
335 void AddNetTiePadGroup( const wxString& aGroup )
336 {
337 m_netTiePadGroups.emplace_back( aGroup );
338 }
339
344 std::map<wxString, int> MapPadNumbersToNetTieGroups() const;
345
349 std::vector<PAD*> GetNetTiePads( PAD* aPad ) const;
350
356 int GetLikelyAttribute() const;
357
358 void Move( const VECTOR2I& aMoveVector ) override;
359
360 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
361
362 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
363
375 void MoveAnchorPosition( const VECTOR2I& aMoveVector );
376
380 bool IsFlipped() const { return GetLayer() == B_Cu; }
381
386 PCB_LAYER_ID GetSide() const;
387
391 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
392
393// m_footprintStatus bits:
394#define FP_is_LOCKED 0x01
395#define FP_is_PLACED 0x02
396#define FP_to_PLACE 0x04
397#define FP_PADS_are_LOCKED 0x08
398
399
400 bool IsLocked() const override
401 {
402 return ( m_fpStatus & FP_is_LOCKED ) != 0;
403 }
404
410 void SetLocked( bool isLocked ) override
411 {
412 if( isLocked )
414 else
415 m_fpStatus &= ~FP_is_LOCKED;
416 }
417
421 bool IsConflicting() const;
422
423 bool IsPlaced() const { return m_fpStatus & FP_is_PLACED; }
424 void SetIsPlaced( bool isPlaced )
425 {
426 if( isPlaced )
428 else
429 m_fpStatus &= ~FP_is_PLACED;
430 }
431
432 bool NeedsPlaced() const { return m_fpStatus & FP_to_PLACE; }
433 void SetNeedsPlaced( bool needsPlaced )
434 {
435 if( needsPlaced )
437 else
438 m_fpStatus &= ~FP_to_PLACE;
439 }
440
442
453 void CheckFootprintAttributes( const std::function<void( const wxString& )>& aErrorHandler );
454
461 void CheckPads( UNITS_PROVIDER* aUnitsProvider,
462 const std::function<void( const PAD*, int, const wxString& )>& aErrorHandler );
463
469 void CheckShortingPads( const std::function<void( const PAD*, const PAD*, int aErrorCode,
470 const VECTOR2I& )>& aErrorHandler );
471
478 void CheckNetTies( const std::function<void( const BOARD_ITEM* aItem,
479 const BOARD_ITEM* bItem,
480 const BOARD_ITEM* cItem,
481 const VECTOR2I& )>& aErrorHandler );
482
489 void CheckNetTiePadGroups( const std::function<void( const wxString& )>& aErrorHandler );
490
511 void TransformPadsToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
512 int aMaxError, ERROR_LOC aErrorLoc,
513 bool aSkipNPTHPadsWihNoCopper = false,
514 bool aSkipPlatedPads = false,
515 bool aSkipNonPlatedPads = false ) const;
516
531 void TransformFPShapesToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
532 int aError, ERROR_LOC aErrorLoc,
533 bool aIncludeText = true,
534 bool aIncludeShapes = true,
535 bool aIncludePrivateItems = false ) const;
536
540 void TransformFPTextToPolySet( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
541 int aError, ERROR_LOC aErrorLoc ) const
542 {
543 TransformFPShapesToPolySet( aBuffer, aLayer, aClearance, aError, aErrorLoc, true, false );
544 }
545
549 void GetContextualTextVars( wxArrayString* aVars ) const;
550
556 bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
557
559 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
560
561 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
562
572 bool HitTestAccurate( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
573
574 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
575
584 bool HitTestOnLayer( const VECTOR2I& aPosition, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
585
586 bool HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_ID aLayer, int aAccuracy = 0 ) const;
587
591 const wxString& GetReference() const { return Reference().GetText(); }
592
597 void SetReference( const wxString& aReference ) { Reference().SetText( aReference ); }
598
599 // Property system doesn't like const references
600 wxString GetReferenceAsString() const
601 {
602 return GetReference();
603 }
604
608 void IncrementReference( int aDelta );
609
613 const wxString& GetValue() const { return Value().GetText(); }
614
618 void SetValue( const wxString& aValue ) { Value().SetText( aValue ); }
619
620 // Property system doesn't like const references
621 wxString GetValueAsString() const
622 {
623 return GetValue();
624 }
625
630
632 const PCB_FIELD& Value() const { return *GetField( VALUE_FIELD ); }
633 const PCB_FIELD& Reference() const { return *GetField( REFERENCE_FIELD ); }
634 const PCB_FIELD& Footprint() const { return *GetField( FOOTPRINT_FIELD ); }
635
636 //-----<Fields>-----------------------------------------------------------
637
646 PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldType );
647 const PCB_FIELD* GetField( MANDATORY_FIELD_T aFieldNdx ) const;
648
656 PCB_FIELD* GetFieldById( int aFieldId );
657
665 PCB_FIELD* GetFieldByName( const wxString& aFieldName );
666
667 bool HasFieldByName( const wxString& aFieldName ) const;
668
674 wxString GetFieldText( const wxString& aFieldName ) const;
675
682 void GetFields( std::vector<PCB_FIELD*>& aVector, bool aVisibleOnly );
683
687 PCB_FIELDS GetFields() { return m_fields; }
688 const PCB_FIELDS& GetFields() const { return m_fields; }
689
697 PCB_FIELD* AddField( const PCB_FIELD& aField );
698
704 void RemoveField( const wxString& aFieldName );
705
709 int GetFieldCount() const { return (int) m_fields.size(); }
710
718 void ApplyDefaultSettings( const BOARD& board, bool aStyleFields, bool aStyleText,
719 bool aStyleShapes );
720
721 bool IsBoardOnly() const { return m_attributes & FP_BOARD_ONLY; }
722 void SetBoardOnly( bool aIsBoardOnly = true )
723 {
724 if( aIsBoardOnly )
726 else
727 m_attributes &= ~FP_BOARD_ONLY;
728 }
729
731 void SetExcludedFromPosFiles( bool aExclude = true )
732 {
733 if( aExclude )
735 else
736 m_attributes &= ~FP_EXCLUDE_FROM_POS_FILES;
737 }
738
740 void SetExcludedFromBOM( bool aExclude = true )
741 {
742 if( aExclude )
744 else
745 m_attributes &= ~FP_EXCLUDE_FROM_BOM;
746 }
747
749 void SetAllowMissingCourtyard( bool aAllow = true )
750 {
751 if( aAllow )
753 else
754 m_attributes &= ~FP_ALLOW_MISSING_COURTYARD;
755 }
756
757 bool IsDNP() const { return m_attributes & FP_DNP; }
758 void SetDNP( bool aDNP = true )
759 {
760 if( aDNP )
762 else
763 m_attributes &= ~FP_DNP;
764 }
765
766 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
768
778 PAD* FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe = nullptr ) const;
779
787 PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
788
789 std::vector<const PAD*> GetPads( const wxString& aPadNumber,
790 const PAD* aIgnore = nullptr ) const;
791
799 unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
800
811 unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
812
816 std::set<wxString>
818
826 wxString GetNextPadNumber( const wxString& aLastPadName ) const;
827
831 void AutoPositionFields();
832
837 wxString GetTypeName() const;
838
839 double GetArea( int aPadding = 0 ) const;
840
841 KIID GetLink() const { return m_link; }
842 void SetLink( const KIID& aLink ) { m_link = aLink; }
843
844 BOARD_ITEM* Duplicate() const override;
845
851 BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
852
858 void Add3DModel( FP_3DMODEL* a3DModel );
859
860 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
861 const std::vector<KICAD_T>& aScanTypes ) override;
862
863 wxString GetClass() const override
864 {
865 return wxT( "FOOTPRINT" );
866 }
867
868 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
869
870 BITMAPS GetMenuImage() const override;
871
872 EDA_ITEM* Clone() const override;
873
875 void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const override;
876
878 void RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction,
879 int aDepth = 0 ) const override;
880
881 virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
882
883 double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
884
885 virtual const BOX2I ViewBBox() const override;
886
894 static bool IsLibNameValid( const wxString& aName );
895
905 static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
906
910 bool FootprintNeedsUpdate( const FOOTPRINT* aLibFP, int aCompareFlags = 0,
911 REPORTER* aReporter = nullptr );
912
927 void SetInitialComments( wxArrayString* aInitialComments )
928 {
929 delete m_initial_comments;
930 m_initial_comments = aInitialComments;
931 }
932
939 double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
940
941 static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
942
944 const wxArrayString* GetInitialComments() const { return m_initial_comments; }
945
951 const SHAPE_POLY_SET& GetCourtyard( PCB_LAYER_ID aLayer ) const;
952
958 const SHAPE_POLY_SET& GetCachedCourtyard( PCB_LAYER_ID aLayer ) const;
959
966 void BuildCourtyardCaches( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
967
968 // @copydoc BOARD_ITEM::GetEffectiveShape
969 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
970 FLASHING aFlash = FLASHING::DEFAULT ) const override;
971
973 {
974 return static_cast<EMBEDDED_FILES*>( this );
975 }
976
978 {
979 return static_cast<const EMBEDDED_FILES*>( this );
980 }
981
982 void EmbedFonts() override;
983
984 double Similarity( const BOARD_ITEM& aOther ) const override;
985
986 bool operator==( const BOARD_ITEM& aOther ) const override;
987 bool operator==( const FOOTPRINT& aOther ) const;
988
989#if defined(DEBUG)
990 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
991#endif
992
994 {
995 bool operator()( const BOARD_ITEM* itemA, const BOARD_ITEM* itemB ) const;
996 };
997
998 struct cmp_pads
999 {
1000 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1001 };
1002
1004 {
1005 bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
1006 };
1007
1009 {
1010 bool operator()( const ZONE* aFirst, const ZONE* aSecond ) const;
1011 };
1012
1013protected:
1014 virtual void swapData( BOARD_ITEM* aImage ) override;
1015
1016private:
1017 PCB_FIELDS m_fields;
1018 DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
1019 PADS m_pads; // PAD items, owned by pointer
1020 ZONES m_zones; // PCB_ZONE items, owned by pointer
1021 GROUPS m_groups; // PCB_GROUP items, owned by pointer
1022
1023 EDA_ANGLE m_orient; // Orientation
1024 VECTOR2I m_pos; // Position of footprint on the board in internal units.
1025 LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
1026 int m_attributes; // Flag bits (see FOOTPRINT_ATTR_T)
1027 int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
1029
1030 // Bounding box caching strategy:
1031 // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
1032 // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
1033 // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
1034 // counter, and storing that as a timestamp for the various caches.
1035 // This means caches will get regenerated often -- but still far less often than if we had no
1036 // caches at all. The principal opitmization would be to change to dirty flag and make sure
1037 // that any edit that could affect the bounding boxes (including edits to the footprint
1038 // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
1039 // fragile.
1048
1049 // A list of pad groups, each of which is allowed to short nets within their group.
1050 // A pad group is a comma-separated list of pad numbers.
1051 std::vector<wxString> m_netTiePadGroups;
1052
1053 // Optional overrides
1055 std::optional<int> m_clearance;
1056 std::optional<int> m_solderMaskMargin; // Solder mask margin
1057 std::optional<int> m_solderPasteMargin; // Solder paste margin absolute value
1058 std::optional<double> m_solderPasteMarginRatio; // Solder mask margin ratio of pad size
1059 // The final margin is the sum of these 2 values
1060
1061 wxString m_libDescription; // File name and path for documentation file.
1062 wxString m_keywords; // Search keywords to find footprint in library.
1063 KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
1064 wxString m_sheetname; // Name of the sheet containing the symbol for this footprint
1065 wxString m_sheetfile; // File of the sheet containing the symbol for this footprint
1066 wxString m_filters; // Footprint filters from symbol
1068 int m_arflag; // Use to trace ratsnest and auto routing.
1069 KIID m_link; // Temporary logical link used during editing
1070 LSET m_privateLayers; // Layers visible only in the footprint editor
1071
1072 std::vector<FP_3DMODEL> m_3D_Drawings; // 3D models.
1073 wxArrayString* m_initial_comments; // s-expression comments in the footprint,
1074 // lazily allocated only if needed for speed
1075
1076 SHAPE_POLY_SET m_courtyard_cache_front; // Note that a footprint can have both front and back
1077 SHAPE_POLY_SET m_courtyard_cache_back; // courtyards populated.
1080 mutable std::mutex m_courtyard_cache_mutex;
1081};
1082
1083#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:645
std::optional< int > GetClearanceOverrides(wxString *aSource) const
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
Definition: footprint.h:311
void EmbedFonts() override
Definition: footprint.cpp:3714
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:2343
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:238
LIB_ID m_fpid
Definition: footprint.h:1025
wxString GetLibDescription() const
Definition: footprint.h:246
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:277
void SetLink(const KIID &aLink)
Definition: footprint.h:842
KIID_PATH m_path
Definition: footprint.h:1063
bool IsBoardOnly() const
Definition: footprint.h:721
int GetFieldCount() const
Return the number of fields in this symbol.
Definition: footprint.h:709
BOX2I m_cachedTextExcludedBBox
Definition: footprint.h:1044
bool IsDNP() const
Definition: footprint.h:757
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:410
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition: footprint.h:187
HASH_128 m_courtyard_cache_back_hash
Definition: footprint.h:1079
std::vector< PAD * > GetNetTiePads(PAD *aPad) const
Definition: footprint.cpp:3022
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:901
EDA_ANGLE GetOrientation() const
Definition: footprint.h:216
bool HasFieldByName(const wxString &aFieldName) const
Definition: footprint.cpp:537
ZONES & Zones()
Definition: footprint.h:201
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:1041
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:424
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:1054
BOX2I m_cachedBoundingBox
Definition: footprint.h:1040
static double GetCoverageArea(const BOARD_ITEM *aItem, const GENERAL_COLLECTOR &aCollector)
Definition: footprint.cpp:2659
bool IsExcludedFromBOM() const
Definition: footprint.h:739
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:2415
void SetFlag(int aFlag)
Definition: footprint.h:282
std::optional< double > m_solderPasteMarginRatio
Definition: footprint.h:1058
PCB_FIELD * GetFieldByName(const wxString &aFieldName)
Return a field in this symbol.
Definition: footprint.cpp:548
void SetDNP(bool aDNP=true)
Definition: footprint.h:758
static bool IsLibNameValid(const wxString &aName)
Test for validity of a name of a footprint to be used in a footprint library ( no spaces,...
Definition: footprint.cpp:2209
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of pads.
Definition: footprint.cpp:1861
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
Definition: footprint.h:274
void IncrementFlag()
Definition: footprint.h:283
const BOX2I GetLayerBoundingBox(LSET aLayers) const
Return the bounding box of the footprint on a given set of layers.
Definition: footprint.cpp:1408
std::optional< int > m_clearance
Definition: footprint.h:1055
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:590
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:3152
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:3069
void SetExcludedFromBOM(bool aExclude=true)
Definition: footprint.h:740
wxString GetSheetname() const
Definition: footprint.h:255
int m_fpStatus
Definition: footprint.h:1027
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:253
PCB_FIELDS GetFields()
Return a vector of fields from the symbol.
Definition: footprint.h:687
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: footprint.cpp:2153
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:1046
std::set< wxString > GetUniquePadNumbers(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the names of the unique, non-blank pads.
Definition: footprint.cpp:1880
void SetFilters(const wxString &aFilters)
Definition: footprint.h:262
void SetAllowMissingCourtyard(bool aAllow=true)
Definition: footprint.h:749
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:250
const DRAWINGS & GraphicalItems() const
Definition: footprint.h:199
void SetInitialComments(wxArrayString *aInitialComments)
Take ownership of caller's heap allocated aInitialComments block.
Definition: footprint.h:927
int m_attributes
Definition: footprint.h:1026
PCB_LAYER_ID GetSide() const
Use instead of IsFlipped() when you also need to account for unsided footprints (those purely on user...
Definition: footprint.cpp:1615
PCB_FIELD & Footprint()
Definition: footprint.h:629
std::vector< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:1072
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:2742
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:2455
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:2806
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2038
void SetAttributes(int aAttributes)
Definition: footprint.h:280
void SetSheetfile(const wxString &aSheetfile)
Definition: footprint.h:259
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: footprint.cpp:2026
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction, int aDepth=0) const override
Invoke a function on all descendants.
Definition: footprint.cpp:2064
std::optional< int > GetLocalSolderPasteMargin() const
Definition: footprint.h:270
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:3584
wxArrayString * m_initial_comments
Definition: footprint.h:1073
EDA_ITEM * Clone() const override
Invoke a function on all children.
Definition: footprint.cpp:2032
BOX2I m_cachedVisibleBBox
Definition: footprint.h:1042
BOX2I GetFpPadsLocalBbox() const
Return the bounding box containing pads when the footprint is on the front side, orientation 0,...
Definition: footprint.cpp:1208
int m_visibleBBoxCacheTimeStamp
Definition: footprint.h:1043
PCB_FIELD & Value()
read/write accessors:
Definition: footprint.h:627
const EMBEDDED_FILES * GetEmbeddedFiles() const
Definition: footprint.h:977
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:2247
std::optional< int > m_solderPasteMargin
Definition: footprint.h:1057
void SetFileFormatVersionAtLoad(int aVersion)
Definition: footprint.h:766
std::mutex m_courtyard_cache_mutex
Definition: footprint.h:1080
void SetExcludedFromPosFiles(bool aExclude=true)
Definition: footprint.h:731
const PCB_FIELD & Footprint() const
Definition: footprint.h:634
void SetOrientationDegrees(double aOrientation)
Definition: footprint.h:228
void SetPrivateLayers(LSET aLayers)
Adds an item to the container.
Definition: footprint.h:131
void ApplyDefaultSettings(const BOARD &board, bool aStyleFields, bool aStyleText, bool aStyleShapes)
Apply default board settings to the footprint field text properties.
Definition: footprint.cpp:612
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:2967
std::optional< int > GetLocalClearance() const
Definition: footprint.h:264
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:3375
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:540
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
Definition: footprint.cpp:2370
FOOTPRINT & operator=(const FOOTPRINT &aOther)
Definition: footprint.cpp:777
int m_arflag
Definition: footprint.h:1068
double GetOrientationDegrees() const
Definition: footprint.h:232
BOARD_ITEM * Duplicate() const override
Create a copy of this BOARD_ITEM.
Definition: footprint.cpp:2442
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: footprint.cpp:1928
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:279
std::optional< int > GetLocalClearance(wxString *aSource) const
Definition: footprint.h:297
void SetLocalZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:276
void ClearNetTiePadGroups()
Definition: footprint.h:330
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:225
LSET GetPrivateLayers() const
Definition: footprint.h:130
wxString GetFPIDAsString() const
Definition: footprint.h:243
wxString GetValueAsString() const
Definition: footprint.h:621
bool AllowMissingCourtyard() const
Definition: footprint.h:748
const ZONES & Zones() const
Definition: footprint.h:202
bool IsFlipped() const
Definition: footprint.h:380
wxString GetSheetfile() const
Definition: footprint.h:258
PADS & Pads()
Definition: footprint.h:195
SHAPE_POLY_SET GetBoundingHull() const
Return a bounding polygon for the shapes and pads in the footprint.
Definition: footprint.cpp:1453
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:3657
wxString GetTypeName() const
Get the type of footprint.
Definition: footprint.cpp:1196
DRAWINGS m_drawings
Definition: footprint.h:1018
bool NeedsPlaced() const
Definition: footprint.h:432
PCB_FIELD * GetFieldById(int aFieldId)
Return a field in this symbol.
Definition: footprint.cpp:526
SHAPE_POLY_SET m_courtyard_cache_back
Definition: footprint.h:1077
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:1045
const std::vector< wxString > & GetNetTiePadGroups() const
Definition: footprint.h:328
const LIB_ID & GetFPID() const
Definition: footprint.h:237
void SetReference(const wxString &aReference)
Definition: footprint.h:597
bool IsLocked() const override
Definition: footprint.h:400
const GROUPS & Groups() const
Definition: footprint.h:205
bool IsExcludedFromPosFiles() const
Definition: footprint.h:730
void SetLayerAndFlip(PCB_LAYER_ID aLayer)
Used as Layer property setter – performs a flip if necessary to set the footprint layer.
Definition: footprint.cpp:2275
ZONES m_zones
Definition: footprint.h:1020
int m_hullCacheTimeStamp
Definition: footprint.h:1047
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
Return the number of unique non-blank pads.
Definition: footprint.cpp:1911
void AddNetTiePadGroup(const wxString &aGroup)
Definition: footprint.h:335
bool LegacyPadsLocked() const
Definition: footprint.h:441
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: footprint.cpp:2194
LSET m_privateLayers
Definition: footprint.h:1070
int GetLikelyAttribute() const
Returns the most likely attribute based on pads Either FP_THROUGH_HOLE/FP_SMD/OTHER(0)
Definition: footprint.cpp:1143
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: footprint.cpp:2237
static bool ClassOf(const EDA_ITEM *aItem)
Definition: footprint.h:125
wxString m_libDescription
Definition: footprint.h:1061
bool HitTestOnLayer(const VECTOR2I &aPosition, PCB_LAYER_ID aLayer, int aAccuracy=0) const
Test if the point hits one or more of the footprint elements on a given layer.
Definition: footprint.cpp:1677
VECTOR2I m_pos
Definition: footprint.h:1024
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource) const
Definition: footprint.h:316
std::vector< wxString > m_netTiePadGroups
Definition: footprint.h:1051
PAD * GetPad(const VECTOR2I &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Get a pad at aPosition on aLayerMask in the footprint.
Definition: footprint.cpp:1829
void Add3DModel(FP_3DMODEL *a3DModel)
Add a3DModel definition to the end of the 3D model list.
Definition: footprint.cpp:1917
void SetValue(const wxString &aValue)
Definition: footprint.h:618
GROUPS m_groups
Definition: footprint.h:1021
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:1535
PCB_FIELD & Reference()
Definition: footprint.h:628
const PCB_FIELD & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:632
wxString GetReferenceAsString() const
Definition: footprint.h:600
wxString m_sheetfile
Definition: footprint.h:1065
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars for this footprint.
Definition: footprint.cpp:887
std::optional< int > m_solderMaskMargin
Definition: footprint.h:1056
SHAPE_POLY_SET m_courtyard_cache_front
Definition: footprint.h:1076
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:978
std::vector< const PAD * > GetPads(const wxString &aPadNumber, const PAD *aIgnore=nullptr) const
Definition: footprint.cpp:1845
void AutoPositionFields()
Position Reference and Value fields at the top and bottom of footprint's bounding box.
Definition: footprint.cpp:2604
wxString m_keywords
Definition: footprint.h:1062
const PCB_FIELD & Reference() const
Definition: footprint.h:633
void ClearAllNets()
Clear (i.e.
Definition: footprint.cpp:969
bool HasThroughHolePads() const
Definition: footprint.cpp:3310
void BuildCourtyardCaches(OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr)
Build complex polygons of the courtyard areas from graphic items on the courtyard layers.
Definition: footprint.cpp:2865
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: footprint.cpp:1646
wxString GetFieldText(const wxString &aFieldName) const
Search for a field named aFieldName and returns text associated with this field.
Definition: footprint.cpp:563
EDA_ANGLE m_orient
Definition: footprint.h:1023
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1752
bool IsNetTie() const
Definition: footprint.h:286
wxString GetClass() const override
Return the class name.
Definition: footprint.h:863
const PCB_FIELDS & Fields() const
Definition: footprint.h:193
const PADS & Pads() const
Definition: footprint.h:196
void IncrementReference(int aDelta)
Bump the current reference by aDelta.
Definition: footprint.cpp:2632
int GetFileFormatVersionAtLoad() const
Definition: footprint.h:767
std::optional< double > GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:273
KIID m_link
Definition: footprint.h:1069
void RemoveField(const wxString &aFieldName)
Remove a user field from the footprint.
Definition: footprint.cpp:599
GROUPS & Groups()
Definition: footprint.h:204
wxString GetFilters() const
Definition: footprint.h:261
void SetSheetname(const wxString &aSheetname)
Definition: footprint.h:256
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: footprint.h:944
KIID GetLink() const
Definition: footprint.h:841
bool IsConflicting() const
Definition: footprint.cpp:881
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:209
const SHAPE_POLY_SET & GetCachedCourtyard(PCB_LAYER_ID aLayer) const
Return the cached courtyard area.
Definition: footprint.cpp:2856
PCB_FIELDS & Fields()
Definition: footprint.h:192
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
Test for validity of the name in a library of the footprint ( no spaces, dir separators ....
Definition: footprint.cpp:2220
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:247
bool TextOnly() const
Definition: footprint.cpp:1233
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:2284
const wxString & GetValue() const
Definition: footprint.h:613
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:3087
double GetArea(int aPadding=0) const
Definition: footprint.cpp:1133
const PCB_FIELDS & GetFields() const
Definition: footprint.h:688
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:433
wxString m_filters
Definition: footprint.h:1066
const wxString & GetReference() const
Definition: footprint.h:591
void CheckNetTiePadGroups(const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
Definition: footprint.cpp:3265
void SetFPIDAsString(const wxString &aFPID)
Definition: footprint.h:244
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: footprint.cpp:2015
void SetBoardOnly(bool aIsBoardOnly=true)
Definition: footprint.h:722
const std::vector< FP_3DMODEL > & Models() const
Definition: footprint.h:210
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition: footprint.h:268
PCB_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: footprint.cpp:514
timestamp_t m_lastEditTime
Definition: footprint.h:1067
const SHAPE_POLY_SET & GetCourtyard(PCB_LAYER_ID aLayer) const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.cpp:2842
int GetFlag() const
Definition: footprint.h:284
wxString m_sheetname
Definition: footprint.h:1064
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: footprint.cpp:2101
int m_fileFormatVersionAtLoad
Definition: footprint.h:1028
void SetLocalClearance(std::optional< int > aClearance)
Definition: footprint.h:265
const KIID_PATH & GetPath() const
Definition: footprint.h:252
std::optional< int > GetLocalSolderMaskMargin() const
Definition: footprint.h:267
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
Definition: footprint.h:271
wxString GetKeywords() const
Definition: footprint.h:249
bool operator==(const BOARD_ITEM &aOther) const override
Definition: footprint.cpp:3322
EMBEDDED_FILES * GetEmbeddedFiles() override
Definition: footprint.h:972
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:3044
PADS m_pads
Definition: footprint.h:1019
virtual void swapData(BOARD_ITEM *aImage) override
Definition: footprint.cpp:3288
wxString GetNextPadNumber(const wxString &aLastPadName) const
Return the next available pad number in the footprint.
Definition: footprint.cpp:2584
bool IsPlaced() const
Definition: footprint.h:423
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:1041
VECTOR2I GetPosition() const override
Definition: footprint.h:213
DRAWINGS & GraphicalItems()
Definition: footprint.h:198
PCB_FIELDS m_fields
Definition: footprint.h:1017
HASH_128 m_courtyard_cache_front_hash
Definition: footprint.h:1078
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: footprint.cpp:1745
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1809
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:1248
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:395
#define FP_is_LOCKED
footprint LOCKED: no autoplace allowed
Definition: footprint.h:394
#define FP_PADS_are_LOCKED
Definition: footprint.h:397
#define FP_to_PLACE
In autoplace: footprint waiting for autoplace.
Definition: footprint.h:396
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:3398
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3475
bool operator()(const PAD *aFirst, const PAD *aSecond) const
Definition: footprint.cpp:3503
bool operator()(const ZONE *aFirst, const ZONE *aSecond) const
Definition: footprint.cpp:3558
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