KiCad PCB EDA Suite
class_module.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-2017 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 
31 #ifndef MODULE_H_
32 #define MODULE_H_
33 
34 
35 #include <list>
36 #include <dlist.h>
37 #include <layers_id_colors_and_visibility.h> // ALL_LAYERS definition.
38 #include <class_board_item.h>
39 #include <board_item_container.h>
40 #include <lib_id.h>
41 
42 #include <class_text_mod.h>
43 #include <PolyLine.h>
44 #include "zones.h"
45 
46 #include <core/iterators.h>
47 
48 #include <functional>
49 
50 class LINE_READER;
51 class EDA_3D_CANVAS;
52 class EDA_DRAW_PANEL;
53 class D_PAD;
54 class BOARD;
55 class MSG_PANEL_ITEM;
56 
57 namespace KIGFX {
58 class VIEW;
59 }
60 
62 {
64  INCLUDE_NPTH = true
65 };
66 
74 {
76  MOD_CMS = 1,
77  MOD_VIRTUAL = 2
79 };
81 
83 {
84  public:
86  // Initialize with sensible values
87  m_Scale { 1, 1, 1 },
88  m_Rotation { 0, 0, 0 },
89  m_Offset { 0, 0, 0 }
90  {
91  }
92 
93  struct VECTOR3D
94  {
95  double x, y, z;
96  };
97 
101  wxString m_Filename;
102 };
103 
105 {
106 public:
107  MODULE( BOARD* parent );
108 
109  MODULE( const MODULE& aModule );
110 
111  ~MODULE();
112 
113  MODULE& operator=( const MODULE& aOther );
114 
115  static inline bool ClassOf( const EDA_ITEM* aItem )
116  {
117  return PCB_MODULE_T == aItem->Type();
118  }
119 
120  MODULE* Next() const { return static_cast<MODULE*>( Pnext ); }
121  MODULE* Back() const { return static_cast<MODULE*>( Pback ); }
122 
124  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_INSERT ) override;
125 
127  void Remove( BOARD_ITEM* aItem ) override;
128 
136  void ClearAllNets();
137 
142  void CalculateBoundingBox();
143 
149  EDA_RECT GetFootprintRect() const;
150 
151  // Virtual function
152  const EDA_RECT GetBoundingBox() const override;
153 
154  DLIST<D_PAD>& PadsList() { return m_Pads; }
155  const DLIST<D_PAD>& PadsList() const { return m_Pads; }
156 
159 
161  {
163  }
164 
166  {
168  }
169 
170  std::list<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
171  const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
172 
173  void SetPosition( const wxPoint& aPos ) override;
174 
175  const wxPoint& GetPosition() const override { return m_Pos; }
176 
177  void SetOrientation( double newangle );
178 
179  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
180  double GetOrientation() const { return m_Orient; }
181  double GetOrientationDegrees() const { return m_Orient / 10.0; }
182  double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
183 
184  const LIB_ID& GetFPID() const { return m_fpid; }
185  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
186 
187  const wxString& GetDescription() const { return m_Doc; }
188  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
189 
190  const wxString& GetKeywords() const { return m_KeyWord; }
191  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
192 
193  const wxString& GetPath() const { return m_Path; }
194  void SetPath( const wxString& aPath ) { m_Path = aPath; }
195 
197  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
198 
199  int GetLocalClearance() const { return m_LocalClearance; }
200  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
201 
203  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
204 
207 
210 
211  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
212  int GetThermalWidth() const { return m_ThermalWidth; }
213 
214  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
215  int GetThermalGap() const { return m_ThermalGap; }
216 
217  int GetAttributes() const { return m_Attributs; }
218  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
219 
220  void SetFlag( int aFlag ) { m_arflag = aFlag; }
221  void IncrementFlag() { m_arflag += 1; }
222  int GetFlag() const { return m_arflag; }
223 
224  void Move( const wxPoint& aMoveVector ) override;
225 
226  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
227 
228  void Flip( const wxPoint& aCentre ) override;
229 
241  void MoveAnchorPosition( const wxPoint& aMoveVector );
242 
247  bool IsFlipped() const { return GetLayer() == B_Cu; }
248 
249 // m_ModuleStatus bits:
250 #define MODULE_is_LOCKED 0x01
251 #define MODULE_is_PLACED 0x02
252 #define MODULE_to_PLACE 0x04
253 #define MODULE_PADS_LOCKED 0x08
254 
255 
256  bool IsLocked() const override
257  {
258  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
259  }
260 
266  void SetLocked( bool isLocked ) override
267  {
268  if( isLocked )
270  else
272  }
273 
274  bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
275  void SetIsPlaced( bool isPlaced )
276  {
277  if( isPlaced )
279  else
281  }
282 
283  bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
284  void SetNeedsPlaced( bool needsPlaced )
285  {
286  if( needsPlaced )
288  else
290  }
291 
292  bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
293 
294  void SetPadsLocked( bool aPadsLocked )
295  {
296  if( aPadsLocked )
298  else
300  }
301 
302  void SetLastEditTime( time_t aTime ) { m_LastEditTime = aTime; }
303  void SetLastEditTime() { m_LastEditTime = time( NULL ); }
304  time_t GetLastEditTime() const { return m_LastEditTime; }
305 
306  /* drawing functions */
307 
316  void Draw( EDA_DRAW_PANEL* aPanel,
317  wxDC* aDC,
318  GR_DRAWMODE aDrawMode,
319  const wxPoint& aOffset = ZeroOffset ) override;
320 
331  wxDC* aDC, const wxPoint& aMoveVector );
332 
357  SHAPE_POLY_SET& aCornerBuffer,
358  int aInflateValue,
359  int aCircleToSegmentsCount,
360  double aCorrectionFactor,
361  bool aSkipNPTHPadsWihNoCopper = false ) const;
362 
384  SHAPE_POLY_SET& aCornerBuffer,
385  int aInflateValue,
386  int aCircleToSegmentsCount,
387  double aCorrectionFactor,
388  int aCircleToSegmentsCountForTexts = 0 ) const;
389 
402  SHAPE_POLY_SET& aCornerBuffer,
403  int aInflateValue,
404  int aCircleToSegmentsCount,
405  double aCorrectionFactor,
406  int aCircleToSegmentsCountForTexts = 0 ) const;
407 
416  void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
417  GR_DRAWMODE draw_mode );
418 
425  void DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC,
426  const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
427 
429  void GetMsgPanelInfo( std::vector<MSG_PANEL_ITEM>& aList ) override;
430 
431  bool HitTest( const wxPoint& aPosition ) const override;
432 
433  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
434 
439  const wxString& GetReference() const
440  {
441  return m_Reference->GetText();
442  }
443 
449  void SetReference( const wxString& aReference )
450  {
451  m_Reference->SetText( aReference );
452  }
453 
461  wxString GetReferencePrefix() const;
462 
467  const wxString& GetValue() const
468  {
469  return m_Value->GetText();
470  }
471 
476  void SetValue( const wxString& aValue )
477  {
478  m_Value->SetText( aValue );
479  }
480 
482  TEXTE_MODULE& Value() { return *m_Value; }
484 
486  TEXTE_MODULE& Value() const { return *m_Value; }
487  TEXTE_MODULE& Reference() const { return *m_Reference; }
488 
497  D_PAD* FindPadByName( const wxString& aPadName ) const;
498 
507  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
508 
509  D_PAD* GetTopLeftPad();
510 
519  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
520 
533  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
534 
543  wxString GetNextPadName( bool aFillSequenceGaps ) const;
544 
545  double GetArea() const { return m_Surface; }
546 
547  time_t GetLink() const { return m_Link; }
548  void SetLink( time_t aLink ) { m_Link = aLink; }
549 
550  int GetPlacementCost180() const { return m_CntRot180; }
551  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
552 
553  int GetPlacementCost90() const { return m_CntRot90; }
554  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
555 
561  BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem,
562  bool aIncrementPadNumbers,
563  bool aAddToModule = false );
564 
571  void Add3DModel( MODULE_3D_SETTINGS* a3DModel );
572 
573  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
574 
575  wxString GetClass() const override
576  {
577  return wxT( "MODULE" );
578  }
579 
580  wxString GetSelectMenuText() const override;
581 
582  BITMAP_DEF GetMenuImage() const override;
583 
584  EDA_ITEM* Clone() const override;
585 
592  void RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction );
593 
594 
595  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
596 
597  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
598 
599  virtual const BOX2I ViewBBox() const override;
600 
617  void CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings );
618 
626  static bool IsLibNameValid( const wxString& aName );
627 
636  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
637 
653  void SetInitialComments( wxArrayString* aInitialComments )
654  {
655  delete m_initial_comments;
656  m_initial_comments = aInitialComments;
657  }
658 
665  double PadCoverageRatio() const;
666 
668  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
669 
675 
683  bool BuildPolyCourtyard();
684 
685  virtual void SwapData( BOARD_ITEM* aImage ) override;
686 
687 #if defined(DEBUG)
688  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
689 #endif
690 
691 private:
694  std::list<MODULE_3D_SETTINGS> m_3D_Drawings;
695  double m_Orient;
703 
704  // The final margin is the sum of these 2 values
707  wxString m_Doc;
708  wxString m_KeyWord;
709  wxString m_Path;
712  int m_arflag;
713  double m_Surface;
714  time_t m_Link;
717 
718  // Local tolerances. When zero, this means the corresponding netclass value
719  // is used. Usually theses local tolerances zero, in deference to the
720  // corresponding netclass values.
725 
727  wxArrayString* m_initial_comments;
728 
734 };
735 
736 #endif // MODULE_H_
int GetFlag() const
Definition: class_module.h:222
LIB_ID m_fpid
The LIB_ID of the MODULE.
Definition: class_module.h:699
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:673
bool BuildPolyCourtyard()
Used in DRC to build the courtyard area (a complex polygon) from graphic items put on the courtyard...
#define MODULE_to_PLACE
In autoplace: module waiting for autoplace.
Definition: class_module.h:252
void SetPlacementCost90(int aCost)
Definition: class_module.h:554
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:179
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
void RunOnChildren(std::function< void(BOARD_ITEM *)> aFunction)
Function RunOnChildren.
wxString GetReferencePrefix() const
Function GetReference prefix Gets the alphabetic prefix of the module reference - e...
const DLIST< D_PAD > & PadsList() const
Definition: class_module.h:155
TEXTE_MODULE & Reference()
Definition: class_module.h:483
void SetThermalGap(int aGap)
Definition: class_module.h:214
int m_CntRot90
Horizontal automatic placement cost ( 0..10 ).
Definition: class_module.h:715
int GetThermalGap() const
Definition: class_module.h:215
time_t GetLastEditTime() const
Definition: class_module.h:304
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
void IncrementFlag()
Definition: class_module.h:221
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:733
PNG memory record (file in memory).
Definition: bitmap_types.h:38
void SetLocalClearance(int aClearance)
Definition: class_module.h:200
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
wxString m_KeyWord
Search keywords to find module in library.
Definition: class_module.h:708
wxString m_Path
Definition: class_module.h:709
void SetPlacementCost180(int aCost)
Definition: class_module.h:551
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
int GetLocalClearance() const
Definition: class_module.h:199
int m_ThermalWidth
Definition: class_module.h:705
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block...
Definition: class_module.h:653
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
double m_LocalSolderPasteMarginRatio
Solder mask margin ratio value of pad size.
Definition: class_module.h:724
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
const wxPoint & GetPosition() const override
Definition: class_module.h:175
ZoneConnection
How pads are covered by copper in zone.
Definition: zones.h:55
D_PAD * FindPadByName(const wxString &aPadName) const
Function FindPadByName returns a D_PAD* with a matching name.
BOARD_ITEM * Duplicate(const BOARD_ITEM *aItem, bool aIncrementPadNumbers, bool aAddToModule=false)
Function Duplicate Duplicate a given item within the module, without adding to the board...
MODULE * Next() const
Definition: class_module.h:120
int m_LocalSolderPasteMargin
Solder paste margin absolute value.
Definition: class_module.h:723
int m_ThermalGap
Definition: class_module.h:706
DLIST_ITERATOR_WRAPPER< D_PAD > Pads()
Definition: class_module.h:160
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:284
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:76
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:467
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:208
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
MODULE(BOARD *parent)
void SetOrientationDegrees(double aOrientation)
Definition: class_module.h:179
void Add3DModel(MODULE_3D_SETTINGS *a3DModel)
Function Add3DModel adds a3DModel definition to the end of the 3D model list.
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
static function StringLibNameInvalidChars Test for validity of the name in a library of the footprint...
bool NeedsPlaced() const
Definition: class_module.h:283
double m_Surface
Bounding box area.
Definition: class_module.h:713
ZoneConnection GetZoneConnection() const
Definition: class_module.h:209
time_t m_Link
Temporary logical link used in edition.
Definition: class_module.h:714
int GetPlacementCost90() const
Definition: class_module.h:553
Class LIB_ID.
Definition: lib_id.h:56
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
void MoveAnchorPosition(const wxPoint &aMoveVector)
Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint:...
wxArrayString * m_initial_comments
leading s-expression comments in the module, lazily allocated only if needed for speed ...
Definition: class_module.h:727
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:206
void DrawAncre(EDA_DRAW_PANEL *panel, wxDC *DC, const wxPoint &offset, int dim_ancre, GR_DRAWMODE draw_mode)
Function DrawAncre Draw the anchor cross (vertical) Must be done after the pads, because drawing the ...
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:205
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:253
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
static wxPoint ZeroOffset
A value of wxPoint(0,0) which can be passed to the Draw() functions.
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:100
wxString m_Doc
File name and path for documentation file.
Definition: class_module.h:707
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:251
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
int m_LocalClearance
Definition: class_module.h:721
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:118
const LIB_ID & GetFPID() const
Definition: class_module.h:184
double m_Orient
Orientation in tenths of a degree, 900=90.0 degrees.
Definition: class_module.h:695
bool PadsLocked() const
Definition: class_module.h:292
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > GraphicalItems()
Definition: class_module.h:165
class MODULE, a footprint
Definition: typeinfo.h:89
void ClearAllNets()
Function ClearAllNets Clear (i.e.
TEXTE_MODULE & Reference() const
Definition: class_module.h:487
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
PCB_LAYER_ID
A quick note on layer IDs:
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
>
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on...
EDA_RECT m_BoundaryBox
Bounding box : coordinates on board, real orientation.
Definition: class_module.h:702
Class LSET is a set of PCB_LAYER_IDs.
Footprint text class description.
double GetOrientationDegrees() const
Definition: class_module.h:181
double GetOrientation() const
Definition: class_module.h:180
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
Class SHAPE_POLY_SET.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:482
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Returns the area of the module footprint excluding any text...
const std::list< MODULE_3D_SETTINGS > & Models() const
Definition: class_module.h:171
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:247
time_t GetLink() const
Definition: class_module.h:547
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_module.h:115
void SetThermalWidth(int aWidth)
Definition: class_module.h:211
int m_LocalSolderMaskMargin
Solder mask margin.
Definition: class_module.h:722
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Linked list of 3D models.
Definition: class_module.h:694
int GetAttributes() const
Definition: class_module.h:217
int m_arflag
Use to trace ratsnest and auto routing.
Definition: class_module.h:712
const wxString & GetKeywords() const
Definition: class_module.h:190
static LSET AllLayersMask()
Definition: lset.cpp:683
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:73
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:294
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:449
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
void TransformGraphicTextWithClearanceToPolygonSet(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aCircleToSegmentsCount, double aCorrectionFactor, int aCircleToSegmentsCountForTexts=0) const
TransformGraphicTextWithClearanceToPolygonSet This function is the same as TransformGraphicShapesWith...
SHAPE_POLY_SET m_poly_courtyard_front
Used in DRC to test the courtyard area (a polygon which can be not basic Note also a footprint can ha...
Definition: class_module.h:732
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:275
void Remove(BOARD_ITEM *aItem) override
>
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
MODULE * Back() const
Definition: class_module.h:121
void SetPosition(const wxPoint &aPos) override
const DLIST< BOARD_ITEM > & GraphicalItemsList() const
Definition: class_module.h:158
int GetLocalSolderMaskMargin() const
Definition: class_module.h:196
void TransformPadsShapesWithClearanceToPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aCircleToSegmentsCount, double aCorrectionFactor, bool aSkipNPTHPadsWihNoCopper=false) const
function TransformPadsShapesWithClearanceToPolygon generate pads shapes on layer aLayer as polygons...
void DrawEdgesOnly(EDA_DRAW_PANEL *panel, wxDC *DC, const wxPoint &offset, GR_DRAWMODE draw_mode)
Function DrawEdgesOnly Draws the footprint edges only to the current Device Context.
wxString GetNextPadName(bool aFillSequenceGaps) const
Function GetNextPadName returns the next available pad name in the module.
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:256
double GetOrientationRadians() const
Definition: class_module.h:182
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:197
D_PAD * GetTopLeftPad()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:202
void TransformGraphicShapesWithClearanceToPolygonSet(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aCircleToSegmentsCount, double aCorrectionFactor, int aCircleToSegmentsCountForTexts=0) const
function TransformGraphicShapesWithClearanceToPolygonSet generate shapes of graphic items (outlines) ...
MODULE & operator=(const MODULE &aOther)
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetPadCount returns the number of pads.
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:101
default
Definition: class_module.h:75
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
static bool IsLibNameValid(const wxString &aName)
static function IsLibNameValid Test for validity of a name of a footprint to be used in a footprint l...
time_t m_LastEditTime
Definition: class_module.h:711
D_PAD * GetPad(const wxPoint &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Function GetPad get a pad at aPosition on aLayerMask in the footprint.
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:203
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:170
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:250
TEXTE_MODULE & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:486
int m_CntRot180
Vertical automatic placement cost ( 0..10 ).
Definition: class_module.h:716
Board layer functions and definitions.
void SetLocked(bool isLocked) override
Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: class_module.h:266
const wxString & GetDescription() const
Definition: class_module.h:187
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:99
DLIST< BOARD_ITEM > m_Drawings
Linked list of graphical items.
Definition: class_module.h:693
double GetArea() const
Definition: class_module.h:545
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:439
int m_ModuleStatus
For autoplace: flags (LOCKED, AUTOPLACED)
Definition: class_module.h:701
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
void SetOrientation(double newangle)
Virtual component: when created by copper shapes on board (Like edge card connectors, mounting hole...)
Definition: class_module.h:78
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
double PadCoverageRatio() const
Function PadCoverageRatio Calculates the ratio of total area of the footprint pads to the area of the...
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_module.h:575
void SetLink(time_t aLink)
Definition: class_module.h:548
Class EDA_RECT handles the component boundary box.
void SetLastEditTime()
Definition: class_module.h:303
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:476
TEXTE_MODULE * m_Value
Component value (74LS00, 22K..)
Definition: class_module.h:698
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:165
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:98
wxPoint m_Pos
Position of module on the board in internal units.
Definition: class_module.h:696
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:191
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:157
TEXTE_MODULE * m_Reference
Component reference designator value (U34, R18..)
Definition: class_module.h:697
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & PadsList()
Definition: class_module.h:154
void DrawOutlinesWhenMoving(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aMoveVector)
Function DrawOutlinesWhenMoving draws in XOR mode the footprint when moving it to the aDC...
Definition: ratsnest.cpp:217
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetUniquePadCount returns the number of unique pads.
SHAPE_POLY_SET & GetPolyCourtyardBack()
Definition: class_module.h:674
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
Class VIEW.
Definition: view.h:58
const wxString & GetPath() const
Definition: class_module.h:193
SEARCH_RESULT
Definition: base_struct.h:82
DLIST< D_PAD > m_Pads
Linked list of pads.
Definition: class_module.h:692
ZoneConnection m_ZoneConnection
Definition: class_module.h:710
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership. ...
Definition: class_module.h:668
bool IsPlaced() const
Definition: class_module.h:274
INCLUDE_NPTH_T
Definition: class_module.h:61
int GetPlacementCost180() const
Definition: class_module.h:550
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:185
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:178
void SetPath(const wxString &aPath)
Definition: class_module.h:194
int GetThermalWidth() const
Definition: class_module.h:212
void SetFlag(int aFlag)
Definition: class_module.h:220
void SetAttributes(int aAttributes)
Definition: class_module.h:218
int m_Attributs
Flag bits ( see Mod_Attribut )
Definition: class_module.h:700
virtual void SetText(const wxString &aText)
Definition: eda_text.h:141
void SetDescription(const wxString &aDoc)
Definition: class_module.h:188
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...