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-2016 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 <functional>
48 
49 class LINE_READER;
50 class EDA_3D_CANVAS;
51 class EDA_DRAW_PANEL;
52 class D_PAD;
53 class BOARD;
54 class MSG_PANEL_ITEM;
55 
56 namespace KIGFX
57 {
58  class VIEW;
59 };
60 
62 {
64  INCLUDE_NPTH = true
65 };
66 
74 {
76  MOD_CMS = 1,
77  MOD_VIRTUAL = 2
79 };
81 
82 
84 {
85 public:
86  MODULE( BOARD* parent );
87 
88  MODULE( const MODULE& aModule );
89 
90  ~MODULE();
91 
92  MODULE& operator=( const MODULE& aOther );
93 
94  static inline bool ClassOf( const EDA_ITEM* aItem )
95  {
96  return PCB_MODULE_T == aItem->Type();
97  }
98 
99  MODULE* Next() const { return static_cast<MODULE*>( Pnext ); }
100  MODULE* Back() const { return static_cast<MODULE*>( Pback ); }
101 
103  void Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode = ADD_INSERT ) override;
104 
106  void Remove( BOARD_ITEM* aBoardItem ) override;
107 
115  void ClearAllNets();
116 
121  void CalculateBoundingBox();
122 
128  EDA_RECT GetFootprintRect() const;
129 
130  // Virtual function
131  const EDA_RECT GetBoundingBox() const override;
132 
133  DLIST<D_PAD>& Pads() { return m_Pads; }
134  const DLIST<D_PAD>& Pads() const { return m_Pads; }
135 
137  const DLIST<BOARD_ITEM>& GraphicalItems() const { return m_Drawings; }
138 
139  std::list<S3D_INFO>& Models() { return m_3D_Drawings; }
140  const std::list<S3D_INFO>& Models() const { return m_3D_Drawings; }
141 
142  void SetPosition( const wxPoint& aPos ) override;
143  const wxPoint& GetPosition() const override { return m_Pos; }
144 
145  void SetOrientation( double newangle );
146  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation*10.0 ); }
147  double GetOrientation() const { return m_Orient; }
148  double GetOrientationDegrees() const { return m_Orient/10.0; }
149  double GetOrientationRadians() const { return m_Orient*M_PI/1800; }
150 
151  const LIB_ID& GetFPID() const { return m_fpid; }
152  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
153 
154  const wxString& GetDescription() const { return m_Doc; }
155  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
156 
157  const wxString& GetKeywords() const { return m_KeyWord; }
158  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
159 
160  const wxString& GetPath() const { return m_Path; }
161  void SetPath( const wxString& aPath ) { m_Path = aPath; }
162 
164  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
165 
166  int GetLocalClearance() const { return m_LocalClearance; }
167  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
168 
170  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
171 
174 
177 
178  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
179  int GetThermalWidth() const { return m_ThermalWidth; }
180 
181  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
182  int GetThermalGap() const { return m_ThermalGap; }
183 
184  int GetAttributes() const { return m_Attributs; }
185  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
186 
187  void SetFlag( int aFlag ) { m_arflag = aFlag; }
188  void IncrementFlag() { m_arflag += 1; }
189  int GetFlag() const { return m_arflag; }
190 
191  void Move( const wxPoint& aMoveVector ) override;
192 
193  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
194 
195  void Flip( const wxPoint& aCentre ) override;
196 
208  void MoveAnchorPosition( const wxPoint& aMoveVector );
209 
214  bool IsFlipped() const {return GetLayer() == B_Cu; }
215 
216 // m_ModuleStatus bits:
217 #define MODULE_is_LOCKED 0x01
218 #define MODULE_is_PLACED 0x02
219 #define MODULE_to_PLACE 0x04
220 #define MODULE_PADS_LOCKED 0x08
221 
222 
223  bool IsLocked() const override
224  {
225  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
226  }
227 
233  void SetLocked( bool isLocked ) override
234  {
235  if( isLocked )
237  else
239  }
240 
241  bool IsPlaced() const { return (m_ModuleStatus & MODULE_is_PLACED); }
242  void SetIsPlaced( bool isPlaced )
243  {
244  if( isPlaced )
246  else
248  }
249 
250  bool NeedsPlaced() const { return (m_ModuleStatus & MODULE_to_PLACE); }
251  void SetNeedsPlaced( bool needsPlaced )
252  {
253  if( needsPlaced )
255  else
257  }
258 
259  bool PadsLocked() const { return ( m_ModuleStatus & MODULE_PADS_LOCKED ); }
260 
261  void SetPadsLocked( bool aPadsLocked )
262  {
263  if( aPadsLocked )
265  else
267  }
268 
269  void SetLastEditTime( time_t aTime ) { m_LastEditTime = aTime; }
270  void SetLastEditTime( ) { m_LastEditTime = time( NULL ); }
271  time_t GetLastEditTime() const { return m_LastEditTime; }
272 
273  /* drawing functions */
274 
283  void Draw( EDA_DRAW_PANEL* aPanel,
284  wxDC* aDC,
285  GR_DRAWMODE aDrawMode,
286  const wxPoint& aOffset = ZeroOffset ) override;
287 
298  wxDC* aDC, const wxPoint& aMoveVector );
299 
324  SHAPE_POLY_SET& aCornerBuffer,
325  int aInflateValue,
326  int aCircleToSegmentsCount,
327  double aCorrectionFactor,
328  bool aSkipNPTHPadsWihNoCopper = false ) const;
329 
351  LAYER_ID aLayer,
352  SHAPE_POLY_SET& aCornerBuffer,
353  int aInflateValue,
354  int aCircleToSegmentsCount,
355  double aCorrectionFactor,
356  int aCircleToSegmentsCountForTexts = 0 ) const;
357 
370  LAYER_ID aLayer,
371  SHAPE_POLY_SET& aCornerBuffer,
372  int aInflateValue,
373  int aCircleToSegmentsCount,
374  double aCorrectionFactor,
375  int aCircleToSegmentsCountForTexts = 0 ) const;
376 
385  void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
386  GR_DRAWMODE draw_mode );
387 
394  void DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC,
395  const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
396 
398  void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
399 
400  bool HitTest( const wxPoint& aPosition ) const override;
401 
405  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
406 
411  const wxString& GetReference() const
412  {
413  return m_Reference->GetText();
414  }
415 
421  void SetReference( const wxString& aReference )
422  {
423  m_Reference->SetText( aReference );
424  }
425 
433  wxString GetReferencePrefix() const;
434 
439  const wxString& GetValue() const
440  {
441  return m_Value->GetText();
442  }
443 
448  void SetValue( const wxString& aValue )
449  {
450  m_Value->SetText( aValue );
451  }
452 
454  TEXTE_MODULE& Value() { return *m_Value; }
456 
458  TEXTE_MODULE& Value() const { return *m_Value; }
459  TEXTE_MODULE& Reference() const { return *m_Reference; }
460 
469  D_PAD* FindPadByName( const wxString& aPadName ) const;
470 
479  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
480 
489  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T( INCLUDE_NPTH ) ) const;
490 
503  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T( INCLUDE_NPTH ) ) const;
504 
513  wxString GetNextPadName( bool aFillSequenceGaps ) const;
514 
515  double GetArea() const { return m_Surface; }
516 
517  time_t GetLink() const { return m_Link; }
518  void SetLink( time_t aLink ) { m_Link = aLink; }
519 
520  int GetPlacementCost180() const { return m_CntRot180; }
521  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
522 
523  int GetPlacementCost90() const { return m_CntRot90; }
524  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
525 
531  BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem,
532  bool aIncrementPadNumbers,
533  bool aAddToModule = false );
534 
541  void Add3DModel( S3D_INFO* a3DModel );
542 
543  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
544 
545  wxString GetClass() const override
546  {
547  return wxT( "MODULE" );
548  }
549 
550  wxString GetSelectMenuText() const override;
551 
552  BITMAP_DEF GetMenuImage() const override;
553 
554  EDA_ITEM* Clone() const override;
555 
562  void RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction );
563 
564 
566  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
567 
569  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
570 
572  virtual const BOX2I ViewBBox() const override;
573 
590  void CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings );
591 
599  static bool IsLibNameValid( const wxString & aName );
600 
609  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
610 
626  void SetInitialComments( wxArrayString* aInitialComments )
627  {
628  delete m_initial_comments;
629  m_initial_comments = aInitialComments;
630  }
631 
638  double PadCoverageRatio() const;
639 
641  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
642 
648 
656  bool BuildPolyCourtyard();
657 
658 #if defined(DEBUG)
659  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
660 #endif
661 
662 private:
665  std::list<S3D_INFO> m_3D_Drawings;
666  double m_Orient;
674 
675  // The final margin is the sum of these 2 values
678  wxString m_Doc;
679  wxString m_KeyWord;
680  wxString m_Path;
683  int m_arflag;
684  double m_Surface;
685  time_t m_Link;
688 
689  // Local tolerances. When zero, this means the corresponding netclass value
690  // is used. Usually theses local tolerances zero, in deference to the
691  // corresponding netclass values.
696 
698  wxArrayString* m_initial_comments;
699 
705 };
706 
707 #endif // MODULE_H_
int GetFlag() const
Definition: class_module.h:189
LIB_ID m_fpid
The LIB_ID of the MODULE.
Definition: class_module.h:670
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:646
void Add(BOARD_ITEM *aBoardItem, ADD_MODE aMode=ADD_INSERT) override
>
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:219
void SetPlacementCost90(int aCost)
Definition: class_module.h:524
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...
TEXTE_MODULE & Reference()
Definition: class_module.h:455
void SetThermalGap(int aGap)
Definition: class_module.h:181
int m_CntRot90
Horizontal automatic placement cost ( 0..10 ).
Definition: class_module.h:686
int GetThermalGap() const
Definition: class_module.h:182
time_t GetLastEditTime() const
Definition: class_module.h:271
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
void IncrementFlag()
Definition: class_module.h:188
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:704
PNG memory record (file in memory).
Definition: bitmap_types.h:38
void SetLocalClearance(int aClearance)
Definition: class_module.h:167
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
wxString m_KeyWord
Search keywords to find module in library.
Definition: class_module.h:679
wxString m_Path
Definition: class_module.h:680
void SetPlacementCost180(int aCost)
Definition: class_module.h:521
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:166
int m_ThermalWidth
Definition: class_module.h:676
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block...
Definition: class_module.h:626
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:695
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
const wxPoint & GetPosition() const override
Definition: class_module.h:143
void TransformPadsShapesWithClearanceToPolygon(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...
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:99
int m_LocalSolderPasteMargin
Solder paste margin absolute value.
Definition: class_module.h:694
int m_ThermalGap
Definition: class_module.h:677
const DLIST< D_PAD > & Pads() const
Definition: class_module.h:134
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:251
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
std::list< S3D_INFO > m_3D_Drawings
Linked list of 3D models.
Definition: class_module.h:665
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:439
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:175
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:146
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:250
double m_Surface
Bounding box area.
Definition: class_module.h:684
ZoneConnection GetZoneConnection() const
Definition: class_module.h:176
time_t m_Link
Temporary logical link used in edition.
Definition: class_module.h:685
std::list< S3D_INFO > & Models()
Definition: class_module.h:139
int GetPlacementCost90() const
Definition: class_module.h:523
Class LIB_ID.
Definition: lib_id.h:56
void SetLastEditTime(time_t aTime)
Definition: class_module.h:269
LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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:698
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:173
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:172
DLIST< BOARD_ITEM > & GraphicalItems()
Definition: class_module.h:136
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:220
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:678
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:218
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
>
int m_LocalClearance
Definition: class_module.h:692
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:104
const LIB_ID & GetFPID() const
Definition: class_module.h:151
double m_Orient
Orientation in tenths of a degree, 900=90.0 degrees.
Definition: class_module.h:666
bool PadsLocked() const
Definition: class_module.h:259
class MODULE, a footprint
Definition: typeinfo.h:101
void ClearAllNets()
Function ClearAllNets Clear (i.e.
TEXTE_MODULE & Reference() const
Definition: class_module.h:459
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
void Remove(BOARD_ITEM *aBoardItem) override
>
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
EDA_RECT m_BoundaryBox
Bounding box : coordinates on board, real orientation.
Definition: class_module.h:673
Class LSET is a set of LAYER_IDs.
Footprint text class description.
const std::list< S3D_INFO > & Models() const
Definition: class_module.h:140
double GetOrientationDegrees() const
Definition: class_module.h:148
double GetOrientation() const
Definition: class_module.h:147
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:454
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:214
time_t GetLink() const
Definition: class_module.h:517
virtual const BOX2I ViewBBox() const override
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_module.h:94
void SetThermalWidth(int aWidth)
Definition: class_module.h:178
int m_LocalSolderMaskMargin
Solder mask margin.
Definition: class_module.h:693
int GetAttributes() const
Definition: class_module.h:184
int m_arflag
Use to trace ratsnest and auto routing.
Definition: class_module.h:683
const wxString & GetKeywords() const
Definition: class_module.h:157
static LSET AllLayersMask()
Definition: lset.cpp:675
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:261
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:421
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
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:703
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:242
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
MODULE * Back() const
Definition: class_module.h:100
void SetPosition(const wxPoint &aPos) override
int GetLocalSolderMaskMargin() const
Definition: class_module.h:163
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:223
double GetOrientationRadians() const
Definition: class_module.h:149
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:164
int GetLocalSolderPasteMargin() const
Definition: class_module.h:169
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: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:682
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:170
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:217
TEXTE_MODULE & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:458
int m_CntRot180
Vertical automatic placement cost ( 0..10 ).
Definition: class_module.h:687
const DLIST< BOARD_ITEM > & GraphicalItems() const
Definition: class_module.h:137
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:233
const wxString & GetDescription() const
Definition: class_module.h:154
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:664
double GetArea() const
Definition: class_module.h:515
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:411
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
int m_ModuleStatus
For autoplace: flags (LOCKED, AUTOPLACED)
Definition: class_module.h:672
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
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:545
void SetLink(time_t aLink)
Definition: class_module.h:518
Class EDA_RECT handles the component boundary box.
void SetLastEditTime()
Definition: class_module.h:270
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:448
TEXTE_MODULE * m_Value
Component value (74LS00, 22K..)
Definition: class_module.h:669
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:667
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:158
void TransformGraphicTextWithClearanceToPolygonSet(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...
TEXTE_MODULE * m_Reference
Component reference designator value (U34, R18..)
Definition: class_module.h:668
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
DLIST< D_PAD > & Pads()
Definition: class_module.h:133
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: modules.cpp:492
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:647
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:160
SEARCH_RESULT
Definition: base_struct.h:68
DLIST< D_PAD > m_Pads
Linked list of pads.
Definition: class_module.h:663
ZoneConnection m_ZoneConnection
Definition: class_module.h:681
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership. ...
Definition: class_module.h:641
bool IsPlaced() const
Definition: class_module.h:241
INCLUDE_NPTH_T
Definition: class_module.h:61
int GetPlacementCost180() const
Definition: class_module.h:520
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:152
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:164
void SetPath(const wxString &aPath)
Definition: class_module.h:161
int GetThermalWidth() const
Definition: class_module.h:179
void SetFlag(int aFlag)
Definition: class_module.h:187
void SetAttributes(int aAttributes)
Definition: class_module.h:185
int m_Attributs
Flag bits ( see Mod_Attribut )
Definition: class_module.h:671
virtual void SetText(const wxString &aText)
Definition: eda_text.h:141
void TransformGraphicShapesWithClearanceToPolygonSet(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) ...
void SetDescription(const wxString &aDoc)
Definition: class_module.h:155
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...