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 <class_text_mod.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 
49 namespace KIGFX {
50 class VIEW;
51 }
52 
54 {
56  INCLUDE_NPTH = true
57 };
58 
66 {
68  MOD_CMS = 1,
69  MOD_VIRTUAL = 2
71 };
73 
75 {
76  public:
78  // Initialize with sensible values
79  m_Scale { 1, 1, 1 },
80  m_Rotation { 0, 0, 0 },
81  m_Offset { 0, 0, 0 },
82  m_Opacity( 1.0 ),
83  m_Show( true )
84  {
85  }
86 
87  struct VECTOR3D
88  {
89  double x, y, z;
90  };
91 
95  double m_Opacity;
96  wxString m_Filename;
97  bool m_Show;
98 };
99 
100 DECL_DEQ_FOR_SWIG( PADS, D_PAD* )
101 DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
102 DECL_VEC_FOR_SWIG( MODULE_ZONE_CONTAINERS, MODULE_ZONE_CONTAINER* )
103 DECL_DEQ_FOR_SWIG( MODULES, MODULE* )
104 
106 {
107 public:
108  MODULE( BOARD* parent );
109 
110  MODULE( const MODULE& aModule );
111 
112  // Move constructor and operator needed due to std containers inside the module
113  MODULE( MODULE&& aModule );
114 
115  ~MODULE();
116 
117  MODULE& operator=( const MODULE& aOther );
118  MODULE& operator=( MODULE&& aOther );
119 
120  static inline bool ClassOf( const EDA_ITEM* aItem )
121  {
122  return aItem && PCB_MODULE_T == aItem->Type();
123  }
124 
126  void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::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 
160  EDA_RECT GetFpPadsLocalBbox() const;
161 
166  SHAPE_POLY_SET GetBoundingPoly() const;
167 
168  // Virtual function
169  const EDA_RECT GetBoundingBox() const override;
170 
171  const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
172 
173  PADS& Pads()
174  {
175  return m_pads;
176  }
177 
178  const PADS& Pads() const
179  {
180  return m_pads;
181  }
182 
183  DRAWINGS& GraphicalItems()
184  {
185  return m_drawings;
186  }
187 
188  const DRAWINGS& GraphicalItems() const
189  {
190  return m_drawings;
191  }
192 
193  MODULE_ZONE_CONTAINERS& Zones()
194  {
195  return m_fp_zones;
196  }
197 
198 
199  const MODULE_ZONE_CONTAINERS& Zones() const
200  {
201  return m_fp_zones;
202  }
203 
209  bool HasNonSMDPins() const;
210 
211  std::list<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
212  const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
213 
214  void SetPosition( const wxPoint& aPos ) override;
215 
216  wxPoint GetPosition() const override { return m_Pos; }
217 
218  void SetOrientation( double newangle );
219 
220  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
221  double GetOrientation() const { return m_Orient; }
222  double GetOrientationDegrees() const { return m_Orient / 10.0; }
223  double GetOrientationRadians() const { return m_Orient * M_PI / 1800; }
224 
225  const LIB_ID& GetFPID() const { return m_fpid; }
226  void SetFPID( const LIB_ID& aFPID ) { m_fpid = aFPID; }
227 
228  const wxString& GetDescription() const { return m_Doc; }
229  void SetDescription( const wxString& aDoc ) { m_Doc = aDoc; }
230 
231  const wxString& GetKeywords() const { return m_KeyWord; }
232  void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
233 
234  const KIID_PATH& GetPath() const { return m_Path; }
235  void SetPath( const KIID_PATH& aPath ) { m_Path = aPath; }
236 
237  int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; }
238  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
239 
240  int GetLocalClearance() const { return m_LocalClearance; }
241  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
242 
243  int GetLocalClearance( wxString* aSource ) const
244  {
245  if( aSource )
246  *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
247 
248  return m_LocalClearance;
249  }
250 
251  int GetLocalSolderPasteMargin() const { return m_LocalSolderPasteMargin; }
252  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
253 
254  double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; }
255  void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; }
256 
257  void SetZoneConnection( ZONE_CONNECTION aType ) { m_ZoneConnection = aType; }
258  ZONE_CONNECTION GetZoneConnection() const { return m_ZoneConnection; }
259 
260  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
261  int GetThermalWidth() const { return m_ThermalWidth; }
262 
263  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
264  int GetThermalGap() const { return m_ThermalGap; }
265 
266  int GetAttributes() const { return m_Attributs; }
267  void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
268 
269  void SetFlag( int aFlag ) { m_arflag = aFlag; }
270  void IncrementFlag() { m_arflag += 1; }
271  int GetFlag() const { return m_arflag; }
272 
273  // A bit of a hack until net ties are supported as first class citizens
274  bool IsNetTie() const { return GetKeywords().StartsWith( wxT( "net tie" ) ); }
275 
276  void Move( const wxPoint& aMoveVector ) override;
277 
278  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
279 
280  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
281 
293  void MoveAnchorPosition( const wxPoint& aMoveVector );
294 
299  bool IsFlipped() const { return GetLayer() == B_Cu; }
300 
301 // m_ModuleStatus bits:
302 #define MODULE_is_LOCKED 0x01
303 #define MODULE_is_PLACED 0x02
304 #define MODULE_to_PLACE 0x04
305 #define MODULE_PADS_LOCKED 0x08
306 
307 
308  bool IsLocked() const override
309  {
310  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
311  }
312 
318  void SetLocked( bool isLocked ) override
319  {
320  if( isLocked )
321  m_ModuleStatus |= MODULE_is_LOCKED;
322  else
323  m_ModuleStatus &= ~MODULE_is_LOCKED;
324  }
325 
326  bool IsPlaced() const { return m_ModuleStatus & MODULE_is_PLACED; }
327  void SetIsPlaced( bool isPlaced )
328  {
329  if( isPlaced )
330  m_ModuleStatus |= MODULE_is_PLACED;
331  else
332  m_ModuleStatus &= ~MODULE_is_PLACED;
333  }
334 
335  bool NeedsPlaced() const { return m_ModuleStatus & MODULE_to_PLACE; }
336  void SetNeedsPlaced( bool needsPlaced )
337  {
338  if( needsPlaced )
339  m_ModuleStatus |= MODULE_to_PLACE;
340  else
341  m_ModuleStatus &= ~MODULE_to_PLACE;
342  }
343 
344  bool PadsLocked() const { return m_ModuleStatus & MODULE_PADS_LOCKED; }
345 
346  void SetPadsLocked( bool aPadsLocked )
347  {
348  if( aPadsLocked )
349  m_ModuleStatus |= MODULE_PADS_LOCKED;
350  else
351  m_ModuleStatus &= ~MODULE_PADS_LOCKED;
352  }
353 
354  void SetLastEditTime( timestamp_t aTime ) { m_LastEditTime = aTime; }
355  void SetLastEditTime() { m_LastEditTime = time( NULL ); }
356  timestamp_t GetLastEditTime() const { return m_LastEditTime; }
357 
358  /* drawing functions */
359 
377  void TransformPadsShapesWithClearanceToPolygon( PCB_LAYER_ID aLayer,
378  SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, int aMaxError = ARC_HIGH_DEF,
379  bool aSkipNPTHPadsWihNoCopper = false ) const;
380 
395  void TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLayer,
396  SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, int aError = ARC_HIGH_DEF,
397  bool aIncludeText = true, bool aIncludeEdges = true ) const;
398 
405  SHAPE_POLY_SET& aCornerBuffer, int aInflateValue, int aError = ARC_HIGH_DEF ) const
406  {
407  TransformGraphicShapesWithClearanceToPolygonSet( aLayer, aCornerBuffer, aInflateValue,
408  aError, true, false );
409  }
410 
414  void GetContextualTextVars( wxArrayString* aVars ) const;
415 
420  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
421 
423  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
424 
425  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
426 
436  bool HitTestAccurate( const wxPoint& aPosition, int aAccuracy = 0 ) const;
437 
438  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
439 
444  const wxString GetReference() const
445  {
446  return m_Reference->GetText();
447  }
448 
454  void SetReference( const wxString& aReference )
455  {
456  m_Reference->SetText( aReference );
457  }
458 
463  void IncrementReference( int aDelta );
464 
469  const wxString GetValue() const
470  {
471  return m_Value->GetText();
472  }
473 
478  void SetValue( const wxString& aValue )
479  {
480  m_Value->SetText( aValue );
481  }
482 
484  TEXTE_MODULE& Value() { return *m_Value; }
485  TEXTE_MODULE& Reference() { return *m_Reference; }
486 
488  TEXTE_MODULE& Value() const { return *m_Value; }
489  TEXTE_MODULE& Reference() const { return *m_Reference; }
490 
498  D_PAD* FindPadByName( const wxString& aPadName ) const;
499 
508  D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask = LSET::AllLayersMask() );
509 
510  D_PAD* GetTopLeftPad();
511 
517  {
518  return m_pads.empty() ? nullptr : m_pads.front();
519  }
520 
529  unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
530 
543  unsigned GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH) ) const;
544 
553  wxString GetNextPadName( const wxString& aLastPadName ) const;
554 
555  double GetArea( int aPadding = 0 ) const;
556 
557  KIID GetLink() const { return m_Link; }
558  void SetLink( const KIID& aLink ) { m_Link = aLink; }
559 
560  int GetPlacementCost180() const { return m_CntRot180; }
561  void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
562 
563  int GetPlacementCost90() const { return m_CntRot90; }
564  void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; }
565 
571  BOARD_ITEM* DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule = false );
572 
579  void Add3DModel( MODULE_3D_SETTINGS* a3DModel );
580 
581  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
582 
583  wxString GetClass() const override
584  {
585  return wxT( "MODULE" );
586  }
587 
588  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
589 
590  BITMAP_DEF GetMenuImage() const override;
591 
592  EDA_ITEM* Clone() const override;
593 
601  void RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction );
602 
610  void GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads = true ) const;
611 
612  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
613 
614  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
615 
616  virtual const BOX2I ViewBBox() const override;
617 
625  static bool IsLibNameValid( const wxString& aName );
626 
635  static const wxChar* StringLibNameInvalidChars( bool aUserReadable );
636 
651  void SetInitialComments( wxArrayString* aInitialComments )
652  {
653  delete m_initial_comments;
654  m_initial_comments = aInitialComments;
655  }
656 
663  double CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const;
664 
666  const wxArrayString* GetInitialComments() const { return m_initial_comments; }
667 
671  SHAPE_POLY_SET& GetPolyCourtyardFront() { return m_poly_courtyard_front; }
672  SHAPE_POLY_SET& GetPolyCourtyardBack() { return m_poly_courtyard_back; }
673 
679  bool BuildPolyCourtyard();
680 
681  virtual void SwapData( BOARD_ITEM* aImage ) override;
682 
684  {
685  bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
686  };
687 
688  struct cmp_pads
689  {
690  bool operator()( const D_PAD* aFirst, const D_PAD* aSecond ) const;
691  };
692 
693 
694 #if defined(DEBUG)
695  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
696 #endif
697 
698 private:
699  DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
700  PADS m_pads; // D_PAD items, owned by pointer
701  MODULE_ZONE_CONTAINERS m_fp_zones; // MODULE_ZONE_CONTAINER items, owned by pointer
702  std::list<MODULE_3D_SETTINGS> m_3D_Drawings; // Linked list of 3D models.
703 
704  double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees.
705  wxPoint m_Pos; // Position of module on the board in internal units.
706  TEXTE_MODULE* m_Reference; // Component reference designator value (U34, R18..)
707  TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..)
708  LIB_ID m_fpid; // The #LIB_ID of the MODULE.
709  int m_Attributs; // Flag bits ( see Mod_Attribut )
710  int m_ModuleStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)
711  EDA_RECT m_BoundaryBox; // Bounding box : coordinates on board, real orientation.
712 
717  int m_LocalSolderMaskMargin; // Solder mask margin
718  int m_LocalSolderPasteMargin; // Solder paste margin absolute value
719  double m_LocalSolderPasteMarginRatio; // Solder mask margin ratio value of pad size
720 
721  wxString m_Doc; // File name and path for documentation file.
722  wxString m_KeyWord; // Search keywords to find module in library.
723  KIID_PATH m_Path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
725  int m_arflag; // Use to trace ratsnest and auto routing.
726  KIID m_Link; // Temporary logical link used during editing
727  int m_CntRot90; // Horizontal automatic placement cost ( 0..10 ).
728  int m_CntRot180; // Vertical automatic placement cost ( 0..10 ).
729 
730  wxArrayString* m_initial_comments;
731 
737 };
738 
739 #endif // MODULE_H_
LIB_ID m_fpid
Definition: class_module.h:708
SHAPE_POLY_SET & GetPolyCourtyardFront()
Used in DRC to test the courtyard area (a complex polygon)
Definition: class_module.h:671
timestamp_t GetLastEditTime() const
Definition: class_module.h:356
EDA_UNITS
Definition: common.h:198
const DRAWINGS & GraphicalItems() const
Definition: class_module.h:188
#define MODULE_to_PLACE
In autoplace: module waiting for autoplace.
Definition: class_module.h:304
void SetPlacementCost90(int aCost)
Definition: class_module.h:564
void SetLink(const KIID &aLink)
Definition: class_module.h:558
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
int GetAttributes() const
Definition: class_module.h:266
double GetOrientation() const
Definition: class_module.h:221
LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to re...
Definition: richio.h:81
int GetPlacementCost90() const
Definition: class_module.h:563
TEXTE_MODULE & Reference()
Definition: class_module.h:485
void SetThermalGap(int aGap)
Definition: class_module.h:263
int m_CntRot90
Definition: class_module.h:727
void IncrementFlag()
Definition: class_module.h:270
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:736
PNG memory record (file in memory).
Definition: bitmap_def.h:29
void SetLocalClearance(int aClearance)
Definition: class_module.h:241
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:299
wxString m_KeyWord
Definition: class_module.h:722
void SetPlacementCost180(int aCost)
Definition: class_module.h:561
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:714
void SetInitialComments(wxArrayString *aInitialComments)
Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block.
Definition: class_module.h:651
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:719
bool IsPlaced() const
Definition: class_module.h:326
const std::list< MODULE_3D_SETTINGS > & Models() const
Definition: class_module.h:212
ZONE_CONNECTION GetZoneConnection() const
Definition: class_module.h:258
int m_LocalSolderPasteMargin
Definition: class_module.h:718
int m_ThermalGap
Definition: class_module.h:715
PADS & Pads()
Definition: class_module.h:173
void SetNeedsPlaced(bool needsPlaced)
Definition: class_module.h:336
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:469
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:68
bool m_Show
Include module in rendering.
Definition: class_module.h:97
KIID_PATH m_Path
Definition: class_module.h:723
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:47
PADS m_pads
Definition: class_module.h:700
void SetOrientationDegrees(double aOrientation)
Definition: class_module.h:220
const LIB_ID & GetFPID() const
Definition: class_module.h:225
D_PAD * GetFirstPad() const
Gets the first pad in the list or NULL if none.
Definition: class_module.h:516
const KIID_PATH & GetPath() const
Definition: class_module.h:234
DRAWINGS & GraphicalItems()
Definition: class_module.h:183
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:237
wxArrayString * m_initial_comments
leading s-expression comments in the module, lazily allocated only if needed for speed
Definition: class_module.h:730
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:255
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:305
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:94
wxString m_Doc
Definition: class_module.h:721
timestamp_t m_LastEditTime
Definition: class_module.h:724
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:444
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:303
int m_LocalClearance
Definition: class_module.h:716
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
double m_Orient
Definition: class_module.h:704
#define DECL_VEC_FOR_SWIG(TypeName, MemberType)
bool IsNetTie() const
Definition: class_module.h:274
Definition: common.h:68
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:711
LSET is a set of PCB_LAYER_IDs.
Footprint text class description.
int GetLocalClearance() const
Definition: class_module.h:240
#define NULL
SHAPE_POLY_SET.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:484
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:713
void SetLastEditTime(timestamp_t aTime)
Definition: class_module.h:354
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_module.h:120
void SetThermalWidth(int aWidth)
Definition: class_module.h:260
int m_LocalSolderMaskMargin
Definition: class_module.h:717
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:702
double GetOrientationRadians() const
Definition: class_module.h:223
int m_arflag
Definition: class_module.h:725
double GetOrientationDegrees() const
Definition: class_module.h:222
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:701
static LSET AllLayersMask()
Definition: lset.cpp:749
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:65
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:346
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:454
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:735
void SetIsPlaced(bool isPlaced)
Definition: class_module.h:327
bool NeedsPlaced() const
Definition: class_module.h:335
const wxArrayString * GetInitialComments() const
Return the initial comments block or NULL if none, without transfer of ownership.
Definition: class_module.h:666
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:308
const wxString & GetKeywords() const
Definition: class_module.h:231
DRAWINGS m_drawings
Definition: class_module.h:699
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:238
const MODULE_ZONE_CONTAINERS & Zones() const
Definition: class_module.h:199
int GetLocalSolderPasteMargin() const
Definition: class_module.h:251
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:96
default
Definition: class_module.h:67
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:271
#define DECL_DEQ_FOR_SWIG(TypeName, MemberType)
int GetPlacementCost180() const
Definition: class_module.h:560
const wxString & GetDescription() const
Definition: class_module.h:228
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:252
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:254
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:211
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:302
int m_CntRot180
Definition: class_module.h:728
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:318
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:205
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:93
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
int GetFlag() const
Definition: class_module.h:271
#define _(s)
Definition: 3d_actions.cpp:33
int m_ModuleStatus
Definition: class_module.h:710
Virtual component: when created by copper shapes on board (Like edge card connectors,...
Definition: class_module.h:70
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:178
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: class_module.h:257
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_module.h:583
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLastEditTime()
Definition: class_module.h:355
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:478
TEXTE_MODULE * m_Value
Definition: class_module.h:707
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
TEXTE_MODULE & Reference() const
Definition: class_module.h:489
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:950
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:92
KIID GetLink() const
Definition: class_module.h:557
wxPoint m_Pos
Definition: class_module.h:705
static bool GetLayer(MODEL_VRML &aModel, LAYER_NUM layer, VRML_LAYER **vlayer)
bool PadsLocked() const
Definition: class_module.h:344
void SetKeywords(const wxString &aKeywords)
Definition: class_module.h:232
MODULE_ZONE_CONTAINERS & Zones()
Definition: class_module.h:193
TEXTE_MODULE * m_Reference
Definition: class_module.h:706
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:56
wxPoint GetPosition() const override
Definition: class_module.h:216
void SetPath(const KIID_PATH &aPath)
Definition: class_module.h:235
SHAPE_POLY_SET & GetPolyCourtyardBack()
Definition: class_module.h:672
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:53
VIEW.
Definition: view.h:61
void TransformGraphicTextWithClearanceToPolygonSet(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aError=ARC_HIGH_DEF) const
TransformGraphicTextWithClearanceToPolygonSet This function is the same as TransformGraphicShapesWith...
Definition: class_module.h:404
SEARCH_RESULT
Definition: base_struct.h:51
int GetThermalWidth() const
Definition: class_module.h:261
INCLUDE_NPTH_T
Definition: class_module.h:53
int GetThermalGap() const
Definition: class_module.h:264
void SetFPID(const LIB_ID &aFPID)
Definition: class_module.h:226
TEXTE_MODULE & Value() const
The const versions to keep the compiler happy.
Definition: class_module.h:488
void SetFlag(int aFlag)
Definition: class_module.h:269
KIID m_Link
Definition: class_module.h:726
void SetAttributes(int aAttributes)
Definition: class_module.h:267
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
int m_Attributs
Definition: class_module.h:709
void SetDescription(const wxString &aDoc)
Definition: class_module.h:229
int GetLocalClearance(wxString *aSource) const
Definition: class_module.h:243