KiCad PCB EDA Suite
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-2021 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 <board_item_container.h>
31 #include <board_item.h>
32 #include <collectors.h>
33 #include <convert_to_biu.h>
34 #include <layers_id_colors_and_visibility.h> // ALL_LAYERS definition.
35 #include <lib_id.h>
36 #include <list>
37 
38 #include <zones.h>
40 #include <fp_text.h>
41 #include <zone.h>
42 #include <functional>
43 
44 class LINE_READER;
45 class EDA_3D_CANVAS;
46 class PAD;
47 class BOARD;
48 class MSG_PANEL_ITEM;
49 class SHAPE;
50 
51 namespace KIGFX {
52 class VIEW;
53 }
54 
56 {
58  INCLUDE_NPTH = true
59 };
60 
67 {
68  FP_THROUGH_HOLE = 0x0001,
69  FP_SMD = 0x0002,
72  FP_BOARD_ONLY = 0x0010 // Footprint has no corresponding symbol
73 };
74 
76 {
77 public:
79  // Initialize with sensible values
80  m_Scale { 1, 1, 1 },
81  m_Rotation { 0, 0, 0 },
82  m_Offset { 0, 0, 0 },
83  m_Opacity( 1.0 ),
84  m_Show( true )
85  {
86  }
87 
88  struct VECTOR3D
89  {
90  double x, y, z;
91  };
92 
96  double m_Opacity;
97  wxString m_Filename;
98  bool m_Show;
99 };
100 
101 DECL_DEQ_FOR_SWIG( PADS, PAD* )
102 DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
103 DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
104 DECL_VEC_FOR_SWIG( FP_GROUPS, PCB_GROUP* )
105 DECL_DEQ_FOR_SWIG( FOOTPRINTS, FOOTPRINT* )
106 
108 {
109 public:
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  static inline bool ClassOf( const EDA_ITEM* aItem )
123  {
124  return aItem && aItem->Type() == PCB_FOOTPRINT_T;
125  }
126 
128  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT ) override;
129 
131  void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) override;
132 
140  void ClearAllNets();
141 
151  EDA_RECT GetFpPadsLocalBbox() const;
152 
158  SHAPE_POLY_SET GetBoundingHull() const;
159 
160  // Virtual function
161  const EDA_RECT GetBoundingBox() const override;
162  const EDA_RECT GetBoundingBox( bool aIncludeText, bool aIncludeInvisibleText ) const;
163 
164  PADS& Pads() { return m_pads; }
165  const PADS& Pads() const { return m_pads; }
166 
167  DRAWINGS& GraphicalItems() { return m_drawings; }
168  const DRAWINGS& GraphicalItems() const { return m_drawings; }
169 
170  FP_ZONES& Zones() { return m_fp_zones; }
171  const FP_ZONES& Zones() const { return m_fp_zones; }
172 
173  FP_GROUPS& Groups() { return m_fp_groups; }
174  const FP_GROUPS& Groups() const { return m_fp_groups; }
175 
176  bool HasThroughHolePads() const;
177 
178  std::list<FP_3DMODEL>& Models() { return m_3D_Drawings; }
179  const std::list<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
180 
181  void SetPosition( const wxPoint& aPos ) override;
182  wxPoint GetPosition() const override { return m_pos; }
183 
184  void SetOrientation( double aNewAngle );
185  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
186  double GetOrientation() const { return m_orient; }
187  double GetOrientationDegrees() const { return m_orient / 10.0; }
188  double GetOrientationRadians() const { return m_orient * M_PI / 1800; }
189 
190  const LIB_ID& GetFPID() const { return m_fpid; }
191  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
192 
193  const wxString& GetDescription() const { return m_doc; }
194  void SetDescription( const wxString& aDoc ) { m_doc = aDoc; }
195 
196  const wxString& GetKeywords() const { return m_keywords; }
197  void SetKeywords( const wxString& aKeywords ) { m_keywords = aKeywords; }
198 
199  const KIID_PATH& GetPath() const { return m_path; }
200  void SetPath( const KIID_PATH& aPath ) { m_path = aPath; }
201 
202  int GetLocalSolderMaskMargin() const { return m_localSolderMaskMargin; }
203  void SetLocalSolderMaskMargin( int aMargin ) { m_localSolderMaskMargin = aMargin; }
204 
205  int GetLocalClearance() const { return m_localClearance; }
206  void SetLocalClearance( int aClearance ) { m_localClearance = aClearance; }
207 
208  int GetLocalClearance( wxString* aSource ) const
209  {
210  if( aSource )
211  *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
212 
213  return m_localClearance;
214  }
215 
216  int GetLocalSolderPasteMargin() const { return m_localSolderPasteMargin; }
217  void SetLocalSolderPasteMargin( int aMargin ) { m_localSolderPasteMargin = aMargin; }
218 
219  double GetLocalSolderPasteMarginRatio() const { return m_localSolderPasteMarginRatio; }
220  void SetLocalSolderPasteMarginRatio( double aRatio ) { m_localSolderPasteMarginRatio = aRatio; }
221 
222  void SetZoneConnection( ZONE_CONNECTION aType ) { m_zoneConnection = aType; }
223  ZONE_CONNECTION GetZoneConnection() const { return m_zoneConnection; }
224 
225  void SetThermalWidth( int aWidth ) { m_thermalWidth = aWidth; }
226  int GetThermalWidth() const { return m_thermalWidth; }
227 
228  void SetThermalGap( int aGap ) { m_thermalGap = aGap; }
229  int GetThermalGap() const { return m_thermalGap; }
230 
231  int GetAttributes() const { return m_attributes; }
232  void SetAttributes( int aAttributes ) { m_attributes = aAttributes; }
233 
234  void SetFlag( int aFlag ) { m_arflag = aFlag; }
235  void IncrementFlag() { m_arflag += 1; }
236  int GetFlag() const { return m_arflag; }
237 
238  // A bit of a hack until net ties are supported as first class citizens
239  bool IsNetTie() const
240  {
241  return GetKeywords().StartsWith( wxT( "net tie" ) );
242  }
243 
244  void Move( const wxPoint& aMoveVector ) override;
245 
246  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
247 
248  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
249 
261  void MoveAnchorPosition( const wxPoint& aMoveVector );
262 
266  bool IsFlipped() const { return GetLayer() == B_Cu; }
267 
273  bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
274 
275 // m_footprintStatus bits:
276 #define FP_is_LOCKED 0x01
277 #define FP_is_PLACED 0x02
278 #define FP_to_PLACE 0x04
279 #define FP_PADS_are_LOCKED 0x08
280 
281 
282  bool IsLocked() const override
283  {
284  return ( m_fpStatus & FP_is_LOCKED ) != 0;
285  }
286 
292  void SetLocked( bool isLocked ) override
293  {
294  if( isLocked )
295  m_fpStatus |= FP_is_LOCKED;
296  else
297  m_fpStatus &= ~FP_is_LOCKED;
298  }
299 
300  bool IsPlaced() const { return m_fpStatus & FP_is_PLACED; }
301  void SetIsPlaced( bool isPlaced )
302  {
303  if( isPlaced )
304  m_fpStatus |= FP_is_PLACED;
305  else
306  m_fpStatus &= ~FP_is_PLACED;
307  }
308 
309  bool NeedsPlaced() const { return m_fpStatus & FP_to_PLACE; }
310  void SetNeedsPlaced( bool needsPlaced )
311  {
312  if( needsPlaced )
313  m_fpStatus |= FP_to_PLACE;
314  else
315  m_fpStatus &= ~FP_to_PLACE;
316  }
317 
318  bool LegacyPadsLocked() const { return m_fpStatus & FP_PADS_are_LOCKED; }
319 
320  /*
321  void SetPadsLocked( bool aPadsLocked )
322  {
323  if( aPadsLocked )
324  m_fpStatus |= FP_PADS_are_LOCKED;
325  else
326  m_fpStatus &= ~FP_PADS_are_LOCKED;
327  }
328  */
329 
330  void SetLastEditTime( timestamp_t aTime ) { m_lastEditTime = aTime; }
331  void SetLastEditTime() { m_lastEditTime = time( NULL ); }
332  timestamp_t GetLastEditTime() const { return m_lastEditTime; }
333 
354  void TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
355  PCB_LAYER_ID aLayer, int aClearance,
356  int aMaxError, ERROR_LOC aErrorLoc,
357  bool aSkipNPTHPadsWihNoCopper = false,
358  bool aSkipPlatedPads = false,
359  bool aSkipNonPlatedPads = false ) const;
360 
375  void TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
376  PCB_LAYER_ID aLayer, int aClearance,
377  int aError, ERROR_LOC aErrorLoc,
378  bool aIncludeText = true,
379  bool aIncludeShapes = true ) const;
380 
386  PCB_LAYER_ID aLayer, int aClearance,
387  int aError, ERROR_LOC aErrorLoc ) const
388  {
389  TransformFPShapesWithClearanceToPolygon( aCornerBuffer, aLayer, aClearance, aError,
390  aErrorLoc, true, false );
391  }
392 
396  void GetContextualTextVars( wxArrayString* aVars ) const;
397 
403  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
404 
406  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
407 
408  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
409 
419  bool HitTestAccurate( const wxPoint& aPosition, int aAccuracy = 0 ) const;
420 
421  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
422 
426  const wxString& GetReference() const
427  {
428  return m_reference->GetText();
429  }
430 
435  void SetReference( const wxString& aReference )
436  {
437  m_reference->SetText( aReference );
438  }
439 
443  void IncrementReference( int aDelta );
444 
448  const wxString& GetValue() const
449  {
450  return m_value->GetText();
451  }
452 
456  void SetValue( const wxString& aValue )
457  {
458  m_value->SetText( aValue );
459  }
460 
462  FP_TEXT& Value() { return *m_value; }
463  FP_TEXT& Reference() { return *m_reference; }
464 
466  FP_TEXT& Value() const { return *m_value; }
467  FP_TEXT& Reference() const { return *m_reference; }
468 
469  const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
470  void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
471  const wxString& GetProperty( const wxString& aKey) { return m_properties[ aKey ]; }
472  bool HasProperty( const wxString& aKey)
473  {
474  return m_properties.find( aKey ) != m_properties.end();
475  }
476  void SetProperty( const wxString& aKey, const wxString& aVal ) { m_properties[ aKey ] = aVal; }
477 
486  PAD* FindPadByName( const wxString& aPadName ) const;
487 
495  PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
496 
497  PAD* GetTopLeftPad();
498 
506  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
507 
518  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
519 
527  wxString GetNextPadName( const wxString& aLastPadName ) const;
528 
529  double GetArea( int aPadding = 0 ) const;
530 
531  KIID GetLink() const { return m_link; }
532  void SetLink( const KIID& aLink ) { m_link = aLink; }
533 
534  int GetPlacementCost180() const { return m_rot180Cost; }
535  void SetPlacementCost180( int aCost ) { m_rot180Cost = aCost; }
536 
537  int GetPlacementCost90() const { return m_rot90Cost; }
538  void SetPlacementCost90( int aCost ) { m_rot90Cost = aCost; }
539 
540  BOARD_ITEM* Duplicate() const override;
541 
547  BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootprint = false );
548 
554  void Add3DModel( FP_3DMODEL* a3DModel );
555 
556  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
557 
558  wxString GetClass() const override
559  {
560  return wxT( "FOOTPRINT" );
561  }
562 
563  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
564 
565  BITMAPS GetMenuImage() const override;
566 
567  EDA_ITEM* Clone() const override;
568 
576  void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const;
577 
585  void GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads = true ) const;
586 
587  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
588 
589  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
590 
591  virtual const BOX2I ViewBBox() const override;
592 
600  static bool IsLibNameValid( const wxString& aName );
601 
611  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
612 
627  void SetInitialComments( wxArrayString* aInitialComments )
628  {
629  delete m_initial_comments;
630  m_initial_comments = aInitialComments;
631  }
632 
639  double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
640 
641  static double GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLECTOR& aCollector );
642 
644  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
645 
651  const SHAPE_POLY_SET& GetPolyCourtyardFront() const { return m_poly_courtyard_front; }
652  const SHAPE_POLY_SET& GetPolyCourtyardBack() const { return m_poly_courtyard_back; }
653 
660  void BuildPolyCourtyards( OUTLINE_ERROR_HANDLER* aErrorHandler = nullptr );
661 
662  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
663 
664  virtual void SwapData( BOARD_ITEM* aImage ) override;
665 
667  {
668  bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
669  };
670 
671  struct cmp_pads
672  {
673  bool operator()( const PAD* aFirst, const PAD* aSecond ) const;
674  };
675 
676 
677 #if defined(DEBUG)
678  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
679 #endif
680 
681 private:
682  DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
683  PADS m_pads; // PAD items, owned by pointer
684  FP_ZONES m_fp_zones; // FP_ZONE items, owned by pointer
685  FP_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
686 
687  double m_orient; // Orientation in tenths of a degree, 900=90.0 degrees.
688  wxPoint m_pos; // Position of footprint on the board in internal units.
689  FP_TEXT* m_reference; // Component reference designator value (U34, R18..)
690  FP_TEXT* m_value; // Component value (74LS00, 22K..)
691  LIB_ID m_fpid; // The #LIB_ID of the FOOTPRINT.
692  int m_attributes; // Flag bits ( see FOOTPRINT_ATTR_T )
693  int m_fpStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
694 
695  // Bounding box caching strategy:
696  // While we attempt to notice the low-hanging fruit operations and update the bounding boxes
697  // accordingly, we rely mostly on a "if anything changed then the caches are stale" approach.
698  // We implement this by having PCB_BASE_FRAME's OnModify() method increment an operation
699  // counter, and storing that as a timestamp for the various caches.
700  // This means caches will get regenerated often -- but still far less often than if we had no
701  // caches at all. The principal opitmization would be to change to dirty flag and make sure
702  // that any edit that could affect the bounding boxes (including edits to the footprint
703  // children) marked the bounding boxes dirty. It would definitely be faster -- but also more
704  // fragile.
712  mutable int m_hullCacheTimeStamp;
713 
718  int m_localSolderMaskMargin; // Solder mask margin
719  int m_localSolderPasteMargin; // Solder paste margin absolute value
720  double m_localSolderPasteMarginRatio; // Solder mask margin ratio value of pad size
721 
722  wxString m_doc; // File name and path for documentation file.
723  wxString m_keywords; // Search keywords to find footprint in library.
724  KIID_PATH m_path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
726  int m_arflag; // Use to trace ratsnest and auto routing.
727  KIID m_link; // Temporary logical link used during editing
728  int m_rot90Cost; // Horizontal automatic placement cost ( 0..10 ).
729  int m_rot180Cost; // Vertical automatic placement cost ( 0..10 ).
730 
731  std::list<FP_3DMODEL> m_3D_Drawings; // Linked list of 3D models.
732  std::map<wxString, wxString> m_properties;
733  wxArrayString* m_initial_comments; // s-expression comments in the footprint,
734  // lazily allocated only if needed for speed
735 
736  SHAPE_POLY_SET m_poly_courtyard_front; // Note that a footprint can have both front and back
737  SHAPE_POLY_SET m_poly_courtyard_back; // courtyards populated.
738 };
739 
740 #endif // FOOTPRINT_H
void SetReference(const wxString &aReference)
Definition: footprint.h:435
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
Definition: macros_swig.h:51
int m_localSolderPasteMargin
Definition: footprint.h:719
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
bool IsLocked() const override
Definition: footprint.h:282
bool NeedsPlaced() const
Definition: footprint.h:309
const wxString & GetDescription() const
Definition: footprint.h:193
void SetInitialComments(wxArrayString *aInitialComments)
Take ownership of caller's heap allocated aInitialComments block.
Definition: footprint.h:627
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
EDA_RECT m_cachedVisibleBBox
Definition: footprint.h:707
const SHAPE_POLY_SET & GetPolyCourtyardFront() const
Used in DRC to test the courtyard area (a complex polygon).
Definition: footprint.h:651
double GetOrientationRadians() const
Definition: footprint.h:188
std::list< FP_3DMODEL > & Models()
Definition: footprint.h:178
void SetNeedsPlaced(bool needsPlaced)
Definition: footprint.h:310
const wxString & GetValue() const
Definition: footprint.h:448
FP_TEXT & Value() const
The const versions to keep the compiler happy.
Definition: footprint.h:466
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:222
const KIID_PATH & GetPath() const
Definition: footprint.h:199
ZONE_CONNECTION m_zoneConnection
Definition: footprint.h:714
double m_localSolderPasteMarginRatio
Definition: footprint.h:720
SHAPE_POLY_SET m_poly_courtyard_back
Definition: footprint.h:737
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
int GetPlacementCost180() const
Definition: footprint.h:534
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:200
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
#define FP_PADS_are_LOCKED
Definition: footprint.h:279
void SetIsPlaced(bool isPlaced)
Definition: footprint.h:301
double m_orient
Definition: footprint.h:687
void Flip(T &aValue)
timestamp_t m_lastEditTime
Definition: footprint.h:725
void IncrementFlag()
Definition: footprint.h:235
double GetOrientation() const
Definition: footprint.h:186
void TransformFPTextWithClearanceToPolygonSet(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc) const
This function is the same as TransformGraphicShapesWithClearanceToPolygonSet but only generate text.
Definition: footprint.h:385
FP_3DMODEL()
Definition: footprint.h:78
bool LegacyPadsLocked() const
Definition: footprint.h:318
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:48
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: footprint.h:220
functions to convert a shape built with DRAWSEGMENTS to a polygon.
void SetOrientationDegrees(double aOrientation)
Definition: footprint.h:185
FP_TEXT * m_reference
Definition: footprint.h:689
int m_visibleBBoxCacheTimeStamp
Definition: footprint.h:708
INCLUDE_NPTH_T
Definition: footprint.h:55
void SetThermalGap(int aGap)
Definition: footprint.h:228
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
The base class for create windows for drawing purpose.
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:95
FOOTPRINT_ATTR_T
The set of attributes allowed within a FOOTPRINT, using FOOTPRINT::SetAttributes() and FOOTPRINT::Get...
Definition: footprint.h:66
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:95
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
timestamp_t GetLastEditTime() const
Definition: footprint.h:332
void SetAttributes(int aAttributes)
Definition: footprint.h:232
int m_rot90Cost
Definition: footprint.h:728
PADS & Pads()
Definition: footprint.h:164
void SetPlacementCost180(int aCost)
Definition: footprint.h:535
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:462
FP_TEXT * m_value
Definition: footprint.h:690
void SetThermalWidth(int aWidth)
Definition: footprint.h:225
void SetDescription(const wxString &aDoc)
Definition: footprint.h:194
int m_arflag
Definition: footprint.h:726
KIID m_link
Definition: footprint.h:727
FP_TEXT & Reference()
Definition: footprint.h:463
const FP_ZONES & Zones() const
Definition: footprint.h:171
int m_localSolderMaskMargin
Definition: footprint.h:718
EDA_RECT m_cachedBoundingBox
Definition: footprint.h:705
FP_ZONES & Zones()
Definition: footprint.h:170
Definition: kiid.h:44
bool m_Show
Include model in rendering.
Definition: footprint.h:98
int m_fpStatus
Definition: footprint.h:693
int GetFlag() const
Definition: footprint.h:236
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
FP_ZONES m_fp_zones
Definition: footprint.h:684
#define NULL
SHAPE_POLY_SET m_poly_courtyard_front
Definition: footprint.h:736
Represent a set of closed polygons.
SHAPE_POLY_SET m_cachedHull
Definition: footprint.h:711
const DRAWINGS & GraphicalItems() const
Definition: footprint.h:168
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:93
int m_thermalGap
Definition: footprint.h:716
void SetLocalClearance(int aClearance)
Definition: footprint.h:206
int GetLocalClearance() const
Definition: footprint.h:205
bool IsNetTie() const
Definition: footprint.h:239
const SHAPE_POLY_SET & GetPolyCourtyardBack() const
Definition: footprint.h:652
const PADS & Pads() const
Definition: footprint.h:165
const wxString & GetReference() const
Definition: footprint.h:426
double m_Opacity
Definition: footprint.h:96
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
static LSET AllLayersMask()
Definition: lset.cpp:787
bool IsPlaced() const
Definition: footprint.h:300
const LIB_ID & GetFPID() const
Definition: footprint.h:190
const FP_GROUPS & Groups() const
Definition: footprint.h:174
An abstract shape on 2D plane.
Definition: shape.h:116
FP_TEXT & Reference() const
Definition: footprint.h:467
wxPoint m_pos
Definition: footprint.h:688
void SetValue(const wxString &aValue)
Definition: footprint.h:456
void SetFlag(int aFlag)
Definition: footprint.h:234
const wxString & GetKeywords() const
Definition: footprint.h:196
int GetThermalWidth() const
Definition: footprint.h:226
int m_boundingBoxCacheTimeStamp
Definition: footprint.h:706
#define FP_to_PLACE
In autoplace: footprint waiting for autoplace.
Definition: footprint.h:278
KIID GetLink() const
Definition: footprint.h:531
#define FP_is_LOCKED
footprint LOCKED: no autoplace allowed
Definition: footprint.h:276
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
KIID_PATH m_path
Definition: footprint.h:724
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxString m_Filename
The 3D shape filename in 3D library.
Definition: footprint.h:97
const wxArrayString * GetInitialComments() const
Definition: footprint.h:644
EDA_UNITS
Definition: eda_units.h:38
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:32
int GetLocalClearance(wxString *aSource) const
Definition: footprint.h:208
bool IsFlipped() const
Definition: footprint.h:266
FP_GROUPS & Groups()
Definition: footprint.h:173
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:191
void SetLink(const KIID &aLink)
Definition: footprint.h:532
double GetOrientationDegrees() const
Definition: footprint.h:187
int m_thermalWidth
Definition: footprint.h:715
wxString m_keywords
Definition: footprint.h:723
int GetLocalSolderMaskMargin() const
Definition: footprint.h:202
int m_localClearance
Definition: footprint.h:717
void SetProperty(const wxString &aKey, const wxString &aVal)
Definition: footprint.h:476
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:94
Board layer functions and definitions.
int GetAttributes() const
Definition: footprint.h:231
int m_rot180Cost
Definition: footprint.h:729
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
int m_textExcludedBBoxCacheTimeStamp
Definition: footprint.h:710
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:257
wxString GetClass() const override
Return the class name.
Definition: footprint.h:558
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
const std::list< FP_3DMODEL > & Models() const
Definition: footprint.h:179
#define _(s)
Definition: 3d_actions.cpp:33
LIB_ID m_fpid
Definition: footprint.h:691
void SetLastEditTime(timestamp_t aTime)
Definition: footprint.h:330
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:241
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:197
Handle the component boundary box.
Definition: eda_rect.h:42
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:292
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
EDA_RECT m_cachedTextExcludedBBox
Definition: footprint.h:709
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const wxPoint &pt)> OUTLINE_ERROR_HANDLER
wxPoint GetPosition() const override
Definition: footprint.h:182
double GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:219
DRAWINGS m_drawings
Definition: footprint.h:682
const std::map< wxString, wxString > & GetProperties() const
Definition: footprint.h:469
ZONE_CONNECTION GetZoneConnection() const
Definition: footprint.h:223
int GetPlacementCost90() const
Definition: footprint.h:537
void SetLastEditTime()
Definition: footprint.h:331
std::map< wxString, wxString > m_properties
Definition: footprint.h:732
static bool ClassOf(const EDA_ITEM *aItem)
Adds an item to the container.
Definition: footprint.h:122
Abstract interface for BOARD_ITEMs capable of storing other items inside.
int GetLocalSolderPasteMargin() const
Definition: footprint.h:216
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:54
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: footprint.h:470
wxArrayString * m_initial_comments
Definition: footprint.h:733
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
Declare a std::vector but no swig template.
Definition: macros_swig.h:50
#define FP_is_PLACED
In autoplace: footprint automatically placed.
Definition: footprint.h:277
const wxString & GetProperty(const wxString &aKey)
Definition: footprint.h:471
Definition: pad.h:60
SEARCH_RESULT
Definition: eda_item.h:41
FP_GROUPS m_fp_groups
Definition: footprint.h:685
bool HasProperty(const wxString &aKey)
Definition: footprint.h:472
wxString m_doc
Definition: footprint.h:722
int GetThermalGap() const
Definition: footprint.h:229
std::list< FP_3DMODEL > m_3D_Drawings
Definition: footprint.h:731
A specialization of ZONE for use in footprints.
Definition: zone.h:943
PADS m_pads
Definition: footprint.h:683
int m_hullCacheTimeStamp
Definition: footprint.h:712
void SetPlacementCost90(int aCost)
Definition: footprint.h:538
int m_attributes
Definition: footprint.h:692
void SetLocalSolderMaskMargin(int aMargin)
Definition: footprint.h:203
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163
void SetLocalSolderPasteMargin(int aMargin)
Definition: footprint.h:217