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 <collectors.h>
41 #include <lib_id.h>
42 
43 #include <class_text_mod.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  m_Preview( true )
91  {
92  }
93 
94  struct VECTOR3D
95  {
96  double x, y, z;
97  };
98 
102  wxString m_Filename;
103  bool m_Preview;
104 };
105 
107 {
108 public:
109  MODULE( BOARD* parent );
110 
111  MODULE( const MODULE& aModule );
112 
113  ~MODULE();
114 
115  MODULE& operator=( const MODULE& aOther );
116 
117  static inline bool ClassOf( const EDA_ITEM* aItem )
118  {
119  return aItem && PCB_MODULE_T == aItem->Type();
120  }
121 
122  MODULE* Next() const { return static_cast<MODULE*>( Pnext ); }
123  MODULE* Back() const { return static_cast<MODULE*>( Pback ); }
124 
126  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_INSERT ) override;
127 
129  void Remove( BOARD_ITEM* aItem ) override;
130 
138  void ClearAllNets();
139 
144  void CalculateBoundingBox();
145 
151  EDA_RECT GetFootprintRect() const;
152 
158 
159  // Virtual function
160  const EDA_RECT GetBoundingBox() const override;
161 
162  DLIST<D_PAD>& PadsList() { return m_Pads; }
163  const DLIST<D_PAD>& PadsList() const { return m_Pads; }
164 
167 
169  {
171  }
172 
174  {
176  }
177 
178  std::list<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
179  const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
180 
181  void SetPosition( const wxPoint& aPos ) override;
182 
183  const wxPoint GetPosition() const override { return m_Pos; }
184 
185  void SetOrientation( double newangle );
186 
187  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
188  double GetOrientation() const { return m_Orient; }
189  double GetOrientationDegrees() const { return m_Orient / 10.0; }
190  double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
191 
192  const LIB_ID& GetFPID() const { return m_fpid; }
193  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
194 
195  const wxString& GetDescription() const { return m_Doc; }
196  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
197 
198  const wxString& GetKeywords() const { return m_KeyWord; }
199  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
200 
201  const wxString& GetPath() const { return m_Path; }
202  void SetPath( const wxString& aPath ) { m_Path = aPath; }
203 
205  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
206 
207  int GetLocalClearance() const { return m_LocalClearance; }
208  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
209 
211  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
212 
215 
218 
219  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
220  int GetThermalWidth() const { return m_ThermalWidth; }
221 
222  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
223  int GetThermalGap() const { return m_ThermalGap; }
224 
225  int GetAttributes() const { return m_Attributs; }
226  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
227 
228  void SetFlag( int aFlag ) { m_arflag = aFlag; }
229  void IncrementFlag() { m_arflag += 1; }
230  int GetFlag() const { return m_arflag; }
231 
232  // A bit of a hack until net ties are supported as first class citizens
233  bool IsNetTie() const { return GetKeywords().StartsWith( wxT( "net tie" ) ); }
234 
235  void Move( const wxPoint& aMoveVector ) override;
236 
237  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
238 
239  void Flip( const wxPoint& aCentre ) override;
240 
252  void MoveAnchorPosition( const wxPoint& aMoveVector );
253 
258  bool IsFlipped() const { return GetLayer() == B_Cu; }
259 
260 // m_ModuleStatus bits:
261 #define MODULE_is_LOCKED 0x01
262 #define MODULE_is_PLACED 0x02
263 #define MODULE_to_PLACE 0x04
264 #define MODULE_PADS_LOCKED 0x08
265 
266 
267  bool IsLocked() const override
268  {
269  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
270  }
271 
277  void SetLocked( bool isLocked ) override
278  {
279  if( isLocked )
281  else
283  }
284 
285  bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
286  void SetIsPlaced( bool isPlaced )
287  {
288  if( isPlaced )
290  else
292  }
293 
294  bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
295  void SetNeedsPlaced( bool needsPlaced )
296  {
297  if( needsPlaced )
299  else
301  }
302 
303  bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
304 
305  void SetPadsLocked( bool aPadsLocked )
306  {
307  if( aPadsLocked )
309  else
311  }
312 
313  void SetLastEditTime( timestamp_t aTime ) { m_LastEditTime = aTime; }
314  void SetLastEditTime() { m_LastEditTime = time( NULL ); }
316 
317  /* drawing functions */
318 
327  void Draw( EDA_DRAW_PANEL* aPanel,
328  wxDC* aDC,
329  GR_DRAWMODE aDrawMode,
330  const wxPoint& aOffset = ZeroOffset ) override;
331 
342  wxDC* aDC, const wxPoint& aMoveVector );
343 
368  SHAPE_POLY_SET& aCornerBuffer,
369  int aInflateValue,
370  int aCircleToSegmentsCount,
371  double aCorrectionFactor,
372  bool aSkipNPTHPadsWihNoCopper = false ) const;
373 
395  SHAPE_POLY_SET& aCornerBuffer,
396  int aInflateValue,
397  int aCircleToSegmentsCount,
398  double aCorrectionFactor,
399  int aCircleToSegmentsCountForTexts = 0,
400  bool aIncludeText = true ) const;
401 
414  SHAPE_POLY_SET& aCornerBuffer,
415  int aInflateValue,
416  int aCircleToSegmentsCount,
417  double aCorrectionFactor,
418  int aCircleToSegmentsCountForTexts = 0 ) const;
419 
428  void DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
429  GR_DRAWMODE draw_mode );
430 
437  void DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC,
438  const wxPoint& offset, int dim_ancre, GR_DRAWMODE draw_mode );
439 
441  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
442 
443  bool HitTest( const wxPoint& aPosition ) const override;
444 
454  bool HitTestAccurate( const wxPoint& aPosition ) const;
455 
456  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
457 
462  const wxString GetReference() const
463  {
464  return m_Reference->GetText();
465  }
466 
472  void SetReference( const wxString& aReference )
473  {
474  m_Reference->SetText( aReference );
475  }
476 
481  void IncrementReference( int aDelta );
482 
487  const wxString GetValue() const
488  {
489  return m_Value->GetText();
490  }
491 
496  void SetValue( const wxString& aValue )
497  {
498  m_Value->SetText( aValue );
499  }
500 
502  TEXTE_MODULE& Value() { return *m_Value; }
504 
506  TEXTE_MODULE& Value() const { return *m_Value; }
507  TEXTE_MODULE& Reference() const { return *m_Reference; }
508 
517  D_PAD* FindPadByName( const wxString& aPadName ) const;
518 
527  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
528 
529  D_PAD* GetTopLeftPad();
530 
539  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
540 
553  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
554 
563  wxString GetNextPadName( bool aFillSequenceGaps ) const;
564 
565  double GetArea( int aPadding = 0 ) const;
566 
567  timestamp_t GetLink() const { return m_Link; }
568  void SetLink( timestamp_t aLink ) { m_Link = aLink; }
569 
570  int GetPlacementCost180() const { return m_CntRot180; }
571  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
572 
573  int GetPlacementCost90() const { return m_CntRot90; }
574  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
575 
581  BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem,
582  bool aIncrementPadNumbers,
583  bool aAddToModule = false );
584 
591  void Add3DModel( MODULE_3D_SETTINGS* a3DModel );
592 
593  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
594 
595  wxString GetClass() const override
596  {
597  return wxT( "MODULE" );
598  }
599 
600  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
601 
602  BITMAP_DEF GetMenuImage() const override;
603 
604  EDA_ITEM* Clone() const override;
605 
612  void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction );
613 
622  void GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads = true ) const;
623 
624  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
625 
626  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
627 
628  virtual const BOX2I ViewBBox() const override;
629 
646  void CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings );
647 
655  static bool IsLibNameValid( const wxString& aName );
656 
665  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
666 
682  void SetInitialComments( wxArrayString* aInitialComments )
683  {
684  delete m_initial_comments;
685  m_initial_comments = aInitialComments;
686  }
687 
694  double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
695 
697  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
698 
704 
712  bool BuildPolyCourtyard();
713 
714  virtual void SwapData( BOARD_ITEM* aImage ) override;
715 
716 #if defined(DEBUG)
717  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
718 #endif
719 
720 private:
723  std::list<MODULE_3D_SETTINGS> m_3D_Drawings;
724  double m_Orient;
725  wxPoint m_Pos;
732 
733  // The final margin is the sum of these 2 values
736  wxString m_Doc;
737  wxString m_KeyWord;
738  wxString m_Path;
741  int m_arflag;
745 
746  // Local tolerances. When zero, this means the corresponding netclass value
747  // is used. Usually theses local tolerances zero, in deference to the
748  // corresponding netclass values.
753 
755  wxArrayString* m_initial_comments;
756 
762 };
763 
764 #endif // MODULE_H_
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetPadCount returns the number of pads.
wxString GetNextPadName(bool aFillSequenceGaps) const
Function GetNextPadName returns the next available pad name in the module.
LIB_ID m_fpid
The LIB_ID of the MODULE.
Definition: class_module.h:728
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:702
timestamp_t GetLastEditTime() const
Definition: class_module.h:315
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:263
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void SetPlacementCost90(int aCost)
Definition: class_module.h:574
int GetAttributes() const
Definition: class_module.h:225
double GetOrientation() const
Definition: class_module.h:188
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...
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:170
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
int GetPlacementCost90() const
Definition: class_module.h:573
double GetArea(int aPadding=0) const
TEXTE_MODULE & Reference()
Definition: class_module.h:503
void SetThermalGap(int aGap)
Definition: class_module.h:222
int m_CntRot90
Horizontal automatic placement cost ( 0..10 ).
Definition: class_module.h:743
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction)
Function RunOnChildren.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
void IncrementFlag()
Definition: class_module.h:229
unsigned GetUniquePadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetUniquePadCount returns the number of unique pads.
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:761
void SetLocalClearance(int aClearance)
Definition: class_module.h:208
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:258
wxString m_KeyWord
Search keywords to find module in library.
Definition: class_module.h:737
wxString m_Path
Definition: class_module.h:738
void SetPlacementCost180(int aCost)
Definition: class_module.h:571
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
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 GetAllDrawingLayers(int aLayers[], int &aCount, bool aIncludePads=true) const
Returns a set of all layers that this module has drawings on similar to ViewGetLayers()
SHAPE_POLY_SET GetBoundingPoly() const
Returns a bounding polygon for the shapes and pads in the module This operation is slower but more ac...
int m_ThermalWidth
Definition: class_module.h:734
double CoverageRatio(const GENERAL_COLLECTOR &aCollector) const
Function CoverageRatio Calculates the ratio of total area of the footprint pads and graphical items t...
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block.
Definition: class_module.h:682
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
void TransformGraphicShapesWithClearanceToPolygonSet(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aCircleToSegmentsCount, double aCorrectionFactor, int aCircleToSegmentsCountForTexts=0, bool aIncludeText=true) const
function TransformGraphicShapesWithClearanceToPolygonSet generate shapes of graphic items (outlines) ...
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:752
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
bool IsPlaced() const
Definition: class_module.h:285
const std::list< MODULE_3D_SETTINGS > & Models() const
Definition: class_module.h:179
ZoneConnection
How pads are covered by copper in zone.
Definition: zones.h:50
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.
int m_LocalSolderPasteMargin
Solder paste margin absolute value.
Definition: class_module.h:751
int m_ThermalGap
Definition: class_module.h:735
const wxString & GetPath() const
Definition: class_module.h:201
DLIST_ITERATOR_WRAPPER< D_PAD > Pads()
Definition: class_module.h:168
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:295
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:487
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:76
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:52
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Returns the area of the module footprint excluding any text.
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:216
MODULE(BOARD *parent)
virtual const wxString GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:148
void SetOrientationDegrees(double aOrientation)
Definition: class_module.h:187
void Add3DModel(MODULE_3D_SETTINGS *a3DModel)
Function Add3DModel adds a3DModel definition to the end of the 3D model list.
const LIB_ID & GetFPID() const
Definition: class_module.h:192
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
static function StringLibNameInvalidChars Test for validity of the name in a library of the footprint...
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int GetLocalSolderMaskMargin() const
Definition: class_module.h:204
void MoveAnchorPosition(const wxPoint &aMoveVector)
Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint:...
bool m_Preview
Include module in 3D preview.
Definition: class_module.h:103
wxArrayString * m_initial_comments
leading s-expression comments in the module, lazily allocated only if needed for speed
Definition: class_module.h:755
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:214
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 ...
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:264
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.
timestamp_t GetLink() const
Definition: class_module.h:567
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:101
wxString m_Doc
File name and path for documentation file.
Definition: class_module.h:736
timestamp_t m_LastEditTime
Definition: class_module.h:740
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:462
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:262
int m_LocalClearance
Definition: class_module.h:749
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:102
double m_Orient
Orientation in tenths of a degree, 900=90.0 degrees.
Definition: class_module.h:724
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > GraphicalItems()
Definition: class_module.h:173
bool IsNetTie() const
Definition: class_module.h:233
class MODULE, a footprint
Definition: typeinfo.h:89
void ClearAllNets()
Function ClearAllNets Clear (i.e.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
const DLIST< BOARD_ITEM > & GraphicalItemsList() const
Definition: class_module.h:166
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.
D_PAD * FindPadByName(const wxString &aPadName) const
Function FindPadByName returns a D_PAD* with a matching name.
EDA_RECT m_BoundaryBox
Bounding box : coordinates on board, real orientation.
Definition: class_module.h:731
Class LSET is a set of PCB_LAYER_IDs.
Footprint text class description.
int GetLocalClearance() const
Definition: class_module.h:207
void SetLink(timestamp_t aLink)
Definition: class_module.h:568
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
Class SHAPE_POLY_SET.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:502
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:313
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
const DLIST< D_PAD > & PadsList() const
Definition: class_module.h:163
timestamp_t m_Link
Temporary logical link used during editing.
Definition: class_module.h:742
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_module.h:117
void SetThermalWidth(int aWidth)
Definition: class_module.h:219
int m_LocalSolderMaskMargin
Solder mask margin.
Definition: class_module.h:750
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Linked list of 3D models.
Definition: class_module.h:723
double GetOrientationRadians() const
Definition: class_module.h:190
int m_arflag
Use to trace ratsnest and auto routing.
Definition: class_module.h:741
double GetOrientationDegrees() const
Definition: class_module.h:189
static LSET AllLayersMask()
Definition: lset.cpp:713
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:305
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:472
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:760
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:286
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.
void SetPosition(const wxPoint &aPos) override
bool NeedsPlaced() const
Definition: class_module.h:294
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.
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: class_module.h:697
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:267
const wxString & GetKeywords() const
Definition: class_module.h:198
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:205
D_PAD * GetTopLeftPad()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:210
MODULE & operator=(const MODULE &aOther)
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:102
default
Definition: class_module.h:75
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
int GetPlacementCost180() const
Definition: class_module.h:570
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...
const wxString & GetDescription() const
Definition: class_module.h:195
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:211
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:213
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:178
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:261
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
int m_CntRot180
Vertical automatic placement cost ( 0..10 ).
Definition: class_module.h:744
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:277
void IncrementReference(int aDelta)
Function IncrementReference Bumps the current reference by aDelta.
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:100
DLIST< BOARD_ITEM > m_Drawings
Linked list of graphical items.
Definition: class_module.h:722
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
int GetFlag() const
Definition: class_module.h:230
int m_ModuleStatus
For autoplace: flags (LOCKED, AUTOPLACED)
Definition: class_module.h:730
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,...
Definition: class_module.h:78
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:245
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_module.h:595
MODULE * Back() const
Definition: class_module.h:123
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLastEditTime()
Definition: class_module.h:314
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:496
TEXTE_MODULE * m_Value
Component value (74LS00, 22K..)
Definition: class_module.h:727
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:156
TEXTE_MODULE & Reference() const
Definition: class_module.h:507
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:99
wxPoint m_Pos
Position of module on the board in internal units.
Definition: class_module.h:725
bool HitTestAccurate(const wxPoint &aPosition) const
Tests if a point is inside the bounding polygon of the module.
bool PadsLocked() const
Definition: class_module.h:303
MODULE * Next() const
Definition: class_module.h:122
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:199
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:165
TEXTE_MODULE * m_Reference
Component reference designator value (U34, R18..)
Definition: class_module.h:726
void CopyNetlistSettings(MODULE *aModule, bool aCopyLocalSettings)
Function CopyNetlistSettings copies the netlist settings to aModule.
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: common.h:53
DLIST< D_PAD > & PadsList()
Definition: class_module.h:162
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:239
SHAPE_POLY_SET & GetPolyCourtyardBack()
Definition: class_module.h:703
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:61
SEARCH_RESULT
Definition: base_struct.h:66
DLIST< D_PAD > m_Pads
Linked list of pads.
Definition: class_module.h:721
int GetThermalWidth() const
Definition: class_module.h:220
ZoneConnection m_ZoneConnection
Definition: class_module.h:739
INCLUDE_NPTH_T
Definition: class_module.h:61
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
const wxPoint GetPosition() const override
Definition: class_module.h:183
int GetThermalGap() const
Definition: class_module.h:223
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:193
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:169
void SetPath(const wxString &aPath)
Definition: class_module.h:202
EDA_UNITS_T
Definition: common.h:157
TEXTE_MODULE & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:506
void SetFlag(int aFlag)
Definition: class_module.h:228
ZoneConnection GetZoneConnection() const
Definition: class_module.h:217
void SetAttributes(int aAttributes)
Definition: class_module.h:226
KICAD_T Type() const
Function Type()
Definition: base_struct.h:203
int m_Attributs
Flag bits ( see Mod_Attribut )
Definition: class_module.h:729
virtual void SetText(const wxString &aText)
Definition: eda_text.h:159
void SetDescription(const wxString &aDoc)
Definition: class_module.h:196
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item.