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 #include <3d_cache/3d_info.h>
46 
47 #include <core/iterators.h>
48 
49 #include <functional>
50 
51 class LINE_READER;
52 class EDA_3D_CANVAS;
53 class EDA_DRAW_PANEL;
54 class D_PAD;
55 class BOARD;
56 class MSG_PANEL_ITEM;
57 
58 namespace KIGFX {
59 class VIEW;
60 };
61 
63 {
65  INCLUDE_NPTH = true
66 };
67 
75 {
77  MOD_CMS = 1,
78  MOD_VIRTUAL = 2
80 };
82 
83 
85 {
86 public:
87  MODULE( BOARD* parent );
88 
89  MODULE( const MODULE& aModule );
90 
91  ~MODULE();
92 
93  MODULE& operator=( const MODULE& aOther );
94 
95  static inline bool ClassOf( const EDA_ITEM* aItem )
96  {
97  return PCB_MODULE_T == aItem->Type();
98  }
99 
100  MODULE* Next() const { return static_cast<MODULE*>( Pnext ); }
101  MODULE* Back() const { return static_cast<MODULE*>( Pback ); }
102 
104  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_INSERT ) override;
105 
107  void Remove( BOARD_ITEM* aItem ) override;
108 
116  void ClearAllNets();
117 
122  void CalculateBoundingBox();
123 
129  EDA_RECT GetFootprintRect() const;
130 
131  // Virtual function
132  const EDA_RECT GetBoundingBox() const override;
133 
134  DLIST<D_PAD>& PadsList() { return m_Pads; }
135  const DLIST<D_PAD>& PadsList() const { return m_Pads; }
136 
139 
141  {
143  }
144 
146  {
148  }
149 
150  std::list<S3D_INFO>& Models() { return m_3D_Drawings; }
151  const std::list<S3D_INFO>& Models() const { return m_3D_Drawings; }
152 
153  void SetPosition( const wxPoint& aPos ) override;
154 
155  const wxPoint& GetPosition() const override { return m_Pos; }
156 
157  void SetOrientation( double newangle );
158 
159  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
160  double GetOrientation() const { return m_Orient; }
161  double GetOrientationDegrees() const { return m_Orient / 10.0; }
162  double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
163 
164  const LIB_ID& GetFPID() const { return m_fpid; }
165  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
166 
167  const wxString& GetDescription() const { return m_Doc; }
168  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
169 
170  const wxString& GetKeywords() const { return m_KeyWord; }
171  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
172 
173  const wxString& GetPath() const { return m_Path; }
174  void SetPath( const wxString& aPath ) { m_Path = aPath; }
175 
177  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
178 
179  int GetLocalClearance() const { return m_LocalClearance; }
180  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
181 
183  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
184 
187 
190 
191  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
192  int GetThermalWidth() const { return m_ThermalWidth; }
193 
194  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
195  int GetThermalGap() const { return m_ThermalGap; }
196 
197  int GetAttributes() const { return m_Attributs; }
198  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
199 
200  void SetFlag( int aFlag ) { m_arflag = aFlag; }
201  void IncrementFlag() { m_arflag += 1; }
202  int GetFlag() const { return m_arflag; }
203 
204  void Move( const wxPoint& aMoveVector ) override;
205 
206  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
207 
208  void Flip( const wxPoint& aCentre ) override;
209 
221  void MoveAnchorPosition( const wxPoint& aMoveVector );
222 
227  bool IsFlipped() const { return GetLayer() == B_Cu; }
228 
229 // m_ModuleStatus bits:
230 #define MODULE_is_LOCKED 0x01
231 #define MODULE_is_PLACED 0x02
232 #define MODULE_to_PLACE 0x04
233 #define MODULE_PADS_LOCKED 0x08
234 
235 
236  bool IsLocked() const override
237  {
238  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
239  }
240 
246  void SetLocked( bool isLocked ) override
247  {
248  if( isLocked )
250  else
252  }
253 
254  bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
255  void SetIsPlaced( bool isPlaced )
256  {
257  if( isPlaced )
259  else
261  }
262 
263  bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
264  void SetNeedsPlaced( bool needsPlaced )
265  {
266  if( needsPlaced )
268  else
270  }
271 
272  bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
273 
274  void SetPadsLocked( bool aPadsLocked )
275  {
276  if( aPadsLocked )
278  else
280  }
281 
282  void SetLastEditTime( time_t aTime ) { m_LastEditTime = aTime; }
283  void SetLastEditTime() { m_LastEditTime = time( NULL ); }
284  time_t GetLastEditTime() const { return m_LastEditTime; }
285 
286  /* drawing functions */
287 
296  void Draw( EDA_DRAW_PANEL* aPanel,
297  wxDC* aDC,
298  GR_DRAWMODE aDrawMode,
299  const wxPoint& aOffset = ZeroOffset ) override;
300 
311  wxDC* aDC, const wxPoint& aMoveVector );
312 
337  SHAPE_POLY_SET& aCornerBuffer,
338  int aInflateValue,
339  int aCircleToSegmentsCount,
340  double aCorrectionFactor,
341  bool aSkipNPTHPadsWihNoCopper = false ) const;
342 
364  SHAPE_POLY_SET& aCornerBuffer,
365  int aInflateValue,
366  int aCircleToSegmentsCount,
367  double aCorrectionFactor,
368  int aCircleToSegmentsCountForTexts = 0 ) const;
369 
382  SHAPE_POLY_SET& aCornerBuffer,
383  int aInflateValue,
384  int aCircleToSegmentsCount,
385  double aCorrectionFactor,
386  int aCircleToSegmentsCountForTexts = 0 ) const;
387 
396  void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
397  GR_DRAWMODE draw_mode );
398 
405  void DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC,
406  const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
407 
409  void GetMsgPanelInfo( std::vector<MSG_PANEL_ITEM>& aList ) override;
410 
411  bool HitTest( const wxPoint& aPosition ) const override;
412 
413  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
414 
419  const wxString& GetReference() const
420  {
421  return m_Reference->GetText();
422  }
423 
429  void SetReference( const wxString& aReference )
430  {
431  m_Reference->SetText( aReference );
432  }
433 
441  wxString GetReferencePrefix() const;
442 
447  const wxString& GetValue() const
448  {
449  return m_Value->GetText();
450  }
451 
456  void SetValue( const wxString& aValue )
457  {
458  m_Value->SetText( aValue );
459  }
460 
462  TEXTE_MODULE& Value() { return *m_Value; }
464 
466  TEXTE_MODULE& Value() const { return *m_Value; }
467  TEXTE_MODULE& Reference() const { return *m_Reference; }
468 
477  D_PAD* FindPadByName( const wxString& aPadName ) const;
478 
487  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
488 
489  D_PAD* GetTopLeftPad();
490 
499  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
500 
513  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
514 
523  wxString GetNextPadName( bool aFillSequenceGaps ) const;
524 
525  double GetArea() const { return m_Surface; }
526 
527  time_t GetLink() const { return m_Link; }
528  void SetLink( time_t aLink ) { m_Link = aLink; }
529 
530  int GetPlacementCost180() const { return m_CntRot180; }
531  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
532 
533  int GetPlacementCost90() const { return m_CntRot90; }
534  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
535 
541  BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem,
542  bool aIncrementPadNumbers,
543  bool aAddToModule = false );
544 
551  void Add3DModel( S3D_INFO* a3DModel );
552 
553  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
554 
555  wxString GetClass() const override
556  {
557  return wxT( "MODULE" );
558  }
559 
560  wxString GetSelectMenuText() const override;
561 
562  BITMAP_DEF GetMenuImage() const override;
563 
564  EDA_ITEM* Clone() const override;
565 
572  void RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction );
573 
574 
575  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
576 
577  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
578 
579  virtual const BOX2I ViewBBox() const override;
580 
597  void CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings );
598 
606  static bool IsLibNameValid( const wxString& aName );
607 
616  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
617 
633  void SetInitialComments( wxArrayString* aInitialComments )
634  {
635  delete m_initial_comments;
636  m_initial_comments = aInitialComments;
637  }
638 
645  double PadCoverageRatio() const;
646 
648  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
649 
655 
663  bool BuildPolyCourtyard();
664 
665 #if defined(DEBUG)
666  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
667 #endif
668 
669 private:
672  std::list<S3D_INFO> m_3D_Drawings;
673  double m_Orient;
681 
682  // The final margin is the sum of these 2 values
685  wxString m_Doc;
686  wxString m_KeyWord;
687  wxString m_Path;
690  int m_arflag;
691  double m_Surface;
692  time_t m_Link;
695 
696  // Local tolerances. When zero, this means the corresponding netclass value
697  // is used. Usually theses local tolerances zero, in deference to the
698  // corresponding netclass values.
703 
705  wxArrayString* m_initial_comments;
706 
712 };
713 
714 #endif // MODULE_H_
int GetFlag() const
Definition: class_module.h:202
LIB_ID m_fpid
The LIB_ID of the MODULE.
Definition: class_module.h:677
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:653
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:232
void SetPlacementCost90(int aCost)
Definition: class_module.h:534
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:165
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:135
TEXTE_MODULE & Reference()
Definition: class_module.h:463
void SetThermalGap(int aGap)
Definition: class_module.h:194
int m_CntRot90
Horizontal automatic placement cost ( 0..10 ).
Definition: class_module.h:693
int GetThermalGap() const
Definition: class_module.h:195
time_t GetLastEditTime() const
Definition: class_module.h:284
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
void IncrementFlag()
Definition: class_module.h:201
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:711
PNG memory record (file in memory).
Definition: bitmap_types.h:38
void SetLocalClearance(int aClearance)
Definition: class_module.h:180
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
wxString m_KeyWord
Search keywords to find module in library.
Definition: class_module.h:686
wxString m_Path
Definition: class_module.h:687
void SetPlacementCost180(int aCost)
Definition: class_module.h:531
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:179
int m_ThermalWidth
Definition: class_module.h:683
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block...
Definition: class_module.h:633
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:702
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
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:100
int m_LocalSolderPasteMargin
Solder paste margin absolute value.
Definition: class_module.h:701
int m_ThermalGap
Definition: class_module.h:684
DLIST_ITERATOR_WRAPPER< D_PAD > Pads()
Definition: class_module.h:140
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:264
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:77
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
std::list< S3D_INFO > m_3D_Drawings
Linked list of 3D models.
Definition: class_module.h:672
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:447
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:188
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:159
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:263
double m_Surface
Bounding box area.
Definition: class_module.h:691
ZoneConnection GetZoneConnection() const
Definition: class_module.h:189
time_t m_Link
Temporary logical link used in edition.
Definition: class_module.h:692
std::list< S3D_INFO > & Models()
Definition: class_module.h:150
int GetPlacementCost90() const
Definition: class_module.h:533
Class LIB_ID.
Definition: lib_id.h:56
void SetLastEditTime(time_t aTime)
Definition: class_module.h:282
defines the basic data associated with a single 3D model.
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:705
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:186
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:185
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:233
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:90
static wxPoint ZeroOffset
A value of wxPoint(0,0) which can be passed to the Draw() functions.
wxString m_Doc
File name and path for documentation file.
Definition: class_module.h:685
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:231
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
int m_LocalClearance
Definition: class_module.h:699
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:104
const LIB_ID & GetFPID() const
Definition: class_module.h:164
double m_Orient
Orientation in tenths of a degree, 900=90.0 degrees.
Definition: class_module.h:673
bool PadsLocked() const
Definition: class_module.h:272
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > GraphicalItems()
Definition: class_module.h:145
class MODULE, a footprint
Definition: typeinfo.h:101
void ClearAllNets()
Function ClearAllNets Clear (i.e.
TEXTE_MODULE & Reference() const
Definition: class_module.h:467
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:680
Class LSET is a set of PCB_LAYER_IDs.
Footprint text class description.
const std::list< S3D_INFO > & Models() const
Definition: class_module.h:151
double GetOrientationDegrees() const
Definition: class_module.h:161
double GetOrientation() const
Definition: class_module.h:160
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:462
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Returns the area of the module footprint excluding any text...
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:227
time_t GetLink() const
Definition: class_module.h:527
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:95
void SetThermalWidth(int aWidth)
Definition: class_module.h:191
int m_LocalSolderMaskMargin
Solder mask margin.
Definition: class_module.h:700
int GetAttributes() const
Definition: class_module.h:197
int m_arflag
Use to trace ratsnest and auto routing.
Definition: class_module.h:690
const wxString & GetKeywords() const
Definition: class_module.h:170
static LSET AllLayersMask()
Definition: lset.cpp:676
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:74
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:274
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:429
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:710
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:255
void Remove(BOARD_ITEM *aItem) override
>
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail of the item.
MODULE * Back() const
Definition: class_module.h:101
void SetPosition(const wxPoint &aPos) override
const DLIST< BOARD_ITEM > & GraphicalItemsList() const
Definition: class_module.h:138
int GetLocalSolderMaskMargin() const
Definition: class_module.h:176
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:236
double GetOrientationRadians() const
Definition: class_module.h:162
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:177
D_PAD * GetTopLeftPad()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:182
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.
default
Definition: class_module.h:76
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:689
D_PAD * GetPad(const wxPoint &aPosition, LSET aLayerMask=LSET::AllLayersMask())
Function GetPad get a pad at aPosition on aLayerMask in the footprint.
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:183
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:230
TEXTE_MODULE & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:466
int m_CntRot180
Vertical automatic placement cost ( 0..10 ).
Definition: class_module.h:694
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:246
const wxString & GetDescription() const
Definition: class_module.h:167
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...
DLIST< BOARD_ITEM > m_Drawings
Linked list of graphical items.
Definition: class_module.h:671
double GetArea() const
Definition: class_module.h:525
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:419
int m_ModuleStatus
For autoplace: flags (LOCKED, AUTOPLACED)
Definition: class_module.h:679
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:79
double PadCoverageRatio() const
Function PadCoverageRatio Calculates the ratio of total area of the footprint pads to the area of the...
void Add3DModel(S3D_INFO *a3DModel)
Function Add3DModel adds a3DModel definition to the end of the 3D model list.
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_module.h:555
void SetLink(time_t aLink)
Definition: class_module.h:528
Class EDA_RECT handles the component boundary box.
void SetLastEditTime()
Definition: class_module.h:283
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:456
TEXTE_MODULE * m_Value
Component value (74LS00, 22K..)
Definition: class_module.h:676
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
wxPoint m_Pos
Position of module on the board in internal units.
Definition: class_module.h:674
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:171
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
TEXTE_MODULE * m_Reference
Component reference designator value (U34, R18..)
Definition: class_module.h:675
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & PadsList()
Definition: class_module.h:134
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:218
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:654
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:173
SEARCH_RESULT
Definition: base_struct.h:68
DLIST< D_PAD > m_Pads
Linked list of pads.
Definition: class_module.h:670
ZoneConnection m_ZoneConnection
Definition: class_module.h:688
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership. ...
Definition: class_module.h:648
bool IsPlaced() const
Definition: class_module.h:254
INCLUDE_NPTH_T
Definition: class_module.h:62
int GetPlacementCost180() const
Definition: class_module.h:530
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:165
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:164
void SetPath(const wxString &aPath)
Definition: class_module.h:174
int GetThermalWidth() const
Definition: class_module.h:192
void SetFlag(int aFlag)
Definition: class_module.h:200
void SetAttributes(int aAttributes)
Definition: class_module.h:198
int m_Attributs
Flag bits ( see Mod_Attribut )
Definition: class_module.h:678
virtual void SetText(const wxString &aText)
Definition: eda_text.h:141
void SetDescription(const wxString &aDoc)
Definition: class_module.h:168
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...