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-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef MODULE_H_
26 #define MODULE_H_
27 
28 #include <deque>
29 
30 #include <board_item_container.h>
31 #include <class_board_item.h>
32 #include <collectors.h>
33 #include <convert_to_biu.h>
34 #include <layers_id_colors_and_visibility.h> // ALL_LAYERS definition.
35 #include <lib_id.h>
36 #include <list>
37 
38 #include "zones.h"
39 #include <fp_text.h>
40 #include <class_zone.h>
41 #include <functional>
42 
43 class LINE_READER;
44 class EDA_3D_CANVAS;
45 class D_PAD;
46 class BOARD;
47 class MSG_PANEL_ITEM;
48 class SHAPE;
49 
50 namespace KIGFX {
51 class VIEW;
52 }
53 
55 {
57  INCLUDE_NPTH = true
58 };
59 
67 {
68  MOD_THROUGH_HOLE = 0x0001,
69  MOD_SMD = 0x0002,
72  MOD_BOARD_ONLY = 0x0010 // Footprint has no corresponding symbol
73 };
74 
76 {
77 public:
79  // Initialize with sensible values
80  m_Scale { 1, 1, 1 },
81  m_Rotation { 0, 0, 0 },
82  m_Offset { 0, 0, 0 },
83  m_Opacity( 1.0 ),
84  m_Show( true )
85  {
86  }
87 
88  struct VECTOR3D
89  {
90  double x, y, z;
91  };
92 
96  double m_Opacity;
97  wxString m_Filename;
98  bool m_Show;
99 };
100 
101 DECL_DEQ_FOR_SWIG( PADS, D_PAD* )
102 DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
103 DECL_VEC_FOR_SWIG( MODULE_ZONE_CONTAINERS, MODULE_ZONE_CONTAINER* )
104 DECL_VEC_FOR_SWIG( MODULE_GROUPS, PCB_GROUP* )
105 DECL_DEQ_FOR_SWIG( MODULES, MODULE* )
106 
108 {
109 public:
110  MODULE( BOARD* parent );
111 
112  MODULE( const MODULE& aFootprint );
113 
114  // Move constructor and operator needed due to std containers inside the module
115  MODULE( MODULE&& aFootprint );
116 
117  ~MODULE();
118 
119  MODULE& operator=( const MODULE& aOther );
120  MODULE& operator=( MODULE&& aOther );
121 
122  static inline bool ClassOf( const EDA_ITEM* aItem )
123  {
124  return aItem && PCB_MODULE_T == aItem->Type();
125  }
126 
128  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT ) override;
129 
131  void Remove( BOARD_ITEM* aItem ) override;
132 
140  void ClearAllNets();
141 
146  void CalculateBoundingBox();
147 
153  EDA_RECT GetFootprintRect() const;
154 
160  EDA_RECT GetBoundingBoxBase() const { return m_BoundaryBox; }
161 
169  EDA_RECT GetFpPadsLocalBbox() const;
170 
175  SHAPE_POLY_SET GetBoundingPoly() const;
176 
177  // Virtual function
178  const EDA_RECT GetBoundingBox() const override;
179 
180  const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
181 
182  PADS& Pads() { return m_pads; }
183  const PADS& Pads() const { return m_pads; }
184 
185  DRAWINGS& GraphicalItems() { return m_drawings; }
186  const DRAWINGS& GraphicalItems() const { return m_drawings; }
187 
188  MODULE_ZONE_CONTAINERS& Zones() { return m_fp_zones; }
189  const MODULE_ZONE_CONTAINERS& Zones() const { return m_fp_zones; }
190 
191  MODULE_GROUPS& Groups() { return m_fp_groups; }
192  const MODULE_GROUPS& Groups() const { return m_fp_groups; }
193 
194  bool HasThroughHolePads() const;
195 
196  std::list<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
197  const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
198 
199  void SetPosition( const wxPoint& aPos ) override;
200 
201  wxPoint GetPosition() const override { return m_Pos; }
202 
203  void SetOrientation( double aNewAngle );
204 
205  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
206  double GetOrientation() const { return m_Orient; }
207  double GetOrientationDegrees() const { return m_Orient / 10.0; }
208  double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
209 
210  const LIB_ID& GetFPID() const { return m_fpid; }
211  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
212 
213  const wxString& GetDescription() const { return m_Doc; }
214  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
215 
216  const wxString& GetKeywords() const { return m_KeyWord; }
217  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
218 
219  const KIID_PATH& GetPath() const { return m_Path; }
220  void SetPath( const KIID_PATH& aPath ) { m_Path = aPath; }
221 
222  int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; }
223  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
224 
225  int GetLocalClearance() const { return m_LocalClearance; }
226  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
227 
228  int GetLocalClearance( wxString* aSource ) const
229  {
230  if( aSource )
231  *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
232 
233  return m_LocalClearance;
234  }
235 
236  int GetLocalSolderPasteMargin() const { return m_LocalSolderPasteMargin; }
237  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
238 
239  double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; }
240  void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; }
241 
242  void SetZoneConnection( ZONE_CONNECTION aType ) { m_ZoneConnection = aType; }
243  ZONE_CONNECTION GetZoneConnection() const { return m_ZoneConnection; }
244 
245  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
246  int GetThermalWidth() const { return m_ThermalWidth; }
247 
248  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
249  int GetThermalGap() const { return m_ThermalGap; }
250 
251  int GetAttributes() const { return m_Attributs; }
252  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
253 
254  void SetFlag( int aFlag ) { m_arflag = aFlag; }
255  void IncrementFlag() { m_arflag += 1; }
256  int GetFlag() const { return m_arflag; }
257 
258  // A bit of a hack until net ties are supported as first class citizens
259  bool IsNetTie() const { return GetKeywords().StartsWith( wxT( "net tie" ) ); }
260 
261  void Move( const wxPoint& aMoveVector ) override;
262 
263  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
264 
265  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
266 
278  void MoveAnchorPosition( const wxPoint& aMoveVector );
279 
284  bool IsFlipped() const { return GetLayer() == B_Cu; }
285 
286 // m_footprintstatus bits:
287 #define MODULE_is_LOCKED 0x01
288 #define MODULE_is_PLACED 0x02
289 #define MODULE_to_PLACE 0x04
290 #define MODULE_PADS_LOCKED 0x08
291 
292 
293  bool IsLocked() const override
294  {
295  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
296  }
297 
303  void SetLocked( bool isLocked ) override
304  {
305  if( isLocked )
306  m_ModuleStatus |= MODULE_is_LOCKED;
307  else
308  m_ModuleStatus &= ~MODULE_is_LOCKED;
309  }
310 
311  bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
312  void SetIsPlaced( bool isPlaced )
313  {
314  if( isPlaced )
315  m_ModuleStatus |= MODULE_is_PLACED;
316  else
317  m_ModuleStatus &= ~MODULE_is_PLACED;
318  }
319 
320  bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
321  void SetNeedsPlaced( bool needsPlaced )
322  {
323  if( needsPlaced )
324  m_ModuleStatus |= MODULE_to_PLACE;
325  else
326  m_ModuleStatus &= ~MODULE_to_PLACE;
327  }
328 
329  bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
330 
331  void SetPadsLocked( bool aPadsLocked )
332  {
333  if( aPadsLocked )
334  m_ModuleStatus |= MODULE_PADS_LOCKED;
335  else
336  m_ModuleStatus &= ~MODULE_PADS_LOCKED;
337  }
338 
339  void SetLastEditTime( timestamp_t aTime ) { m_LastEditTime = aTime; }
340  void SetLastEditTime() { m_LastEditTime = time( NULL ); }
341  timestamp_t GetLastEditTime() const { return m_LastEditTime; }
342 
343  /* drawing functions */
344 
363  void TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
364  PCB_LAYER_ID aLayer,int aClearance,
365  int aMaxError, ERROR_LOC aErrorLoc,
366  bool aSkipNPTHPadsWihNoCopper = false,
367  bool aSkipPlatedPads = false,
368  bool aSkipNonPlatedPads = false ) const;
369 
383  void TransformGraphicShapesWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer,
384  PCB_LAYER_ID aLayer, int aClearance,
385  int aError, ERROR_LOC aErrorLoc,
386  bool aIncludeText = true,
387  bool aIncludeEdges = true ) const;
388 
395  PCB_LAYER_ID aLayer, int aClearance,
396  int aError, ERROR_LOC aErrorLoc ) const
397  {
398  TransformGraphicShapesWithClearanceToPolygonSet( aCornerBuffer, aLayer, aClearance,
399  aError, aErrorLoc, true, false );
400  }
401 
405  void GetContextualTextVars( wxArrayString* aVars ) const;
406 
411  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
412 
414  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
415 
416  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
417 
427  bool HitTestAccurate( const wxPoint& aPosition, int aAccuracy = 0 ) const;
428 
429  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
430 
435  const wxString GetReference() const
436  {
437  return m_Reference->GetText();
438  }
439 
445  void SetReference( const wxString& aReference )
446  {
447  m_Reference->SetText( aReference );
448  }
449 
454  void IncrementReference( int aDelta );
455 
460  const wxString GetValue() const
461  {
462  return m_Value->GetText();
463  }
464 
469  void SetValue( const wxString& aValue )
470  {
471  m_Value->SetText( aValue );
472  }
473 
475  FP_TEXT& Value() { return *m_Value; }
476  FP_TEXT& Reference() { return *m_Reference; }
477 
479  FP_TEXT& Value() const { return *m_Value; }
480  FP_TEXT& Reference() const { return *m_Reference; }
481 
482  const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
483  void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
484 
492  D_PAD* FindPadByName( const wxString& aPadName ) const;
493 
502  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
503 
504  D_PAD* GetTopLeftPad();
505 
511  {
512  return m_pads.empty() ? nullptr : m_pads.front();
513  }
514 
523  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
524 
537  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
538 
547  wxString GetNextPadName( const wxString& aLastPadName ) const;
548 
549  double GetArea( int aPadding = 0 ) const;
550 
551  KIID GetLink() const { return m_Link; }
552  void SetLink( const KIID& aLink ) { m_Link = aLink; }
553 
554  int GetPlacementCost180() const { return m_CntRot180; }
555  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
556 
557  int GetPlacementCost90() const { return m_CntRot90; }
558  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
559 
560  BOARD_ITEM* Duplicate() const override;
561 
567  BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule = false );
568 
575  void Add3DModel( MODULE_3D_SETTINGS* a3DModel );
576 
577  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
578 
579  wxString GetClass() const override
580  {
581  return wxT( "MODULE" );
582  }
583 
584  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
585 
586  BITMAP_DEF GetMenuImage() const override;
587 
588  EDA_ITEM* Clone() const override;
589 
597  void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction ) const;
598 
606  void GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads = true ) const;
607 
608  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
609 
610  double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
611 
612  virtual const BOX2I ViewBBox() const override;
613 
621  static bool IsLibNameValid( const wxString& aName );
622 
631  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
632 
647  void SetInitialComments( wxArrayString* aInitialComments )
648  {
649  delete m_initial_comments;
650  m_initial_comments = aInitialComments;
651  }
652 
659  double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
660 
662  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
663 
667  SHAPE_POLY_SET& GetPolyCourtyardFront() { return m_poly_courtyard_front; }
668  SHAPE_POLY_SET& GetPolyCourtyardBack() { return m_poly_courtyard_back; }
669 
675  void BuildPolyCourtyards();
676 
677  virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
678 
679  virtual void SwapData( BOARD_ITEM* aImage ) override;
680 
682  {
683  bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
684  };
685 
686  struct cmp_pads
687  {
688  bool operator()( const D_PAD* aFirst, const D_PAD* aSecond ) const;
689  };
690 
691 
692 #if defined(DEBUG)
693  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
694 #endif
695 
696 private:
697  DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
698  PADS m_pads; // D_PAD items, owned by pointer
699  MODULE_ZONE_CONTAINERS m_fp_zones; // MODULE_ZONE_CONTAINER items, owned by pointer
700  MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
701 
702  double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees.
703  wxPoint m_Pos; // Position of module on the board in internal units.
704  FP_TEXT* m_Reference; // Component reference designator value (U34, R18..)
705  FP_TEXT* m_Value; // Component value (74LS00, 22K..)
706  LIB_ID m_fpid; // The #LIB_ID of the MODULE.
707  int m_Attributs; // Flag bits ( see Mod_Attribut )
708  int m_ModuleStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
709  EDA_RECT m_BoundaryBox; // Bounding box : coordinates on board, real orientation.
710 
715  int m_LocalSolderMaskMargin; // Solder mask margin
716  int m_LocalSolderPasteMargin; // Solder paste margin absolute value
717  double m_LocalSolderPasteMarginRatio; // Solder mask margin ratio value of pad size
718 
719  wxString m_Doc; // File name and path for documentation file.
720  wxString m_KeyWord; // Search keywords to find module in library.
721  KIID_PATH m_Path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
723  int m_arflag; // Use to trace ratsnest and auto routing.
724  KIID m_Link; // Temporary logical link used during editing
725  int m_CntRot90; // Horizontal automatic placement cost ( 0..10 ).
726  int m_CntRot180; // Vertical automatic placement cost ( 0..10 ).
727 
728  std::list<MODULE_3D_SETTINGS> m_3D_Drawings; // Linked list of 3D models.
729  std::map<wxString, wxString> m_properties;
730  wxArrayString* m_initial_comments; // s-expression comments in the module,
731  // lazily allocated only if needed for speed
732 
733  SHAPE_POLY_SET m_poly_courtyard_front; // Note that a module can have both front and back
734  SHAPE_POLY_SET m_poly_courtyard_back; // courtyards populated.
735 };
736 
737 #endif // MODULE_H_
LIB_ID m_fpid
Definition: class_module.h:706
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:667
timestamp_t GetLastEditTime() const
Definition: class_module.h:341
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
Definition: macros_swig.h:51
const DRAWINGS & GraphicalItems() const
Definition: class_module.h:186
#define MODULE_to_PLACE
In autoplace: module waiting for autoplace.
Definition: class_module.h:289
void SetPlacementCost90(int aCost)
Definition: class_module.h:558
void SetLink(const KIID &aLink)
Definition: class_module.h:552
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
EDA_RECT GetBoundingBoxBase() const
Returns the last calculated bounding box of the footprint (does not recalculate it).
Definition: class_module.h:160
int GetAttributes() const
Definition: class_module.h:251
double GetOrientation() const
Definition: class_module.h:206
LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to re...
Definition: richio.h:82
int GetPlacementCost90() const
Definition: class_module.h:557
void SetThermalGap(int aGap)
Definition: class_module.h:248
int m_CntRot90
Definition: class_module.h:725
void IncrementFlag()
Definition: class_module.h:255
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:734
PNG memory record (file in memory).
Definition: bitmap_def.h:29
void SetLocalClearance(int aClearance)
Definition: class_module.h:226
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:284
wxString m_KeyWord
Definition: class_module.h:720
void SetPlacementCost180(int aCost)
Definition: class_module.h:555
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
int m_ThermalWidth
Definition: class_module.h:712
FP_TEXT & Value()
read/write accessors:
Definition: class_module.h:475
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block.
Definition: class_module.h:647
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:717
bool IsPlaced() const
Definition: class_module.h:311
const std::list< MODULE_3D_SETTINGS > & Models() const
Definition: class_module.h:197
ZONE_CONNECTION GetZoneConnection() const
Definition: class_module.h:243
int m_LocalSolderPasteMargin
Definition: class_module.h:716
int m_ThermalGap
Definition: class_module.h:713
PADS & Pads()
Definition: class_module.h:182
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:321
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:460
bool m_Show
Include module in rendering.
Definition: class_module.h:98
KIID_PATH m_Path
Definition: class_module.h:721
FP_TEXT & Reference() const
Definition: class_module.h:480
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:48
PADS m_pads
Definition: class_module.h:698
void SetOrientationDegrees(double aOrientation)
Definition: class_module.h:205
const LIB_ID & GetFPID() const
Definition: class_module.h:210
D_PAD * GetFirstPad() const
Gets the first pad in the list or NULL if none.
Definition: class_module.h:510
const KIID_PATH & GetPath() const
Definition: class_module.h:219
DRAWINGS & GraphicalItems()
Definition: class_module.h:185
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
The base class for create windows for drawing purpose.
int GetLocalSolderMaskMargin() const
Definition: class_module.h:222
wxArrayString * m_initial_comments
Definition: class_module.h:730
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:240
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:290
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:94
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:95
wxString m_Doc
Definition: class_module.h:719
timestamp_t m_LastEditTime
Definition: class_module.h:722
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:435
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:288
FP_TEXT & Reference()
Definition: class_module.h:476
int m_LocalClearance
Definition: class_module.h:714
double m_Orient
Definition: class_module.h:702
bool IsNetTie() const
Definition: class_module.h:259
Definition: kiid.h:44
class MODULE, a footprint
Definition: typeinfo.h:89
PCB_LAYER_ID
A quick note on layer IDs:
EDA_RECT m_BoundaryBox
Definition: class_module.h:709
LSET is a set of PCB_LAYER_IDs.
int GetLocalClearance() const
Definition: class_module.h:225
#define NULL
FP_TEXT * m_Reference
Definition: class_module.h:704
SHAPE_POLY_SET.
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:711
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:339
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_module.h:122
void SetThermalWidth(int aWidth)
Definition: class_module.h:245
int m_LocalSolderMaskMargin
Definition: class_module.h:715
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:728
double GetOrientationRadians() const
Definition: class_module.h:208
int m_arflag
Definition: class_module.h:723
double GetOrientationDegrees() const
Definition: class_module.h:207
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:699
MODULE_GROUPS m_fp_groups
Definition: class_module.h:700
static LSET AllLayersMask()
Definition: lset.cpp:786
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:66
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:331
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:445
SHAPE.
Definition: shape.h:122
SHAPE_POLY_SET m_poly_courtyard_front
Definition: class_module.h:733
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:312
FP_TEXT * m_Value
Definition: class_module.h:705
bool NeedsPlaced() const
Definition: class_module.h:320
MODULE_GROUPS & Groups()
Definition: class_module.h:191
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: class_module.h:662
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:293
FP_TEXT & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:479
const wxString & GetKeywords() const
Definition: class_module.h:216
DRAWINGS m_drawings
Definition: class_module.h:697
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:223
const MODULE_ZONE_CONTAINERS & Zones() const
Definition: class_module.h:189
int GetLocalSolderPasteMargin() const
Definition: class_module.h:236
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:97
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:277
EDA_UNITS
Definition: eda_units.h:38
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
Definition: kiid.h:32
int GetPlacementCost180() const
Definition: class_module.h:554
const wxString & GetDescription() const
Definition: class_module.h:213
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:237
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:239
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:196
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:287
int m_CntRot180
Definition: class_module.h:726
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:303
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:94
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: class_module.h:483
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
int GetFlag() const
Definition: class_module.h:256
#define _(s)
Definition: 3d_actions.cpp:33
int m_ModuleStatus
Definition: class_module.h:708
void Flip(T &aValue)
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:240
const PADS & Pads() const
Definition: class_module.h:183
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: class_module.h:242
std::map< wxString, wxString > m_properties
Definition: class_module.h:729
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_module.h:579
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLastEditTime()
Definition: class_module.h:340
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:469
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:958
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:93
KIID GetLink() const
Definition: class_module.h:551
wxPoint m_Pos
Definition: class_module.h:703
static bool GetLayer(MODEL_VRML &aModel, LAYER_NUM layer, VRML_LAYER **vlayer)
bool PadsLocked() const
Definition: class_module.h:329
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:217
const std::map< wxString, wxString > & GetProperties() const
Definition: class_module.h:482
MODULE_ZONE_CONTAINERS & Zones()
Definition: class_module.h:188
const MODULE_GROUPS & Groups() const
Definition: class_module.h:192
wxPoint GetPosition() const override
Definition: class_module.h:201
void SetPath(const KIID_PATH &aPath)
Definition: class_module.h:220
SHAPE_POLY_SET & GetPolyCourtyardBack()
Definition: class_module.h:668
Abstract interface for BOARD_ITEMs capable of storing other items inside.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:54
VIEW.
Definition: view.h:63
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
Declare a std::vector but no swig template.
Definition: macros_swig.h:50
int GetThermalWidth() const
Definition: class_module.h:246
SEARCH_RESULT
Definition: eda_item.h:40
INCLUDE_NPTH_T
Definition: class_module.h:54
int GetThermalGap() const
Definition: class_module.h:249
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:211
void SetFlag(int aFlag)
Definition: class_module.h:254
KIID m_Link
Definition: class_module.h:724
void SetAttributes(int aAttributes)
Definition: class_module.h:252
KICAD_T Type() const
Function Type()
Definition: eda_item.h:182
int m_Attributs
Definition: class_module.h:707
void SetDescription(const wxString &aDoc)
Definition: class_module.h:214
void TransformGraphicTextWithClearanceToPolygonSet(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc) const
TransformGraphicTextWithClearanceToPolygonSet This function is the same as TransformGraphicShapesWith...
Definition: class_module.h:394
int GetLocalClearance(wxString *aSource) const
Definition: class_module.h:228