KiCad PCB EDA Suite
MODULE Class Reference

#include <class_module.h>

Inheritance diagram for MODULE:
BOARD_ITEM_CONTAINER BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Classes

struct  cmp_drawings
 
struct  cmp_pads
 

Public Member Functions

 MODULE (BOARD *parent)
 
 MODULE (const MODULE &aModule)
 
 MODULE (MODULE &&aModule)
 
 ~MODULE ()
 
MODULEoperator= (const MODULE &aOther)
 
MODULEoperator= (MODULE &&aOther)
 
void Add (BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
 

More...
 
void Remove (BOARD_ITEM *aItem) override
 

More...
 
void ClearAllNets ()
 Function ClearAllNets Clear (i.e. More...
 
void CalculateBoundingBox ()
 Function CalculateBoundingBox calculates the bounding box in board coordinates. More...
 
EDA_RECT GetFootprintRect () const
 Function GetFootprintRect() Build and returns the boundary box of the module footprint excluding any text. More...
 
EDA_RECT GetBoundingBoxBase () const
 Returns the last calculated bounding box of the footprint (does not recalculate it). More...
 
EDA_RECT GetFpPadsLocalBbox () const
 Returns the bounding box containing pads when the footprint is on the front side, orientation 0, position 0,0. More...
 
SHAPE_POLY_SET GetBoundingPoly () const
 Returns a bounding polygon for the shapes and pads in the module This operation is slower but more accurate than calculating a bounding box. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
const EDA_RECT GetBoundingBox (bool aIncludeInvisibleText) const
 
PADS & Pads ()
 
const PADS & Pads () const
 
DRAWINGS & GraphicalItems ()
 
const DRAWINGS & GraphicalItems () const
 
MODULE_ZONE_CONTAINERS & Zones ()
 
const MODULE_ZONE_CONTAINERS & Zones () const
 
bool HasThroughHolePads () const
 
std::list< MODULE_3D_SETTINGS > & Models ()
 
const std::list< MODULE_3D_SETTINGS > & Models () const
 
void SetPosition (const wxPoint &aPos) override
 
wxPoint GetPosition () const override
 
void SetOrientation (double aNewAngle)
 
void SetOrientationDegrees (double aOrientation)
 
double GetOrientation () const
 
double GetOrientationDegrees () const
 
double GetOrientationRadians () const
 
const LIB_IDGetFPID () const
 
void SetFPID (const LIB_ID &aFPID)
 
const wxString & GetDescription () const
 
void SetDescription (const wxString &aDoc)
 
const wxString & GetKeywords () const
 
void SetKeywords (const wxString &aKeywords)
 
const KIID_PATHGetPath () const
 
void SetPath (const KIID_PATH &aPath)
 
int GetLocalSolderMaskMargin () const
 
void SetLocalSolderMaskMargin (int aMargin)
 
int GetLocalClearance () const
 
void SetLocalClearance (int aClearance)
 
int GetLocalClearance (wxString *aSource) const
 
int GetLocalSolderPasteMargin () const
 
void SetLocalSolderPasteMargin (int aMargin)
 
double GetLocalSolderPasteMarginRatio () const
 
void SetLocalSolderPasteMarginRatio (double aRatio)
 
void SetZoneConnection (ZONE_CONNECTION aType)
 
ZONE_CONNECTION GetZoneConnection () const
 
void SetThermalWidth (int aWidth)
 
int GetThermalWidth () const
 
void SetThermalGap (int aGap)
 
int GetThermalGap () const
 
int GetAttributes () const
 
void SetAttributes (int aAttributes)
 
void SetFlag (int aFlag)
 
void IncrementFlag ()
 
int GetFlag () const
 
bool IsNetTie () const
 
void Move (const wxPoint &aMoveVector) override
 Function Move move this object. More...
 
void Rotate (const wxPoint &aRotCentre, double aAngle) override
 Function Rotate Rotate this object. More...
 
void Flip (const wxPoint &aCentre, bool aFlipLeftRight) override
 Function Flip Flip this object, i.e. More...
 
void MoveAnchorPosition (const wxPoint &aMoveVector)
 Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint: the footprints elements (pads, outlines, edges . More...
 
bool IsFlipped () const
 function IsFlipped More...
 
bool IsLocked () const override
 Function IsLocked. More...
 
void SetLocked (bool isLocked) override
 Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus. More...
 
bool IsPlaced () const
 
void SetIsPlaced (bool isPlaced)
 
bool NeedsPlaced () const
 
void SetNeedsPlaced (bool needsPlaced)
 
bool PadsLocked () const
 
void SetPadsLocked (bool aPadsLocked)
 
void SetLastEditTime (timestamp_t aTime)
 
void SetLastEditTime ()
 
timestamp_t GetLastEditTime () const
 
void TransformPadsShapesWithClearanceToPolygon (PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aMaxError=ARC_HIGH_DEF, bool aSkipNPTHPadsWihNoCopper=false, bool aSkipPlatedPads=false, bool aSkipNonPlatedPads=false) const
 function TransformPadsShapesWithClearanceToPolygon generate pads shapes on layer aLayer as polygons and adds these polygons to aCornerBuffer Useful to generate a polygonal representation of a footprint in 3D view and plot functions, when a full polygonal approach is needed More...
 
void TransformGraphicShapesWithClearanceToPolygonSet (PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aError=ARC_HIGH_DEF, bool aIncludeText=true, bool aIncludeEdges=true) const
 function TransformGraphicShapesWithClearanceToPolygonSet generate shapes of graphic items (outlines) on layer aLayer as polygons and adds these polygons to aCornerBuffer Useful to generate a polygonal representation of a footprint in 3D view and plot functions, when a full polygonal approach is needed More...
 
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 TransformGraphicShapesWithClearanceToPolygonSet but only generate text. More...
 
void GetContextualTextVars (wxArrayString *aVars) const
 Return the list of system text vars for this footprint. More...
 
bool ResolveTextVar (wxString *token, int aDepth=0) const
 Resolve any references to system tokens supported by the component. More...
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
 

More...
 
bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const override
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
bool HitTestAccurate (const wxPoint &aPosition, int aAccuracy=0) const
 Tests if a point is inside the bounding polygon of the module. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const override
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
const wxString GetReference () const
 Function GetReference. More...
 
void SetReference (const wxString &aReference)
 Function SetReference. More...
 
void IncrementReference (int aDelta)
 Function IncrementReference Bumps the current reference by aDelta. More...
 
const wxString GetValue () const
 Function GetValue. More...
 
void SetValue (const wxString &aValue)
 Function SetValue. More...
 
TEXTE_MODULEValue ()
 read/write accessors: More...
 
TEXTE_MODULEReference ()
 
TEXTE_MODULEValue () const
 The const versions to keep the compiler happy. More...
 
TEXTE_MODULEReference () const
 
const std::map< wxString, wxString > & GetProperties () const
 
void SetProperties (const std::map< wxString, wxString > &aProps)
 
D_PADFindPadByName (const wxString &aPadName) const
 Function FindPadByName returns a D_PAD* with a matching name. More...
 
D_PADGetPad (const wxPoint &aPosition, LSET aLayerMask=LSET::AllLayersMask())
 Function GetPad get a pad at aPosition on aLayerMask in the footprint. More...
 
D_PADGetTopLeftPad ()
 
D_PADGetFirstPad () const
 Gets the first pad in the list or NULL if none. More...
 
unsigned GetPadCount (INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
 GetPadCount returns the number of pads. More...
 
unsigned GetUniquePadCount (INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
 GetUniquePadCount returns the number of unique pads. More...
 
wxString GetNextPadName (const wxString &aLastPadName) const
 Function GetNextPadName returns the next available pad name in the module. More...
 
double GetArea (int aPadding=0) const
 
KIID GetLink () const
 
void SetLink (const KIID &aLink)
 
int GetPlacementCost180 () const
 
void SetPlacementCost180 (int aCost)
 
int GetPlacementCost90 () const
 
void SetPlacementCost90 (int aCost)
 
BOARD_ITEMDuplicate () const override
 Function Duplicate creates a copy of a BOARD_ITEM. More...
 
BOARD_ITEMDuplicateItem (const BOARD_ITEM *aItem, bool aAddToModule=false)
 Function DuplicateItem Duplicate a given item within the module, optionally adding it to the board. More...
 
void Add3DModel (MODULE_3D_SETTINGS *a3DModel)
 Function Add3DModel adds a3DModel definition to the end of the 3D model list. More...
 
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 its member data. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
void RunOnChildren (const std::function< void(BOARD_ITEM *)> &aFunction)
 Function RunOnChildren. More...
 
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() More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
double ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
void SetInitialComments (wxArrayString *aInitialComments)
 Function SetInitialComments takes ownership of caller's heap allocated aInitialComments block. More...
 
double CoverageRatio (const GENERAL_COLLECTOR &aCollector) const
 Function CoverageRatio Calculates the ratio of total area of the footprint pads and graphical items to the area of the footprint. More...
 
const wxArrayString * GetInitialComments () const
 Return the initial comments block or NULL if none, without transfer of ownership. More...
 
SHAPE_POLY_SETGetPolyCourtyardFront ()
 Used in DRC to test the courtyard area (a complex polygon) More...
 
SHAPE_POLY_SETGetPolyCourtyardBack ()
 
bool BuildPolyCourtyard ()
 Builds a complex polygon of the courtyard area from graphic items on the courtyard layer. More...
 
virtual std::shared_ptr< SHAPEGetEffectiveShape (PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
 Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes. More...
 
virtual void SwapData (BOARD_ITEM *aImage) override
 Swap data between aItem and aImage. More...
 
virtual void Delete (BOARD_ITEM *aItem)
 Removes an item from the container and deletes it. More...
 
virtual const ZONE_SETTINGSGetZoneSettings () const
 Fetch the zone settings for this container. More...
 
virtual void SetZoneSettings (const ZONE_SETTINGS &aSettings)
 Set the zone settings for this container. More...
 
void SetGroup (const KIID &aGroup)
 Set the group that this item belongs to. More...
 
const KIIDGetGroup () const
 Get the group this item belongs to. More...
 
bool IsInGroup ()
 Test if this item is inside a group. More...
 
int GetX () const
 
int GetY () const
 
virtual wxPoint GetCenter () const
 Function GetCenter() More...
 
void SetX (int aX)
 
void SetY (int aY)
 
virtual bool IsConnected () const
 Function IsConnected() Returns information if the object is derived from BOARD_CONNECTED_ITEM. More...
 
virtual bool IsOnCopperLayer () const
 
BOARD_ITEM_CONTAINERGetParent () const
 
virtual PCB_LAYER_ID GetLayer () const
 Function GetLayer returns the primary layer this item is on. More...
 
virtual LSET GetLayerSet () const
 Function GetLayerSet returns a std::bitset of all layers on which the item physically resides. More...
 
virtual void SetLayerSet (LSET aLayers)
 
virtual void SetLayer (PCB_LAYER_ID aLayer)
 Function SetLayer sets the layer this item is on. More...
 
virtual bool IsOnLayer (PCB_LAYER_ID aLayer) const
 Function IsOnLayer tests to see if this object is on the given layer. More...
 
bool IsTrack () const
 Function IsTrack tests to see if this object is a track or via (or microvia). More...
 
void DeleteStructure ()
 Function DeleteStructure deletes this object after removing from its parent if it has one. More...
 
void Move (const VECTOR2I &aMoveVector)
 
void Rotate (const VECTOR2I &aRotCentre, double aAngle)
 
void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight)
 
virtual BOARDGetBoard () const
 Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
wxString GetLayerName () const
 Function GetLayerName returns the name of the PCB layer on which the item resides. More...
 
virtual void TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError=ARC_LOW_DEF, bool ignoreLineWidth=false) const
 Function TransformShapeWithClearanceToPolygon Convert the item shape to a closed polygon Used in filling zones calculations Circles and arcs are approximated by segments. More...
 
KICAD_T Type () const
 Function Type() More...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual const wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static bool IsLibNameValid (const wxString &aName)
 static function IsLibNameValid Test for validity of a name of a footprint to be used in a footprint library ( no spaces, dir separators ... More...
 
static const wxChar * StringLibNameInvalidChars (bool aUserReadable)
 static function StringLibNameInvalidChars Test for validity of the name in a library of the footprint ( no spaces, dir separators ... More...
 
static wxString ShowShape (STROKE_T aShape)
 Function ShowShape converts the enum STROKE_T integer value to a wxString. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Static Public Attributes

static wxPoint ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

virtual wxString LayerMaskDescribe () const
 Helper function Return a string (to be shown to the user) describing a layer mask. More...
 
bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Protected Attributes

PCB_LAYER_ID m_Layer
 
KIID m_groupUuid
 
STATUS_FLAGS m_Status
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_Flags
 

Private Attributes

DRAWINGS m_drawings
 
PADS m_pads
 
MODULE_ZONE_CONTAINERS m_fp_zones
 
double m_Orient
 
wxPoint m_Pos
 
TEXTE_MODULEm_Reference
 
TEXTE_MODULEm_Value
 
LIB_ID m_fpid
 
int m_Attributs
 
int m_ModuleStatus
 
EDA_RECT m_BoundaryBox
 
ZONE_CONNECTION m_ZoneConnection
 
int m_ThermalWidth
 
int m_ThermalGap
 
int m_LocalClearance
 
int m_LocalSolderMaskMargin
 
int m_LocalSolderPasteMargin
 
double m_LocalSolderPasteMarginRatio
 
wxString m_Doc
 
wxString m_KeyWord
 
KIID_PATH m_Path
 
timestamp_t m_LastEditTime
 
int m_arflag
 
KIID m_Link
 
int m_CntRot90
 
int m_CntRot180
 
std::list< MODULE_3D_SETTINGSm_3D_Drawings
 
std::map< wxString, wxString > m_properties
 
wxArrayString * m_initial_comments
 
SHAPE_POLY_SET m_poly_courtyard_front
 
SHAPE_POLY_SET m_poly_courtyard_back
 

Detailed Description

Definition at line 106 of file class_module.h.

Constructor & Destructor Documentation

◆ MODULE() [1/3]

MODULE::MODULE ( BOARD parent)

Definition at line 40 of file class_module.cpp.

40  :
43 {
44  m_Attributs = 0;
45  m_Layer = F_Cu;
46  m_Orient = 0;
48  m_arflag = 0;
49  m_CntRot90 = m_CntRot180 = 0;
50  m_Link = 0;
51  m_LastEditTime = 0;
52  m_LocalClearance = 0;
56  m_ZoneConnection = ZONE_CONNECTION::INHERITED; // Use zone setting by default
57  m_ThermalWidth = 0; // Use zone setting by default
58  m_ThermalGap = 0; // Use zone setting by default
59 
60  // These are special and mandatory text fields
63 
64  m_3D_Drawings.clear();
65 }
int m_CntRot90
Definition: class_module.h:740
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:727
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:732
int m_LocalSolderPasteMargin
Definition: class_module.h:731
int m_ThermalGap
Definition: class_module.h:728
wxArrayString * m_initial_comments
Definition: class_module.h:745
#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:308
timestamp_t m_LastEditTime
Definition: class_module.h:737
int m_LocalClearance
Definition: class_module.h:729
PCB_LAYER_ID m_Layer
double m_Orient
Definition: class_module.h:717
class MODULE, a footprint
Definition: typeinfo.h:89
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:726
int m_LocalSolderMaskMargin
Definition: class_module.h:730
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
int m_arflag
Definition: class_module.h:738
int m_CntRot180
Definition: class_module.h:741
int m_ModuleStatus
Definition: class_module.h:723
TEXTE_MODULE * m_Value
Definition: class_module.h:720
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
KIID m_Link
Definition: class_module.h:739
int m_Attributs
Definition: class_module.h:722

References F_Cu, INHERITED, m_3D_Drawings, m_arflag, m_Attributs, m_CntRot180, m_CntRot90, m_LastEditTime, BOARD_ITEM::m_Layer, m_Link, m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_ModuleStatus, m_Orient, m_Reference, m_ThermalGap, m_ThermalWidth, m_Value, m_ZoneConnection, MODULE_PADS_LOCKED, TEXTE_MODULE::TEXT_is_REFERENCE, and TEXTE_MODULE::TEXT_is_VALUE.

Referenced by Clone().

◆ MODULE() [2/3]

MODULE::MODULE ( const MODULE aModule)

Definition at line 68 of file class_module.cpp.

68  :
69  BOARD_ITEM_CONTAINER( aModule )
70 {
71  m_Pos = aModule.m_Pos;
72  m_fpid = aModule.m_fpid;
73  m_Attributs = aModule.m_Attributs;
75  m_Orient = aModule.m_Orient;
76  m_BoundaryBox = aModule.m_BoundaryBox;
77  m_CntRot90 = aModule.m_CntRot90;
78  m_CntRot180 = aModule.m_CntRot180;
80  m_Link = aModule.m_Link;
81  m_Path = aModule.m_Path;
82 
89  m_ThermalGap = aModule.m_ThermalGap;
90 
91  // Copy reference and value.
92  m_Reference = new TEXTE_MODULE( *aModule.m_Reference );
93  m_Reference->SetParent( this );
94  m_Value = new TEXTE_MODULE( *aModule.m_Value );
95  m_Value->SetParent( this );
96 
97  // Copy auxiliary data: Pads
98  for( D_PAD* pad : aModule.Pads() )
99  Add( static_cast<D_PAD*>( pad->Clone() ) );
100 
101  // Copy auxiliary data: Zones
102  for( MODULE_ZONE_CONTAINER* item : aModule.Zones() )
103  {
104  Add( static_cast<MODULE_ZONE_CONTAINER*>( item->Clone() ) );
105 
106  // Ensure the net info is OK and especially uses the net info list
107  // living in the current board
108  // Needed when copying a fp from fp editor that has its own board
109  // Must be NETINFO_LIST::ORPHANED_ITEM for a keepout that has no net.
110  item->SetNetCode( -1 );
111  }
112 
113  // Copy auxiliary data: Drawings
114  for( BOARD_ITEM* item : aModule.GraphicalItems() )
115  {
116  switch( item->Type() )
117  {
118  case PCB_MODULE_TEXT_T:
119  case PCB_MODULE_EDGE_T:
120  Add( static_cast<BOARD_ITEM*>( item->Clone() ) );
121  break;
122 
123  default:
124  wxLogMessage( wxT( "Class MODULE copy constructor internal error: unknown type" ) );
125  break;
126  }
127  }
128 
129  // Copy auxiliary data: 3D_Drawings info
130  m_3D_Drawings = aModule.m_3D_Drawings;
131 
132  m_Doc = aModule.m_Doc;
133  m_KeyWord = aModule.m_KeyWord;
134  m_properties = aModule.m_properties;
135 
136  m_arflag = 0;
137 
138  // Ensure auxiliary data is up to date
140 
142  new wxArrayString( *aModule.m_initial_comments ) : nullptr;
143 }
LIB_ID m_fpid
Definition: class_module.h:721
int m_CntRot90
Definition: class_module.h:740
wxString m_KeyWord
Definition: class_module.h:735
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:727
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:732
int m_LocalSolderPasteMargin
Definition: class_module.h:731
int m_ThermalGap
Definition: class_module.h:728
PADS & Pads()
Definition: class_module.h:181
KIID_PATH m_Path
Definition: class_module.h:736
DRAWINGS & GraphicalItems()
Definition: class_module.h:191
wxArrayString * m_initial_comments
Definition: class_module.h:745
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
wxString m_Doc
Definition: class_module.h:734
timestamp_t m_LastEditTime
Definition: class_module.h:737
int m_LocalClearance
Definition: class_module.h:729
double m_Orient
Definition: class_module.h:717
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:726
int m_LocalSolderMaskMargin
Definition: class_module.h:730
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
int m_arflag
Definition: class_module.h:738
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
int m_CntRot180
Definition: class_module.h:741
int m_ModuleStatus
Definition: class_module.h:723
std::map< wxString, wxString > m_properties
Definition: class_module.h:744
TEXTE_MODULE * m_Value
Definition: class_module.h:720
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
wxPoint m_Pos
Definition: class_module.h:718
MODULE_ZONE_CONTAINERS & Zones()
Definition: class_module.h:201
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
KIID m_Link
Definition: class_module.h:739
int m_Attributs
Definition: class_module.h:722

References Add(), CalculateBoundingBox(), GraphicalItems(), m_3D_Drawings, m_arflag, m_Attributs, m_BoundaryBox, m_CntRot180, m_CntRot90, m_Doc, m_fpid, m_initial_comments, m_KeyWord, m_LastEditTime, m_Link, m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_ModuleStatus, m_Orient, m_Path, m_Pos, m_properties, m_Reference, m_ThermalGap, m_ThermalWidth, m_Value, m_ZoneConnection, Pads(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, EDA_ITEM::SetParent(), and Zones().

◆ MODULE() [3/3]

MODULE::MODULE ( MODULE &&  aModule)

Definition at line 146 of file class_module.cpp.

146  :
147  BOARD_ITEM_CONTAINER( aModule )
148 {
149  *this = std::move( aModule );
150 }
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)

◆ ~MODULE()

MODULE::~MODULE ( )

Definition at line 153 of file class_module.cpp.

154 {
155  // Clean up the owned elements
156  delete m_Reference;
157  delete m_Value;
158  delete m_initial_comments;
159 
160  for( D_PAD* p : m_pads )
161  delete p;
162 
163  m_pads.clear();
164 
166  delete p;
167 
168  m_fp_zones.clear();
169 
170  for( BOARD_ITEM* d : m_drawings )
171  delete d;
172 
173  m_drawings.clear();
174 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PADS m_pads
Definition: class_module.h:714
wxArrayString * m_initial_comments
Definition: class_module.h:745
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
TEXTE_MODULE * m_Value
Definition: class_module.h:720
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
TEXTE_MODULE * m_Reference
Definition: class_module.h:719

References m_drawings, m_fp_zones, m_initial_comments, m_pads, m_Reference, and m_Value.

Member Function Documentation

◆ Add()

void MODULE::Add ( BOARD_ITEM aItem,
ADD_MODE  aMode = ADD_MODE::INSERT 
)
overridevirtual

Implements BOARD_ITEM_CONTAINER.

Definition at line 399 of file class_module.cpp.

400 {
401  switch( aBoardItem->Type() )
402  {
403  case PCB_MODULE_TEXT_T:
404  // Only user text can be added this way.
405  assert( static_cast<TEXTE_MODULE*>( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS );
407 
408  case PCB_MODULE_EDGE_T:
409  if( aMode == ADD_MODE::APPEND )
410  m_drawings.push_back( aBoardItem );
411  else
412  m_drawings.push_front( aBoardItem );
413  break;
414 
415  case PCB_PAD_T:
416  if( aMode == ADD_MODE::APPEND )
417  m_pads.push_back( static_cast<D_PAD*>( aBoardItem ) );
418  else
419  m_pads.push_front( static_cast<D_PAD*>( aBoardItem ) );
420  break;
421 
423  if( aMode == ADD_MODE::APPEND )
424  m_fp_zones.push_back( static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) );
425  else
426  m_fp_zones.insert( m_fp_zones.begin(), static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) );
427  break;
428 
429  default:
430  {
431  wxString msg;
432  msg.Printf( wxT( "MODULE::Add() needs work: BOARD_ITEM type (%d) not handled" ),
433  aBoardItem->Type() );
434  wxFAIL_MSG( msg );
435 
436  return;
437  }
438  }
439 
440  aBoardItem->ClearEditFlags();
441  aBoardItem->SetParent( this );
442 }
PADS m_pads
Definition: class_module.h:714
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:88
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
class ZONE_CONTAINER, managed by a footprint
Definition: typeinfo.h:95

References APPEND, EDA_ITEM::ClearEditFlags(), KI_FALLTHROUGH, m_drawings, m_fp_zones, m_pads, PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, PCB_MODULE_ZONE_AREA_T, PCB_PAD_T, EDA_ITEM::SetParent(), TEXTE_MODULE::TEXT_is_DIVERS, and EDA_ITEM::Type().

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), PCAD2KICAD::PCB_LINE::AddToModule(), PCAD2KICAD::PCB_ARC::AddToModule(), PCAD2KICAD::PCB_PAD::AddToModule(), PCAD2KICAD::PCB_POLYGON::AddToModule(), MICROWAVE_TOOL::createBaseFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), MICROWAVE_TOOL::createPolygonShape(), KI_TEST::DrawArc(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape(), KI_TEST::DrawSegment(), DuplicateItem(), PCB_EDIT_FRAME::Exchange_Module(), PCB_BASE_FRAME::GetFootprintFromBoardByReference(), ALTIUM_PCB::HelperCreateAndAddDrawsegment(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryPads(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadMODULE_EDGE(), LEGACY_PLUGIN::loadPAD(), MODULE(), operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packagePad(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageSMD(), EAGLE_PLUGIN::packageText(), EAGLE_PLUGIN::packageWire(), ALTIUM_PCB::ParsePads6Data(), ALTIUM_PCB::ParseTexts6Data(), CLIPBOARD_IO::SaveSelection(), FOOTPRINT_EDIT_FRAME::SelectFootprintFromBoard(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ Add3DModel()

void MODULE::Add3DModel ( MODULE_3D_SETTINGS a3DModel)

Function Add3DModel adds a3DModel definition to the end of the 3D model list.

Parameters
a3DModelA pointer to a MODULE_3D_SETTINGS to add to the list.

Definition at line 880 of file class_module.cpp.

881 {
882  if( NULL == a3DModel )
883  return;
884 
885  if( !a3DModel->m_Filename.empty() )
886  m_3D_Drawings.push_back( *a3DModel );
887 
888  delete a3DModel;
889 }
#define NULL
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:97

References m_3D_Drawings, MODULE_3D_SETTINGS::m_Filename, and NULL.

◆ BuildPolyCourtyard()

bool MODULE::BuildPolyCourtyard ( )

Builds a complex polygon of the courtyard area from graphic items on the courtyard layer.

Returns
true if OK, or no courtyard defined, false only if the polygon cannot be built due to a malformed courtyard shape

Definition at line 1605 of file class_module.cpp.

1606 {
1609  // Build the courtyard area from graphic items on the courtyard.
1610  // Only PCB_MODULE_EDGE_T have meaning, graphic texts are ignored.
1611  // Collect items:
1612  std::vector< DRAWSEGMENT* > list_front;
1613  std::vector< DRAWSEGMENT* > list_back;
1614 
1615  for( BOARD_ITEM* item : GraphicalItems() )
1616  {
1617  if( item->GetLayer() == B_CrtYd && item->Type() == PCB_MODULE_EDGE_T )
1618  list_back.push_back( static_cast< DRAWSEGMENT* > ( item ) );
1619 
1620  if( item->GetLayer() == F_CrtYd && item->Type() == PCB_MODULE_EDGE_T )
1621  list_front.push_back( static_cast< DRAWSEGMENT* > ( item ) );
1622  }
1623 
1624  // Note: if no item found on courtyard layers, return true.
1625  // false is returned only when the shape defined on courtyard layers
1626  // is not convertible to a polygon
1627  if( !list_front.size() && !list_back.size() )
1628  return true;
1629 
1630  wxString error_msg;
1631 
1632  #define ARC_ERROR_MAX 0.02 /* error max in mm to approximate a arc by segments */
1633  bool success = ConvertOutlineToPolygon( list_front, m_poly_courtyard_front,
1634  &error_msg,
1635  (unsigned) Millimeter2iu( ARC_ERROR_MAX ) );
1636 
1637  if( success )
1638  {
1639  success = ConvertOutlineToPolygon( list_back, m_poly_courtyard_back,
1640  &error_msg,
1641  (unsigned) Millimeter2iu( ARC_ERROR_MAX ) );
1642  }
1643 
1644  if( !error_msg.IsEmpty() )
1645  {
1646  wxLogMessage( wxString::Format( _( "Processing courtyard of \"%s\": %s" ),
1647  GetChars( GetFPID().Format() ),
1648  error_msg) );
1649  }
1650 
1651  return success;
1652 }
SHAPE_POLY_SET m_poly_courtyard_back
Definition: class_module.h:749
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
bool ConvertOutlineToPolygon(std::vector< DRAWSEGMENT * > &aSegList, SHAPE_POLY_SET &aPolygons, wxString *aErrorText, unsigned int aTolerance, wxPoint *aErrorLocation=nullptr)
Function ConvertOutlineToPolygon build a polygon (with holes) from a DRAWSEGMENT list,...
const LIB_ID & GetFPID() const
Definition: class_module.h:228
#define ARC_ERROR_MAX
DRAWINGS & GraphicalItems()
Definition: class_module.h:191
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
SHAPE_POLY_SET m_poly_courtyard_front
Definition: class_module.h:748
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
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
#define _(s)
Definition: 3d_actions.cpp:33
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
static constexpr int Millimeter2iu(double mm)

References _, ARC_ERROR_MAX, B_CrtYd, ConvertOutlineToPolygon(), F_CrtYd, Format(), GetChars(), GetFPID(), GraphicalItems(), m_poly_courtyard_back, m_poly_courtyard_front, Millimeter2iu(), PCB_MODULE_EDGE_T, and SHAPE_POLY_SET::RemoveAllContours().

Referenced by AR_AUTOPLACER::buildFpAreas().

◆ CalculateBoundingBox()

◆ ClassOf()

static bool MODULE::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 121 of file class_module.h.

122  {
123  return aItem && PCB_MODULE_T == aItem->Type();
124  }
class MODULE, a footprint
Definition: typeinfo.h:89
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References PCB_MODULE_T, and EDA_ITEM::Type().

◆ ClearAllNets()

void MODULE::ClearAllNets ( )

Function ClearAllNets Clear (i.e.

force the ORPHANED dummy net info) the net info which depends on a given board for all pads of the footprint. This is needed when a footprint is copied between the fp editor and the board editor for instance, because net info become fully broken

Definition at line 390 of file class_module.cpp.

391 {
392  // Force the ORPHANED dummy net info for all pads.
393  // ORPHANED dummy net does not depend on a board
394  for( auto pad : m_pads )
395  pad->SetNetCode( NETINFO_LIST::ORPHANED );
396 }
PADS m_pads
Definition: class_module.h:714
static const int ORPHANED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:482

References m_pads, and NETINFO_LIST::ORPHANED.

Referenced by FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), and PCB_BASE_FRAME::loadFootprint().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 233 of file base_struct.h.

233 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), LIB_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 245 of file base_struct.h.

246  {
248  DO_NOT_DRAW );
249  }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:125
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
#define CANDIDATE
flag indicating that the structure is connected
Definition: base_struct.h:127
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:123
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:233
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:129
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:122

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, ENDPOINT, IS_LINKED, SKIP_STRUCT, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 154 of file view_item.h.

155  {
157  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:162
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * MODULE::Clone ( ) const
overridevirtual

Function Clone creates a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented from EDA_ITEM.

Definition at line 990 of file class_module.cpp.

991 {
992  return new MODULE( *this );
993 }
MODULE(BOARD *parent)

References MODULE().

Referenced by FOOTPRINT_EDIT_FRAME::AddModuleToBoard(), Duplicate(), BOARD_NETLIST_UPDATER::updateComponentPadConnections(), and BOARD_NETLIST_UPDATER::updateComponentParameters().

◆ CoverageRatio()

double MODULE::CoverageRatio ( const GENERAL_COLLECTOR aCollector) const

Function CoverageRatio Calculates the ratio of total area of the footprint pads and graphical items to the area of the footprint.

Used by selection tool heuristics.

Returns
the ratio

Definition at line 1537 of file class_module.cpp.

1538 {
1539  double moduleArea = GetFootprintRect().GetArea();
1540  SHAPE_POLY_SET coveredRegion;
1541  addRect( coveredRegion, GetFootprintRect() );
1542 
1543  // build list of holes (covered areas not available for selection)
1544  SHAPE_POLY_SET holes;
1545 
1546  for( auto pad : m_pads )
1547  addRect( holes, pad->GetBoundingBox() );
1548 
1549  addRect( holes, m_Reference->GetBoundingBox() );
1550  addRect( holes, m_Value->GetBoundingBox() );
1551 
1552  for( int i = 0; i < aCollector.GetCount(); ++i )
1553  {
1554  BOARD_ITEM* item = aCollector[i];
1555 
1556  switch( item->Type() )
1557  {
1558  case PCB_TEXT_T:
1559  case PCB_MODULE_TEXT_T:
1560  case PCB_TRACE_T:
1561  case PCB_ARC_T:
1562  case PCB_VIA_T:
1563  addRect( holes, item->GetBoundingBox() );
1564  break;
1565  default:
1566  break;
1567  }
1568  }
1569 
1570  SHAPE_POLY_SET uncoveredRegion;
1571 
1572  try
1573  {
1574  uncoveredRegion.BooleanSubtract( coveredRegion, holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
1575  uncoveredRegion.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
1576  uncoveredRegion.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
1577  }
1578  catch( ClipperLib::clipperException& )
1579  {
1580  // better to be conservative (this will result in the disambiguate dialog)
1581  return 1.0;
1582  }
1583 
1584  double uncoveredRegionArea = polygonArea( uncoveredRegion );
1585  double coveredArea = moduleArea - uncoveredRegionArea;
1586  double ratio = ( coveredArea / moduleArea );
1587 
1588  return std::min( ratio, 1.0 );
1589 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
static double polygonArea(SHAPE_POLY_SET &aPolySet)
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
PADS m_pads
Definition: class_module.h:714
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Build and returns the boundary box of the module footprint excluding any ...
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:101
static void addRect(SHAPE_POLY_SET &aPolySet, wxRect aRect)
SHAPE_POLY_SET.
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
double GetArea() const
Function GetArea returns the area of the rectangle.
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
TEXTE_MODULE * m_Value
Definition: class_module.h:720
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset difference For aFastMode meaning, see function booleanOp
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: base_struct.cpp:97
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References addRect(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::Fracture(), EDA_RECT::GetArea(), TEXTE_MODULE::GetBoundingBox(), EDA_ITEM::GetBoundingBox(), COLLECTOR::GetCount(), GetFootprintRect(), m_pads, m_Reference, m_Value, PCB_ARC_T, PCB_MODULE_TEXT_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, polygonArea(), SHAPE_POLY_SET::Simplify(), and EDA_ITEM::Type().

◆ Delete()

virtual void BOARD_ITEM_CONTAINER::Delete ( BOARD_ITEM aItem)
inlinevirtualinherited

Removes an item from the container and deletes it.

Definition at line 66 of file board_item_container.h.

67  {
68  Remove( aItem );
69  delete aItem;
70  }
virtual void Remove(BOARD_ITEM *aItem)=0
Removes an item from the container.

References BOARD_ITEM_CONTAINER::Remove().

Referenced by BOARD_DRC_ITEMS_PROVIDER::DeleteItem(), BOARD_COMMIT::Push(), and BOARD::RemoveArea().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

Function DeleteStructure deletes this object after removing from its parent if it has one.

Definition at line 115 of file class_board_item.cpp.

116 {
117  auto parent = GetParent();
118 
119  if( parent )
120  parent->Remove( this );
121 
122  delete this;
123 }
BOARD_ITEM_CONTAINER * GetParent() const

References BOARD_ITEM::GetParent().

Referenced by BOARD::PadDelete(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ Duplicate()

BOARD_ITEM * MODULE::Duplicate ( ) const
overridevirtual

Function Duplicate creates a copy of a BOARD_ITEM.

Reimplemented from BOARD_ITEM.

Definition at line 1388 of file class_module.cpp.

1389 {
1390  MODULE* dupe = (MODULE*) Clone();
1391  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
1392 
1393  dupe->RunOnChildren( [&]( BOARD_ITEM* child )
1394  {
1395  const_cast<KIID&>( child->m_Uuid ) = KIID();
1396  });
1397 
1398  return static_cast<BOARD_ITEM*>( dupe );
1399 }
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction)
Function RunOnChildren.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: common.h:68
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
const KIID m_Uuid
Definition: base_struct.h:162

References Clone(), EDA_ITEM::m_Uuid, and RunOnChildren().

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), GPCB_PLUGIN::FootprintLoad(), PCB_IO::FootprintLoad(), PCB_IO::FootprintSave(), and FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD().

◆ DuplicateItem()

BOARD_ITEM * MODULE::DuplicateItem ( const BOARD_ITEM aItem,
bool  aAddToModule = false 
)

Function DuplicateItem Duplicate a given item within the module, optionally adding it to the board.

Returns
the new item, or NULL if the item could not be duplicated

Definition at line 1402 of file class_module.cpp.

1403 {
1404  BOARD_ITEM* new_item = NULL;
1405  MODULE_ZONE_CONTAINER* new_zone = NULL;
1406 
1407  switch( aItem->Type() )
1408  {
1409  case PCB_PAD_T:
1410  {
1411  D_PAD* new_pad = new D_PAD( *static_cast<const D_PAD*>( aItem ) );
1412  const_cast<KIID&>( new_pad->m_Uuid ) = KIID();
1413 
1414  if( aAddToModule )
1415  m_pads.push_back( new_pad );
1416 
1417  new_item = new_pad;
1418  break;
1419  }
1420 
1422  {
1423  new_zone = new MODULE_ZONE_CONTAINER( *static_cast<const MODULE_ZONE_CONTAINER*>( aItem ) );
1424  const_cast<KIID&>( new_zone->m_Uuid ) = KIID();
1425 
1426  if( aAddToModule )
1427  m_fp_zones.push_back( new_zone );
1428 
1429  new_item = new_zone;
1430  break;
1431  }
1432 
1433  case PCB_MODULE_TEXT_T:
1434  {
1435  TEXTE_MODULE* new_text = new TEXTE_MODULE( *static_cast<const TEXTE_MODULE*>( aItem ) );
1436  const_cast<KIID&>( new_text->m_Uuid ) = KIID();
1437 
1438  if( new_text->GetType() == TEXTE_MODULE::TEXT_is_REFERENCE )
1439  {
1440  new_text->SetText( wxT( "${REFERENCE}" ) );
1442  }
1443  else if( new_text->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
1444  {
1445  new_text->SetText( wxT( "${VALUE}" ) );
1447  }
1448 
1449  if( aAddToModule )
1450  Add( new_text );
1451 
1452  new_item = new_text;
1453 
1454  break;
1455  }
1456 
1457  case PCB_MODULE_EDGE_T:
1458  {
1459  EDGE_MODULE* new_edge = new EDGE_MODULE( *static_cast<const EDGE_MODULE*>(aItem) );
1460  const_cast<KIID&>( new_edge->m_Uuid ) = KIID();
1461 
1462  if( aAddToModule )
1463  Add( new_edge );
1464 
1465  new_item = new_edge;
1466  break;
1467  }
1468 
1469  case PCB_MODULE_T:
1470  // Ignore the module itself
1471  break;
1472 
1473  default:
1474  // Un-handled item for duplication
1475  wxFAIL_MSG( "Duplication not supported for items of class " + aItem->GetClass() );
1476  break;
1477  }
1478 
1479  return new_item;
1480 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PADS m_pads
Definition: class_module.h:714
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
Definition: common.h:68
class MODULE, a footprint
Definition: typeinfo.h:89
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
#define NULL
TEXT_TYPE GetType() const
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
void SetType(TEXT_TYPE aType)
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
const KIID m_Uuid
Definition: base_struct.h:162
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
virtual wxString GetClass() const =0
Function GetClass returns the class name.
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
class ZONE_CONTAINER, managed by a footprint
Definition: typeinfo.h:95
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References Add(), EDA_ITEM::GetClass(), TEXTE_MODULE::GetType(), m_fp_zones, m_pads, EDA_ITEM::m_Uuid, NULL, PCB_MODULE_EDGE_T, PCB_MODULE_T, PCB_MODULE_TEXT_T, PCB_MODULE_ZONE_AREA_T, PCB_PAD_T, EDA_TEXT::SetText(), TEXTE_MODULE::SetType(), TEXTE_MODULE::TEXT_is_DIVERS, TEXTE_MODULE::TEXT_is_REFERENCE, TEXTE_MODULE::TEXT_is_VALUE, and EDA_ITEM::Type().

Referenced by EDIT_TOOL::Duplicate(), and ARRAY_CREATOR::Invoke().

◆ FindPadByName()

D_PAD * MODULE::FindPadByName ( const wxString &  aPadName) const

Function FindPadByName returns a D_PAD* with a matching name.

Note that names may not be unique, depending on how the foot print was created.

Parameters
aPadNamethe pad name to find
Returns
D_PAD* - The first matching name is returned, or NULL if not found.

Definition at line 781 of file class_module.cpp.

782 {
783  for( D_PAD* pad : m_pads )
784  {
785  if( pad->GetName() == aPadName )
786  return pad;
787  }
788 
789  return NULL;
790 }
PADS m_pads
Definition: class_module.h:714
#define NULL

References m_pads, and NULL.

Referenced by PCB_EDIT_FRAME::Exchange_Module(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), BOARD_NETLIST_UPDATER::testConnectivity(), and DRC_TEST_PROVIDER_LVS::testFootprints().

◆ Flip() [1/2]

void MODULE::Flip ( const wxPoint aCentre,
bool  aFlipLeftRight 
)
overridevirtual

Function Flip Flip this object, i.e.

change the board side for this object

Parameters
aCentre- the rotation point.
aFlipLeftRight- mirror across Y axis instead of X (the default)

Mirror the Y position (around the X axis)

Reimplemented from BOARD_ITEM.

Definition at line 1182 of file class_module.cpp.

1183 {
1184  // Move module to its final position:
1185  wxPoint finalPos = m_Pos;
1186 
1187  // Now Flip the footprint.
1188  // Flipping a footprint is a specific transform:
1189  // it is not mirrored like a text.
1190  // We have to change the side, and ensure the footprint rotation is
1191  // modified accordint to the transform, because this parameter is used
1192  // in pick and place files, and when updating the footprint from library.
1193  // When flipped around the X axis (Y coordinates changed) orientation is negated
1194  // When flipped around the Y axis (X coordinates changed) orientation is 180 - old orient.
1195  // Because it is specfic to a footprint, we flip around the X axis, and after rotate 180 deg
1196 
1197  MIRROR( finalPos.y, aCentre.y );
1198 
1199  SetPosition( finalPos );
1200 
1201  // Flip layer
1202  SetLayer( FlipLayer( GetLayer() ) );
1203 
1204  // Reverse mirror orientation.
1205  m_Orient = -m_Orient;
1206 
1208 
1209  // Mirror pads to other side of board.
1210  for( auto pad : m_pads )
1211  pad->Flip( m_Pos, false );
1212 
1213  // Mirror zones to other side of board.
1214  for( auto zone : m_fp_zones )
1215  zone->Flip( m_Pos, aFlipLeftRight );
1216 
1217  // Mirror reference and value.
1218  m_Reference->Flip( m_Pos, false );
1219  m_Value->Flip( m_Pos, false );
1220 
1221  // Reverse mirror module graphics and texts.
1222  for( auto item : m_drawings )
1223  {
1224  switch( item->Type() )
1225  {
1226  case PCB_MODULE_EDGE_T:
1227  static_cast<EDGE_MODULE*>( item )->Flip( m_Pos, false );
1228  break;
1229 
1230  case PCB_MODULE_TEXT_T:
1231  static_cast<TEXTE_MODULE*>( item )->Flip( m_Pos, false );
1232  break;
1233 
1234  default:
1235  wxMessageBox( wxT( "MODULE::Flip() error: Unknown Draw Type" ) );
1236  break;
1237  }
1238  }
1239 
1240  // Now rotate 180 deg if required
1241  if( aFlipLeftRight )
1242  Rotate( aCentre, 1800.0 );
1243 
1245 }
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:490
PADS m_pads
Definition: class_module.h:714
void NORMALIZE_ANGLE_180(T &Angle)
Definition: trigo.h:373
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
double m_Orient
Definition: class_module.h:717
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:175
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
void SetPosition(const wxPoint &aPos) override
DRAWINGS m_drawings
Definition: class_module.h:713
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip entity during module flip.
TEXTE_MODULE * m_Value
Definition: class_module.h:720
wxPoint m_Pos
Definition: class_module.h:718
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.

References CalculateBoundingBox(), TEXTE_MODULE::Flip(), FlipLayer(), BOARD_ITEM::GetLayer(), m_drawings, m_fp_zones, m_Orient, m_pads, m_Pos, m_Reference, m_Value, MIRROR(), NORMALIZE_ANGLE_180(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, Rotate(), BOARD_ITEM::SetLayer(), SetPosition(), and wxPoint::y.

Referenced by PCB_BASE_FRAME::AddModuleToBoard(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), EAGLE_PLUGIN::orientModuleAndText(), PCB_EDITOR_CONTROL::PlaceModule(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ Flip() [2/2]

void BOARD_ITEM::Flip ( const VECTOR2I aCentre,
bool  aFlipLeftRight 
)
inlineinherited

Definition at line 349 of file class_board_item.h.

350  {
351  Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
352  }
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight)
Function Flip Flip this object, i.e.

References BOARD_ITEM::Flip(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual wxAny getter(void *aObject) const =0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/3]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetAllDrawingLayers()

void MODULE::GetAllDrawingLayers ( int  aLayers[],
int &  aCount,
bool  aIncludePads = true 
) const

Returns a set of all layers that this module has drawings on similar to ViewGetLayers()

Parameters
aLayersis an array to store layer ids
aCountis the number of layers stored in the array
aIncludePadscontrols whether to also include pad layers

Definition at line 1019 of file class_module.cpp.

1020 {
1021  std::unordered_set<int> layers;
1022 
1023  for( BOARD_ITEM* item : m_drawings )
1024  layers.insert( static_cast<int>( item->GetLayer() ) );
1025 
1026  if( aIncludePads )
1027  {
1028  for( D_PAD* pad : m_pads )
1029  {
1030  int pad_layers[KIGFX::VIEW::VIEW_MAX_LAYERS], pad_layers_count;
1031  pad->ViewGetLayers( pad_layers, pad_layers_count );
1032 
1033  for( int i = 0; i < pad_layers_count; i++ )
1034  layers.insert( pad_layers[i] );
1035  }
1036  }
1037 
1038  aCount = layers.size();
1039  int i = 0;
1040 
1041  for( int layer : layers )
1042  aLayers[i++] = layer;
1043 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PADS m_pads
Definition: class_module.h:714
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:697
DRAWINGS m_drawings
Definition: class_module.h:713

References m_drawings, m_pads, and KIGFX::VIEW::VIEW_MAX_LAYERS.

◆ GetArea()

double MODULE::GetArea ( int  aPadding = 0) const

Definition at line 509 of file class_module.cpp.

510 {
511  double w = std::abs( m_BoundaryBox.GetWidth() ) + aPadding;
512  double h = std::abs( m_BoundaryBox.GetHeight() ) + aPadding;
513  return w * h;
514 }
int GetWidth() const
Definition: eda_rect.h:119
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
int GetHeight() const
Definition: eda_rect.h:120

References EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), and m_BoundaryBox.

Referenced by sortFootprintsByComplexity(), sortFootprintsByRatsnestSize(), and SpreadFootprints().

◆ GetAttributes()

◆ GetBoard()

BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.

Definition at line 48 of file class_board_item.cpp.

49 {
50  if( Type() == PCB_T )
51  return (BOARD*) this;
52 
53  BOARD_ITEM* parent = GetParent();
54 
55  if( parent )
56  return parent->GetBoard();
57 
58  return NULL;
59 }
Definition: typeinfo.h:85
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
#define NULL
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
BOARD_ITEM_CONTAINER * GetParent() const
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), NULL, PCB_T, and EDA_ITEM::Type().

Referenced by D_PAD::BuildEffectiveShapes(), ZONE_CONTAINER::BuildSmoothedPoly(), TEXTE_PCB::Flip(), TRACK::Flip(), ARC::Flip(), VIA::Flip(), ZONE_CONTAINER::Flip(), BOARD_ITEM::GetBoard(), GetBoundingBox(), GetBoundingPoly(), BOARD_CONNECTED_ITEM::GetClearance(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), ZONE_CONTAINER::GetInteractingZones(), BOARD_ITEM::GetLayerName(), VIA::GetMinAnnulus(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), ZONE_CONTAINER::GetSelectMenuText(), TEXTE_MODULE::GetShownText(), D_PAD::GetSolderMaskMargin(), D_PAD::GetSolderPasteMargin(), BOARD::GetTrackLength(), TRACK::GetWidthConstraints(), insideArea(), insideCourtyard(), VIA::IsPadOnLayer(), D_PAD::IsPadOnLayer(), BOARD_ITEM::LayerMaskDescribe(), VIA::LayerMaskDescribe(), D_PAD::MergePrimitivesAsPolygon(), EAGLE_PLUGIN::packageWire(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), BOARD_CONNECTED_ITEM::SetNetCode(), setupDummyPadForHole(), ZONE_CONTAINER::TransformSmoothedOutlineWithClearanceToPolygon(), ZONE_CONTAINER::TransformSolidAreasShapesToPolygon(), ViewBBox(), and D_PAD::ViewGetLOD().

◆ GetBoundingBox() [1/2]

const EDA_RECT MODULE::GetBoundingBox ( ) const
overridevirtual

Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 563 of file class_module.cpp.

564 {
565  return GetBoundingBox( true );
566 }
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

Referenced by AR_AUTOPLACER::buildFpAreas(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), AR_AUTOPLACER::genModuleOnRoutingMatrix(), and HitTest().

◆ GetBoundingBox() [2/2]

const EDA_RECT MODULE::GetBoundingBox ( bool  aIncludeInvisibleText) const

Definition at line 569 of file class_module.cpp.

570 {
571  EDA_RECT area = GetFootprintRect();
572 
573  // Add in items not collected by GetFootprintRect():
574  for( BOARD_ITEM* item : m_drawings )
575  {
576  if( item->Type() != PCB_MODULE_EDGE_T )
577  area.Merge( item->GetBoundingBox() );
578  }
579 
580  // This can be further optimized when aIncludeInvisibleText is true, but currently
581  // leaving this as is until it's determined there is a noticeable speed hit.
582  bool valueLayerIsVisible = true;
583  bool refLayerIsVisible = true;
584  BOARD* board = GetBoard();
585 
586  if( board )
587  {
588  // The first "&&" conditional handles the user turning layers off as well as layers
589  // not being present in the current PCB stackup. Values, references, and all
590  // footprint text can also be turned off via the GAL meta-layers, so the 2nd and
591  // 3rd "&&" conditionals handle that.
592  valueLayerIsVisible = board->IsLayerVisible( m_Value->GetLayer() )
594  && board->IsElementVisible( LAYER_MOD_TEXT_FR );
595 
596  refLayerIsVisible = board->IsLayerVisible( m_Reference->GetLayer() )
598  && board->IsElementVisible( LAYER_MOD_TEXT_FR );
599  }
600 
601 
602  if( ( m_Value->IsVisible() && valueLayerIsVisible ) || aIncludeInvisibleText )
603  area.Merge( m_Value->GetBoundingBox() );
604 
605  if( ( m_Reference->IsVisible() && refLayerIsVisible ) || aIncludeInvisibleText )
606  area.Merge( m_Reference->GetBoundingBox() );
607 
608  return area;
609 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
bool IsVisible() const
Definition: eda_text.h:186
show modules values (when texts are visibles)
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Build and returns the boundary box of the module footprint excluding any ...
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
DRAWINGS m_drawings
Definition: class_module.h:713
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
TEXTE_MODULE * m_Value
Definition: class_module.h:720
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
show modules references (when texts are visibles)

References BOARD_ITEM::GetBoard(), TEXTE_MODULE::GetBoundingBox(), GetFootprintRect(), BOARD_ITEM::GetLayer(), BOARD::IsElementVisible(), BOARD::IsLayerVisible(), EDA_TEXT::IsVisible(), LAYER_MOD_REFERENCES, LAYER_MOD_TEXT_FR, LAYER_MOD_VALUES, m_drawings, m_Reference, m_Value, EDA_RECT::Merge(), and PCB_MODULE_EDGE_T.

◆ GetBoundingBoxBase()

EDA_RECT MODULE::GetBoundingBoxBase ( ) const
inline

Returns the last calculated bounding box of the footprint (does not recalculate it).

(call CalculateBoundingBox() to recalculate it)

Returns
EDA_RECT - The rectangle containing the footprint

Definition at line 159 of file class_module.h.

159 { return m_BoundaryBox; }
EDA_RECT m_BoundaryBox
Definition: class_module.h:724

Referenced by KIGFX::PCB_PAINTER::draw().

◆ GetBoundingPoly()

SHAPE_POLY_SET MODULE::GetBoundingPoly ( ) const

Returns a bounding polygon for the shapes and pads in the module This operation is slower but more accurate than calculating a bounding box.

This is a bit hacky right now for performance reasons.

We assume that most footprints will have features aligned to the axes in the zero-rotation state. Therefore, if the footprint is rotated, we temporarily rotate back to zero, get the bounding box (excluding reference and value text) and then rotate the resulting poly back to the correct orientation.

This is more accurate than using the AABB when most footprints are rotated off of the axes, but less accurate than computing some kind of bounding hull. We should consider doing that instead at some point in the future if we can use a performant algorithm and cache the result to avoid extra computing.

Definition at line 626 of file class_module.cpp.

627 {
628  SHAPE_POLY_SET poly;
629 
630  double orientation = GetOrientationRadians();
631 
632  MODULE temp = *this;
633  temp.SetOrientation( 0.0 );
634  BOX2I area = temp.GetFootprintRect();
635 
636  poly.NewOutline();
637 
638  VECTOR2I p = area.GetPosition();
639  poly.Append( p );
640  p.x = area.GetRight();
641  poly.Append( p );
642  p.y = area.GetBottom();
643  poly.Append( p );
644  p.x = area.GetX();
645  poly.Append( p );
646 
647  BOARD* board = GetBoard();
648  if( board )
649  {
650  int biggest_clearance = board->GetDesignSettings().GetBiggestClearanceValue();
651  poly.Inflate( biggest_clearance, 4 );
652  }
653 
654  poly.Inflate( Millimeter2iu( 0.01 ), 4 );
655  poly.Rotate( -orientation, m_Pos );
656 
657  return poly;
658 }
coord_type GetX() const
Definition: box2.h:190
int GetBiggestClearanceValue()
Function GetBiggestClearanceValue.
coord_type GetRight() const
Definition: box2.h:199
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:537
EDA_RECT GetFootprintRect() const
Function GetFootprintRect() Build and returns the boundary box of the module footprint excluding any ...
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Function Rotate rotates all vertices by a given angle.
coord_type GetBottom() const
Definition: box2.h:200
void Inflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Performs outline inflation/deflation.
BOX2 handles a 2-D bounding box, built on top of an origin point and size vector, both of templated c...
Definition: box2.h:43
SHAPE_POLY_SET.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
double GetOrientationRadians() const
Definition: class_module.h:226
int NewOutline()
Creates a new empty polygon in the set and returns its index
void SetOrientation(double aNewAngle)
const Vec & GetPosition() const
Definition: box2.h:194
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
wxPoint m_Pos
Definition: class_module.h:718
static constexpr int Millimeter2iu(double mm)
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)

References SHAPE_POLY_SET::Append(), BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue(), BOARD_ITEM::GetBoard(), BOX2< Vec >::GetBottom(), BOARD::GetDesignSettings(), GetFootprintRect(), GetOrientationRadians(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), SHAPE_POLY_SET::Inflate(), m_Pos, Millimeter2iu(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Rotate(), SetOrientation(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by HitTestAccurate().

◆ GetCenter()

virtual wxPoint BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

Function GetCenter()

This defaults to the same point as returned by GetPosition(), unless overridden

Returns
centre point of the item

Reimplemented in DRAWSEGMENT.

Definition at line 145 of file class_board_item.h.

145 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: base_struct.h:337

References EDA_ITEM::GetPosition().

Referenced by BOARD_ADAPTER::createNewTrack(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), KIGFX::PCB_PAINTER::draw(), export_vrml_tracks(), PlotStandardLayer(), and TRACK::TransformShapeWithClearanceToPolygon().

◆ GetClass()

wxString MODULE::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 595 of file class_module.h.

596  {
597  return wxT( "MODULE" );
598  }

Referenced by Visit().

◆ GetContextualTextVars()

void MODULE::GetContextualTextVars ( wxArrayString *  aVars) const

Return the list of system text vars for this footprint.

Definition at line 355 of file class_module.cpp.

356 {
357  aVars->push_back( wxT( "REFERENCE" ) );
358  aVars->push_back( wxT( "VALUE" ) );
359  aVars->push_back( wxT( "LAYER" ) );
360 }

◆ GetDescription()

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 237 of file base_struct.h.

238  {
239  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
241 
242  return m_Flags & mask;
243  }
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:130
#define IS_MOVED
Item being moved.
Definition: base_struct.h:116

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_Flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), LIB_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > MODULE::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER) const
overridevirtual

Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.

This routine returns a COMPOUND shape (set of simple shapes which make up the pad fod use with routing, collision determiniation, etc).

Note that this list can contain a SHAPE_SIMPLE (a simple single-outline non-intersecting polygon), but should never contain a SHAPE_POLY_SET (a complex polygon consisting of multiple outlines and/or holes).

Parameters
aLayerin case of items spanning multiple layers, only the shapes belonging to aLayer will be returned. Pass UNDEFINED_LAYER to return shapes for all layers.

Reimplemented from BOARD_ITEM.

Definition at line 1597 of file class_module.cpp.

1598 {
1599  std::shared_ptr<SHAPE> shape ( new SHAPE_NULL );
1600 
1601  return shape;
1602 }

◆ GetFirstPad()

D_PAD* MODULE::GetFirstPad ( ) const
inline

Gets the first pad in the list or NULL if none.

Returns
first pad or null pointer

Definition at line 526 of file class_module.h.

527  {
528  return m_pads.empty() ? nullptr : m_pads.front();
529  }
PADS m_pads
Definition: class_module.h:714

Referenced by GetTopLeftPad().

◆ GetFlag()

int MODULE::GetFlag ( ) const
inline

Definition at line 274 of file class_module.h.

274 { return m_arflag; }
int m_arflag
Definition: class_module.h:738

Referenced by DSN::SPECCTRA_DB::FromBOARD(), AR_AUTOPLACER::pickModule(), and sortFootprintsByRatsnestSize().

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in DRAWSEGMENT, and TRACK.

Definition at line 345 of file base_struct.h.

345 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: base_struct.h:337

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetFootprintRect()

EDA_RECT MODULE::GetFootprintRect ( ) const

Function GetFootprintRect() Build and returns the boundary box of the module footprint excluding any text.

Returns
EDA_RECT - The rectangle containing the footprint.

Definition at line 517 of file class_module.cpp.

518 {
519  EDA_RECT area;
520 
521  area.SetOrigin( m_Pos );
522  area.SetEnd( m_Pos );
523  area.Inflate( Millimeter2iu( 0.25 ) ); // Give a min size to the area
524 
525  for( BOARD_ITEM* item : m_drawings )
526  {
527  if( item->Type() == PCB_MODULE_EDGE_T )
528  area.Merge( item->GetBoundingBox() );
529  }
530 
531  for( D_PAD* pad : m_pads )
532  area.Merge( pad->GetBoundingBox() );
533 
534  for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
535  area.Merge( zone->GetBoundingBox() );
536 
537  return area;
538 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
PADS m_pads
Definition: class_module.h:714
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
void SetEnd(int x, int y)
Definition: eda_rect.h:192
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
wxPoint m_Pos
Definition: class_module.h:718
static constexpr int Millimeter2iu(double mm)
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Inflate(), m_drawings, m_fp_zones, m_pads, m_Pos, EDA_RECT::Merge(), Millimeter2iu(), PCB_MODULE_EDGE_T, EDA_RECT::SetEnd(), and EDA_RECT::SetOrigin().

Referenced by CalculateBoundingBox(), CoverageRatio(), GetBoundingBox(), GetBoundingPoly(), FOOTPRINT_EDIT_FRAME::GetDocumentExtents(), AR_AUTOPLACER::getOptimalModulePlacement(), moveFootprintsInArea(), SELECTION_TOOL::pickSmallestComponent(), SpreadFootprints(), AR_AUTOPLACER::testModuleOnBoard(), and ViewBBox().

◆ GetFPID()

const LIB_ID& MODULE::GetFPID ( ) const
inline

Definition at line 228 of file class_module.h.

228 { return m_fpid; }
LIB_ID m_fpid
Definition: class_module.h:721

Referenced by FOOTPRINT_EDIT_FRAME::AddModuleToBoard(), BASIC_FOOTPRINT_INFO::BASIC_FOOTPRINT_INFO(), BuildPolyCourtyard(), FOOTPRINT_EDIT_FRAME::canCloseWindow(), CreateDevicesSection(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), doPushPadProperties(), FOOTPRINT_EDIT_FRAME::editFootprintProperties(), PCB_EDIT_FRAME::Exchange_Module(), FOOTPRINT_EDIT_FRAME::Export_Module(), PCB_IO::FootprintSave(), FP_LIB_TABLE::FootprintSave(), PCB_IO::format(), PLACE_FILE_EXPORTER::GenPositionData(), FOOTPRINT_EDIT_FRAME::GetLoadedFPID(), PCB_EDIT_FRAME::InstallFootprintPropertiesDialog(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadMODULE_EDGE(), LEGACY_PLUGIN::loadPAD(), DSN::SPECCTRA_DB::makeIMAGE(), FOOTPRINT_EDITOR_TOOLS::PasteFootprint(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), DIALOG_EXCHANGE_FOOTPRINTS::processModule(), BOARD_NETLIST_UPDATER::replaceComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), setLibNickname(), BOARD_NETLIST_UPDATER::testConnectivity(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), PCBNEW_CONTROL::UpdateMessagePanel(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetFpPadsLocalBbox()

EDA_RECT MODULE::GetFpPadsLocalBbox ( ) const

Returns the bounding box containing pads when the footprint is on the front side, orientation 0, position 0,0.

mainly used in Gerber place file to draw a fp outline when the coutyard is missing or broken

Returns
EDA_RECT - The rectangle containing the pads for the normalized footprint.

Definition at line 541 of file class_module.cpp.

542 {
543  EDA_RECT area;
544 
545  // We want the bounding box of the footprint pads at rot 0, not flipped
546  // Create such a image:
547  MODULE dummy( *this );
548 
549  dummy.SetPosition( wxPoint( 0, 0 ) );
550  if( dummy.IsFlipped() )
551  dummy.Flip( wxPoint( 0, 0 ) , false );
552 
553  if( dummy.GetOrientation() )
554  dummy.SetOrientation( 0 );
555 
556  for( auto pad : dummy.Pads() )
557  area.Merge( pad->GetBoundingBox() );
558 
559  return area;
560 }
void Merge(const EDA_RECT &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
virtual void SetPosition(const wxPoint &aPos)
Definition: base_struct.h:338
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

References dummy(), EDA_RECT::Merge(), and EDA_ITEM::SetPosition().

◆ GetGroup()

const KIID& BOARD_ITEM::GetGroup ( ) const
inlineinherited

Get the group this item belongs to.

Returns
the group this item is in

Definition at line 114 of file class_board_item.h.

114 { return m_groupUuid; }

References BOARD_ITEM::m_groupUuid.

◆ GetInitialComments()

const wxArrayString* MODULE::GetInitialComments ( ) const
inline

Return the initial comments block or NULL if none, without transfer of ownership.

Definition at line 678 of file class_module.h.

678 { return m_initial_comments; }
wxArrayString * m_initial_comments
Definition: class_module.h:745

Referenced by PCB_IO::format().

◆ GetKeywords()

◆ GetLastEditTime()

timestamp_t MODULE::GetLastEditTime ( ) const
inline

Definition at line 359 of file class_module.h.

359 { return m_LastEditTime; }
timestamp_t m_LastEditTime
Definition: class_module.h:737

Referenced by PCB_IO::format(), and PCBNEW_CONTROL::UpdateMessagePanel().

◆ GetLayer()

virtual PCB_LAYER_ID BOARD_ITEM::GetLayer ( ) const
inlinevirtualinherited

Function GetLayer returns the primary layer this item is on.

Reimplemented in ZONE_CONTAINER.

Definition at line 203 of file class_board_item.h.

203 { return m_Layer; }
PCB_LAYER_ID m_Layer

References BOARD_ITEM::m_Layer.

Referenced by CN_LIST::Add(), BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer(), GRAPHICS_CLEANER::areEquivalent(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), AR_AUTOPLACER::buildFpAreas(), TRACKS_CLEANER::cleanupSegments(), CreateBoardSection(), MICROWAVE_TOOL::createMicrowaveInductor(), PCB_BASE_FRAME::CreateNewModule(), CreateRoutesSection(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), PCB_EDIT_FRAME::Exchange_Module(), export_vrml_drawsegment(), export_vrml_edge_module(), export_vrml_module(), export_vrml_pcbtext(), export_vrml_text_module(), export_vrml_tracks(), PCB_TARGET::Flip(), TEXTE_PCB::Flip(), TRACK::Flip(), EDGE_MODULE::Flip(), TEXTE_MODULE::Flip(), DIMENSION::Flip(), Flip(), ARC::Flip(), DRAWSEGMENT::Flip(), PCB_IO::FootprintSave(), FootprintWriteShape(), PCB_IO::formatLayer(), DSN::SPECCTRA_DB::FromBOARD(), AR_AUTOPLACER::genModuleOnRoutingMatrix(), GetBoundingBox(), ZONE_CONTAINER::GetLayer(), getMatchingTextItem(), TRACK::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), AR_AUTOPLACER::getOptimalModulePlacement(), BOARD::GetPad(), TEXT_MOD_GRID_TABLE::GetValueAsLong(), TRACK::GetWidthConstraints(), SELECTION_TOOL::GuessSelectionCandidates(), idf_export_module(), GENERAL_COLLECTOR::Inspect(), D_PAD::IsFlipped(), BOARD_ITEM::IsOnCopperLayer(), EDGE_MODULE::IsParentFlipped(), TEXTE_MODULE::IsParentFlipped(), itemIsIncludedByFilter(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MODULE_DESC::MODULE_DESC(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAddField(), DIALOG_DRC::OnDRCItemSelected(), TRACK::cmp_tracks::operator()(), DRAWSEGMENT::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), MODULE::cmp_drawings::operator()(), EAGLE_PLUGIN::packagePad(), BRDITEMS_PLOTTER::PlotDimension(), BRDITEMS_PLOTTER::PlotDrawSegment(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), BRDITEMS_PLOTTER::PlotPcbTarget(), BRDITEMS_PLOTTER::PlotTextePcb(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), processTextItem(), PAD_TOOL::recombinePad(), CLIPBOARD_IO::SaveSelection(), CONVERT_TOOL::SegmentToArc(), SELECTION_TOOL::Selectable(), TEXT_MOD_GRID_TABLE::SetValueAsLong(), GLOBAL_EDIT_TOOL::swapBoardItem(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTrack(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperTextAndGraphics(), AR_AUTOPLACER::testModuleOnBoard(), TEXTE_MODULE::TEXTE_MODULE(), TRACK_VIA_DESC::TRACK_VIA_DESC(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet(), TransformGraphicShapesWithClearanceToPolygonSet(), TRACK::ViewBBox(), TRACK::ViewGetLayers(), TEXTE_MODULE::ViewGetLayers(), TEXTE_MODULE::ViewGetLOD(), MODULE_ZONE_CONTAINER::ViewGetLOD(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetLayerName()

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

Function GetLayerName returns the name of the PCB layer on which the item resides.

Returns
wxString containing the layer name associated with this item.

Definition at line 62 of file class_board_item.cpp.

63 {
64  BOARD* board = GetBoard();
65 
66  if( board )
67  return board->GetLayerName( m_Layer );
68 
69  // If no parent, return standard name
71 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
PCB_LAYER_ID m_Layer
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Function GetStandardLayerName returns an "English Standard" name of a PCB layer when given aLayerNumb...
Definition: class_board.h:628

References BOARD_ITEM::GetBoard(), BOARD::GetLayerName(), BOARD::GetStandardLayerName(), and BOARD_ITEM::m_Layer.

Referenced by PCB_IO::format(), PCB_IO::formatLayer(), TEXTE_PCB::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), DRAWSEGMENT::GetMsgPanelInfo(), TEXTE_PCB::GetSelectMenuText(), EDGE_MODULE::GetSelectMenuText(), TRACK::GetSelectMenuText(), DIMENSION::GetSelectMenuText(), DRAWSEGMENT::GetSelectMenuText(), TEXTE_PCB::GetShownText(), TEXT_MOD_GRID_TABLE::GetValue(), and ResolveTextVar().

◆ GetLayerSet()

virtual LSET BOARD_ITEM::GetLayerSet ( ) const
inlinevirtualinherited

◆ GetLink()

◆ GetLocalClearance() [1/2]

◆ GetLocalClearance() [2/2]

int MODULE::GetLocalClearance ( wxString *  aSource) const
inline

Definition at line 246 of file class_module.h.

247  {
248  if( aSource )
249  *aSource = wxString::Format( _( "footprint %s" ), GetReference() );
250 
251  return m_LocalClearance;
252  }
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:451
int m_LocalClearance
Definition: class_module.h:729
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
#define _(s)
Definition: 3d_actions.cpp:33

References _, and Format().

◆ GetLocalSolderMaskMargin()

int MODULE::GetLocalSolderMaskMargin ( ) const
inline

◆ GetLocalSolderPasteMargin()

◆ GetLocalSolderPasteMarginRatio()

double MODULE::GetLocalSolderPasteMarginRatio ( ) const
inline

◆ GetMenuImage()

BITMAP_DEF MODULE::GetMenuImage ( ) const
overridevirtual

Function GetMenuImage returns a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 984 of file class_module.cpp.

985 {
986  return module_xpm;
987 }
const BITMAP_OPAQUE module_xpm[1]
Definition: module.cpp:29

References module_xpm.

◆ GetMsgPanelInfo()

void MODULE::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 661 of file class_module.cpp.

662 {
663  wxString msg, msg2;
664 
665  aList.emplace_back( m_Reference->GetShownText(), m_Value->GetShownText(), DARKCYAN );
666 
667  if( aFrame->IsType( FRAME_FOOTPRINT_VIEWER )
669  || aFrame->IsType( FRAME_FOOTPRINT_EDITOR ) )
670  {
671  wxDateTime date( static_cast<time_t>( m_LastEditTime ) );
672 
673  // Date format: see http://www.cplusplus.com/reference/ctime/strftime
674  if( m_LastEditTime && date.IsValid() )
675  msg = date.Format( wxT( "%b %d, %Y" ) ); // Abbreviated_month_name Day, Year
676  else
677  msg = _( "Unknown" );
678 
679  aList.emplace_back( _( "Last Change" ), msg, BROWN );
680  }
681  else if( aFrame->IsType( FRAME_PCB_EDITOR ) )
682  {
683  aList.emplace_back( _( "Board Side" ), IsFlipped() ? _( "Back (Flipped)" )
684  : _( "Front" ), RED );
685  }
686 
687  auto addToken = []( wxString* aStr, const wxString& aAttr )
688  {
689  if( !aStr->IsEmpty() )
690  *aStr += wxT( ", " );
691 
692  *aStr += aAttr;
693  };
694 
695  wxString status;
696  wxString attrs;
697 
698  if( IsLocked() )
699  addToken( &status, _( "locked" ) );
700 
702  addToken( &status, _( "autoplaced" ) );
703 
705  addToken( &attrs, _( "not in schematic" ) );
706 
708  addToken( &attrs, _( "exclude from pos files" ) );
709 
711  addToken( &attrs, _( "exclude from BOM" ) );
712 
713  aList.emplace_back( _( "Status: " ) + status, _( "Attributes: " ) + attrs, BROWN );
714 
715  msg.Printf( "%.2f", GetOrientationDegrees() );
716  aList.emplace_back( _( "Rotation" ), msg, BROWN );
717 
718  msg.Printf( _( "Footprint: %s" ),
719  GetChars( m_fpid.Format().c_str() ) );
720  msg2.Printf( _( "3D-Shape: %s" ),
721  m_3D_Drawings.empty() ? _( "none" ) : m_3D_Drawings.front().m_Filename );
722  aList.emplace_back( msg, msg2, BLUE );
723 
724  msg.Printf( _( "Doc: %s" ), m_Doc );
725  msg2.Printf( _( "Keywords: %s" ), m_KeyWord );
726  aList.emplace_back( msg, msg2, BLACK );
727 }
LIB_ID m_fpid
Definition: class_module.h:721
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:302
wxString m_KeyWord
Definition: class_module.h:735
Definition: color4d.h:61
Definition: color4d.h:44
wxString m_Doc
Definition: class_module.h:734
timestamp_t m_LastEditTime
Definition: class_module.h:737
const char * c_str() const
Definition: utf8.h:107
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:306
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
double GetOrientationDegrees() const
Definition: class_module.h:225
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:311
Definition: color4d.h:59
UTF8 Format() const
Definition: lib_id.cpp:237
Definition: color4d.h:56
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
bool IsType(FRAME_T aType) const
#define _(s)
Definition: 3d_actions.cpp:33
int m_ModuleStatus
Definition: class_module.h:723
TEXTE_MODULE * m_Value
Definition: class_module.h:720
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
int m_Attributs
Definition: class_module.h:722

References _, BLACK, BLUE, BROWN, UTF8::c_str(), DARKCYAN, LIB_ID::Format(), FRAME_FOOTPRINT_EDITOR, FRAME_FOOTPRINT_VIEWER, FRAME_FOOTPRINT_VIEWER_MODAL, FRAME_PCB_EDITOR, GetChars(), GetOrientationDegrees(), TEXTE_MODULE::GetShownText(), IsFlipped(), IsLocked(), EDA_BASE_FRAME::IsType(), m_3D_Drawings, m_Attributs, m_Doc, m_fpid, m_KeyWord, m_LastEditTime, m_ModuleStatus, m_Reference, m_Value, MOD_BOARD_ONLY, MOD_EXCLUDE_FROM_BOM, MOD_EXCLUDE_FROM_POS_FILES, MODULE_is_PLACED, and RED.

Referenced by DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel().

◆ GetNextPadName()

wxString MODULE::GetNextPadName ( const wxString &  aLastPadName) const

Function GetNextPadName returns the next available pad name in the module.

Parameters
aFillSequenceGapstrue if the numbering should "fill in" gaps in the sequence, else return the highest value + 1
Returns
the next available pad name

Definition at line 1483 of file class_module.cpp.

1484 {
1485  std::set<wxString> usedNames;
1486 
1487  // Create a set of used pad numbers
1488  for( D_PAD* pad : m_pads )
1489  usedNames.insert( pad->GetName() );
1490 
1491  wxString prefix = UTIL::GetReferencePrefix( aLastPadName );
1492  int num = GetTrailingInt( aLastPadName );
1493 
1494  while( usedNames.count( wxString::Format( "%s%d", prefix, num ) ) )
1495  num++;
1496 
1497  return wxString::Format( "%s%d", prefix, num );
1498 }
PADS m_pads
Definition: class_module.h:714
wxString GetReferencePrefix(const wxString &aRefDes)
Get the (non-numeric) prefix from a refdes - e.g.
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
int GetTrailingInt(const wxString &aStr)
Gets the trailing int, if any, from a string.
Definition: string.cpp:705

References Format(), UTIL::GetReferencePrefix(), GetTrailingInt(), and m_pads.

Referenced by EDIT_TOOL::Duplicate().

◆ GetOrientation()

◆ GetOrientationDegrees()

double MODULE::GetOrientationDegrees ( ) const
inline

◆ GetOrientationRadians()

double MODULE::GetOrientationRadians ( ) const
inline

Definition at line 226 of file class_module.h.

226 { return m_Orient * M_PI / 1800; }
double m_Orient
Definition: class_module.h:717

Referenced by export_vrml_edge_module(), and GetBoundingPoly().

◆ GetPad()

D_PAD * MODULE::GetPad ( const wxPoint aPosition,
LSET  aLayerMask = LSET::AllLayersMask() 
)

Function GetPad get a pad at aPosition on aLayerMask in the footprint.

Parameters
aPositionA wxPoint object containing the position to hit test.
aLayerMaskA layer or layers to mask the hit test.
Returns
A pointer to a D_PAD object if found otherwise NULL.

Definition at line 793 of file class_module.cpp.

794 {
795  for( D_PAD* pad : m_pads )
796  {
797  // ... and on the correct layer.
798  if( !( pad->GetLayerSet() & aLayerMask ).any() )
799  continue;
800 
801  if( pad->HitTest( aPosition ) )
802  return pad;
803  }
804 
805  return NULL;
806 }
PADS m_pads
Definition: class_module.h:714
#define NULL

References m_pads, and NULL.

◆ GetPadCount()

unsigned MODULE::GetPadCount ( INCLUDE_NPTH_T  aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH)) const

GetPadCount returns the number of pads.

Parameters
aIncludeNPTHincludes non-plated through holes when true. Does not include non-plated through holes when false.
Returns
the number of pads according to aIncludeNPTH.

Definition at line 828 of file class_module.cpp.

829 {
830  if( aIncludeNPTH )
831  return m_pads.size();
832 
833  unsigned cnt = 0;
834 
835  for( D_PAD* pad : m_pads )
836  {
837  if( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
838  continue;
839 
840  cnt++;
841  }
842 
843  return cnt;
844 }
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
PADS m_pads
Definition: class_module.h:714

References m_pads, and PAD_ATTRIB_HOLE_NOT_PLATED.

Referenced by BASIC_FOOTPRINT_INFO::BASIC_FOOTPRINT_INFO(), AR_AUTOPLACER::genModuleOnRoutingMatrix(), FOOTPRINT_INFO_IMPL::load(), sortFootprintsByComplexity(), AR_AUTOPLACER::testModuleOnBoard(), and PCBNEW_CONTROL::UpdateMessagePanel().

◆ GetParent()

BOARD_ITEM_CONTAINER* BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 197 of file class_board_item.h.

197 { return (BOARD_ITEM_CONTAINER*) m_Parent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174
Abstract interface for BOARD_ITEMs capable of storing other items inside.

References EDA_ITEM::m_Parent.

Referenced by POINT_EDITOR::addCorner(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), BOARD_ITEM::DeleteStructure(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), KIGFX::PCB_PAINTER::draw(), EDIT_TOOL::Duplicate(), EditToolSelectionFilter(), PCB_IO::format(), FormatProbeItem(), BOARD_ITEM::GetBoard(), MARKER_PCB::GetColorLayer(), EDGE_MODULE::GetMsgPanelInfo(), TEXTE_MODULE::GetSelectMenuText(), TEXTE_PCB::GetShownText(), TEXTE_MODULE::GetShownText(), SELECTION_TOOL::GuessSelectionCandidates(), GENERAL_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), EDGE_MODULE::IsParentFlipped(), TEXTE_MODULE::IsParentFlipped(), LEGACY_PLUGIN::loadMODULE_TEXT(), ALTIUM_PCB::ParseTexts6Data(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MARKER_PCB::ViewGetLayers(), MODULE_ZONE_CONTAINER::ViewGetLOD(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetPath()

◆ GetPlacementCost180()

int MODULE::GetPlacementCost180 ( ) const
inline

◆ GetPlacementCost90()

int MODULE::GetPlacementCost90 ( ) const
inline

◆ GetPolyCourtyardBack()

SHAPE_POLY_SET& MODULE::GetPolyCourtyardBack ( )
inline

◆ GetPolyCourtyardFront()

SHAPE_POLY_SET& MODULE::GetPolyCourtyardFront ( )
inline

Used in DRC to test the courtyard area (a complex polygon)

Returns
the courtyard polygon

Definition at line 683 of file class_module.h.

683 { return m_poly_courtyard_front; }
SHAPE_POLY_SET m_poly_courtyard_front
Definition: class_module.h:748

Referenced by AR_AUTOPLACER::buildFpAreas(), insideCourtyard(), and DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards().

◆ GetPosition()

wxPoint MODULE::GetPosition ( ) const
inlineoverridevirtual

Reimplemented from EDA_ITEM.

Definition at line 219 of file class_module.h.

219 { return m_Pos; }
wxPoint m_Pos
Definition: class_module.h:718

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), PCB_BASE_FRAME::AddModuleToBoard(), PCAD2KICAD::PCB_PAD::AddToModule(), GRID_HELPER::computeAnchors(), ConvertOutlineToPolygon(), MICROWAVE_TOOL::createBaseFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), D_PAD::D_PAD(), KIGFX::PCB_PAINTER::draw(), PCB_EDIT_FRAME::Exchange_Module(), export_vrml_edge_module(), export_vrml_module(), PCB_IO::FootprintSave(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), EDIT_TOOL::GetAndPlace(), DRAWSEGMENT::GetBoundingBox(), AR_AUTOPLACER::getOptimalModulePlacement(), DRAWSEGMENT::GetRectCorners(), hash_eda(), idf_export_module(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryPads(), LEGACY_PLUGIN::loadPAD(), moveFootprintsInArea(), EAGLE_PLUGIN::orientModuleAndText(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packageText(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_EDITOR_CONTROL::PlaceModule(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), C3D_RENDER_OGL_LEGACY::render_3D_module(), CLIPBOARD_IO::SaveSelection(), DRAWING_TOOL::SetAnchor(), EDGE_MODULE::SetDrawCoord(), TEXTE_MODULE::SetDrawCoord(), D_PAD::SetDrawCoord(), EDGE_MODULE::SetLocalCoord(), TEXTE_MODULE::SetLocalCoord(), D_PAD::SetLocalCoord(), SetOrientation(), DRC_TEST_PROVIDER_LVS::testFootprints(), TEXTE_MODULE::TEXTE_MODULE(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), EAGLE_PLUGIN::transferPad(), and DRAWSEGMENT::TransformShapeWithClearanceToPolygon().

◆ GetProperties()

const std::map<wxString, wxString>& MODULE::GetProperties ( ) const
inline

Definition at line 498 of file class_module.h.

498 { return m_properties; }
std::map< wxString, wxString > m_properties
Definition: class_module.h:744

Referenced by PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::format(), and BOARD_NETLIST_UPDATER::updateComponentParameters().

◆ GetReference()

const wxString MODULE::GetReference ( void  ) const
inline

Function GetReference.

Returns
const wxString& - the reference designator text.

Definition at line 451 of file class_module.h.

452  {
453  return m_Reference->GetText();
454  }
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127

Referenced by FOOTPRINT_EDIT_FRAME::AddModuleToBoard(), AR_AUTOPLACER::AutoplaceModules(), CollisionMatchesExpected(), DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange(), GERBER_WRITER::createDrillFile(), PCB_BASE_FRAME::CreateNewModule(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), FormatProbeItem(), DSN::SPECCTRA_DB::FromBOARD(), PLACE_FILE_EXPORTER::GenReportData(), EDGE_MODULE::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), GetSelectMenuText(), getShapeName(), IncrementReference(), GENERAL_COLLECTOR::Inspect(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), EAGLE_PLUGIN::loadElements(), CADSTAR_PCB_ARCHIVE_LOADER::loadNets(), MODULE_DESC::MODULE_DESC(), ALTIUM_PCB::ParsePads6Data(), pasteModuleItemsToModEdit(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BRDITEMS_PLOTTER::PlotPad(), DIALOG_EXCHANGE_FOOTPRINTS::processModule(), BOARD_NETLIST_UPDATER::replaceComponent(), CLIPBOARD_IO::SaveSelection(), DRC_TEST_PROVIDER_LVS::testFootprints(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), BOARD_NETLIST_UPDATER::updateComponentPadConnections(), BOARD_NETLIST_UPDATER::updateComponentParameters(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetSelectMenuText()

wxString MODULE::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtual

Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 973 of file class_module.cpp.

974 {
975  wxString reference = GetReference();
976 
977  if( reference.IsEmpty() )
978  reference = _( "<no reference designator>" );
979 
980  return wxString::Format( _( "Footprint %s" ), reference );
981 }
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:451
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
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), and GetReference().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 216 of file base_struct.h.

217  {
218  return m_Status & type;
219  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by TRACK::GetMsgPanelInfoBase_Common(), and TRACK::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 229 of file base_struct.h.

229 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

◆ GetThermalGap()

int MODULE::GetThermalGap ( ) const
inline

Definition at line 267 of file class_module.h.

267 { return m_ThermalGap; }
int m_ThermalGap
Definition: class_module.h:728

Referenced by PCB_IO::format(), D_PAD::GetEffectiveThermalGap(), and MODULE_DESC::MODULE_DESC().

◆ GetThermalWidth()

int MODULE::GetThermalWidth ( ) const
inline

Definition at line 264 of file class_module.h.

264 { return m_ThermalWidth; }
int m_ThermalWidth
Definition: class_module.h:727

Referenced by PCB_IO::format(), D_PAD::GetEffectiveThermalSpokeWidth(), and MODULE_DESC::MODULE_DESC().

◆ GetTopLeftPad()

D_PAD * MODULE::GetTopLeftPad ( )

Definition at line 809 of file class_module.cpp.

810 {
811  D_PAD* topLeftPad = GetFirstPad();
812 
813  for( D_PAD* p : m_pads )
814  {
815  wxPoint pnt = p->GetPosition(); // GetPosition() returns the center of the pad
816 
817  if( ( pnt.x < topLeftPad->GetPosition().x ) ||
818  ( topLeftPad->GetPosition().x == pnt.x && pnt.y < topLeftPad->GetPosition().y ) )
819  {
820  topLeftPad = p;
821  }
822  }
823 
824  return topLeftPad;
825 }
wxPoint GetPosition() const override
Definition: class_pad.h:165
PADS m_pads
Definition: class_module.h:714
D_PAD * GetFirstPad() const
Gets the first pad in the list or NULL if none.
Definition: class_module.h:526

References GetFirstPad(), D_PAD::GetPosition(), m_pads, wxPoint::x, and wxPoint::y.

◆ GetUniquePadCount()

unsigned MODULE::GetUniquePadCount ( INCLUDE_NPTH_T  aIncludeNPTH = INCLUDE_NPTH_T(INCLUDE_NPTH)) const

GetUniquePadCount returns the number of unique pads.

A complex pad can be built with many pads having the same pad name to create a complex shape or fragmented solder paste areas.

GetUniquePadCount calculate the count of not blank pad names

Parameters
aIncludeNPTHincludes non-plated through holes when true. Does not include non-plated through holes when false.
Returns
the number of unique pads according to aIncludeNPTH.

Definition at line 847 of file class_module.cpp.

848 {
849  std::set<wxString> usedNames;
850 
851  // Create a set of used pad numbers
852  for( D_PAD* pad : m_pads )
853  {
854  // Skip pads not on copper layers (used to build complex
855  // solder paste shapes for instance)
856  if( ( pad->GetLayerSet() & LSET::AllCuMask() ).none() )
857  continue;
858 
859  // Skip pads with no name, because they are usually "mechanical"
860  // pads, not "electrical" pads
861  if( pad->GetName().IsEmpty() )
862  continue;
863 
864  if( !aIncludeNPTH )
865  {
866  // skip NPTH
867  if( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
868  {
869  continue;
870  }
871  }
872 
873  usedNames.insert( pad->GetName() );
874  }
875 
876  return usedNames.size();
877 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:719
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
PADS m_pads
Definition: class_module.h:714

References LSET::AllCuMask(), m_pads, and PAD_ATTRIB_HOLE_NOT_PLATED.

Referenced by BASIC_FOOTPRINT_INFO::BASIC_FOOTPRINT_INFO(), and FOOTPRINT_INFO_IMPL::load().

◆ GetValue()

◆ GetX()

int BOARD_ITEM::GetX ( ) const
inlineinherited

◆ GetY()

int BOARD_ITEM::GetY ( ) const
inlineinherited

◆ GetZoneConnection()

ZONE_CONNECTION MODULE::GetZoneConnection ( ) const
inline

◆ GetZoneSettings()

virtual const ZONE_SETTINGS& BOARD_ITEM_CONTAINER::GetZoneSettings ( ) const
inlinevirtualinherited

Fetch the zone settings for this container.

Reimplemented in BOARD.

Definition at line 75 of file board_item_container.h.

76  {
77  return m_zoneSettings;
78  }

References BOARD_ITEM_CONTAINER::m_zoneSettings.

Referenced by ZONE_CONTAINER::ZONE_CONTAINER().

◆ GraphicalItems() [1/2]

◆ GraphicalItems() [2/2]

const DRAWINGS& MODULE::GraphicalItems ( ) const
inline

Definition at line 196 of file class_module.h.

197  {
198  return m_drawings;
199  }
DRAWINGS m_drawings
Definition: class_module.h:713

◆ HasFlag()

◆ HasThroughHolePads()

bool MODULE::HasThroughHolePads ( ) const

Definition at line 1663 of file class_module.cpp.

1664 {
1665  for( D_PAD* pad : Pads() )
1666  {
1667  if( pad->GetAttribute() != PAD_ATTRIB_SMD )
1668  return true;
1669  }
1670 
1671  return false;
1672 }
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
PADS & Pads()
Definition: class_module.h:181

References PAD_ATTRIB_SMD, and Pads().

◆ HitTest() [1/2]

bool MODULE::HitTest ( const wxPoint aPosition,
int  aAccuracy = 0 
) const
overridevirtual

Function HitTest tests if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 730 of file class_module.cpp.

731 {
732  EDA_RECT rect = m_BoundaryBox;//.GetBoundingBoxRotated( GetPosition(), m_Orient );
733  return rect.Inflate( aAccuracy ).Contains( aPosition );
734 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), EDA_RECT::Inflate(), and m_BoundaryBox.

Referenced by GENERAL_COLLECTOR::Inspect().

◆ HitTest() [2/2]

bool MODULE::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtual

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 743 of file class_module.cpp.

744 {
745  EDA_RECT arect = aRect;
746  arect.Inflate( aAccuracy );
747 
748  if( aContained )
749  return arect.Contains( m_BoundaryBox );
750  else
751  {
752  // If the rect does not intersect the bounding box, skip any tests
753  if( !aRect.Intersects( GetBoundingBox() ) )
754  return false;
755 
756  // Determine if any elements in the MODULE intersect the rect
757  for( D_PAD* pad : m_pads )
758  {
759  if( pad->HitTest( arect, false, 0 ) )
760  return true;
761  }
762 
763  for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
764  {
765  if( zone->HitTest( arect, false, 0 ) )
766  return true;
767  }
768 
769  for( BOARD_ITEM* item : m_drawings )
770  {
771  if( item->HitTest( arect, false, 0 ) )
772  return true;
773  }
774 
775  // No items were hit
776  return false;
777  }
778 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PADS m_pads
Definition: class_module.h:714
bool Contains(const wxPoint &aPoint) const
Function Contains.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), GetBoundingBox(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), m_BoundaryBox, m_drawings, m_fp_zones, and m_pads.

◆ HitTestAccurate()

bool MODULE::HitTestAccurate ( const wxPoint aPosition,
int  aAccuracy = 0 
) const

Tests if a point is inside the bounding polygon of the module.

The other hit test methods are just checking the bounding box, which can be quite inaccurate for rotated or oddly-shaped footprints.

Parameters
aPositionis the point to test
Returns
true if aPosition is inside the bounding polygon

Definition at line 737 of file class_module.cpp.

738 {
739  return GetBoundingPoly().Collide( aPosition, aAccuracy );
740 }
SHAPE_POLY_SET GetBoundingPoly() const
Returns a bounding polygon for the shapes and pads in the module This operation is slower but more ac...
bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr) const override
Function Collide Checks whether the point aP is either inside or on the edge of the polygon set.

References SHAPE_POLY_SET::Collide(), and GetBoundingPoly().

Referenced by GENERAL_COLLECTOR::Inspect().

◆ IncrementFlag()

void MODULE::IncrementFlag ( )
inline

Definition at line 273 of file class_module.h.

273 { m_arflag += 1; }
int m_arflag
Definition: class_module.h:738

◆ IncrementReference()

void MODULE::IncrementReference ( int  aDelta)

Function IncrementReference Bumps the current reference by aDelta.

Definition at line 1501 of file class_module.cpp.

1502 {
1503  const auto& refdes = GetReference();
1504  SetReference( wxString::Format( wxT( "%s%i" ), UTIL::GetReferencePrefix( refdes ),
1505  GetTrailingInt( refdes ) + aDelta ) );
1506 }
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:451
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:461
wxString GetReferencePrefix(const wxString &aRefDes)
Get the (non-numeric) prefix from a refdes - e.g.
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
int GetTrailingInt(const wxString &aStr)
Gets the trailing int, if any, from a string.
Definition: string.cpp:705

References Format(), GetReference(), UTIL::GetReferencePrefix(), GetTrailingInt(), and SetReference().

◆ IsBrightened()

◆ IsConnected()

virtual bool BOARD_ITEM::IsConnected ( ) const
inlinevirtualinherited

Function IsConnected() Returns information if the object is derived from BOARD_CONNECTED_ITEM.

Returns
True if the object is of BOARD_CONNECTED_ITEM type, false otherwise.

Reimplemented in BOARD_CONNECTED_ITEM.

Definition at line 164 of file class_board_item.h.

165  {
166  return false;
167  }

Referenced by PCB_INSPECTION_TOOL::InspectClearance(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), and CONNECTIVITY_DATA::MarkItemNetAsDirty().

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 201 of file base_struct.h.

201 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_DRAGGED, and EDA_ITEM::m_Flags.

Referenced by DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), and KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsFlipped()

bool MODULE::IsFlipped ( ) const
inline

function IsFlipped

Returns
true if the module is flipped, i.e. on the back side of the board

Definition at line 302 of file class_module.h.

302 { return GetLayer() == B_Cu; }
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.

References B_Cu, and GetLayer().

Referenced by PCB_BASE_FRAME::AddModuleToBoard(), GetMsgPanelInfo(), DIALOG_PAD_PROPERTIES::initValues(), insideCourtyard(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_EDITOR_CONTROL::PlaceModule(), C3D_RENDER_OGL_LEGACY::render_3D_module(), and DIALOG_TEXT_PROPERTIES::TransferDataToWindow().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 286 of file base_struct.h.

286 { return m_forceVisible; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsInGroup()

bool BOARD_ITEM::IsInGroup ( )
inlineinherited

Test if this item is inside a group.

Returns
true if inside a group

Definition at line 121 of file class_board_item.h.

121 { return m_groupUuid != niluuid; }
KIID niluuid(0)

References BOARD_ITEM::m_groupUuid, and niluuid.

Referenced by PCB_GROUP::AddItem(), and PCB_GROUP::RemoveItem().

◆ IsLibNameValid()

bool MODULE::IsLibNameValid ( const wxString &  aName)
static

static function IsLibNameValid Test for validity of a name of a footprint to be used in a footprint library ( no spaces, dir separators ...

)

Parameters
aName= the name in library to validate
Returns
true if the given name is valid

Definition at line 1129 of file class_module.cpp.

1130 {
1131  const wxChar * invalids = StringLibNameInvalidChars( false );
1132 
1133  if( aName.find_first_of( invalids ) != std::string::npos )
1134  return false;
1135 
1136  return true;
1137 }
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
static function StringLibNameInvalidChars Test for validity of the name in a library of the footprint...

References StringLibNameInvalidChars().

Referenced by DIALOG_FOOTPRINT_FP_EDITOR::checkFootprintName().

◆ IsLocked()

bool MODULE::IsLocked ( ) const
inlineoverridevirtual

Function IsLocked.

Returns
bool - true if the object is locked, else false

Reimplemented from BOARD_ITEM.

Definition at line 311 of file class_module.h.

312  {
313  return ( m_ModuleStatus & MODULE_is_LOCKED ) != 0;
314  }
#define MODULE_is_LOCKED
module LOCKED: no autoplace allowed
Definition: class_module.h:305
int m_ModuleStatus
Definition: class_module.h:723

References MODULE_is_LOCKED.

Referenced by EditToolSelectionFilter(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::format(), GetMsgPanelInfo(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 198 of file base_struct.h.

198 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNetTie()

bool MODULE::IsNetTie ( ) const
inline

Definition at line 277 of file class_module.h.

277 { return GetKeywords().StartsWith( wxT( "net tie" ) ); }
const wxString & GetKeywords() const
Definition: class_module.h:234

◆ IsNew()

◆ IsOnCopperLayer()

virtual bool BOARD_ITEM::IsOnCopperLayer ( ) const
inlinevirtualinherited
Returns
true if the object is on any copper layer, false otherwise.

Reimplemented in TRACK, D_PAD, and ZONE_CONTAINER.

Definition at line 172 of file class_board_item.h.

173  {
174  return IsCopperLayer( GetLayer() );
175  }
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.

References BOARD_ITEM::GetLayer(), and IsCopperLayer().

Referenced by CN_CONNECTIVITY_ALGO::Add(), and BOARD_CONNECTED_ITEM::SetNetCode().

◆ IsOnLayer()

virtual bool BOARD_ITEM::IsOnLayer ( PCB_LAYER_ID  aLayer) const
inlinevirtualinherited

Function IsOnLayer tests to see if this object is on the given layer.

Is virtual so objects like D_PAD, which reside on multiple layers can do their own form of testing.

Parameters
aLayerThe layer to test for.
Returns
bool - true if on given layer, else false.

Reimplemented in D_PAD, VIA, ZONE_CONTAINER, and PCB_GROUP.

Definition at line 258 of file class_board_item.h.

259  {
260  return m_Layer == aLayer;
261  }
PCB_LAYER_ID m_Layer

References BOARD_ITEM::m_Layer.

Referenced by BOARD_ADAPTER::createLayers(), GENERAL_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), and onLayer().

◆ IsPlaced()

bool MODULE::IsPlaced ( ) const
inline

Definition at line 329 of file class_module.h.

329 { return m_ModuleStatus & MODULE_is_PLACED; }
#define MODULE_is_PLACED
In autoplace: module automatically placed.
Definition: class_module.h:306
int m_ModuleStatus
Definition: class_module.h:723

References MODULE_is_PLACED.

Referenced by PCB_IO::format().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 502 of file base_struct.h.

502 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 204 of file base_struct.h.

204 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118

References IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsSelected()

◆ IsTrack()

bool BOARD_ITEM::IsTrack ( ) const
inlineinherited

Function IsTrack tests to see if this object is a track or via (or microvia).

form of testing.

Returns
bool - true if a track or via, else false.

Definition at line 269 of file class_board_item.h.

270  {
271  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
272  }
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References PCB_TRACE_T, PCB_VIA_T, and EDA_ITEM::Type().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[]) const
inlinevirtualinherited

Function IsType Checks whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in VIA, SCH_LABEL, DIMENSION, D_PAD, DRAWSEGMENT, TEXTE_MODULE, SCH_FIELD, SCH_LINE, EDGE_MODULE, and TEXTE_PCB.

Definition at line 262 of file base_struct.h.

263  {
264  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
265  return true;
266 
267  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
268  {
269  if( m_StructType == *p )
270  return true;
271  }
272 
273  return false;
274  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:170
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), TEXTE_PCB::IsType(), EDGE_MODULE::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), TEXTE_MODULE::IsType(), DRAWSEGMENT::IsType(), D_PAD::IsType(), DIMENSION::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 202 of file base_struct.h.

202 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward() [1/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use the main queue instead

Definition at line 384 of file base_struct.h.

388  {
389  for( auto it : aList )
390  {
391  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
393  return SEARCH_RESULT::QUIT;
394  }
395 
397  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 405 of file base_struct.h.

407  {
408  for( auto it : aList )
409  {
410  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
412  return SEARCH_RESULT::QUIT;
413  }
414 
416  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ LayerMaskDescribe()

wxString BOARD_ITEM::LayerMaskDescribe ( ) const
protectedvirtualinherited

Helper function Return a string (to be shown to the user) describing a layer mask.

The BOARD is needed because layer names are (somewhat) customizable

Reimplemented in VIA.

Definition at line 74 of file class_board_item.cpp.

75 {
76  BOARD* board = GetBoard();
77  LSET layers = GetLayerSet();
78 
79  // Try to be smart and useful. Check all copper first.
80  if( layers[F_Cu] && layers[B_Cu] )
81  return _( "all copper layers" );
82 
83  LSET copperLayers = layers & board->GetEnabledLayers().AllCuMask();
84  LSET techLayers = layers & board->GetEnabledLayers().AllTechMask();
85 
86  for( LSET testLayers : { copperLayers, techLayers, layers } )
87  {
88  for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
89  {
90  if( testLayers[ bit ] )
91  {
92  wxString layerInfo = board->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
93 
94  if( testLayers.count() > 1 )
95  layerInfo << _( " and others" );
96 
97  return layerInfo;
98  }
99  }
100  }
101 
102  // No copper, no technicals: no layer
103  return _( "no layers" );
104 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:719
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:789
LSET is a set of PCB_LAYER_IDs.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
#define _(s)
Definition: 3d_actions.cpp:33
virtual LSET GetLayerSet() const
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.

References _, LSET::AllCuMask(), LSET::AllTechMask(), B_Cu, F_Cu, BOARD_ITEM::GetBoard(), BOARD::GetEnabledLayers(), BOARD::GetLayerName(), BOARD_ITEM::GetLayerSet(), PCB_LAYER_ID_COUNT, and PCBNEW_LAYER_ID_START.

Referenced by TRACK::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), and D_PAD::GetSelectMenuText().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
inlinevirtualinherited

Function Matches compares the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, SCH_PIN, TEXTE_MODULE, SCH_MARKER, MARKER_PCB, and TEXTE_PCB.

Definition at line 458 of file base_struct.h.

459  {
460  return false;
461  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), TEXTE_PCB::Matches(), MARKER_PCB::Matches(), SCH_MARKER::Matches(), TEXTE_MODULE::Matches(), SCH_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
wxFindReplaceData &  aSearchData 
)
protectedinherited

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 140 of file base_struct.cpp.

141 {
142  wxString text = aText;
143  wxString searchText = aSearchData.GetFindString();
144 
145  // Don't match if searching for replaceable item and the item doesn't support text replace.
146  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
147  return false;
148 
149  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
150  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
151 
152  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
153  {
154  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
155  return text.Matches( searchText );
156 
157  return text.MakeUpper().Matches( searchText.MakeUpper() );
158  }
159 
160  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
161  return aText.Find( searchText ) != wxNOT_FOUND;
162 
163  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
164 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:502

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

◆ Models() [1/2]

◆ Models() [2/2]

const std::list<MODULE_3D_SETTINGS>& MODULE::Models ( ) const
inline

Definition at line 215 of file class_module.h.

215 { return m_3D_Drawings; }
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743

◆ Move() [1/2]

void MODULE::Move ( const wxPoint aMoveVector)
overridevirtual

Function Move move this object.

Parameters
aMoveVector- the move vector for this object.

Reimplemented from BOARD_ITEM.

Definition at line 1155 of file class_module.cpp.

1156 {
1157  wxPoint newpos = m_Pos + aMoveVector;
1158  SetPosition( newpos );
1159 }
void SetPosition(const wxPoint &aPos) override
wxPoint m_Pos
Definition: class_module.h:718

References m_Pos, and SetPosition().

Referenced by moveFootprintsInArea().

◆ Move() [2/2]

void BOARD_ITEM::Move ( const VECTOR2I aMoveVector)
inlineinherited

Definition at line 317 of file class_board_item.h.

318  {
319  Move( wxPoint( aMoveVector.x, aMoveVector.y ) );
320  }
virtual void Move(const wxPoint &aMoveVector)
Function Move move this object.

References BOARD_ITEM::Move(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ MoveAnchorPosition()

void MODULE::MoveAnchorPosition ( const wxPoint aMoveVector)

Function MoveAnchorPosition Move the reference point of the footprint It looks like a move footprint: the footprints elements (pads, outlines, edges .

. ) are moved However:

  • the footprint position is not modified.
  • the relative (local) coordinates of these items are modified (a move footprint does not change these local coordinates, but changes the footprint position)

Definition at line 1293 of file class_module.cpp.

1294 {
1295  /* Move the reference point of the footprint
1296  * the footprints elements (pads, outlines, edges .. ) are moved
1297  * but:
1298  * - the footprint position is not modified.
1299  * - the relative (local) coordinates of these items are modified
1300  * - Draw coordinates are updated
1301  */
1302 
1303 
1304  // Update (move) the relative coordinates relative to the new anchor point.
1305  wxPoint moveVector = aMoveVector;
1306  RotatePoint( &moveVector, -GetOrientation() );
1307 
1308  // Update of the reference and value.
1309  m_Reference->SetPos0( m_Reference->GetPos0() + moveVector );
1311  m_Value->SetPos0( m_Value->GetPos0() + moveVector );
1312  m_Value->SetDrawCoord();
1313 
1314  // Update the pad local coordinates.
1315  for( auto pad : m_pads )
1316  {
1317  pad->SetPos0( pad->GetPos0() + moveVector );
1318  pad->SetDrawCoord();
1319  }
1320 
1321  // Update the draw element coordinates.
1322  for( auto item : GraphicalItems() )
1323  {
1324  switch( item->Type() )
1325  {
1326  case PCB_MODULE_EDGE_T:
1327  {
1328  EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
1329  edge->Move( moveVector );
1330  }
1331  break;
1332 
1333  case PCB_MODULE_TEXT_T:
1334  {
1335  TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
1336  text->SetPos0( text->GetPos0() + moveVector );
1337  text->SetDrawCoord();
1338  }
1339  break;
1340 
1341  default:
1342  break;
1343  }
1344  }
1345 
1347 }
double GetOrientation() const
Definition: class_module.h:224
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
PADS m_pads
Definition: class_module.h:714
DRAWINGS & GraphicalItems()
Definition: class_module.h:191
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
void SetPos0(const wxPoint &aPos)
const wxPoint & GetPos0() const
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
void Move(const wxPoint &aMoveVector) override
Move an edge of the footprint.
void SetDrawCoord()
Set absolute coordinates.
TEXTE_MODULE * m_Value
Definition: class_module.h:720
TEXTE_MODULE * m_Reference
Definition: class_module.h:719

References CalculateBoundingBox(), GetOrientation(), TEXTE_MODULE::GetPos0(), GraphicalItems(), m_pads, m_Reference, m_Value, EDGE_MODULE::Move(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, RotatePoint(), TEXTE_MODULE::SetDrawCoord(), and TEXTE_MODULE::SetPos0().

Referenced by CLIPBOARD_IO::SaveSelection(), and DRAWING_TOOL::SetAnchor().

◆ NeedsPlaced()

bool MODULE::NeedsPlaced ( ) const
inline

Definition at line 338 of file class_module.h.

338 { return m_ModuleStatus & MODULE_to_PLACE; }
#define MODULE_to_PLACE
In autoplace: module waiting for autoplace.
Definition: class_module.h:307
int m_ModuleStatus
Definition: class_module.h:723

References MODULE_to_PLACE.

Referenced by AR_AUTOPLACER::pickModule().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 194 of file base_struct.cpp.

195 {
196  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
197  GetChars( GetClass() ) ) );
198 
199  return false;
200 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
virtual wxString GetClass() const =0
Function GetClass returns the class name.
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

References Format(), GetChars(), and EDA_ITEM::GetClass().

◆ operator=() [1/2]

MODULE & MODULE::operator= ( const MODULE aOther)

Definition at line 270 of file class_module.cpp.

271 {
272  BOARD_ITEM::operator=( aOther );
273 
274  m_Pos = aOther.m_Pos;
275  m_fpid = aOther.m_fpid;
276  m_Attributs = aOther.m_Attributs;
278  m_Orient = aOther.m_Orient;
279  m_BoundaryBox = aOther.m_BoundaryBox;
280  m_CntRot90 = aOther.m_CntRot90;
281  m_CntRot180 = aOther.m_CntRot180;
283  m_Link = aOther.m_Link;
284  m_Path = aOther.m_Path;
285 
292  m_ThermalGap = aOther.m_ThermalGap;
293 
294  // Copy reference and value
295  *m_Reference = *aOther.m_Reference;
296  m_Reference->SetParent( this );
297  *m_Value = *aOther.m_Value;
298  m_Value->SetParent( this );
299 
300  // Copy auxiliary data: Pads
301  m_pads.clear();
302 
303  for( D_PAD* pad : aOther.Pads() )
304  Add( new D_PAD( *pad ) );
305 
306  // Copy auxiliary data: Zones
307  m_fp_zones.clear();
308 
309  for( MODULE_ZONE_CONTAINER* item : aOther.Zones() )
310  {
311  Add( static_cast<MODULE_ZONE_CONTAINER*>( item->Clone() ) );
312 
313  // Ensure the net info is OK and especially uses the net info list
314  // living in the current board
315  // Needed when copying a fp from fp editor that has its own board
316  // Must be NETINFO_LIST::ORPHANED_ITEM for a keepout that has no net.
317  item->SetNetCode( -1 );
318  }
319 
320  // Copy auxiliary data: Drawings
321  m_drawings.clear();
322 
323  for( BOARD_ITEM* item : aOther.GraphicalItems() )
324  {
325  switch( item->Type() )
326  {
327  case PCB_MODULE_TEXT_T:
328  case PCB_MODULE_EDGE_T:
329  Add( static_cast<BOARD_ITEM*>( item->Clone() ) );
330  break;
331 
332  default:
333  wxLogMessage( wxT( "MODULE::operator=() internal error: unknown type" ) );
334  break;
335  }
336  }
337 
338  // Copy auxiliary data: 3D_Drawings info
339  m_3D_Drawings.clear();
340  m_3D_Drawings = aOther.m_3D_Drawings;
341  m_Doc = aOther.m_Doc;
342  m_KeyWord = aOther.m_KeyWord;
343  m_properties = aOther.m_properties;
344 
345  // Ensure auxiliary data is up to date
347 
349  new wxArrayString( *aOther.m_initial_comments ) : nullptr;
350 
351  return *this;
352 }
LIB_ID m_fpid
Definition: class_module.h:721
int m_CntRot90
Definition: class_module.h:740
wxString m_KeyWord
Definition: class_module.h:735
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:727
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:732
int m_LocalSolderPasteMargin
Definition: class_module.h:731
int m_ThermalGap
Definition: class_module.h:728
PADS & Pads()
Definition: class_module.h:181
KIID_PATH m_Path
Definition: class_module.h:736
PADS m_pads
Definition: class_module.h:714
DRAWINGS & GraphicalItems()
Definition: class_module.h:191
wxArrayString * m_initial_comments
Definition: class_module.h:745
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
wxString m_Doc
Definition: class_module.h:734
timestamp_t m_LastEditTime
Definition: class_module.h:737
int m_LocalClearance
Definition: class_module.h:729
double m_Orient
Definition: class_module.h:717
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:726
int m_LocalSolderMaskMargin
Definition: class_module.h:730
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Operator assignment is used to assign the members of aItem to another object.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
int m_CntRot180
Definition: class_module.h:741
int m_ModuleStatus
Definition: class_module.h:723
std::map< wxString, wxString > m_properties
Definition: class_module.h:744
TEXTE_MODULE * m_Value
Definition: class_module.h:720
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
wxPoint m_Pos
Definition: class_module.h:718
MODULE_ZONE_CONTAINERS & Zones()
Definition: class_module.h:201
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
KIID m_Link
Definition: class_module.h:739
int m_Attributs
Definition: class_module.h:722

References Add(), CalculateBoundingBox(), GraphicalItems(), m_3D_Drawings, m_Attributs, m_BoundaryBox, m_CntRot180, m_CntRot90, m_Doc, m_drawings, m_fp_zones, m_fpid, m_initial_comments, m_KeyWord, m_LastEditTime, m_Link, m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_ModuleStatus, m_Orient, m_pads, m_Path, m_Pos, m_properties, m_Reference, m_ThermalGap, m_ThermalWidth, m_Value, m_ZoneConnection, EDA_ITEM::operator=(), Pads(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, EDA_ITEM::SetParent(), and Zones().

◆ operator=() [2/2]

MODULE & MODULE::operator= ( MODULE &&  aOther)

Definition at line 177 of file class_module.cpp.

178 {
179  BOARD_ITEM::operator=( aOther );
180 
181  m_Pos = aOther.m_Pos;
182  m_fpid = aOther.m_fpid;
183  m_Attributs = aOther.m_Attributs;
185  m_Orient = aOther.m_Orient;
186  m_BoundaryBox = aOther.m_BoundaryBox;
187  m_CntRot90 = aOther.m_CntRot90;
188  m_CntRot180 = aOther.m_CntRot180;
190  m_Link = aOther.m_Link;
191  m_Path = aOther.m_Path;
192 
199  m_ThermalGap = aOther.m_ThermalGap;
200 
201  // Move reference and value
202  m_Reference = aOther.m_Reference;
203  m_Reference->SetParent( this );
204  m_Value = aOther.m_Value;
205  m_Value->SetParent( this );
206 
207 
208  // Move the pads
209  m_pads.clear();
210 
211  for( D_PAD* pad : aOther.Pads() )
212  Add( pad );
213 
214  // Move the zones
215  m_fp_zones.clear();
216 
217  for( MODULE_ZONE_CONTAINER* item : aOther.Zones() )
218  {
219  Add( static_cast<MODULE_ZONE_CONTAINER*>( item ) );
220 
221  // Ensure the net info is OK and especially uses the net info list
222  // living in the current board
223  // Needed when copying a fp from fp editor that has its own board
224  // Must be NETINFO_LIST::ORPHANED_ITEM for a keepout that has no net.
225  item->SetNetCode( -1 );
226  }
227 
228  // Move the drawings
229  m_drawings.clear();
230 
231  for( BOARD_ITEM* item : aOther.GraphicalItems() )
232  {
233  switch( item->Type() )
234  {
235  case PCB_MODULE_TEXT_T:
236  case PCB_MODULE_EDGE_T:
237  Add( static_cast<BOARD_ITEM*>( item ) );
238  break;
239 
240  default:
241  wxLogMessage( wxT( "MODULE::operator=() internal error: unknown type" ) );
242  break;
243  }
244  }
245 
246  // Copy auxiliary data: 3D_Drawings info
247  m_3D_Drawings.clear();
248  m_3D_Drawings = aOther.m_3D_Drawings;
249  m_Doc = aOther.m_Doc;
250  m_KeyWord = aOther.m_KeyWord;
251  m_properties = aOther.m_properties;
252 
253  // Ensure auxiliary data is up to date
255 
257 
258  // Clear the other item's containers since this is a move
259  aOther.Pads().clear();
260  aOther.Zones().clear();
261  aOther.GraphicalItems().clear();
262  aOther.m_Value = nullptr;
263  aOther.m_Reference = nullptr;
264  aOther.m_initial_comments = nullptr;
265 
266  return *this;
267 }
LIB_ID m_fpid
Definition: class_module.h:721
int m_CntRot90
Definition: class_module.h:740
wxString m_KeyWord
Definition: class_module.h:735
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:727
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
double m_LocalSolderPasteMarginRatio
Definition: class_module.h:732
int m_LocalSolderPasteMargin
Definition: class_module.h:731
int m_ThermalGap
Definition: class_module.h:728
PADS & Pads()
Definition: class_module.h:181
KIID_PATH m_Path
Definition: class_module.h:736
PADS m_pads
Definition: class_module.h:714
DRAWINGS & GraphicalItems()
Definition: class_module.h:191
wxArrayString * m_initial_comments
Definition: class_module.h:745
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
wxString m_Doc
Definition: class_module.h:734
timestamp_t m_LastEditTime
Definition: class_module.h:737
int m_LocalClearance
Definition: class_module.h:729
double m_Orient
Definition: class_module.h:717
EDA_RECT m_BoundaryBox
Definition: class_module.h:724
ZONE_CONNECTION m_ZoneConnection
Definition: class_module.h:726
int m_LocalSolderMaskMargin
Definition: class_module.h:730
std::list< MODULE_3D_SETTINGS > m_3D_Drawings
Definition: class_module.h:743
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Operator assignment is used to assign the members of aItem to another object.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
int m_CntRot180
Definition: class_module.h:741
int m_ModuleStatus
Definition: class_module.h:723
std::map< wxString, wxString > m_properties
Definition: class_module.h:744
TEXTE_MODULE * m_Value
Definition: class_module.h:720
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
wxPoint m_Pos
Definition: class_module.h:718
MODULE_ZONE_CONTAINERS & Zones()
Definition: class_module.h:201
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
KIID m_Link
Definition: class_module.h:739
int m_Attributs
Definition: class_module.h:722

References Add(), CalculateBoundingBox(), m_3D_Drawings, m_Attributs, m_BoundaryBox, m_CntRot180, m_CntRot90, m_Doc, m_drawings, m_fp_zones, m_fpid, m_initial_comments, m_KeyWord, m_LastEditTime, m_Link, m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_ModuleStatus, m_Orient, m_pads, m_Path, m_Pos, m_properties, m_Reference, m_ThermalGap, m_ThermalWidth, m_Value, m_ZoneConnection, EDA_ITEM::operator=(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, and EDA_ITEM::SetParent().

◆ Pads() [1/2]

◆ Pads() [2/2]

const PADS& MODULE::Pads ( ) const
inline

Definition at line 186 of file class_module.h.

187  {
188  return m_pads;
189  }
PADS m_pads
Definition: class_module.h:714

◆ PadsLocked()

bool MODULE::PadsLocked ( ) const
inline

Definition at line 347 of file class_module.h.

#define MODULE_PADS_LOCKED
In autoplace: module waiting for autoplace.
Definition: class_module.h:308
int m_ModuleStatus
Definition: class_module.h:723

References MODULE_PADS_LOCKED.

Referenced by EditToolSelectionFilter(), EDIT_POINTS_FACTORY::Make(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), and POINT_EDITOR::updatePoints().

◆ Reference() [1/2]

◆ Reference() [2/2]

TEXTE_MODULE& MODULE::Reference ( ) const
inline

Definition at line 496 of file class_module.h.

496 { return *m_Reference; }
TEXTE_MODULE * m_Reference
Definition: class_module.h:719

◆ Remove()

void MODULE::Remove ( BOARD_ITEM aItem)
overridevirtual

Implements BOARD_ITEM_CONTAINER.

Definition at line 445 of file class_module.cpp.

446 {
447  switch( aBoardItem->Type() )
448  {
449  case PCB_MODULE_TEXT_T:
450  // Only user text can be removed this way.
451  wxCHECK_RET(
452  static_cast<TEXTE_MODULE*>( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS,
453  "Please report this bug: Invalid remove operation on required text" );
455 
456  case PCB_MODULE_EDGE_T:
457  for( auto it = m_drawings.begin(); it != m_drawings.end(); ++it )
458  {
459  if( *it == aBoardItem )
460  {
461  m_drawings.erase( it );
462  break;
463  }
464  }
465 
466  break;
467 
468  case PCB_PAD_T:
469  for( auto it = m_pads.begin(); it != m_pads.end(); ++it )
470  {
471  if( *it == static_cast<D_PAD*>( aBoardItem ) )
472  {
473  m_pads.erase( it );
474  break;
475  }
476  }
477 
478  break;
479 
481  for( auto it = m_fp_zones.begin(); it != m_fp_zones.end(); ++it )
482  {
483  if( *it == static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) )
484  {
485  m_fp_zones.erase( it );
486  break;
487  }
488  }
489 
490  break;
491 
492  default:
493  {
494  wxString msg;
495  msg.Printf( wxT( "MODULE::Remove() needs work: BOARD_ITEM type (%d) not handled" ),
496  aBoardItem->Type() );
497  wxFAIL_MSG( msg );
498  }
499  }
500 }
PADS m_pads
Definition: class_module.h:714
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:88
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
class ZONE_CONTAINER, managed by a footprint
Definition: typeinfo.h:95

References KI_FALLTHROUGH, m_drawings, m_fp_zones, m_pads, PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, PCB_MODULE_ZONE_AREA_T, PCB_PAD_T, TEXTE_MODULE::TEXT_is_DIVERS, and EDA_ITEM::Type().

Referenced by EDIT_TOOL::Remove().

◆ Replace() [1/2]

bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
staticinherited

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 167 of file base_struct.cpp.

168 {
169  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
170 
171  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
172  aSearchData.GetFindString() :
173  aSearchData.GetFindString().Upper() );
174 
175  if( result == wxNOT_FOUND )
176  return false;
177 
178  wxString prefix = aText.Left( result );
179  wxString suffix;
180 
181  if( aSearchData.GetFindString().length() + result < aText.length() )
182  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
183 
184  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
185  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
186  GetChars( suffix ) );
187 
188  aText = prefix + aSearchData.GetReplaceString() + suffix;
189 
190  return true;
191 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153

References GetChars(), and traceFindReplace.

Referenced by SCH_FIELD::Replace(), EDA_TEXT::Replace(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, and SCH_PIN.

Definition at line 490 of file base_struct.h.

490 { return false; }

◆ ResolveTextVar()

bool MODULE::ResolveTextVar ( wxString *  token,
int  aDepth = 0 
) const

Resolve any references to system tokens supported by the component.

Parameters
aDeptha counter to limit recursion and circular references.

Definition at line 363 of file class_module.cpp.

364 {
365  if( token->IsSameAs( wxT( "REFERENCE" ) ) )
366  {
367  *token = m_Reference->GetShownText( aDepth + 1 );
368  return true;
369  }
370  else if( token->IsSameAs( wxT( "VALUE" ) ) )
371  {
372  *token = m_Value->GetShownText( aDepth + 1 );
373  return true;
374  }
375  else if( token->IsSameAs( wxT( "LAYER" ) ) )
376  {
377  *token = GetLayerName();
378  return true;
379  }
380  else if( m_properties.count( *token ) )
381  {
382  *token = m_properties.at( *token );
383  return true;
384  }
385 
386  return false;
387 }
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
std::map< wxString, wxString > m_properties
Definition: class_module.h:744
TEXTE_MODULE * m_Value
Definition: class_module.h:720
TEXTE_MODULE * m_Reference
Definition: class_module.h:719
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.

References BOARD_ITEM::GetLayerName(), TEXTE_MODULE::GetShownText(), m_properties, m_Reference, and m_Value.

Referenced by TEXTE_PCB::GetShownText(), and TEXTE_MODULE::GetShownText().

◆ Rotate() [1/2]

void MODULE::Rotate ( const wxPoint aRotCentre,
double  aAngle 
)
overridevirtual

Function Rotate Rotate this object.

Parameters
aRotCentre- the rotation point.
aAngle- the rotation angle in 0.1 degree.

Reimplemented from BOARD_ITEM.

Definition at line 1162 of file class_module.cpp.

1163 {
1164  double orientation = GetOrientation();
1165  double newOrientation = orientation + aAngle;
1166  wxPoint newpos = m_Pos;
1167  RotatePoint( &newpos, aRotCentre, aAngle );
1168  SetPosition( newpos );
1169  SetOrientation( newOrientation );
1170 
1171  m_Reference->KeepUpright( orientation, newOrientation );
1172  m_Value->KeepUpright( orientation, newOrientation );
1173 
1174  for( BOARD_ITEM* item : m_drawings )
1175  {
1176  if( item->Type() == PCB_MODULE_TEXT_T )
1177  static_cast<TEXTE_MODULE*>( item )->KeepUpright( orientation, newOrientation );
1178  }
1179 }
double GetOrientation() const
Definition: class_module.h:224
void KeepUpright(double aOldOrientation, double aNewOrientation)
Called when rotating the parent footprint.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
void SetPosition(const wxPoint &aPos) override
DRAWINGS m_drawings
Definition: class_module.h:713
void SetOrientation(double aNewAngle)
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
TEXTE_MODULE * m_Value
Definition: class_module.h:720
wxPoint m_Pos
Definition: class_module.h:718
TEXTE_MODULE * m_Reference
Definition: class_module.h:719

References GetOrientation(), TEXTE_MODULE::KeepUpright(), m_drawings, m_Pos, m_Reference, m_Value, PCB_MODULE_TEXT_T, RotatePoint(), SetOrientation(), and SetPosition().

Referenced by Flip(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ Rotate() [2/2]

void BOARD_ITEM::Rotate ( const VECTOR2I aRotCentre,
double  aAngle 
)
inlineinherited

Definition at line 333 of file class_board_item.h.

334  {
335  Rotate( wxPoint( aRotCentre.x, aRotCentre.y ), aAngle );
336  }
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Function Rotate Rotate this object.

References BOARD_ITEM::Rotate(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ RunOnChildren()

void MODULE::RunOnChildren ( const std::function< void(BOARD_ITEM *)> &  aFunction)

Function RunOnChildren.

Invokes a function on all BOARD_ITEMs that belong to the module (pads, drawings, texts). Note that this function should not add or remove items to the module

Parameters
aFunctionis the function to be invoked.

Definition at line 996 of file class_module.cpp.

997 {
998  try
999  {
1000  for( D_PAD* pad : m_pads )
1001  aFunction( static_cast<BOARD_ITEM*>( pad ) );
1002 
1003  for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
1004  aFunction( static_cast<MODULE_ZONE_CONTAINER*>( zone ) );
1005 
1006  for( BOARD_ITEM* drawing : m_drawings )
1007  aFunction( static_cast<BOARD_ITEM*>( drawing ) );
1008 
1009  aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
1010  aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
1011  }
1012  catch( std::bad_function_call& )
1013  {
1014  wxFAIL_MSG( "Error running MODULE::RunOnChildren" );
1015  }
1016 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
PADS m_pads
Definition: class_module.h:714
MODULE_ZONE_CONTAINERS m_fp_zones
Definition: class_module.h:715
DRAWINGS m_drawings
Definition: class_module.h:713
TEXTE_MODULE * m_Value
Definition: class_module.h:720
MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER ...
Definition: class_zone.h:954
TEXTE_MODULE * m_Reference
Definition: class_module.h:719

References m_drawings, m_fp_zones, m_pads, m_Reference, and m_Value.

Referenced by PCB_BASE_FRAME::CreateNewModule(), PCB_TOOL_BASE::doInteractiveItemPlacement(), Duplicate(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), KIGFX::PCB_VIEW::Update(), and PCBNEW_SELECTION::updateDrawList().

◆ Set() [1/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67  {
69  TYPE_ID thisType = TYPE_HASH( *this );
70  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71  void* object = nullptr;
72 
73  if( prop )
74  {
75  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76 
77  if( object )
78  prop->set<T>( object, aValue );
79  }
80 
81  return object != nullptr;
82  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ SetAttributes()

◆ SetBrightened()

◆ SetDescription()

void MODULE::SetDescription ( const wxString &  aDoc)
inline

◆ SetFlag()

void MODULE::SetFlag ( int  aFlag)
inline

Definition at line 272 of file class_module.h.

272 { m_arflag = aFlag; }
int m_arflag
Definition: class_module.h:738

Referenced by AR_AUTOPLACER::pickModule().

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 232 of file base_struct.h.

232 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), SCH_MOVE_TOOL::AlignElements(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupSegments(), TRACKS_CLEANER::cleanupSegments(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), LIB_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseWire(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 284 of file base_struct.h.

284 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetFPID()

◆ SetGroup()

void BOARD_ITEM::SetGroup ( const KIID aGroup)
inlineinherited

Set the group that this item belongs to.

Parameters
aGroupis the group this belongs to

Definition at line 107 of file class_board_item.h.

107 { m_groupUuid = aGroup; }

References BOARD_ITEM::m_groupUuid.

Referenced by PCB_GROUP::AddItem(), PCBNEW_CONTROL::placeBoardItems(), and PCB_GROUP::RemoveItem().