KiCad PCB EDA Suite
D_PAD Class Reference

#include <class_pad.h>

Inheritance diagram for D_PAD:
BOARD_CONNECTED_ITEM BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 D_PAD (MODULE *parent)
 
D_PADNext () const
 
MODULEGetParent () const
 
void ImportSettingsFromMaster (const D_PAD &aMasterPad)
 Imports the pad settings from aMasterPad. More...
 
bool IsFlipped () const
 
void SetPadName (const wxString &name)
 Set the pad name (sometimes called pad number, although it can be an array ref like AA12 the pad name is limited to 4 ASCII chars. More...
 
wxString GetPadName () const
 
wxUint32 GetPackedPadName () const
 
bool IncrementPadName (bool aSkipUnconnectable, bool aFillSequenceGaps)
 Function IncrementPadName. More...
 
bool PadNameEqual (const D_PAD *other) const
 
PAD_SHAPE_T GetShape () const
 Function GetShape. More...
 
void SetShape (PAD_SHAPE_T aShape)
 
void SetPosition (const wxPoint &aPos) override
 
const wxPointGetPosition () const override
 
void SetY (int y)
 
void SetX (int x)
 
void SetPos0 (const wxPoint &aPos)
 
const wxPointGetPos0 () const
 
void SetY0 (int y)
 
void SetX0 (int x)
 
void SetSize (const wxSize &aSize)
 
const wxSize & GetSize () const
 
void SetDelta (const wxSize &aSize)
 
const wxSize & GetDelta () const
 
void SetDrillSize (const wxSize &aSize)
 
const wxSize & GetDrillSize () const
 
void SetOffset (const wxPoint &aOffset)
 
const wxPointGetOffset () const
 
void Flip (const wxPoint &aCentre) override
 Function Flip Flip this object, i.e. More...
 
void SetOrientation (double aAngle)
 Function SetOrientation sets the rotation angle of the pad. More...
 
void SetOrientationDegrees (double aOrientation)
 Set orientation in degrees. More...
 
double GetOrientation () const
 Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees. More...
 
double GetOrientationDegrees () const
 
double GetOrientationRadians () const
 
void SetDrillShape (PAD_DRILL_SHAPE_T aDrillShape)
 
PAD_DRILL_SHAPE_T GetDrillShape () const
 
void GetOblongDrillGeometry (wxPoint &aStartPoint, wxPoint &aEndPoint, int &aWidth) const
 Function GetOblongDrillGeometry calculates the start point, end point and width of an equivalent segment which have the same position and width as the hole Usefull to plot/draw oblong holes like segments with rounded ends used in draw and plot functions. More...
 
void SetLayerSet (LSET aLayerMask)
 
LSET GetLayerSet () const override
 Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segment or VIA physically resides. More...
 
void SetAttribute (PAD_ATTR_T aAttribute)
 
PAD_ATTR_T GetAttribute () const
 
void SetPadToDieLength (int aLength)
 
int GetPadToDieLength () const
 
int GetLocalSolderMaskMargin () const
 
void SetLocalSolderMaskMargin (int aMargin)
 
int GetLocalClearance () const
 
void SetLocalClearance (int aClearance)
 
int GetLocalSolderPasteMargin () const
 
void SetLocalSolderPasteMargin (int aMargin)
 
double GetLocalSolderPasteMarginRatio () const
 
void SetLocalSolderPasteMarginRatio (double aRatio)
 
void TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor) const
 Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon Used in filling zones calculations Circles and arcs are approximated by segments. More...
 
int GetClearance (BOARD_CONNECTED_ITEM *aItem=NULL) const override
 Function GetClearance returns the clearance in internal units. More...
 
int GetSolderMaskMargin () const
 Function GetSolderMaskMargin. More...
 
wxSize GetSolderPasteMargin () const
 Function GetSolderPasteMargin. More...
 
void SetZoneConnection (ZoneConnection aType)
 
ZoneConnection GetZoneConnection () const
 
void SetThermalWidth (int aWidth)
 
int GetThermalWidth () const
 
void SetThermalGap (int aGap)
 
int GetThermalGap () const
 
void Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
 Function Draw BOARD_ITEMs have their own color information. More...
 
void DrawShape (EDA_RECT *aClipBox, wxDC *aDC, PAD_DRAWINFO &aDrawInfo)
 Function DrawShape basic function to draw a pad. More...
 
void BuildPadPolygon (wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
 Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Corner list of the polygonal shape, depending on shape, extra size (clearance ...) and orientation. More...
 
int GetRoundRectCornerRadius () const
 Function GetRoundRectCornerRadius Has meaning only for rounded rect pads. More...
 
int GetRoundRectCornerRadius (const wxSize &aSize) const
 Helper function GetRoundRectCornerRadius Has meaning only for rounded rect pads Returns the radius of the rounded corners of a rectangle size aSize, using others setting of the pad. More...
 
void BuildPadShapePolygon (SHAPE_POLY_SET &aCornerBuffer, wxSize aInflateValue, int aSegmentsPerCircle, double aCorrectionFactor) const
 Function BuildPadShapePolygon Build the Corner list of the polygonal shape, depending on shape, extra size (clearance ...) pad and orientation This function is similar to TransformShapeWithClearanceToPolygon, but the difference is BuildPadShapePolygon creates a polygon shape exactly similar to pad shape, which a size inflated by aInflateValue and TransformShapeWithClearanceToPolygon creates a more complex shape (for instance a rectangular pad is converted in a rectangulr shape with ronded corners) More...
 
bool BuildPadDrillShapePolygon (SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aSegmentsPerCircle) const
 Function BuildPadDrillShapePolygon Build the Corner list of the polygonal drill shape, depending on shape pad hole and orientation. More...
 
int BuildSegmentFromOvalShape (wxPoint &aSegStart, wxPoint &aSegEnd, double aRotation, const wxSize &aMargin) const
 Function BuildSegmentFromOvalShape Has meaning only for OVAL (and ROUND) pads Build an equivalent segment having the same shape as the OVAL shape, Useful in draw function and in DRC and HitTest functions, because segments are already well handled by track tests. More...
 
void StringPadName (wxString &text) const
 
int GetBoundingRadius () const
 Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad. More...
 
wxPoint ShapePos () const
 
double GetRoundRectRadiusRatio () const
 has meaning only for rounded rect pads More...
 
void SetRoundRectRadiusRatio (double aRadiusScale)
 has meaning only for rounded rect pads Set the scaling factor between the smaller Y or Y size and the radius of the rounded corners. More...
 
int GetSubRatsnest () const
 Function GetSubRatsnest. More...
 
void SetSubRatsnest (int aSubRatsnest)
 
void GetMsgPanelInfo (std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
bool IsOnLayer (PCB_LAYER_ID aLayer) const override
 Function IsOnLayer tests to see if this object is on the given layer. More...
 
bool HitTest (const wxPoint &aPosition) const override
 Function HitTest tests if aPosition is contained within or on the bounding area of an item. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
void SetDrawCoord ()
 

Set absolute coordinates.

More...
 
void SetLocalCoord ()
 

Set relative coordinates.

More...
 
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...
 
wxString GetSelectMenuText () 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...
 
wxString ShowPadShape () const
 Function ShowPadShape. More...
 
wxString ShowPadAttr () const
 Function ShowPadAttr. More...
 
void AppendConfigs (PARAM_CFG_ARRAY *aResult)
 Function AppendConfigs appends to aResult the configuration setting accessors which will later allow reading or writing of configuration file information directly into this object. More...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
D_PADDuplicate () const
 same as Clone, but returns a D_PAD item. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 
virtual unsigned int ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 
virtual const BOX2I ViewBBox () const override
 
void CopyNetlistSettings (D_PAD *aPad, bool aCopyLocalSettings)
 Function CopyNetlistSettings copies the netlist settings to aPad, and the net name. More...
 
bool IsConnected () const override
 > More...
 
NETINFO_ITEMGetNet () const
 Function GetNet Returns NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Function SetNet Sets a NET_INFO object for the item. More...
 
int GetNetCode () const
 Function GetNetCode. More...
 
bool SetNetCode (int aNetCode, bool aNoAssert=false)
 Function SetNetCode sets net using a net code. More...
 
int GetSubNet () const
 Function GetSubNet. More...
 
void SetSubNet (int aSubNetCode)
 
int GetZoneSubNet () const
 Function GetZoneSubNet. More...
 
void SetZoneSubNet (int aSubNetCode)
 
const wxString & GetNetname () const
 Function GetNetname. More...
 
const wxString & GetShortNetname () const
 Function GetShortNetname. More...
 
std::shared_ptr< NETCLASSGetNetClass () const
 Function GetNetClass returns the NETCLASS for this item. More...
 
wxString GetNetClassName () const
 Function GetNetClassName returns a pointer to the netclass of the zone. More...
 
virtual const wxPoint GetCenter () const
 Function GetCenter() More...
 
BOARD_ITEMBack () const
 
PCB_LAYER_ID GetLayer () const
 Function GetLayer returns the primary layer this item is on. More...
 
virtual void SetLayer (PCB_LAYER_ID aLayer)
 Function SetLayer sets the layer this item is on. More...
 
void SwapData (BOARD_ITEM *aImage)
 Swap data between aItem and aImage. More...
 
bool IsTrack () const
 Function IsTrack tests to see if this object is a track or via (or microvia). More...
 
virtual bool IsLocked () const
 Function IsLocked. More...
 
virtual void SetLocked (bool aLocked)
 Function SetLocked modifies 'lock' status for of the item. More...
 
virtual void UnLink ()
 Function UnLink detaches this object from its owner. More...
 
void DeleteStructure ()
 Function DeleteStructure deletes this object after UnLink()ing it from its owner if it has one. More...
 
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 bool HitTest (const EDA_RECT &aRect, bool aContained=true, int aAccuracy=0) const
 Function HitTest tests if the aRect intersects or contains this object (depending on aContained). More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (time_t aNewTimeStamp)
 
time_t GetTimeStamp () const
 
DHEADGetList () const
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
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
 
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...
 
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 its member data. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
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...
 
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
 

Static Public Member Functions

static LSET StandardMask ()
 layer set for a through hole pad More...
 
static LSET SMDMask ()
 layer set for a SMD pad on Front layer More...
 
static LSET ConnSMDMask ()
 layer set for a SMD pad on Front layer used for edge board connectors More...
 
static LSET UnplatedHoleMask ()
 layer set for a mechanical unplated through hole pad More...
 
static bool ClassOf (const EDA_ITEM *aItem)
 
static int Compare (const D_PAD *padref, const D_PAD *padcmp)
 Function Compare compares two pads and return 0 if they are equal. More...
 
static wxString ShowShape (STROKE_T aShape)
 Function ShowShape converts the enum STROKE_T integer value to a wxString. More...
 
static std::string FormatInternalUnits (int aValue)
 Function FormatInternalUnits converts aValue from board internal units to a string appropriate for writing to file. More...
 
static std::string FormatInternalUnits (const wxPoint &aPoint)
 
static std::string FormatInternalUnits (const wxSize &aSize)
 
static std::string FormatAngle (double aAngle)
 Function FormatAngle converts aAngle from board units to a string appropriate for writing to file. More...
 
static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. 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

std::vector< TRACK * > m_TracksConnected
 
std::vector< D_PAD * > m_PadsConnected
 
char m_Padname [PADNAMEZ]
 
wxUint32 m_NumPadName
 

Static Public Attributes

static int m_PadSketchModePenSize = 0
 Pen size used to draw pads in sketch mode (mode used to print pads on silkscreen layer) More...
 
static wxPoint ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Static Protected Member Functions

static int getTrailingInt (wxString aStr)
 
static int getNextNumberInSequence (const std::set< int > &aSeq, bool aFillSequenceGaps)
 

Protected Attributes

NETINFO_ITEMm_netinfo
 Stores all informations about the net that item belongs to. More...
 
PCB_LAYER_ID m_Layer
 
EDA_ITEMPnext
 next in linked list More...
 
EDA_ITEMPback
 previous in linked list More...
 
DHEADm_List
 which DLIST I am on. More...
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
time_t m_TimeStamp
 Time stamp used for logical links. More...
 
bool m_forceVisible
 Set to true to override the visibility setting of the item. More...
 
STATUS_FLAGS m_Flags
 Flag bits for editing and other uses. More...
 

Private Member Functions

int boundingRadius () const
 Function boundingRadius returns a calculated radius of a bounding circle for this pad. More...
 

Private Attributes

int m_boundingRadius
 radius of the circle containing the pad shape More...
 
union {
   char   m_Padname [PADNAMEZ]
 
   wxUint32   m_NumPadName
 
}; 
 Pad name (4 char) or a long identifier (used in pad name comparisons because this is faster than string comparison) More...
 
wxPoint m_Pos
 pad Position on board More...
 
PAD_SHAPE_T m_padShape
 Shape: PAD_SHAPE_CIRCLE, PAD_SHAPE_RECT, PAD_SHAPE_OVAL, PAD_SHAPE_TRAPEZOID, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_POLYGON. More...
 
int m_SubRatsnest
 variable used in rats nest computations handle subnet (block) number in ratsnest connection More...
 
wxSize m_Drill
 Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE, drill diam = m_Drill.x. More...
 
wxSize m_Size
 X and Y size ( relative to orient 0) More...
 
PAD_DRILL_SHAPE_T m_drillShape
 PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG. More...
 
double m_padRoundRectRadiusScale
 scaling factor from smallest m_Size coord to corner radius, default 0.25 More...
 
wxPoint m_Offset
 m_Offset is useful only for oblong and rect pads (it can be used for other shapes, but without any interest). More...
 
LSET m_layerMask
 Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 . More...
 
wxSize m_DeltaSize
 delta on rectangular shapes More...
 
wxPoint m_Pos0
 Initial Pad position (i.e. More...
 
PAD_ATTR_T m_Attribute
 PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED. More...
 
double m_Orient
 in 1/10 degrees More...
 
int m_LengthPadToDie
 Length net from pad to die, inside the package. More...
 
int m_LocalClearance
 Local clearance. More...
 
int m_LocalSolderMaskMargin
 Local mask margins: when 0, the parent footprint design values are used. More...
 
int m_LocalSolderPasteMargin
 Local solder paste margin absolute value. More...
 
double m_LocalSolderPasteMarginRatio
 Local solder mask margin ratio value of pad size The final margin is the sum of these 2 values. More...
 
ZoneConnection m_ZoneConnection
 how the connection to zone is made: no connection, thermal relief ... More...
 
int m_ThermalWidth
 
int m_ThermalGap
 

Detailed Description

Definition at line 80 of file class_pad.h.

Constructor & Destructor Documentation

D_PAD::D_PAD ( MODULE parent)

Definition at line 60 of file class_pad.cpp.

References GetParent(), MODULE::GetPosition(), m_Attribute, m_boundingRadius, m_Drill, m_layerMask, m_LengthPadToDie, m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_NumPadName, m_Orient, m_padRoundRectRadiusScale, EDA_ITEM::m_Parent, m_Pos, m_Size, m_ThermalGap, m_ThermalWidth, m_ZoneConnection, PAD_ATTRIB_STANDARD, PAD_DRILL_SHAPE_CIRCLE, PAD_SHAPE_CIRCLE, PAD_ZONE_CONN_INHERITED, PCB_MODULE_T, SetDrillShape(), SetShape(), SetSubRatsnest(), StandardMask(), and EDA_ITEM::Type().

Referenced by Clone().

60  :
62 {
63  m_NumPadName = 0;
64  m_Size.x = m_Size.y = Mils2iu( 60 ); // Default pad size 60 mils.
65  m_Drill.x = m_Drill.y = Mils2iu( 30 ); // Default drill size 30 mils.
66  m_Orient = 0; // Pad rotation in 1/10 degrees.
67  m_LengthPadToDie = 0;
68 
69  if( m_Parent && m_Parent->Type() == PCB_MODULE_T )
70  {
72  }
73 
74  SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE.
75  SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle.
76  m_Attribute = PAD_ATTRIB_STANDARD; // Default pad type is NORMAL (thru hole)
77  m_LocalClearance = 0;
81  // Parameters for round rect only:
82  m_padRoundRectRadiusScale = 0.25; // from IPC-7351C standard
83 
84  m_ZoneConnection = PAD_ZONE_CONN_INHERITED; // Use parent setting by default
85  m_ThermalWidth = 0; // Use parent setting by default
86  m_ThermalGap = 0; // Use parent setting by default
87 
88  // Set layers mask to default for a standard thru hole pad.
90 
91  SetSubRatsnest( 0 ); // used in ratsnest calculations
92 
93  m_boundingRadius = -1;
94 }
int m_LocalClearance
Local clearance.
Definition: class_pad.h:659
int m_ThermalGap
Definition: class_pad.h:672
int m_LocalSolderMaskMargin
Local mask margins: when 0, the parent footprint design values are used.
Definition: class_pad.h:663
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
double m_padRoundRectRadiusScale
scaling factor from smallest m_Size coord to corner radius, default 0.25
Definition: class_pad.h:622
int m_boundingRadius
radius of the circle containing the pad shape
Definition: class_pad.h:592
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:168
static LSET StandardMask()
layer set for a through hole pad
Definition: class_pad.cpp:97
int m_LocalSolderPasteMargin
Local solder paste margin absolute value.
Definition: class_pad.h:664
const wxPoint & GetPosition() const override
Definition: class_module.h:144
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
MODULE * GetParent() const
Definition: class_pad.h:108
class D_PAD, a pad in a footprint
Definition: typeinfo.h:102
void SetSubRatsnest(int aSubRatsnest)
Definition: class_pad.h:475
wxUint32 m_NumPadName
Definition: class_pad.h:601
class MODULE, a footprint
Definition: typeinfo.h:101
int m_ThermalWidth
Definition: class_pad.h:671
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
void SetDrillShape(PAD_DRILL_SHAPE_T aDrillShape)
Definition: class_pad.h:218
int m_LengthPadToDie
Length net from pad to die, inside the package.
Definition: class_pad.h:654
Usual pad.
Definition: pad_shapes.h:58
void SetShape(PAD_SHAPE_T aShape)
Definition: class_pad.h:167
PAD_ATTR_T m_Attribute
PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED.
Definition: class_pad.h:650
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
double m_LocalSolderPasteMarginRatio
Local solder mask margin ratio value of pad size The final margin is the sum of these 2 values...
Definition: class_pad.h:666
ZoneConnection m_ZoneConnection
how the connection to zone is made: no connection, thermal relief ...
Definition: class_pad.h:669
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605

Member Function Documentation

void D_PAD::AppendConfigs ( PARAM_CFG_ARRAY aResult)

Function AppendConfigs appends to aResult the configuration setting accessors which will later allow reading or writing of configuration file information directly into this object.

Definition at line 335 of file class_pad.cpp.

References m_Drill, and m_Size.

Referenced by BOARD_DESIGN_SETTINGS::AppendConfigs().

336 {
337  // Parameters stored in config are only significant parameters
338  // for a template.
339  // So not all parameters are stored, just few.
340  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrill" ),
341  &m_Drill.x,
342  Millimeter2iu( 0.6 ),
343  Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ),
344  NULL, MM_PER_IU ) );
345 
346  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadDrillOvalY" ),
347  &m_Drill.y,
348  Millimeter2iu( 0.6 ),
349  Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ),
350  NULL, MM_PER_IU ) );
351 
352  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeH" ),
353  &m_Size.x,
354  Millimeter2iu( 1.4 ),
355  Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ),
356  NULL, MM_PER_IU ) );
357 
358  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PadSizeV" ),
359  &m_Size.y,
360  Millimeter2iu( 1.4 ),
361  Millimeter2iu( 0.1 ), Millimeter2iu( 20.0 ),
362  NULL, MM_PER_IU ) );
363 }
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
Configuration parameter - Integer Class with unit conversion.
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
BOARD_ITEM* BOARD_ITEM::Back ( ) const
inlineinherited

Definition at line 125 of file class_board_item.h.

References EDA_ITEM::Pback.

Referenced by PCB_EDIT_FRAME::Delete_Segment_Edge().

125 { return static_cast<BOARD_ITEM*>( Pback ); }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:165
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
int D_PAD::boundingRadius ( ) const
private

Function boundingRadius returns a calculated radius of a bounding circle for this pad.

Definition at line 131 of file class_pad.cpp.

References abs, EuclideanNorm(), GetRoundRectCornerRadius(), GetShape(), KiROUND(), m_DeltaSize, m_Size, max, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, and PAD_SHAPE_TRAPEZOID.

Referenced by GetBoundingRadius().

132 {
133  int x, y;
134  int radius;
135 
136  switch( GetShape() )
137  {
138  case PAD_SHAPE_CIRCLE:
139  radius = m_Size.x / 2;
140  break;
141 
142  case PAD_SHAPE_OVAL:
143  radius = std::max( m_Size.x, m_Size.y ) / 2;
144  break;
145 
146  case PAD_SHAPE_RECT:
147  radius = 1 + KiROUND( EuclideanNorm( m_Size ) / 2 );
148  break;
149 
150  case PAD_SHAPE_TRAPEZOID:
151  x = m_Size.x + std::abs( m_DeltaSize.y ); // Remember: m_DeltaSize.y is the m_Size.x change
152  y = m_Size.y + std::abs( m_DeltaSize.x ); // Remember: m_DeltaSize.x is the m_Size.y change
153  radius = 1 + KiROUND( hypot( x, y ) / 2 );
154  break;
155 
156  case PAD_SHAPE_ROUNDRECT:
157  radius = GetRoundRectCornerRadius();
158  x = m_Size.x >> 1;
159  y = m_Size.y >> 1;
160  radius += 1 + KiROUND( EuclideanNorm( wxSize( x - radius, y - radius )));
161  break;
162 
163  default:
164  radius = 0;
165  }
166 
167  return radius;
168 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:104
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:351
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
#define abs(a)
Definition: auxiliary.h:84
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
#define max(a, b)
Definition: auxiliary.h:86
bool D_PAD::BuildPadDrillShapePolygon ( SHAPE_POLY_SET aCornerBuffer,
int  aInflateValue,
int  aSegmentsPerCircle 
) const

Function BuildPadDrillShapePolygon Build the Corner list of the polygonal drill shape, depending on shape pad hole and orientation.

Parameters
aCornerBuffer= a buffer to fill.
aInflateValue= the clearance or margin value. value > 0: inflate, < 0 deflate, = 0 : no change
aSegmentsPerCircle= number of segments to approximate a circle (used for round and oblong shapes only(16 to 32 is a good value)
Returns
false if the pad has no hole, true otherwise

Definition at line 758 of file board_items_to_polygon_shape_transform.cpp.

References GetDrillSize(), GetOblongDrillGeometry(), GetPosition(), TransformCircleToPolygon(), and TransformRoundedEndsSegmentToPolygon().

Referenced by CINFO3D_VISU::createLayers().

760 {
761  wxSize drillsize = GetDrillSize();
762 
763  if( !drillsize.x || !drillsize.y )
764  return false;
765 
766  if( drillsize.x == drillsize.y ) // usual round hole
767  {
768  TransformCircleToPolygon( aCornerBuffer, GetPosition(),
769  (drillsize.x / 2) + aInflateValue, aSegmentsPerCircle );
770  }
771  else // Oblong hole
772  {
773  wxPoint start, end;
774  int width;
775 
776  GetOblongDrillGeometry( start, end, width );
777 
778  width += aInflateValue * 2;
779 
781  GetPosition() + start, GetPosition() + end, aSegmentsPerCircle, width );
782  }
783 
784  return true;
785 }
void TransformRoundedEndsSegmentToPolygon(SHAPE_POLY_SET &aCornerBuffer, wxPoint aStart, wxPoint aEnd, int aCircleToSegmentsCount, int aWidth)
Function TransformRoundedEndsSegmentToPolygon convert a segment with rounded ends to a polygon Conver...
void TransformCircleToPolygon(SHAPE_POLY_SET &aCornerBuffer, wxPoint aCenter, int aRadius, int aCircleToSegmentsCount)
Function TransformCircleToPolygon convert a circle to a polygon, using multiple straight lines...
const wxSize & GetDrillSize() const
Definition: class_pad.h:188
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
void GetOblongDrillGeometry(wxPoint &aStartPoint, wxPoint &aEndPoint, int &aWidth) const
Function GetOblongDrillGeometry calculates the start point, end point and width of an equivalent segm...
Definition: class_pad.cpp:667
void D_PAD::BuildPadPolygon ( wxPoint  aCoord[4],
wxSize  aInflateValue,
double  aRotation 
) const

Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Corner list of the polygonal shape, depending on shape, extra size (clearance ...) and orientation.

Parameters
aCoord= a buffer to fill (4 corners).
aInflateValue= wxSize: the clearance or margin value. value > 0: inflate, < 0 deflate
aRotation= full rotation of the polygon

Definition at line 677 of file class_pad_draw_functions.cpp.

References PNS::angle(), delta, GetShape(), KiROUND(), m_DeltaSize, m_Size, PAD_SHAPE_RECT, PAD_SHAPE_TRAPEZOID, RotatePoint(), wxPoint::x, and wxPoint::y.

Referenced by BuildPadShapePolygon(), CINFO3D_VISU::buildPadShapePolygon(), DRC::checkClearancePadToPad(), DRC::checkClearanceSegmToPad(), CINFO3D_VISU::createNewPad(), CINFO3D_VISU::createNewPadWithClearance(), KIGFX::PCB_PAINTER::draw(), DrawShape(), HitTest(), BRDITEMS_PLOTTER::PlotPad(), PNS_KICAD_IFACE::syncPad(), and TransformShapeWithClearanceToPolygon().

679 {
680  wxSize delta;
681  wxSize halfsize;
682 
683  halfsize.x = m_Size.x >> 1;
684  halfsize.y = m_Size.y >> 1;
685 
686  switch( GetShape() )
687  {
688  case PAD_SHAPE_RECT:
689  // For rectangular shapes, inflate is easy
690  halfsize += aInflateValue;
691 
692  // Verify if do not deflate more than than size
693  // Only possible for inflate negative values.
694  if( halfsize.x < 0 )
695  halfsize.x = 0;
696 
697  if( halfsize.y < 0 )
698  halfsize.y = 0;
699  break;
700 
701  case PAD_SHAPE_TRAPEZOID:
702  // Trapezoidal pad: verify delta values
703  delta.x = ( m_DeltaSize.x >> 1 );
704  delta.y = ( m_DeltaSize.y >> 1 );
705 
706  // be sure delta values are not to large
707  if( (delta.x < 0) && (delta.x <= -halfsize.y) )
708  delta.x = -halfsize.y + 1;
709 
710  if( (delta.x > 0) && (delta.x >= halfsize.y) )
711  delta.x = halfsize.y - 1;
712 
713  if( (delta.y < 0) && (delta.y <= -halfsize.x) )
714  delta.y = -halfsize.x + 1;
715 
716  if( (delta.y > 0) && (delta.y >= halfsize.x) )
717  delta.y = halfsize.x - 1;
718  break;
719 
720  default: // is used only for rect and trap. pads
721  return;
722  }
723 
724  // Build the basic rectangular or trapezoid shape
725  // delta is null for rectangular shapes
726  aCoord[0].x = -halfsize.x - delta.y; // lower left
727  aCoord[0].y = +halfsize.y + delta.x;
728 
729  aCoord[1].x = -halfsize.x + delta.y; // upper left
730  aCoord[1].y = -halfsize.y - delta.x;
731 
732  aCoord[2].x = +halfsize.x - delta.y; // upper right
733  aCoord[2].y = -halfsize.y + delta.x;
734 
735  aCoord[3].x = +halfsize.x + delta.y; // lower right
736  aCoord[3].y = +halfsize.y - delta.x;
737 
738  // Offsetting the trapezoid shape id needed
739  // It is assumed delta.x or/and delta.y == 0
740  if( GetShape() == PAD_SHAPE_TRAPEZOID && (aInflateValue.x != 0 || aInflateValue.y != 0) )
741  {
742  double angle;
743  wxSize corr;
744 
745  if( delta.y ) // lower and upper segment is horizontal
746  {
747  // Calculate angle of left (or right) segment with vertical axis
748  angle = atan2( (double) m_DeltaSize.y, (double) m_Size.y );
749 
750  // left and right sides are moved by aInflateValue.x in their perpendicular direction
751  // We must calculate the corresponding displacement on the horizontal axis
752  // that is delta.x +- corr.x depending on the corner
753  corr.x = KiROUND( tan( angle ) * aInflateValue.x );
754  delta.x = KiROUND( aInflateValue.x / cos( angle ) );
755 
756  // Horizontal sides are moved up and down by aInflateValue.y
757  delta.y = aInflateValue.y;
758 
759  // corr.y = 0 by the constructor
760  }
761  else if( delta.x ) // left and right segment is vertical
762  {
763  // Calculate angle of lower (or upper) segment with horizontal axis
764  angle = atan2( (double) m_DeltaSize.x, (double) m_Size.x );
765 
766  // lower and upper sides are moved by aInflateValue.x in their perpendicular direction
767  // We must calculate the corresponding displacement on the vertical axis
768  // that is delta.y +- corr.y depending on the corner
769  corr.y = KiROUND( tan( angle ) * aInflateValue.y );
770  delta.y = KiROUND( aInflateValue.y / cos( angle ) );
771 
772  // Vertical sides are moved left and right by aInflateValue.x
773  delta.x = aInflateValue.x;
774 
775  // corr.x = 0 by the constructor
776  }
777  else // the trapezoid is a rectangle
778  {
779  delta = aInflateValue; // this pad is rectangular (delta null).
780  }
781 
782  aCoord[0].x += -delta.x - corr.x; // lower left
783  aCoord[0].y += delta.y + corr.y;
784 
785  aCoord[1].x += -delta.x + corr.x; // upper left
786  aCoord[1].y += -delta.y - corr.y;
787 
788  aCoord[2].x += delta.x - corr.x; // upper right
789  aCoord[2].y += -delta.y + corr.y;
790 
791  aCoord[3].x += delta.x + corr.x; // lower right
792  aCoord[3].y += delta.y - corr.y;
793 
794  /* test coordinates and clamp them if the offset correction is too large:
795  * Note: if a coordinate is bad, the other "symmetric" coordinate is bad
796  * So when a bad coordinate is found, the 2 symmetric coordinates
797  * are set to the minimun value (0)
798  */
799 
800  if( aCoord[0].x > 0 ) // lower left x coordinate must be <= 0
801  aCoord[0].x = aCoord[3].x = 0;
802 
803  if( aCoord[1].x > 0 ) // upper left x coordinate must be <= 0
804  aCoord[1].x = aCoord[2].x = 0;
805 
806  if( aCoord[0].y < 0 ) // lower left y coordinate must be >= 0
807  aCoord[0].y = aCoord[1].y = 0;
808 
809  if( aCoord[3].y < 0 ) // lower right y coordinate must be >= 0
810  aCoord[3].y = aCoord[2].y = 0;
811  }
812 
813  if( aRotation )
814  {
815  for( int ii = 0; ii < 4; ii++ )
816  RotatePoint( &aCoord[ii], aRotation );
817  }
818 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
static const int delta[8][2]
Definition: solve.cpp:112
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void D_PAD::BuildPadShapePolygon ( SHAPE_POLY_SET aCornerBuffer,
wxSize  aInflateValue,
int  aSegmentsPerCircle,
double  aCorrectionFactor 
) const

Function BuildPadShapePolygon Build the Corner list of the polygonal shape, depending on shape, extra size (clearance ...) pad and orientation This function is similar to TransformShapeWithClearanceToPolygon, but the difference is BuildPadShapePolygon creates a polygon shape exactly similar to pad shape, which a size inflated by aInflateValue and TransformShapeWithClearanceToPolygon creates a more complex shape (for instance a rectangular pad is converted in a rectangulr shape with ronded corners)

Parameters
aCornerBuffer= a buffer to fill.
aInflateValue= the clearance or margin value. value > 0: inflate, < 0 deflate, = 0 : no change the clearance can have different values for x and y directions (relative to the pad)
aSegmentsPerCircle= number of segments to approximate a circle (used for round and oblong shapes only (16 to 32 is a good value)
aCorrectionFactor= the correction to apply to circles radius to keep the pad size/clearance when the arcs are approximated by segments

Definition at line 721 of file board_items_to_polygon_shape_transform.cpp.

References SHAPE_POLY_SET::Append(), BuildPadPolygon(), GetShape(), m_Orient, SHAPE_POLY_SET::NewOutline(), PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, ShapePos(), and TransformShapeWithClearanceToPolygon().

Referenced by CINFO3D_VISU::buildPadShapeThickOutlineAsSegments(), PNS_KICAD_IFACE::syncPad(), and MODULE::TransformPadsShapesWithClearanceToPolygon().

724 {
725  wxPoint corners[4];
726  wxPoint padShapePos = ShapePos(); /* Note: for pad having a shape offset,
727  * the pad position is NOT the shape position */
728  switch( GetShape() )
729  {
730  case PAD_SHAPE_CIRCLE:
731  case PAD_SHAPE_OVAL:
732  case PAD_SHAPE_ROUNDRECT:
733  TransformShapeWithClearanceToPolygon( aCornerBuffer, aInflateValue.x,
734  aSegmentsPerCircle, aCorrectionFactor );
735  break;
736 
737  case PAD_SHAPE_TRAPEZOID:
738  case PAD_SHAPE_RECT:
739  aCornerBuffer.NewOutline();
740 
741  BuildPadPolygon( corners, aInflateValue, m_Orient );
742  for( int ii = 0; ii < 4; ii++ )
743  {
744  corners[ii] += padShapePos; // Shift origin to position
745  aCornerBuffer.Append( corners[ii].x, corners[ii].y );
746  }
747 
748  break;
749  }
750 }
void BuildPadPolygon(wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Co...
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor) const
Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon Used in filli...
int NewOutline()
Creates a new empty polygon in the set and returns its index
wxPoint ShapePos() const
Definition: class_pad.cpp:367
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
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) ...
int D_PAD::BuildSegmentFromOvalShape ( wxPoint aSegStart,
wxPoint aSegEnd,
double  aRotation,
const wxSize &  aMargin 
) const

Function BuildSegmentFromOvalShape Has meaning only for OVAL (and ROUND) pads Build an equivalent segment having the same shape as the OVAL shape, Useful in draw function and in DRC and HitTest functions, because segments are already well handled by track tests.

Function BuildSegmentFromOvalShape Has meaning only for OVAL (and ROUND) pads.

Parameters
aSegStart= the starting point of the equivalent segment relative to the shape position.
aSegEnd= the ending point of the equivalent segment, relative to the shape position
aRotation= full rotation of the segment
aRotation= full rotation of the segment
aMargin= a margin around the shape (for instance mask margin)
Returns
the width of the segment

Build an equivalent segment having the same shape as the OVAL shape, aSegStart and aSegEnd are the ending points of the equivalent segment of the shape aRotation is the asked rotation of the segment (usually m_Orient)

Definition at line 643 of file class_pad_draw_functions.cpp.

References delta, m_Size, RotatePoint(), wxPoint::x, and wxPoint::y.

Referenced by DrawShape(), and PNS_KICAD_IFACE::syncPad().

645 {
646  int width;
647 
648  if( m_Size.y < m_Size.x ) // Build an horizontal equiv segment
649  {
650  int delta = ( m_Size.x - m_Size.y ) / 2;
651  aSegStart.x = -delta - aMargin.x;
652  aSegStart.y = 0;
653  aSegEnd.x = delta + aMargin.x;
654  aSegEnd.y = 0;
655  width = m_Size.y + ( aMargin.y * 2 );
656  }
657  else // Vertical oval: build a vertical equiv segment
658  {
659  int delta = ( m_Size.y -m_Size.x ) / 2;
660  aSegStart.x = 0;
661  aSegStart.y = -delta - aMargin.y;
662  aSegEnd.x = 0;
663  aSegEnd.y = delta + aMargin.y;
664  width = m_Size.x + ( aMargin.x * 2 );
665  }
666 
667  if( aRotation )
668  {
669  RotatePoint( &aSegStart, aRotation);
670  RotatePoint( &aSegEnd, aRotation);
671  }
672 
673  return width;
674 }
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
static const int delta[8][2]
Definition: solve.cpp:112
static bool D_PAD::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 101 of file class_pad.h.

References PCB_PAD_T, and EDA_ITEM::Type().

102  {
103  return aItem && PCB_PAD_T == aItem->Type();
104  }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
class D_PAD, a pad in a footprint
Definition: typeinfo.h:102
void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 233 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by SELECTION_TOOL::disambiguationMenu().

233 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 254 of file base_struct.h.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), abortMoveBitmap(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToList(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::AppendBoardFile(), SCH_EDIT_FRAME::AppendOneEEProject(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_PART::CopySelectedItems(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), LIB_PART::DeleteSelectedItems(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Zone(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MarkItemsInBloc(), MirrorX(), MirrorY(), moveBitmap(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnRotateItem(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), LIB_PIN::Save(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

254 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 232 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

232 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
void EDA_ITEM::ClearSelected ( )
inlineinherited

Definition at line 231 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and SELECTED.

Referenced by POINT_EDITOR::addCorner(), GAL_ARRAY_CREATOR::prePushAction(), SELECTION_TOOL::unselectVisually(), and PCB_EDITOR_CONTROL::ZoneDuplicate().

231 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:120
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
EDA_ITEM * D_PAD::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 922 of file class_pad.cpp.

References D_PAD().

Referenced by Duplicate().

923 {
924  return new D_PAD( *this );
925 }
D_PAD(MODULE *parent)
Definition: class_pad.cpp:60
int D_PAD::Compare ( const D_PAD padref,
const D_PAD padcmp 
)
static

Function Compare compares two pads and return 0 if they are equal.

Returns
int - <0 if left less than right, 0 if equal, >0 if left greater than right.

Definition at line 780 of file class_pad.cpp.

References GetDrillShape(), GetShape(), m_DeltaSize, m_Drill, m_layerMask, m_Offset, m_Size, wxPoint::x, and wxPoint::y.

Referenced by CreatePadsShapesSection(), and PadListSortByShape().

781 {
782  int diff;
783 
784  if( ( diff = padref->GetShape() - padcmp->GetShape() ) != 0 )
785  return diff;
786 
787  if( ( diff = padref->GetDrillShape() - padcmp->GetDrillShape() ) != 0)
788  return diff;
789 
790  if( ( diff = padref->m_Drill.x - padcmp->m_Drill.x ) != 0 )
791  return diff;
792 
793  if( ( diff = padref->m_Drill.y - padcmp->m_Drill.y ) != 0 )
794  return diff;
795 
796  if( ( diff = padref->m_Size.x - padcmp->m_Size.x ) != 0 )
797  return diff;
798 
799  if( ( diff = padref->m_Size.y - padcmp->m_Size.y ) != 0 )
800  return diff;
801 
802  if( ( diff = padref->m_Offset.x - padcmp->m_Offset.x ) != 0 )
803  return diff;
804 
805  if( ( diff = padref->m_Offset.y - padcmp->m_Offset.y ) != 0 )
806  return diff;
807 
808  if( ( diff = padref->m_DeltaSize.x - padcmp->m_DeltaSize.x ) != 0 )
809  return diff;
810 
811  if( ( diff = padref->m_DeltaSize.y - padcmp->m_DeltaSize.y ) != 0 )
812  return diff;
813 
814 // TODO: test custom shapes
815 
816  // Dick: specctra_export needs this
817  // Lorenzo: gencad also needs it to implement padstacks!
818 
819 #if __cplusplus >= 201103L
820  long long d = padref->m_layerMask.to_ullong() - padcmp->m_layerMask.to_ullong();
821  if( d < 0 )
822  return -1;
823  else if( d > 0 )
824  return 1;
825 
826  return 0;
827 #else
828  // these strings are not typically constructed, since we don't get here often.
829  std::string s1 = padref->m_layerMask.to_string();
830  std::string s2 = padcmp->m_layerMask.to_string();
831  return s1.compare( s2 );
832 #endif
833 }
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:221
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
wxPoint m_Offset
m_Offset is useful only for oblong and rect pads (it can be used for other shapes, but without any interest).
Definition: class_pad.h:639
LSET D_PAD::ConnSMDMask ( )
static

layer set for a SMD pad on Front layer used for edge board connectors

Definition at line 111 of file class_pad.cpp.

References F_Cu, and F_Mask.

112 {
113  static LSET saved( 2, F_Cu, F_Mask );
114  return saved;
115 }
Class LSET is a set of PCB_LAYER_IDs.
void D_PAD::CopyNetlistSettings ( D_PAD aPad,
bool  aCopyLocalSettings 
)

Function CopyNetlistSettings copies the netlist settings to aPad, and the net name.

Used to copy some pad parameters when replacing a footprint by an other footprint when reading a netlist, or in exchange footprint dialog

The netlist settings are all of the D_PAD settings not define by a D_PAD in a netlist. The copied settings are the net name and optionally include local clearance, etc. The pad physical geometry settings are not copied.

Parameters
aPadis the D_PAD to copy the settings to.
aCopyLocalSettings= false to copy only the net name true to also copy local prms

Definition at line 435 of file class_pad.cpp.

References BOARD_CONNECTED_ITEM::GetNetCode(), m_LocalClearance, m_LocalSolderMaskMargin, m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_ThermalGap, m_ThermalWidth, m_ZoneConnection, SetLocalClearance(), SetLocalSolderMaskMargin(), SetLocalSolderPasteMargin(), SetLocalSolderPasteMarginRatio(), BOARD_CONNECTED_ITEM::SetNetCode(), SetThermalGap(), SetThermalWidth(), and SetZoneConnection().

Referenced by MODULE::CopyNetlistSettings().

436 {
437  // Don't do anything foolish like trying to copy to yourself.
438  wxCHECK_RET( aPad != NULL && aPad != this, wxT( "Cannot copy to NULL or yourself." ) );
439 
440  aPad->SetNetCode( GetNetCode() );
441 
442  if( aCopyLocalSettings )
443  {
450  aPad->SetThermalGap( m_ThermalGap );
451  }
452 }
int m_LocalClearance
Local clearance.
Definition: class_pad.h:659
int m_ThermalGap
Definition: class_pad.h:672
int m_LocalSolderMaskMargin
Local mask margins: when 0, the parent footprint design values are used.
Definition: class_pad.h:663
int m_LocalSolderPasteMargin
Local solder paste margin absolute value.
Definition: class_pad.h:664
void SetZoneConnection(ZoneConnection aType)
Definition: class_pad.h:309
void SetThermalWidth(int aWidth)
Definition: class_pad.h:312
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
int m_ThermalWidth
Definition: class_pad.h:671
void SetLocalClearance(int aClearance)
Definition: class_pad.h:247
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_pad.h:253
int GetNetCode() const
Function GetNetCode.
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_pad.h:244
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_pad.h:250
double m_LocalSolderPasteMarginRatio
Local solder mask margin ratio value of pad size The final margin is the sum of these 2 values...
Definition: class_pad.h:666
void SetThermalGap(int aGap)
Definition: class_pad.h:315
ZoneConnection m_ZoneConnection
how the connection to zone is made: no connection, thermal relief ...
Definition: class_pad.h:669
void BOARD_ITEM::DeleteStructure ( )
inherited
void D_PAD::Draw ( EDA_DRAW_PANEL panel,
wxDC *  DC,
GR_DRAWMODE  aDrawMode,
const wxPoint offset = ZeroOffset 
)
overridevirtual

Function Draw BOARD_ITEMs have their own color information.

Implements BOARD_ITEM.

Definition at line 75 of file class_pad_draw_functions.cpp.

References KIGFX::COLOR4D::a, LSET::AllCuMask(), B_Cu, B_Mask, B_Paste, LSET::BackMask(), BLACK, color, DARKDARKGRAY, DARKGRAY, DO_NOT_DRAW, DrawShape(), LSET::ExtractLayer(), F_Cu, F_Mask, F_Paste, LSET::FrontMask(), GetAttribute(), BOARD_ITEM::GetBoard(), GetClearance(), EDA_DRAW_PANEL::GetClipBox(), PCB_BASE_FRAME::GetDisplayOptions(), BOARD::GetLayerColor(), EDA_DRAW_PANEL::GetParent(), PCB_BASE_FRAME::GetScreen(), GetSolderMaskMargin(), GetSolderPasteMargin(), EDA_DRAW_FRAME::GetToolId(), BOARD::GetVisibleElementColor(), BOARD::GetVisibleLayers(), GR_ALLOW_HIGHCONTRAST, GR_AND, GR_HIGHLIGHT, ID_TRACK_BUTT, IsCopperLayer(), BOARD::IsElementVisible(), IsOnLayer(), LAYER_NO_CONNECTS, LAYER_NON_PLATED, LAYER_PAD_BK, LAYER_PAD_FR, PCB_SCREEN::m_Active_Layer, PAD_DRAWINFO::m_Color, DISPLAY_OPTIONS::m_ContrastModeDisplay, PAD_DRAWINFO::m_Display_netname, PAD_DRAWINFO::m_Display_padnum, DISPLAY_OPTIONS::m_DisplayNetNamesMode, DISPLAY_OPTIONS::m_DisplayPadFill, DISPLAY_OPTIONS::m_DisplayPadIsol, DISPLAY_OPTIONS::m_DisplayPadNum, PAD_DRAWINFO::m_DrawMode, PAD_DRAWINFO::m_DrawPanel, EDA_ITEM::m_Flags, PAD_DRAWINFO::m_IsPrinting, BASE_SCREEN::m_IsPrinting, m_layerMask, PAD_DRAWINFO::m_Mask_margin, PAD_DRAWINFO::m_NPHoleColor, PAD_DRAWINFO::m_Offset, PAD_DRAWINFO::m_PadClearance, PCB_SCREEN::m_Route_Layer_BOTTOM, PCB_SCREEN::m_Route_Layer_TOP, PAD_DRAWINFO::m_ShowNCMark, PAD_DRAWINFO::m_ShowNotPlatedHole, PAD_DRAWINFO::m_ShowPadFilled, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, SKETCH, UNDEFINED_LAYER, and UNSELECTED_LAYER.

Referenced by Abort_Move_Pad(), DrawMovingBlockOutlines(), MODULE::DrawOutlinesWhenMoving(), PCB_EDIT_FRAME::HighlightUnconnectedPads(), PCB_BASE_FRAME::PlacePad(), Show_Pad_Move(), PCB_EDIT_FRAME::Solve(), and PCB_BASE_FRAME::StartMovePad().

77 {
78  wxSize mask_margin; // margin (clearance) used for some non copper layers
79 
80 #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
81  int showActualMaskSize = 0; /* Layer number if the actual pad size on mask layer can
82  * be displayed i.e. if only one layer is shown for this pad
83  * and this layer is a mask (solder mask or solder paste
84  */
85 #endif
86 
87  if( m_Flags & DO_NOT_DRAW )
88  return;
89 
90  PAD_DRAWINFO drawInfo;
91 
92  drawInfo.m_Offset = aOffset;
93 
94  /* We can show/hide pads from the layer manager.
95  * options are show/hide pads on front and/or back side of the board
96  * For through pads, we hide them only if both sides are hidden.
97  * smd pads on back are hidden for all layers (copper and technical layers)
98  * on back side of the board
99  * smd pads on front are hidden for all layers (copper and technical layers)
100  * on front side of the board
101  * ECO, edge and Draw layers and not considered
102  */
103 
104  BOARD* brd = GetBoard();
105  bool frontVisible = brd->IsElementVisible( LAYER_PAD_FR );
106  bool backVisible = brd->IsElementVisible( LAYER_PAD_BK );
107 
108  if( !frontVisible && !backVisible )
109  return;
110 
111  // If pad is only on front side (no layer on back side)
112  // and if hide front side pads is enabled, do not draw
113  if( !frontVisible && !( m_layerMask & LSET::BackMask() ).any() )
114  return;
115 
116  // If pad is only on back side (no layer on front side)
117  // and if hide back side pads is enabled, do not draw
118  if( !backVisible && !( m_layerMask & LSET::FrontMask() ).any() )
119  return;
120 
121  PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent();
122 
123  wxCHECK_RET( frame != NULL, wxT( "Panel has no parent frame window." ) );
124 
125  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
126  PCB_SCREEN* screen = frame->GetScreen();
127 
128  if( displ_opts && displ_opts->m_DisplayPadFill == SKETCH )
129  drawInfo.m_ShowPadFilled = false;
130  else
131  drawInfo.m_ShowPadFilled = true;
132 
134 
135  if( m_layerMask[F_Cu] )
136  {
137  color = brd->GetVisibleElementColor( LAYER_PAD_FR );
138  }
139 
140  if( m_layerMask[B_Cu] )
141  {
142  color = color.LegacyMix( brd->GetVisibleElementColor( LAYER_PAD_BK ) );
143  }
144 
145  if( color == BLACK ) // Not on a visible copper layer (i.e. still nothing to show)
146  {
147  // If the pad is on only one tech layer, use the layer color else use DARKGRAY
148  LSET mask_non_copper_layers = m_layerMask & ~LSET::AllCuMask();
149 
150 #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
151  mask_non_copper_layers &= brd->GetVisibleLayers();
152 #endif
153  PCB_LAYER_ID pad_layer = mask_non_copper_layers.ExtractLayer();
154 
155  switch( (int) pad_layer )
156  {
157  case UNDEFINED_LAYER: // More than one layer
158  color = DARKGRAY;
159  break;
160 
161  case UNSELECTED_LAYER: // Shouldn't really happen...
162  break;
163 
164  default:
165  color = brd->GetLayerColor( pad_layer );
166 #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
167  showActualMaskSize = pad_layer;
168 #endif
169  }
170  }
171 
172  // if SMD or connector pad and high contrast mode
173  if( ( aDraw_mode & GR_ALLOW_HIGHCONTRAST ) &&
175  displ_opts && displ_opts->m_ContrastModeDisplay )
176  {
177  // when routing tracks
178  if( frame->GetToolId() == ID_TRACK_BUTT )
179  {
180  PCB_LAYER_ID routeTop = screen->m_Route_Layer_TOP;
181  PCB_LAYER_ID routeBot = screen->m_Route_Layer_BOTTOM;
182 
183  // if routing between copper and component layers,
184  // or the current layer is one of said 2 external copper layers,
185  // then highlight only the current layer.
186  if( ( screen->m_Active_Layer == F_Cu || screen->m_Active_Layer == B_Cu ) ||
187  ( routeTop==F_Cu && routeBot==B_Cu ) ||
188  ( routeTop==B_Cu && routeBot==F_Cu )
189  )
190  {
191  if( !IsOnLayer( screen->m_Active_Layer ) )
192  color = COLOR4D( DARKDARKGRAY );
193  }
194  // else routing between an internal signal layer and some other
195  // layer. Grey out all PAD_ATTRIB_SMD pads not on current or the single
196  // selected external layer.
197  else if( !IsOnLayer( screen->m_Active_Layer )
198  && !IsOnLayer( routeTop )
199  && !IsOnLayer( routeBot ) )
200  {
201  color = COLOR4D( DARKDARKGRAY );
202  }
203  }
204  // when not edting tracks, show PAD_ATTRIB_SMD components not on active layer
205  // as greyed out
206  else
207  {
208  if( !IsOnLayer( screen->m_Active_Layer ) )
209  color = COLOR4D( DARKDARKGRAY );
210  }
211  }
212 
213 #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
214  if( showActualMaskSize )
215  {
216  switch( showActualMaskSize )
217  {
218  case B_Mask:
219  case F_Mask:
220  mask_margin.x = mask_margin.y = GetSolderMaskMargin();
221  break;
222 
223  case B_Paste:
224  case F_Paste:
225  mask_margin = GetSolderPasteMargin();
226  break;
227 
228  default:
229  // Another layer which has no margin to handle
230  break;
231  }
232  }
233 #endif
234 
235  // if Contrast mode is ON and a technical layer active, show pads on this
236  // layer so we can see pads on paste or solder layer and the size of the
237  // mask
238  if( ( aDraw_mode & GR_ALLOW_HIGHCONTRAST ) &&
239  displ_opts && displ_opts->m_ContrastModeDisplay && !IsCopperLayer( screen->m_Active_Layer ) )
240  {
241  if( IsOnLayer( screen->m_Active_Layer ) )
242  {
243  color = brd->GetLayerColor( screen->m_Active_Layer );
244 
245  // In high contrast mode, and if the active layer is the mask
246  // layer shows the pad size with the mask clearance
247  switch( screen->m_Active_Layer )
248  {
249  case B_Mask:
250  case F_Mask:
251  mask_margin.x = mask_margin.y = GetSolderMaskMargin();
252  break;
253 
254  case B_Paste:
255  case F_Paste:
256  mask_margin = GetSolderPasteMargin();
257  break;
258 
259  default:
260  break;
261  }
262  }
263  else
264  color = DARKDARKGRAY;
265  }
266 
267  if( ( aDraw_mode & GR_HIGHLIGHT ) && !( aDraw_mode & GR_AND ) )
268  color.SetToLegacyHighlightColor();
269 
270  bool DisplayIsol = displ_opts && displ_opts->m_DisplayPadIsol;
271 
272  if( !( m_layerMask & LSET::AllCuMask() ).any() )
273  DisplayIsol = false;
274 
277  {
278  drawInfo.m_ShowNotPlatedHole = true;
280  }
281 
282  drawInfo.m_DrawMode = aDraw_mode;
283  drawInfo.m_Color = color;
284  drawInfo.m_DrawPanel = aPanel;
285  drawInfo.m_Mask_margin = mask_margin;
287  drawInfo.m_IsPrinting = screen->m_IsPrinting;
288  color.a = 0.666;
289 
290  /* Get the pad clearance. This has a meaning only for Pcbnew.
291  * for CvPcb GetClearance() creates debug errors because
292  * there is no net classes so a call to GetClearance() is made only when
293  * needed (never needed in CvPcb)
294  */
295  drawInfo.m_PadClearance = DisplayIsol ? GetClearance() : 0;
296 
297  // Draw the pad number
298  if( displ_opts && !displ_opts->m_DisplayPadNum )
299  drawInfo.m_Display_padnum = false;
300 
301  if( displ_opts &&
302  (( displ_opts ->m_DisplayNetNamesMode == 0 ) || ( displ_opts->m_DisplayNetNamesMode == 2 )) )
303  drawInfo.m_Display_netname = false;
304 
305  // Display net names is restricted to pads that are on the active layer
306  // in high contrast mode display
307  if( ( aDraw_mode & GR_ALLOW_HIGHCONTRAST ) &&
308  !IsOnLayer( screen->m_Active_Layer ) && displ_opts && displ_opts->m_ContrastModeDisplay )
309  drawInfo.m_Display_netname = false;
310 
311  DrawShape( aPanel->GetClipBox(), aDC, drawInfo );
312 }
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:639
COLOR4D GetLayerColor(PCB_LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
show a marker on pads with no nets
bool IsElementVisible(GAL_LAYER_ID LAYER_aPCB) const
Function IsElementVisible tests whether a given element category is visible.
bool m_Display_padnum
Definition: class_pad.h:66
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:63
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
COLOR4D GetVisibleElementColor(GAL_LAYER_ID LAYER_aPCB)
Function GetVisibleElementColor returns the color of a pcb visible element.
bool m_ShowNCMark
Definition: class_pad.h:70
PCB_LAYER_ID m_Active_Layer
smd pads, back layer
static LSET FrontMask()
Function FrontMask returns a mask holding all technical layers and the external CU layer on front sid...
Definition: lset.cpp:738
bool m_IsPrinting
Definition: class_pad.h:73
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
Definition: lset.cpp:578
PCB_LAYER_ID
A quick note on layer IDs:
double a
Alpha component.
Definition: color4d.h:284
Class LSET is a set of PCB_LAYER_IDs.
int GetSolderMaskMargin() const
Function GetSolderMaskMargin.
Definition: class_pad.cpp:486
GR_DRAWMODE m_DrawMode
Definition: class_pad.h:59
EDA_DRAW_PANEL * m_DrawPanel
Definition: class_pad.h:58
bool m_ContrastModeDisplay
Definition: pcbstruct.h:85
PCB_LAYER_ID m_Route_Layer_BOTTOM
bool m_ShowNotPlatedHole
Definition: class_pad.h:71
void DrawShape(EDA_RECT *aClipBox, wxDC *aDC, PAD_DRAWINFO &aDrawInfo)
Function DrawShape basic function to draw a pad.
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:60
int m_PadClearance
Definition: class_pad.h:64
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
bool m_DisplayPadFill
Definition: pcbstruct.h:65
bool m_DisplayPadIsol
Definition: pcbstruct.h:68
wxPoint m_Offset
Definition: class_pad.h:74
smd pads, front layer
handle color for not plated holes
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
bool m_DisplayPadNum
Definition: pcbstruct.h:67
int GetToolId() const
Definition: draw_frame.h:406
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
wxSize GetSolderPasteMargin() const
Function GetSolderPasteMargin.
Definition: class_pad.cpp:519
int m_DisplayNetNamesMode
Definition: pcbstruct.h:78
int GetClearance(BOARD_CONNECTED_ITEM *aItem=NULL) const override
Function GetClearance returns the clearance in internal units.
Definition: class_pad.cpp:455
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
static LSET BackMask()
Function BackMask returns a mask holding all technical layers and the external CU layer on back side...
Definition: lset.cpp:745
bool m_ShowPadFilled
Definition: class_pad.h:68
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
COLOR4D m_NPHoleColor
Definition: class_pad.h:63
COLOR4D m_Color
Definition: class_pad.h:60
Definition: colors.h:45
bool m_Display_netname
Definition: class_pad.h:67
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: class_pad.h:479
wxSize m_Mask_margin
Definition: class_pad.h:65
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
PCB_LAYER_ID m_Route_Layer_TOP
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:125
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void D_PAD::DrawShape ( EDA_RECT aClipBox,
wxDC *  aDC,
PAD_DRAWINFO aDrawInfo 
)

Function DrawShape basic function to draw a pad.

This function is used by Draw after calculation of parameters (color, ) final orientation transforms are set. It can also be called to draw a pad on any panel even if this panel is not a EDA_DRAW_PANEL for instance on a wxPanel inside the pad editor.

Definition at line 315 of file class_pad_draw_functions.cpp.

References PNS::angle(), B_Cu, BLACK, BLUE, BuildPadPolygon(), BuildSegmentFromOvalShape(), DrawGraphicHaloText(), F_Cu, EDA_DRAW_PANEL::GetClipBox(), GetDrillShape(), GetGRForceBlackPenState(), BOARD_CONNECTED_ITEM::GetNetCode(), GetOblongDrillGeometry(), GetOrientation(), GetRoundRectCornerCenters(), GetRoundRectCornerRadius(), GetShape(), BOARD_CONNECTED_ITEM::GetShortNetname(), GetSize(), GR_COPY, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_XOR, GRCircle(), GRClosedPoly(), GRCSegm(), GRFillCSegm(), GRFilledCircle(), GRFilledSegment(), GRForceBlackPen(), GRLine(), GRSetDrawMode(), PAD_DRAWINFO::m_Color, PAD_DRAWINFO::m_Display_netname, PAD_DRAWINFO::m_Display_padnum, PAD_DRAWINFO::m_DrawMode, PAD_DRAWINFO::m_DrawPanel, m_Drill, PAD_DRAWINFO::m_HoleColor, PAD_DRAWINFO::m_IsPrinting, m_layerMask, PAD_DRAWINFO::m_Mask_margin, PAD_DRAWINFO::m_NPHoleColor, PAD_DRAWINFO::m_Offset, m_Orient, PAD_DRAWINFO::m_PadClearance, m_PadSketchModePenSize, m_Pos, PAD_DRAWINFO::m_ShowNCMark, PAD_DRAWINFO::m_ShowNotPlatedHole, PAD_DRAWINFO::m_ShowPadFilled, m_Size, max, min, MIN_CHAR_COUNT, MIN_DRAW_WIDTH, MIN_TEXT_SIZE, NORMALIZE_ANGLE_90(), SHAPE_POLY_SET::Outline(), PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, SHAPE_LINE_CHAIN::Point(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_POLY_SET::RemoveAllContours(), RotatePoint(), SEGCOUNT, ShapePos(), StringPadName(), TransformRoundRectToPolygon(), TransformShapeWithClearanceToPolygon(), WHITE, wxPoint::x, and wxPoint::y.

Referenced by Draw(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

316 {
317  wxPoint coord[12];
318  double angle = m_Orient;
319  int seg_width;
320 
321  GRSetDrawMode( aDC, aDrawInfo.m_DrawMode );
322 
323  // calculate pad shape position :
324  wxPoint shape_pos = ShapePos() - aDrawInfo.m_Offset;
325 
326  wxSize halfsize = m_Size;
327  halfsize.x >>= 1;
328  halfsize.y >>= 1;
329 
330  switch( GetShape() )
331  {
332  case PAD_SHAPE_CIRCLE:
333  if( aDrawInfo.m_ShowPadFilled )
334  GRFilledCircle( aClipBox, aDC, shape_pos.x, shape_pos.y,
335  halfsize.x + aDrawInfo.m_Mask_margin.x, 0,
336  aDrawInfo.m_Color, aDrawInfo.m_Color );
337  else
338  GRCircle( aClipBox, aDC, shape_pos.x, shape_pos.y,
339  halfsize.x + aDrawInfo.m_Mask_margin.x,
340  m_PadSketchModePenSize, aDrawInfo.m_Color );
341 
342  if( aDrawInfo.m_PadClearance )
343  {
344  GRCircle( aClipBox,
345  aDC, shape_pos.x, shape_pos.y,
346  halfsize.x + aDrawInfo.m_PadClearance,
347  0, aDrawInfo.m_Color );
348  }
349 
350  break;
351 
352  case PAD_SHAPE_OVAL:
353  {
354  wxPoint segStart, segEnd;
355  seg_width = BuildSegmentFromOvalShape(segStart, segEnd, angle,
356  aDrawInfo.m_Mask_margin);
357  segStart += shape_pos;
358  segEnd += shape_pos;
359 
360  if( aDrawInfo.m_ShowPadFilled )
361  {
362  GRFillCSegm( aClipBox, aDC, segStart.x, segStart.y, segEnd.x, segEnd.y,
363  seg_width, aDrawInfo.m_Color );
364  }
365  else
366  {
367  GRCSegm( aClipBox, aDC, segStart.x, segStart.y, segEnd.x, segEnd.y,
368  seg_width, m_PadSketchModePenSize, aDrawInfo.m_Color );
369  }
370 
371  // Draw the clearance line
372  if( aDrawInfo.m_PadClearance )
373  {
374  seg_width += 2 * aDrawInfo.m_PadClearance;
375  GRCSegm( aClipBox, aDC, segStart.x, segStart.y, segEnd.x, segEnd.y,
376  seg_width, aDrawInfo.m_Color );
377  }
378  }
379  break;
380 
381  case PAD_SHAPE_RECT:
382  case PAD_SHAPE_TRAPEZOID:
383  BuildPadPolygon( coord, aDrawInfo.m_Mask_margin, angle );
384 
385  for( int ii = 0; ii < 4; ii++ )
386  coord[ii] += shape_pos;
387 
388  GRClosedPoly( aClipBox, aDC, 4, coord, aDrawInfo.m_ShowPadFilled,
389  aDrawInfo.m_ShowPadFilled ? 0 : m_PadSketchModePenSize,
390  aDrawInfo.m_Color, aDrawInfo.m_Color );
391 
392  if( aDrawInfo.m_PadClearance )
393  {
394  #define SEGCOUNT 32 // number of segments to approximate a circle
395  SHAPE_POLY_SET outline;
397 
398  // Draw the polygon: Inflate creates only one convex polygon
399  SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
400 
401  GRClosedPoly( aClipBox, aDC, poly.PointCount(),
402  (wxPoint*)&poly.Point( 0 ), false, 0,
403  aDrawInfo.m_Color, aDrawInfo.m_Color );
404  }
405  break;
406 
407  case PAD_SHAPE_ROUNDRECT:
408  {
409  // Use solder[Paste/Mask]size or pad size to build pad shape to draw
410  wxSize size( GetSize() );
411  size += aDrawInfo.m_Mask_margin * 2;
412  int corner_radius = GetRoundRectCornerRadius( size );
413 
414  // Draw the polygon: Inflate creates only one convex polygon
415  SHAPE_POLY_SET outline;
416  bool filled = aDrawInfo.m_ShowPadFilled;
417 
418  if( filled )
419  {
420  wxPoint centers[4];
421  GetRoundRectCornerCenters( centers, corner_radius, shape_pos,
422  size, GetOrientation() );
423  GRClosedPoly( aClipBox, aDC, 4, centers, true, corner_radius*2,
424  aDrawInfo.m_Color, aDrawInfo.m_Color );
425  }
426  else
427  {
428  TransformRoundRectToPolygon( outline, shape_pos, size, GetOrientation(),
429  corner_radius, 64 );
430 
431  SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
432 
433  GRClosedPoly( aClipBox, aDC, poly.PointCount(),
434  (wxPoint*)&poly.Point( 0 ), aDrawInfo.m_ShowPadFilled, 0,
435  aDrawInfo.m_Color, aDrawInfo.m_Color );
436  }
437 
438  if( aDrawInfo.m_PadClearance )
439  {
440  outline.RemoveAllContours();
441  size = GetSize();
442  size.x += aDrawInfo.m_PadClearance * 2;
443  size.y += aDrawInfo.m_PadClearance * 2;
444  corner_radius = GetRoundRectCornerRadius() + aDrawInfo.m_PadClearance;
445 
446  TransformRoundRectToPolygon( outline, shape_pos, size, GetOrientation(),
447  corner_radius, 32 );
448 
449  // Draw the polygon: Inflate creates only one convex polygon
450  SHAPE_LINE_CHAIN& clearance_poly = outline.Outline( 0 );
451 
452  GRClosedPoly( aClipBox, aDC, clearance_poly.PointCount(),
453  (wxPoint*)&clearance_poly.Point( 0 ), false, 0,
454  aDrawInfo.m_Color, aDrawInfo.m_Color );
455  }
456  }
457  break;
458 
459  default:
460  break;
461  }
462 
463  // Draw the pad hole
464  wxPoint holepos = m_Pos - aDrawInfo.m_Offset;
465  int hole = m_Drill.x >> 1;
466 
467  bool drawhole = hole > 0;
468 
469  if( !aDrawInfo.m_ShowPadFilled && !aDrawInfo.m_ShowNotPlatedHole )
470  drawhole = false;
471 
472  if( drawhole )
473  {
474  bool blackpenstate = false;
475 
476  if( aDrawInfo.m_IsPrinting )
477  {
478  blackpenstate = GetGRForceBlackPenState();
479  GRForceBlackPen( false );
480  aDrawInfo.m_HoleColor = WHITE;
481  aDrawInfo.m_NPHoleColor = WHITE;
482  }
483  else
484  {
485  GRSetDrawMode( aDC, ( aDrawInfo.m_DrawMode != GR_XOR ) ? GR_COPY : GR_XOR );
486  }
487 
488  COLOR4D hole_color = aDrawInfo.m_HoleColor;
489 
490  if( aDrawInfo. m_ShowNotPlatedHole ) // Draw a specific hole color
491  hole_color = aDrawInfo.m_NPHoleColor;
492 
493  switch( GetDrillShape() )
494  {
496  if( aDC->LogicalToDeviceXRel( hole ) > MIN_DRAW_WIDTH )
497  GRFilledCircle( aClipBox, aDC, holepos.x, holepos.y, hole, 0,
498  hole_color, hole_color );
499  break;
500 
502  {
503  wxPoint drl_start, drl_end;
504  GetOblongDrillGeometry( drl_start, drl_end, seg_width );
505  GRFilledSegment( aClipBox, aDC, holepos + drl_start,
506  holepos + drl_end, seg_width, hole_color );
507  }
508  break;
509 
510  default:
511  break;
512  }
513 
514  if( aDrawInfo.m_IsPrinting )
515  GRForceBlackPen( blackpenstate );
516  }
517 
518  GRSetDrawMode( aDC, aDrawInfo.m_DrawMode );
519 
520  // Draw "No connect" ( / or \ or cross X ) if necessary
521  if( GetNetCode() == 0 && aDrawInfo.m_ShowNCMark )
522  {
523  int dx0 = std::min( halfsize.x, halfsize.y );
524  COLOR4D nc_color = COLOR4D( BLUE );
525 
526  if( m_layerMask[F_Cu] ) /* Draw \ */
527  GRLine( aClipBox, aDC, holepos.x - dx0, holepos.y - dx0,
528  holepos.x + dx0, holepos.y + dx0, 0, nc_color );
529 
530  if( m_layerMask[B_Cu] ) // Draw /
531  GRLine( aClipBox, aDC, holepos.x + dx0, holepos.y - dx0,
532  holepos.x - dx0, holepos.y + dx0, 0, nc_color );
533  }
534 
535  if( !aDrawInfo.m_IsPrinting )
536  GRSetDrawMode( aDC, ( aDrawInfo.m_DrawMode != GR_XOR ) ? GR_COPY : GR_XOR );
537 
538  // Draw the pad number
539  if( !aDrawInfo.m_Display_padnum && !aDrawInfo.m_Display_netname )
540  return;
541 
542  wxPoint tpos0 = shape_pos; // Position of the centre of text
543  wxPoint tpos = tpos0;
544  wxSize AreaSize; // size of text area, normalized to AreaSize.y < AreaSize.x
545  int shortname_len = 0;
546 
547  if( aDrawInfo.m_Display_netname )
548  shortname_len = GetShortNetname().Len();
549 
550  if( GetShape() == PAD_SHAPE_CIRCLE )
551  angle = 0;
552 
553  AreaSize = m_Size;
554 
555  if( m_Size.y > m_Size.x )
556  {
557  angle += 900;
558  AreaSize.x = m_Size.y;
559  AreaSize.y = m_Size.x;
560  }
561 
562  if( shortname_len > 0 ) // if there is a netname, provides room to display this netname
563  {
564  AreaSize.y /= 2; // Text used only the upper area of the
565  // pad. The lower area displays the net name
566  tpos.y -= AreaSize.y / 2;
567  }
568 
569  // Calculate the position of text, that is the middle point of the upper
570  // area of the pad
571  RotatePoint( &tpos, shape_pos, angle );
572 
573  // Draw text with an angle between -90 deg and + 90 deg
574  double t_angle = angle;
575  NORMALIZE_ANGLE_90( t_angle );
576 
577  /* Note: in next calculations, texte size is calculated for 3 or more
578  * chars. Of course, pads numbers and nets names can have less than 3
579  * chars. but after some tries, i found this is gives the best look
580  */
581  #define MIN_CHAR_COUNT 3
582  wxString buffer;
583 
584  int tsize;
585  EDA_RECT* clipBox = aDrawInfo.m_DrawPanel?
586  aDrawInfo.m_DrawPanel->GetClipBox() : NULL;
587 
588  if( aDrawInfo.m_Display_padnum )
589  {
590  StringPadName( buffer );
591  int numpad_len = buffer.Len();
592  numpad_len = std::max( numpad_len, MIN_CHAR_COUNT );
593 
594  tsize = std::min( AreaSize.y, AreaSize.x / numpad_len );
595 
596  if( aDC->LogicalToDeviceXRel( tsize ) >= MIN_TEXT_SIZE ) // Not drawable when size too small.
597  {
598  // tsize reserve room for marges and segments thickness
599  tsize = ( tsize * 7 ) / 10;
600  DrawGraphicHaloText( clipBox, aDC, tpos,
601  aDrawInfo.m_Color, BLACK, WHITE,
602  buffer, t_angle,
603  wxSize( tsize , tsize ), GR_TEXT_HJUSTIFY_CENTER,
604  GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false );
605 
606  }
607  }
608 
609  // display the short netname, if exists
610  if( shortname_len == 0 )
611  return;
612 
613  shortname_len = std::max( shortname_len, MIN_CHAR_COUNT );
614  tsize = std::min( AreaSize.y, AreaSize.x / shortname_len );
615 
616  if( aDC->LogicalToDeviceXRel( tsize ) >= MIN_TEXT_SIZE ) // Not drawable in size too small.
617  {
618  tpos = tpos0;
619 
620  if( aDrawInfo.m_Display_padnum )
621  tpos.y += AreaSize.y / 2;
622 
623  RotatePoint( &tpos, shape_pos, angle );
624 
625  // tsize reserve room for marges and segments thickness
626  tsize = ( tsize * 7 ) / 10;
627  DrawGraphicHaloText( clipBox, aDC, tpos,
628  aDrawInfo.m_Color, BLACK, WHITE,
629  GetShortNetname(), t_angle,
630  wxSize( tsize, tsize ), GR_TEXT_HJUSTIFY_CENTER,
631  GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false );
632  }
633 }
Definition: colors.h:57
void DrawGraphicHaloText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, const COLOR4D aBgColor, COLOR4D aColor1, COLOR4D aColor2, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf), PLOTTER *aPlotter)
Draw graphic text with a border, so that it can be read on different backgrounds. ...
Definition: drawtxt.cpp:176
static int m_PadSketchModePenSize
Pen size used to draw pads in sketch mode (mode used to print pads on silkscreen layer) ...
Definition: class_pad.h:83
#define MIN_CHAR_COUNT
bool m_Display_padnum
Definition: class_pad.h:66
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:290
void BuildPadPolygon(wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Co...
int PointCount() const
Function PointCount()
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:352
void TransformRoundRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, int aCircleToSegmentsCount)
Function TransformRoundRectToPolygon convert a rectangle with rounded corners to a polygon Convert ar...
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:351
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
#define SEGCOUNT
#define MIN_DRAW_WIDTH
Minimum trace drawing width in pixels.
Definition: pcbnew.h:65
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
Definition: gr_basic.cpp:481
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:221
bool m_ShowNCMark
Definition: class_pad.h:70
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:833
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
void NORMALIZE_ANGLE_90(T &Angle)
Definition: trigo.h:277
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, COLOR4D Color, COLOR4D BgColor)
Function GRClosedPoly draws a closed polygon onto the drawing context aDC and optionally fills and/or...
Definition: gr_basic.cpp:777
bool m_IsPrinting
Definition: class_pad.h:73
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor) const
Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon Used in filli...
#define MIN_TEXT_SIZE
Definition: drawtxt.h:43
void GRForceBlackPen(bool flagforce)
Function GRForceBlackPen.
Definition: gr_basic.cpp:271
Class SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
void GRFillCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:584
GR_DRAWMODE m_DrawMode
Definition: class_pad.h:59
EDA_DRAW_PANEL * m_DrawPanel
Definition: class_pad.h:58
COLOR4D m_HoleColor
Definition: class_pad.h:62
const wxSize & GetSize() const
Definition: class_pad.h:182
EDA_RECT * GetClipBox()
bool m_ShowNotPlatedHole
Definition: class_pad.h:71
int m_PadClearance
Definition: class_pad.h:64
int GetNetCode() const
Function GetNetCode.
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
int BuildSegmentFromOvalShape(wxPoint &aSegStart, wxPoint &aSegEnd, double aRotation, const wxSize &aMargin) const
Function BuildSegmentFromOvalShape Has meaning only for OVAL (and ROUND) pads Build an equivalent seg...
wxPoint m_Offset
Definition: class_pad.h:74
void GetOblongDrillGeometry(wxPoint &aStartPoint, wxPoint &aEndPoint, int &aWidth) const
Function GetOblongDrillGeometry calculates the start point, end point and width of an equivalent segm...
Definition: class_pad.cpp:667
#define max(a, b)
Definition: auxiliary.h:86
Class SHAPE_LINE_CHAIN.
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
Definition: gr_basic.cpp:592
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:791
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:214
Class EDA_RECT handles the component boundary box.
void GetRoundRectCornerCenters(wxPoint aCenters[4], int aRadius, const wxPoint &aPosition, const wxSize &aSize, double aRotation)
Helper function GetRoundRectCornerCenters Has meaning only for rounded rect Returns the centers of th...
Definition: colors.h:49
wxPoint ShapePos() const
Definition: class_pad.cpp:367
bool m_ShowPadFilled
Definition: class_pad.h:68
COLOR4D m_NPHoleColor
Definition: class_pad.h:63
COLOR4D m_Color
Definition: class_pad.h:60
VECTOR2I & Point(int aIndex)
Function Point()
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
Definition: colors.h:45
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
void StringPadName(wxString &text) const
Definition: class_pad.cpp:391
bool m_Display_netname
Definition: class_pad.h:67
bool GetGRForceBlackPenState(void)
Function GetGRForceBlackPenState.
Definition: gr_basic.cpp:281
wxSize m_Mask_margin
Definition: class_pad.h:65
#define min(a, b)
Definition: auxiliary.h:85
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
const wxString & GetShortNetname() const
Function GetShortNetname.
D_PAD* D_PAD::Duplicate ( ) const
inline

same as Clone, but returns a D_PAD item.

Useful mainly for pythons scripts, because Clone (virtual function) returns an EDA_ITEM.

Definition at line 546 of file class_pad.h.

References Clone().

547  {
548  return (D_PAD*) Clone();
549  }
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_pad.cpp:922
void D_PAD::Flip ( const wxPoint aCentre)
overridevirtual

Function Flip Flip this object, i.e.

change the board side for this object

Parameters
aCentre- the rotation point.

Reimplemented from BOARD_ITEM.

Definition at line 313 of file class_pad.cpp.

References FlipLayerMask(), GetOrientation(), GetPosition(), m_DeltaSize, m_layerMask, m_Offset, m_Pos0, MIRROR(), SetLayerSet(), SetOrientation(), SetY(), and wxPoint::y.

Referenced by MODULE_EDITOR_TOOLS::PlacePad().

314 {
315  int y = GetPosition().y;
316  MIRROR( y, aCentre.y ); // invert about x axis.
317  SetY( y );
318 
319  MIRROR( m_Pos0.y, 0 );
320  MIRROR( m_Offset.y, 0 );
321  MIRROR( m_DeltaSize.y, 0 );
322 
324 
325  // flip pads layers
326  // PADS items are currently on all copper layers, or
327  // currently, only on Front or Back layers.
328  // So the copper layers count is not taken in account
330 
331  // m_boundingRadius = -1; the shape has not been changed
332 }
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask, paste, solder layers are swapped internal layers are flipped only if the copper layers count is known.
Definition: lset.cpp:491
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:111
const wxPoint & GetPosition() const override
Definition: class_pad.h:170
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:234
void SetY(int y)
Definition: class_pad.h:172
wxPoint m_Pos0
Initial Pad position (i.e.
Definition: class_pad.h:647
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:214
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:306
wxPoint m_Offset
m_Offset is useful only for oblong and rect pads (it can be used for other shapes, but without any interest).
Definition: class_pad.h:639
std::string BOARD_ITEM::FormatAngle ( double  aAngle)
staticinherited

Function FormatAngle converts aAngle from board units to a string appropriate for writing to file.

Note
Internal angles for board items can be either degrees or tenths of degree on how KiCad is built.
Parameters
aAngleA angle value to convert.
Returns
A std::string object containing the converted angle.

Definition at line 170 of file class_board_item.cpp.

171 {
172  char temp[50];
173 
174  int len = snprintf( temp, sizeof(temp), "%.10g", aAngle / 10.0 );
175 
176  return std::string( temp, len );
177 }
std::string BOARD_ITEM::FormatInternalUnits ( int  aValue)
staticinherited

Function FormatInternalUnits converts aValue from board internal units to a string appropriate for writing to file.

Note
Internal units for board items can be either deci-mils or nanometers depending on how KiCad is build.
Parameters
aValueA coordinate value to convert.
Returns
A std::string object containing the converted value.

Definition at line 89 of file class_board_item.cpp.

Referenced by checkConnectedTo(), ConvertOutlineToPolygon(), BOARD_ITEM::FormatInternalUnits(), and BOARD::TracksInNetBetweenPoints().

90 {
91 #if 1
92 
93  char buf[50];
94  int len;
95  double mm = aValue / IU_PER_MM;
96 
97  if( mm != 0.0 && fabs( mm ) <= 0.0001 )
98  {
99  len = sprintf( buf, "%.10f", mm );
100 
101  while( --len > 0 && buf[len] == '0' )
102  buf[len] = '\0';
103 
104  if( buf[len] == '.' )
105  buf[len] = '\0';
106  else
107  ++len;
108  }
109  else
110  {
111  len = sprintf( buf, "%.10g", mm );
112  }
113 
114  return std::string( buf, len );
115 
116 #else
117 
118  // Assume aValue is in nanometers, and that we want the result in millimeters,
119  // and that int is 32 bits wide. Then perform an alternative algorithm.
120  // Can be used to verify that the above algorithm is correctly generating text.
121  // Convert aValue into an integer string, then insert a decimal point manually.
122  // Results are the same as above general purpose algorithm.
123 
124  wxASSERT( sizeof(int) == 4 );
125 
126  if( aValue == 0 )
127  return std::string( 1, '0' );
128  else
129  {
130  char buf[50];
131  int len = sprintf( buf, aValue > 0 ? "%06d" : "%07d", aValue ); // optionally pad w/leading zeros
132 
133  std::string ret( buf, len );
134 
135  std::string::iterator it = ret.end() - 1; // last byte
136 
137  // insert '.' at 6 positions from end, dividing by 10e6 (a million), nm => mm
138  std::string::iterator decpoint = ret.end() - 6;
139 
140  // truncate trailing zeros, up to decimal point position
141  for( ; *it=='0' && it >= decpoint; --it )
142  ret.erase( it ); // does not invalidate iterators it or decpoint
143 
144  if( it >= decpoint )
145  {
146  ret.insert( decpoint, '.' );
147 
148  // decpoint is invalidated here, after insert()
149 
150 #if 1 // want a leading zero when decimal point is in first position?
151  if( ret[0] == '.' )
152  {
153  // insert leading zero ahead of decimal point.
154  ret.insert( ret.begin(), '0' );
155  }
156  else if( ret[0]=='-' && ret[1]=='.' )
157  {
158  ret.insert( ret.begin() + 1, '0' );
159  }
160 #endif
161  }
162 
163  return ret;
164  }
165 
166 #endif
167 }
std::string BOARD_ITEM::FormatInternalUnits ( const wxPoint aPoint)
staticinherited

Definition at line 180 of file class_board_item.cpp.

References BOARD_ITEM::FormatInternalUnits(), wxPoint::x, and wxPoint::y.

181 {
182  return FormatInternalUnits( aPoint.x ) + " " + FormatInternalUnits( aPoint.y );
183 }
static std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from board internal units to a string appropriate for wr...
std::string BOARD_ITEM::FormatInternalUnits ( const wxSize &  aSize)
staticinherited

Definition at line 186 of file class_board_item.cpp.

References BOARD_ITEM::FormatInternalUnits().

187 {
188  return FormatInternalUnits( aSize.GetWidth() ) + " " + FormatInternalUnits( aSize.GetHeight() );
189 }
static std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from board internal units to a string appropriate for wr...
BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

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

Definition at line 63 of file class_board_item.cpp.

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

Referenced by ZONE_CONTAINER::buildFeatureHoleList(), DeleteMarkedItems(), TEXTE_PCB::Draw(), PCB_TARGET::Draw(), EDGE_MODULE::Draw(), ZONE_CONTAINER::Draw(), TEXTE_MODULE::Draw(), TRACK::Draw(), DRAWSEGMENT::Draw(), DIMENSION::Draw(), MODULE::Draw(), Draw(), SEGZONE::Draw(), VIA::Draw(), MODULE::DrawAncre(), ZONE_CONTAINER::DrawFilledArea(), BOARD_PRINTOUT_CONTROLLER::DrawPage(), ZONE_CONTAINER::DrawWhileCreateOutline(), EVT_COMMAND_RANGE(), POINT_EDITOR::finishItem(), TEXTE_PCB::Flip(), TRACK::Flip(), VIA::Flip(), ZONE_CONTAINER::Flip(), BOARD_ITEM::GetBoard(), MODULE::GetBoundingBox(), BOARD_ITEM::GetLayerName(), TRACK::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase(), SEGZONE::GetMsgPanelInfoBase(), VIA::GetMsgPanelInfoBase(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), TRACK::GetSelectMenuText(), SEGZONE::GetSelectMenuText(), VIA::GetSelectMenuText(), GetSelectMenuText(), ZONE_CONTAINER::GetSelectMenuText(), GetSolderMaskMargin(), GetSolderPasteMargin(), BRDITEMS_PLOTTER::PlotDimension(), PushTrack(), BOARD_CONNECTED_ITEM::SetNet(), BOARD_CONNECTED_ITEM::SetNetCode(), and VIA::ViewGetLOD().

64 {
65  if( Type() == PCB_T )
66  return (BOARD*) this;
67 
68  BOARD_ITEM* parent = GetParent();
69 
70  if( parent )
71  return parent->GetBoard();
72 
73  return NULL;
74 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
BOARD_ITEM_CONTAINER * GetParent() const
Definition: typeinfo.h:97
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
const EDA_RECT D_PAD::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 181 of file class_pad.cpp.

References abs, GetShape(), EDA_RECT::Inflate(), m_DeltaSize, m_Orient, m_Pos, m_Size, max, min, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, RotatePoint(), EDA_RECT::SetOrigin(), EDA_RECT::SetSize(), wxPoint::x, and wxPoint::y.

Referenced by CreateThermalReliefPadPolygon(), PCB_BASE_FRAME::Import_Pad_Settings(), PCB_EDIT_FRAME::moveExact(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and ViewBBox().

182 {
183  EDA_RECT area;
184  wxPoint quadrant1, quadrant2, quadrant3, quadrant4;
185  int x, y, dx, dy;
186 
187  switch( GetShape() )
188  {
189  case PAD_SHAPE_CIRCLE:
190  area.SetOrigin( m_Pos );
191  area.Inflate( m_Size.x / 2 );
192  break;
193 
194  case PAD_SHAPE_OVAL:
195  // Calculate the position of each rounded ent
196  quadrant1.x = m_Size.x/2;
197  quadrant1.y = 0;
198  quadrant2.x = 0;
199  quadrant2.y = m_Size.y/2;
200 
201  RotatePoint( &quadrant1, m_Orient );
202  RotatePoint( &quadrant2, m_Orient );
203 
204  // Calculate the max position of each end, relative to the pad position
205  // (the min position is symetrical)
206  dx = std::max( std::abs( quadrant1.x ) , std::abs( quadrant2.x ) );
207  dy = std::max( std::abs( quadrant1.y ) , std::abs( quadrant2.y ) );
208 
209  // Set the bbox
210  area.SetOrigin( m_Pos );
211  area.Inflate( dx, dy );
212  break;
213 
214  case PAD_SHAPE_RECT:
215  case PAD_SHAPE_ROUNDRECT:
216  // Use two opposite corners and track their rotation
217  // (use symmetry for other points)
218  quadrant1.x = m_Size.x/2;
219  quadrant1.y = m_Size.y/2;
220  quadrant2.x = -m_Size.x/2;
221  quadrant2.y = m_Size.y/2;
222 
223  RotatePoint( &quadrant1, m_Orient );
224  RotatePoint( &quadrant2, m_Orient );
225  dx = std::max( std::abs( quadrant1.x ) , std::abs( quadrant2.x ) );
226  dy = std::max( std::abs( quadrant1.y ) , std::abs( quadrant2.y ) );
227 
228  // Set the bbox
229  area.SetOrigin( m_Pos );
230  area.Inflate( dx, dy );
231  break;
232 
233  case PAD_SHAPE_TRAPEZOID:
234  //Use the four corners and track their rotation
235  // (Trapezoids will not be symmetric)
236  quadrant1.x = (m_Size.x + m_DeltaSize.y)/2;
237  quadrant1.y = (m_Size.y - m_DeltaSize.x)/2;
238  quadrant2.x = -(m_Size.x + m_DeltaSize.y)/2;
239  quadrant2.y = (m_Size.y + m_DeltaSize.x)/2;
240  quadrant3.x = -(m_Size.x - m_DeltaSize.y)/2;
241  quadrant3.y = -(m_Size.y + m_DeltaSize.x)/2;
242  quadrant4.x = (m_Size.x - m_DeltaSize.y)/2;
243  quadrant4.y = -(m_Size.y - m_DeltaSize.x)/2;
244 
245  RotatePoint( &quadrant1, m_Orient );
246  RotatePoint( &quadrant2, m_Orient );
247  RotatePoint( &quadrant3, m_Orient );
248  RotatePoint( &quadrant4, m_Orient );
249 
250  x = std::min( quadrant1.x, std::min( quadrant2.x, std::min( quadrant3.x, quadrant4.x) ) );
251  y = std::min( quadrant1.y, std::min( quadrant2.y, std::min( quadrant3.y, quadrant4.y) ) );
252  dx = std::max( quadrant1.x, std::max( quadrant2.x, std::max( quadrant3.x, quadrant4.x) ) );
253  dy = std::max( quadrant1.y, std::max( quadrant2.y, std::max( quadrant3.y, quadrant4.y) ) );
254  area.SetOrigin( m_Pos.x+x, m_Pos.y+y );
255  area.SetSize( dx-x, dy-y );
256  break;
257 
258  default:
259  break;
260  }
261 
262  return area;
263 }
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
void SetOrigin(const wxPoint &pos)
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
#define abs(a)
Definition: auxiliary.h:84
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
void SetSize(const wxSize &size)
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
#define min(a, b)
Definition: auxiliary.h:85
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
int D_PAD::GetBoundingRadius ( ) const
inline

Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad.

The center is the pad position

Definition at line 428 of file class_pad.h.

References boundingRadius(), and m_boundingRadius.

Referenced by DRC::checkClearancePadToPad(), HitTest(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), CONNECTIONS::SearchConnectionsPadsToIntersectingPads(), CONNECTIONS::SearchTracksConnectedToPads(), and DRC::testPad2Pad().

429  {
430  // Any member function which would affect this calculation should set
431  // m_boundingRadius to -1 to re-trigger the calculation from here.
432  // Currently that is only m_Size, m_DeltaSize, and m_padShape accessors.
433  if( m_boundingRadius == -1 )
434  {
436  }
437 
438  return m_boundingRadius;
439  }
int m_boundingRadius
radius of the circle containing the pad shape
Definition: class_pad.h:592
int boundingRadius() const
Function boundingRadius returns a calculated radius of a bounding circle for this pad...
Definition: class_pad.cpp:131
virtual const 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 105 of file class_board_item.h.

References BOARD_ITEM::GetPosition().

Referenced by LEGACY_ARRAY_CREATOR::getRotationCentre(), and DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem().

105 { return GetPosition(); }
virtual const wxPoint & GetPosition() const =0
wxString D_PAD::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 486 of file class_pad.h.

487  {
488  return wxT( "PAD" );
489  }
int D_PAD::GetClearance ( BOARD_CONNECTED_ITEM aItem = NULL) const
overridevirtual

Function GetClearance returns the clearance in internal units.

If aItem is not NULL then the returned clearance is the greater of this object's clearance and aItem's clearance. If aItem is NULL, then this objects clearance is returned.

Parameters
aItemis another BOARD_CONNECTED_ITEM or NULL
Returns
int - the clearance in internal units.

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 455 of file class_pad.cpp.

References BOARD_CONNECTED_ITEM::GetClearance(), MODULE::GetLocalClearance(), GetLocalClearance(), GetParent(), m_LocalClearance, and max.

Referenced by ZONE_CONTAINER::buildFeatureHoleList(), DRC::checkClearancePadToPad(), KIGFX::PCB_PAINTER::draw(), Draw(), genModuleOnRoutingMatrix(), DRC::testPad2Pad(), and DRC::testTexts().

456 {
457  // A pad can have specific clearance parameters that
458  // overrides its NETCLASS clearance value
459  int clearance = m_LocalClearance;
460 
461  if( clearance == 0 )
462  {
463  // If local clearance is 0, use the parent footprint clearance value
464  if( GetParent() && GetParent()->GetLocalClearance() )
465  clearance = GetParent()->GetLocalClearance();
466  }
467 
468  if( clearance == 0 ) // If the parent footprint clearance value = 0, use NETCLASS value
469  return BOARD_CONNECTED_ITEM::GetClearance( aItem );
470 
471  // We have a specific clearance.
472  // if aItem, return the biggest clearance
473  if( aItem )
474  {
475  int hisClearance = aItem->GetClearance();
476  return std::max( hisClearance, clearance );
477  }
478 
479  // Return the specific clearance.
480  return clearance;
481 }
int m_LocalClearance
Local clearance.
Definition: class_pad.h:659
int GetLocalClearance() const
Definition: class_module.h:167
MODULE * GetParent() const
Definition: class_pad.h:108
virtual int GetClearance(BOARD_CONNECTED_ITEM *aItem=NULL) const
Function GetClearance returns the clearance in 1/10000 inches.
int GetLocalClearance() const
Definition: class_pad.h:246
#define max(a, b)
Definition: auxiliary.h:86
STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 255 of file base_struct.h.

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), LIB_EDIT_FRAME::LoadOneSymbol(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), moveBitmap(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), and DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow().

255 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
PCB_LAYER_ID BOARD_ITEM::GetLayer ( ) const
inlineinherited

Function GetLayer returns the primary layer this item is on.

Definition at line 132 of file class_board_item.h.

References BOARD_ITEM::m_Layer.

Referenced by Abort_MoveOrCopyModule(), DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), DIMENSION::AdjustDimensionDetails(), PCB_EDIT_FRAME::Begin_DrawSegment(), PCB_EDIT_FRAME::Begin_Zone(), GRID_HELPER::BestSnapAnchor(), PCB_EDIT_FRAME::Block_SelectItems(), ZONE_CONTAINER::buildFeatureHoleList(), BuildUnconnectedThermalStubsPolygonList(), PCB_EDIT_FRAME::Change_Side_Module(), checkConnectedTo(), BOARD::CombineAllAreasInNet(), BOARD::ConvertBrdLayerToPolygonalContours(), MODULE::CopyNetlistSettings(), CreateBoardSection(), CINFO3D_VISU::createLayers(), MWAVE::CreateMicrowaveInductor(), CreateRoutesSection(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DRC::doEdgeZoneDrc(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), DRC::doTrackKeepoutDrc(), TEXTE_MODULE::Draw(), DRAWSEGMENT::Draw(), KIGFX::PCB_PAINTER::draw(), PCB_EDIT_FRAME::duplicateZone(), FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer(), PCB_EDIT_FRAME::Edit_Zone_Params(), PCB_EDIT_FRAME::End_Zone(), export_vrml_drawsegment(), export_vrml_edge_module(), export_vrml_module(), export_vrml_pcbtext(), export_vrml_text_module(), export_vrml_zones(), PCB_EDIT_FRAME::ExportToGenCAD(), TEXTE_PCB::Flip(), PCB_TARGET::Flip(), EDGE_MODULE::Flip(), TEXTE_MODULE::Flip(), TRACK::Flip(), MODULE::Flip(), DIMENSION::Flip(), DRAWSEGMENT::Flip(), ZONE_CONTAINER::Flip(), PCB_IO::FootprintSave(), FootprintWriteShape(), PCB_IO::formatLayer(), DSN::SPECCTRA_DB::FromBOARD(), genModuleOnRoutingMatrix(), genPlacementRoutingMatrix(), BOARD::GetFootprint(), getOptimalModulePlacement(), BOARD::GetPad(), BOARD::GetVisibleTrack(), SELECTION_TOOL::guessSelectionCandidates(), ZONE_CONTAINER::Hatch(), BOARD::HitTestForAnyFilledArea(), idf_export_module(), DIALOG_NON_COPPER_ZONES_EDITOR::Init(), DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties(), GENERAL_COLLECTOR::Inspect(), IsFlipped(), MODULE::IsFlipped(), ZONE_CONTAINER::IsOnCopperLayer(), ZONE_CONTAINER::IsSame(), itemIsIncludedByFilter(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), BOARD::MarkTrace(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), PCB_EDIT_FRAME::OnRightClick(), ZONE_SETTINGS::operator<<(), PlaceCells(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), BRDITEMS_PLOTTER::Plot_Edges_Modules(), BRDITEMS_PLOTTER::PlotAllTextsModule(), BRDITEMS_PLOTTER::PlotDimension(), BRDITEMS_PLOTTER::PlotDrawSegment(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPcbTarget(), PlotSilkScreen(), PlotSolderMaskLayer(), PlotStandardLayer(), BRDITEMS_PLOTTER::PlotTextePcb(), Print_Module(), PCB_EDIT_FRAME::PrintPage(), BOARD::RedrawAreasOutlines(), BOARD::RedrawFilledAreas(), TRACKS_CLEANER::remove_duplicates_of_track(), PCB_EDIT_FRAME::Remove_Zone_Corner(), SaveCopyOfZones(), SELECTION_TOOL::selectable(), ShowClearance(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::Swap_Layers(), PNS_KICAD_IFACE::syncTrack(), BOARD::Test_Connections_To_Copper_Areas(), BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines(), BOARD::TestAreaIntersection(), BOARD::TestAreaIntersections(), ZONE_CONTAINER::TestForCopperIslandAndRemoveInsulatedIslands(), DRC::testKeepoutAreas(), TEXTE_MODULE::TEXTE_MODULE(), TraceSegmentPcb(), TrackListSortByNetcode(), DialogEditModuleText::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow(), DialogEditModuleText::TransferDataToWindow(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), CINFO3D_VISU::transformGraphicModuleEdgeToPolygonSet(), MODULE::TransformGraphicShapesWithClearanceToPolygonSet(), MODULE::TransformGraphicTextWithClearanceToPolygonSet(), TstModuleOnBoard(), TEXTE_MODULE::ViewGetLayers(), TRACK::ViewGetLayers(), TRACKS_CLEANER::zoneForTrackEndpoint(), and PCB_EDITOR_CONTROL::ZoneMerge().

132 { return m_Layer; }
PCB_LAYER_ID m_Layer
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 77 of file class_board_item.cpp.

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

Referenced by PCB_IO::formatLayer(), TEXTE_PCB::GetMsgPanelInfo(), EDGE_MODULE::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), DRAWSEGMENT::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), EDGE_MODULE::GetSelectMenuText(), TEXTE_PCB::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), DIMENSION::GetSelectMenuText(), DRAWSEGMENT::GetSelectMenuText(), TRACK::GetSelectMenuText(), SEGZONE::GetSelectMenuText(), MODULE::GetSelectMenuText(), and ZONE_CONTAINER::GetSelectMenuText().

78 {
79  BOARD* board = GetBoard();
80 
81  if( board )
82  return board->GetLayerName( m_Layer );
83 
84  // If no parent, return standard name
86 }
PCB_LAYER_ID m_Layer
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
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:646
DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited
int D_PAD::GetLocalClearance ( ) const
inline
int D_PAD::GetLocalSolderMaskMargin ( ) const
inline

Definition at line 243 of file class_pad.h.

References m_LocalSolderMaskMargin.

Referenced by PCB_BASE_FRAME::GlobalChange_PadSettings(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

243 { return m_LocalSolderMaskMargin; }
int m_LocalSolderMaskMargin
Local mask margins: when 0, the parent footprint design values are used.
Definition: class_pad.h:663
int D_PAD::GetLocalSolderPasteMargin ( ) const
inline

Definition at line 249 of file class_pad.h.

References m_LocalSolderPasteMargin.

Referenced by PCB_BASE_FRAME::GlobalChange_PadSettings(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

249 { return m_LocalSolderPasteMargin; }
int m_LocalSolderPasteMargin
Local solder paste margin absolute value.
Definition: class_pad.h:664
double D_PAD::GetLocalSolderPasteMarginRatio ( ) const
inline

Definition at line 252 of file class_pad.h.

References m_LocalSolderPasteMarginRatio.

Referenced by PCB_BASE_FRAME::GlobalChange_PadSettings(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

double m_LocalSolderPasteMarginRatio
Local solder mask margin ratio value of pad size The final margin is the sum of these 2 values...
Definition: class_pad.h:666
BITMAP_DEF D_PAD::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 916 of file class_pad.cpp.

917 {
918  return pad_xpm;
919 }
void D_PAD::GetMsgPanelInfo ( std::vector< MSG_PANEL_ITEM > &  aList)
overridevirtual

Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Note
This method replaces DisplayInfo() so that KiCad objects no longer have any knowledge of wxWidgets UI objects.
Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 592 of file class_pad.cpp.

References BROWN, CoordinateToString(), CYAN, DARKCYAN, DARKGREEN, BOARD_ITEM::GetBoard(), GetDrillShape(), BOARD_CONNECTED_ITEM::GetNetname(), MODULE::GetOrientationDegrees(), GetOrientationDegrees(), GetPadToDieLength(), MODULE::GetReference(), BOARD_CONNECTED_ITEM::GetSubNet(), GetSubRatsnest(), BOARD_CONNECTED_ITEM::GetZoneSubNet(), LayerMaskDescribe(), LIGHTBLUE, m_Drill, m_layerMask, EDA_ITEM::m_Parent, m_Pos, m_Size, PAD_DRILL_SHAPE_CIRCLE, RED, ShowPadAttr(), ShowPadShape(), StringPadName(), wxPoint::x, and wxPoint::y.

593 {
594  MODULE* module;
595  wxString Line;
596  BOARD* board;
597 
598  module = (MODULE*) m_Parent;
599 
600  if( module )
601  {
602  wxString msg = module->GetReference();
603  aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKCYAN ) );
604  StringPadName( Line );
605  aList.push_back( MSG_PANEL_ITEM( _( "Pad" ), Line, BROWN ) );
606  }
607 
608  aList.push_back( MSG_PANEL_ITEM( _( "Net" ), GetNetname(), DARKCYAN ) );
609 
610  /* For test and debug only: display m_physical_connexion and
611  * m_logical_connexion */
612 #if 1 // Used only to debug connectivity calculations
613  Line.Printf( wxT( "%d-%d-%d " ), GetSubRatsnest(), GetSubNet(), GetZoneSubNet() );
614  aList.push_back( MSG_PANEL_ITEM( wxT( "L-P-Z" ), Line, DARKGREEN ) );
615 #endif
616 
617  board = GetBoard();
618 
619  aList.push_back( MSG_PANEL_ITEM( _( "Layer" ),
620  LayerMaskDescribe( board, m_layerMask ), DARKGREEN ) );
621 
622  aList.push_back( MSG_PANEL_ITEM( ShowPadShape(), ShowPadAttr(), DARKGREEN ) );
623 
624  Line = ::CoordinateToString( m_Size.x );
625  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), Line, RED ) );
626 
627  Line = ::CoordinateToString( m_Size.y );
628  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), Line, RED ) );
629 
630  Line = ::CoordinateToString( (unsigned) m_Drill.x );
631 
633  {
634  aList.push_back( MSG_PANEL_ITEM( _( "Drill" ), Line, RED ) );
635  }
636  else
637  {
638  Line = ::CoordinateToString( (unsigned) m_Drill.x );
639  wxString msg;
640  msg = ::CoordinateToString( (unsigned) m_Drill.y );
641  Line += wxT( "/" ) + msg;
642  aList.push_back( MSG_PANEL_ITEM( _( "Drill X / Y" ), Line, RED ) );
643  }
644 
645  double module_orient_degrees = module ? module->GetOrientationDegrees() : 0;
646 
647  if( module_orient_degrees != 0.0 )
648  Line.Printf( wxT( "%3.1f(+%3.1f)" ),
649  GetOrientationDegrees() - module_orient_degrees,
650  module_orient_degrees );
651  else
652  Line.Printf( wxT( "%3.1f" ), GetOrientationDegrees() );
653 
654  aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), Line, LIGHTBLUE ) );
655 
656  Line = ::CoordinateToString( m_Pos.x ) + wxT( ", " ) + ::CoordinateToString( m_Pos.y );
657  aList.push_back( MSG_PANEL_ITEM( _( "Position" ), Line, LIGHTBLUE ) );
658 
659  if( GetPadToDieLength() )
660  {
662  aList.push_back( MSG_PANEL_ITEM( _( "Length in package" ), Line, CYAN ) );
663  }
664 }
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:117
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:168
int GetPadToDieLength() const
Definition: class_pad.h:241
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
wxString ShowPadAttr() const
Function ShowPadAttr.
Definition: class_pad.cpp:871
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:221
double GetOrientationDegrees() const
Definition: class_module.h:149
int GetSubRatsnest() const
Function GetSubRatsnest.
Definition: class_pad.h:474
int GetZoneSubNet() const
Function GetZoneSubNet.
Definition: colors.h:59
Definition: colors.h:60
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
const wxString & GetNetname() const
Function GetNetname.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:412
wxString ShowPadShape() const
Function ShowPadShape.
Definition: class_pad.cpp:846
int GetSubNet() const
Function GetSubNet.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
void StringPadName(wxString &text) const
Definition: class_pad.cpp:391
double GetOrientationDegrees() const
Definition: class_pad.h:215
static wxString LayerMaskDescribe(const BOARD *aBoard, LSET aMask)
Helper function Return a string (to be shown to the user) describing a layer mask.
Definition: class_pad.cpp:1013
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
Definition: colors.h:62
NETCLASSPTR BOARD_CONNECTED_ITEM::GetNetClass ( ) const
inherited

Function GetNetClass returns the NETCLASS for this item.

Definition at line 104 of file class_board_connected_item.cpp.

References DBG, BOARD::FindNet(), BOARD_ITEM::GetBoard(), BOARD_DESIGN_SETTINGS::GetDefault(), BOARD::GetDesignSettings(), NETINFO_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetCode(), and EDA_ITEM::Type().

Referenced by DIALOG_TRACK_VIA_PROPERTIES::Apply(), DRC::doTrackDrc(), ZONE_CONTAINER::GetClearance(), BOARD_CONNECTED_ITEM::GetClearance(), VIA::GetDrillValue(), TRACK::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClassName(), and ROUTER_TOOL::prepareInteractive().

105 {
106  // It is important that this be implemented without any sequential searching.
107  // Simple array lookups should be fine, performance-wise.
108  BOARD* board = GetBoard();
109 
110  // DO NOT use wxASSERT, because GetNetClass is called inside an OnPaint event
111  // and a call to wxASSERT can crash the application.
112 
113  if( board == NULL ) // Should not occur
114  {
115  DBG(printf( "%s: NULL board,type %d", __func__, Type() );)
116 
117  return NETCLASSPTR();
118  }
119 
120  NETCLASSPTR netclass;
121  NETINFO_ITEM* net = board->FindNet( GetNetCode() );
122 
123  if( net )
124  {
125  netclass = net->GetNetClass();
126 
127  //DBG( if(!netclass) printf( "%s: NULL netclass,type %d", __func__, Type() );)
128  }
129 
130  if( netclass )
131  return netclass;
132  else
133  return board->GetDesignSettings().GetDefault();
134 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
NETCLASSPTR GetDefault() const
Function GetDefault.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
int GetNetCode() const
Function GetNetCode.
Class NETINFO_ITEM handles the data for a net.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
NETCLASSPTR GetNetClass()
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
#define DBG(x)
Definition: fctsys.h:33
wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
inherited

Function GetNetClassName returns a pointer to the netclass of the zone.

If the net is not found (can happen when a netlist is reread, and the net name does not exist, return the default net class (should not return a null pointer).

Returns
the Net Class name of this item

Definition at line 137 of file class_board_connected_item.cpp.

References NETCLASS::Default, BOARD_CONNECTED_ITEM::GetNetClass(), and name.

Referenced by PCB_EDIT_FRAME::createPopUpMenuForFpPads(), and PCB_EDIT_FRAME::createPopupMenuForTracks().

138 {
139  wxString name;
140  NETCLASSPTR myclass = GetNetClass();
141 
142  if( myclass )
143  name = myclass->GetName();
144  else
145  name = NETCLASS::Default;
146 
147  return name;
148 }
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.
static const char Default[]
the name of the default NETCLASS
const char * name
int BOARD_CONNECTED_ITEM::GetNetCode ( ) const
inlineinherited

Function GetNetCode.

Returns
int - the net code.

Definition at line 109 of file class_board_connected_item.h.

References NETINFO_ITEM::GetNet(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by RN_DATA::AddBlocked(), ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG(), RN_DATA::AddSimple(), RN_DATA::AreConnected(), PCB_EDIT_FRAME::Attribut_net(), PCB_EDIT_FRAME::Autoroute(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_BASE_FRAME::build_ratsnest_module(), Build_Work(), PCB_BASE_FRAME::BuildAirWiresTargetsList(), ZONE_CONTAINER::buildFeatureHoleList(), NETINFO_LIST::buildListOfNets(), BuildUnconnectedThermalStubsPolygonList(), PCB_EDIT_FRAME::Change_Net_Tracks_And_Vias_Sizes(), Collect_TrackSegmentsToDrag(), BOARD::CombineAllAreasInNet(), CopyNetlistSettings(), CreateRoutesSection(), CreateSignalsSection(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Track(), DRC::doEdgeZoneDrc(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), VIA::Draw(), BOARD::DrawHighLight(), DrawShape(), TRACK::DrawShortNetname(), PCB_EDIT_FRAME::duplicateZone(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::EraseRedundantTrack(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::Fill_Zone(), PNS::NODE::FindItemByParent(), POINT_EDITOR::finishItem(), DSN::SPECCTRA_DB::FromBOARD(), TRACK::GetBestInsertPoint(), RN_DATA::GetConnectedItems(), TRACK::GetEndNetCode(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), TRACK::GetSelectMenuText(), VIA::GetSelectMenuText(), ZONE_CONTAINER::GetSelectMenuText(), TRACK::GetStartNetCode(), TRACK::GetTrack(), BOARD::HitTestForAnyFilledArea(), ZONE_CONTAINER::IsSame(), LocateIntrusion(), Magnetize(), DSN::SPECCTRA_DB::makeIMAGE(), Merge_SubNets_Connected_By_CopperAreas(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), ZONE_SETTINGS::operator<<(), PlaceCells(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_EDIT_FRAME::Process_Special_Functions(), RN_DATA::ProcessBoard(), PushTrack(), TRACKS_CLEANER::remove_duplicates_of_track(), PCB_EDIT_FRAME::Remove_One_Track(), PCB_EDIT_FRAME::Remove_Zone_Corner(), TRACKS_CLEANER::removeBadTrackSegments(), PCB_SELECTION_CONDITIONS::sameNetFunc(), SaveCopyOfZones(), BOARD::SetAreasNetCodesFromNetNames(), PCB_EDIT_FRAME::Show_1_Ratsnest(), sort_areas(), sortByNetcode(), SortTracksByNetCode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PNS_KICAD_IFACE::syncPad(), PNS_KICAD_IFACE::syncTrack(), PNS_KICAD_IFACE::syncVia(), BOARD::Test_Connections_To_Copper_Areas(), BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines(), BOARD::TestAreaIntersections(), ZONE_CONTAINER::TestForCopperIslandAndRemoveInsulatedIslands(), PCB_BASE_FRAME::TestNetConnection(), DRC::testZones(), TrackListSortByNetcode(), BOARD::TracksInNet(), NETINFO_MAPPING::Update(), ZONE_CONTAINER::ZONE_CONTAINER(), TRACKS_CLEANER::zoneForTrackEndpoint(), and PCB_EDITOR_CONTROL::ZoneMerge().

110  {
111  return m_netinfo->GetNet();
112  }
int GetNet() const
Function GetNet.
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
int BOARD_ITEM::getNextNumberInSequence ( const std::set< int > &  aSeq,
bool  aFillSequenceGaps 
)
staticprotectedinherited

Definition at line 223 of file class_board_item.cpp.

Referenced by MODULE::GetNextPadName().

224 {
225  if( aSeq.empty() )
226  return 1;
227 
228  // By default go to the end of the sequence
229  int candidate = *aSeq.rbegin();
230 
231  // Filling in gaps in pad numbering
232  if( aFillSequenceGaps )
233  {
234  // start at the beginning
235  candidate = *aSeq.begin();
236 
237  for( auto it : aSeq )
238  {
239  if( it - candidate > 1 )
240  break;
241 
242  candidate = it;
243  }
244  }
245 
246  ++candidate;
247 
248  return candidate;
249 }
void D_PAD::GetOblongDrillGeometry ( wxPoint aStartPoint,
wxPoint aEndPoint,
int &  aWidth 
) const

Function GetOblongDrillGeometry calculates the start point, end point and width of an equivalent segment which have the same position and width as the hole Usefull to plot/draw oblong holes like segments with rounded ends used in draw and plot functions.

Parameters
aStartPoint= first point of the equivalent segment, relative to the pad position.
aEndPoint= second point of the equivalent segment, relative to the pad position.
aWidth= width equivalent segment.

Definition at line 667 of file class_pad.cpp.

References GetDrillSize(), m_Drill, m_Orient, RotatePoint(), wxPoint::x, and wxPoint::y.

Referenced by BuildPadDrillShapePolygon(), CINFO3D_VISU::createNewPadDrill(), and DrawShape().

669 {
670  // calculates the start point, end point and width
671  // of an equivalent segment which have the same position and width as the hole
672  int delta_cx, delta_cy;
673 
674  wxSize halfsize = GetDrillSize();
675  halfsize.x /= 2;
676  halfsize.y /= 2;
677 
678  if( m_Drill.x > m_Drill.y ) // horizontal
679  {
680  delta_cx = halfsize.x - halfsize.y;
681  delta_cy = 0;
682  aWidth = m_Drill.y;
683  }
684  else // vertical
685  {
686  delta_cx = 0;
687  delta_cy = halfsize.y - halfsize.x;
688  aWidth = m_Drill.x;
689  }
690 
691  RotatePoint( &delta_cx, &delta_cy, m_Orient );
692 
693  aStartPoint.x = delta_cx;
694  aStartPoint.y = delta_cy;
695 
696  aEndPoint.x = - delta_cx;
697  aEndPoint.y = - delta_cy;
698 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
const wxSize & GetDrillSize() const
Definition: class_pad.h:188
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
double D_PAD::GetOrientationDegrees ( ) const
inline

Definition at line 215 of file class_pad.h.

References m_Orient.

Referenced by GetMsgPanelInfo(), and DSN::SPECCTRA_DB::makeIMAGE().

215 { return m_Orient/10.0; }
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
double D_PAD::GetOrientationRadians ( ) const
inline

Definition at line 216 of file class_pad.h.

References m_Orient.

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

216 { return m_Orient*M_PI/1800; }
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
wxUint32 D_PAD::GetPackedPadName ( ) const
inline
Returns
the pad name in a wxUint32 which is possible because the pad name is limited to 4 ASCII chars The packed pad name should be used only to compare 2 pad names, not to try to print this name

Definition at line 143 of file class_pad.h.

References m_NumPadName.

143 { return m_NumPadName; }
wxUint32 m_NumPadName
Definition: class_pad.h:601
wxString D_PAD::GetPadName ( ) const
Returns
the pad name the pad name is limited to 4 ASCII chars

Definition at line 382 of file class_pad.cpp.

References name, and StringPadName().

Referenced by BOARD_NETLIST_UPDATER::deleteSinglePadNets(), KIGFX::PCB_PAINTER::draw(), GetSelectMenuText(), DIALOG_PAD_PROPERTIES::initValues(), DSN::SPECCTRA_DB::makeIMAGE(), BRDITEMS_PLOTTER::PlotPad(), BOARD::ReplaceNetlist(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and ViewGetLayers().

383 {
384  wxString name;
385 
386  StringPadName( name );
387  return name;
388 }
const char * name
void StringPadName(wxString &text) const
Definition: class_pad.cpp:391
int D_PAD::GetPadToDieLength ( ) const
inline

Definition at line 241 of file class_pad.h.

References m_LengthPadToDie.

Referenced by GetMsgPanelInfo(), DIALOG_PAD_PROPERTIES::initValues(), BOARD::MarkTrace(), ShowNewTrackWhenMovingCursor(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

241 { return m_LengthPadToDie; }
int m_LengthPadToDie
Length net from pad to die, inside the package.
Definition: class_pad.h:654
const wxPoint& D_PAD::GetPosition ( ) const
inlineoverridevirtual

Implements BOARD_ITEM.

Definition at line 170 of file class_pad.h.

References m_Pos.

Referenced by RN_NET::AddItem(), AddNewTrace(), PCB_BASE_FRAME::AddPad(), Autoroute_One_Track(), PCB_EDIT_FRAME::Begin_Route(), PCB_BASE_FRAME::build_ratsnest_module(), Build_Work(), PCB_BASE_FRAME::BuildAirWiresTargetsList(), BuildPadDrillShapePolygon(), CONNECTIONS::BuildPadsCandidatesList(), compute_Ratsnest_PlaceModule(), GRID_HELPER::computeAnchors(), PCB_EDIT_FRAME::Create_MuWaveComponent(), MWAVE::CreateMicrowaveInductor(), CINFO3D_VISU::createNewPadDrill(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), RATSNEST_ITEM::Draw(), KIGFX::PCB_PAINTER::draw(), EnsureEndTrackOnPad(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), export_vrml_pad(), DRC::fillMarker(), Flip(), BOARD::GetPad(), BOARD::GetPadFast(), MODULE::GetTopLeftPad(), MIN_SPAN_TREE_PADS::GetWeight(), DIALOG_PAD_PROPERTIES::initValues(), C3D_RENDER_RAYTRACING::insert3DPadHole(), Magnetize(), MarkItemsInBloc(), BOARD::MarkTrace(), mirrorPadX(), PCB_EDIT_FRAME::moveExact(), MoveMarkedItems(), MoveMarkedItemsExactly(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), OrCell_Trace(), MODULE_EDITOR_TOOLS::PlacePad(), PCB_BASE_FRAME::PlacePad(), DIALOG_PAD_PROPERTIES::redraw(), CONNECTIONS::SearchTracksConnectedToPads(), DRAG_SEGM_PICKER::SetAuxParameters(), DRAG_SEGM_PICKER::SetTrackEndsCoordinates(), sortPadsByXthenYCoord(), PCB_BASE_FRAME::StartMovePad(), DRC::testPad2Pad(), DRC::testUnconnected(), PCB_BASE_FRAME::TraceModuleRatsNest(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

170 { return m_Pos; }
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
int D_PAD::GetRoundRectCornerRadius ( ) const
inline

Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.

Returns
The radius of the rounded corners for this pad.

Definition at line 351 of file class_pad.h.

References m_Size.

Referenced by boundingRadius(), DRC::checkClearancePadToPad(), DRC::checkClearanceSegmToPad(), CINFO3D_VISU::createNewPadWithClearance(), KIGFX::PCB_PAINTER::draw(), DrawShape(), HitTest(), DIALOG_PAD_PROPERTIES::onCornerSizePercentChange(), BRDITEMS_PLOTTER::PlotPad(), TransformShapeWithClearanceToPolygon(), and DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues().

352  {
354  }
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:351
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
int D_PAD::GetRoundRectCornerRadius ( const wxSize &  aSize) const

Helper function GetRoundRectCornerRadius Has meaning only for rounded rect pads Returns the radius of the rounded corners of a rectangle size aSize, using others setting of the pad.

Parameters
aSize= size of the of the round rect. Usually the pad size but can be the size of the pad on solder mask or solder paste
Returns
The radius of the rounded corners for this pad size.

Definition at line 171 of file class_pad.cpp.

References m_padRoundRectRadiusScale.

172 {
173  // radius of rounded corners, usually 25% of shorter pad edge for now
174  int r = aSize.x > aSize.y ? aSize.y : aSize.x;
175  r = int( r * m_padRoundRectRadiusScale );
176 
177  return r;
178 }
double m_padRoundRectRadiusScale
scaling factor from smallest m_Size coord to corner radius, default 0.25
Definition: class_pad.h:622
double D_PAD::GetRoundRectRadiusRatio ( ) const
inline

has meaning only for rounded rect pads

Returns
the scaling factor between the smaller Y or Y size and the radius of the rounded corners. Cannot be > 0.5 the normalized IPC-7351C value is 0.25

Definition at line 450 of file class_pad.h.

References m_padRoundRectRadiusScale.

Referenced by ImportSettingsFromMaster(), DIALOG_PAD_PROPERTIES::OnPadShapeSelection(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues().

451  {
453  }
double m_padRoundRectRadiusScale
scaling factor from smallest m_Size coord to corner radius, default 0.25
Definition: class_pad.h:622
wxString D_PAD::GetSelectMenuText ( ) 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 893 of file class_pad.cpp.

References BOARD_ITEM::GetBoard(), GetChars(), GetPadName(), GetParent(), LayerMaskDescribe(), and m_layerMask.

Referenced by PCB_EDIT_FRAME::createPopUpMenuForFpPads(), DRC::fillMarker(), and DRC::testUnconnected().

894 {
895  wxString text;
896  wxString padlayers( LayerMaskDescribe( GetBoard(), m_layerMask ) );
897  wxString padname( GetPadName() );
898 
899  if( padname.IsEmpty() )
900  {
901  text.Printf( _( "Pad on %s of %s" ),
902  GetChars( padlayers ),
903  GetChars(GetParent()->GetReference() ) );
904  }
905  else
906  {
907  text.Printf( _( "Pad %s on %s of %s" ),
908  GetChars(GetPadName() ), GetChars( padlayers ),
909  GetChars(GetParent()->GetReference() ) );
910  }
911 
912  return text;
913 }
MODULE * GetParent() const
Definition: class_pad.h:108
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
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:92
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxString GetPadName() const
Definition: class_pad.cpp:382
static wxString LayerMaskDescribe(const BOARD *aBoard, LSET aMask)
Helper function Return a string (to be shown to the user) describing a layer mask.
Definition: class_pad.cpp:1013
PAD_SHAPE_T D_PAD::GetShape ( ) const
inline

Function GetShape.

Returns
the shape of this pad.

Definition at line 166 of file class_pad.h.

References m_padShape.

Referenced by CINFO3D_VISU::AddPadsShapesWithClearanceToContainer(), boundingRadius(), BuildPadPolygon(), BuildPadShapePolygon(), CINFO3D_VISU::buildPadShapePolygon(), CINFO3D_VISU::buildPadShapeThickOutlineAsPolygon(), CINFO3D_VISU::buildPadShapeThickOutlineAsSegments(), DRC::checkClearancePadToPad(), DRC::checkClearanceSegmToPad(), Compare(), CINFO3D_VISU::createNewPad(), CINFO3D_VISU::createNewPadWithClearance(), CreatePadsShapesSection(), CreateThermalReliefPadPolygon(), KIGFX::PCB_PAINTER::draw(), DrawShape(), export_vrml_padshape(), GetBoundingBox(), PCB_BASE_FRAME::GlobalChange_PadSettings(), globalChangePadSettings(), HitTest(), ImportSettingsFromMaster(), DIALOG_PAD_PROPERTIES::initValues(), DSN::isRoundKeepout(), DSN::SPECCTRA_DB::makePADSTACK(), DIALOG_PAD_PROPERTIES::onCornerSizePercentChange(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), EAGLE_PLUGIN::packagePad(), DIALOG_PAD_PROPERTIES::padValuesOK(), GPCB_FPL_CACHE::parseMODULE(), PlacePad(), BRDITEMS_PLOTTER::PlotPad(), ShowPadShape(), PNS_KICAD_IFACE::syncPad(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), MODULE::TransformPadsShapesWithClearanceToPolygon(), CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon(), TransformShapeWithClearanceToPolygon(), and DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues().

166 { return m_padShape; }
PAD_SHAPE_T m_padShape
Shape: PAD_SHAPE_CIRCLE, PAD_SHAPE_RECT, PAD_SHAPE_OVAL, PAD_SHAPE_TRAPEZOID, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_POLYGON.
Definition: class_pad.h:607
const wxString& BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inlineinherited

Function GetShortNetname.

Returns
wxString - the short netname

Definition at line 165 of file class_board_connected_item.h.

References NETINFO_ITEM::GetShortNetname(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by KIGFX::PCB_PAINTER::draw(), and DrawShape().

166  {
167  return m_netinfo->GetShortNetname();
168  }
const wxString & GetShortNetname() const
Function GetShortNetname.
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
int D_PAD::GetSolderMaskMargin ( ) const

Function GetSolderMaskMargin.

Returns
the margin for the solder mask layer usually > 0 (mask shape bigger than pad value is 1 - the local value 2 - if null, the parent footprint value 1 - if null, the global value

Definition at line 486 of file class_pad.cpp.

References BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), MODULE::GetLocalSolderMaskMargin(), GetParent(), m_LocalSolderMaskMargin, m_Size, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, and min.

Referenced by CINFO3D_VISU::AddPadsShapesWithClearanceToContainer(), KIGFX::PCB_PAINTER::draw(), Draw(), MODULE::TransformPadsShapesWithClearanceToPolygon(), CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon(), and ViewBBox().

487 {
488  int margin = m_LocalSolderMaskMargin;
489  MODULE* module = GetParent();
490 
491  if( module )
492  {
493  if( margin == 0 )
494  {
495  if( module->GetLocalSolderMaskMargin() )
496  margin = module->GetLocalSolderMaskMargin();
497  }
498 
499  if( margin == 0 )
500  {
501  BOARD* brd = GetBoard();
502  margin = brd->GetDesignSettings().m_SolderMaskMargin;
503  }
504  }
505 
506  // ensure mask have a size always >= 0
507  if( margin < 0 )
508  {
509  int minsize = -std::min( m_Size.x, m_Size.y ) / 2;
510 
511  if( margin < minsize )
512  margin = minsize;
513  }
514 
515  return margin;
516 }
int m_LocalSolderMaskMargin
Local mask margins: when 0, the parent footprint design values are used.
Definition: class_pad.h:663
int m_SolderMaskMargin
Solder mask margin.
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
MODULE * GetParent() const
Definition: class_pad.h:108
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
int GetLocalSolderMaskMargin() const
Definition: class_module.h:164
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
#define min(a, b)
Definition: auxiliary.h:85
wxSize D_PAD::GetSolderPasteMargin ( ) const

Function GetSolderPasteMargin.

Returns
the margin for the solder mask layer usually < 0 (mask shape smaller than pad because the margin can be dependent on the pad size, the margin has a x and a y value value is 1 - the local value 2 - if null, the parent footprint value 1 - if null, the global value

Definition at line 519 of file class_pad.cpp.

References BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), MODULE::GetLocalSolderPasteMargin(), MODULE::GetLocalSolderPasteMarginRatio(), GetParent(), KiROUND(), m_LocalSolderPasteMargin, m_LocalSolderPasteMarginRatio, m_Size, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, and BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio.

Referenced by CINFO3D_VISU::AddPadsShapesWithClearanceToContainer(), KIGFX::PCB_PAINTER::draw(), Draw(), MODULE::TransformPadsShapesWithClearanceToPolygon(), CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon(), and ViewBBox().

520 {
521  int margin = m_LocalSolderPasteMargin;
522  double mratio = m_LocalSolderPasteMarginRatio;
523  MODULE* module = GetParent();
524 
525  if( module )
526  {
527  if( margin == 0 )
528  margin = module->GetLocalSolderPasteMargin();
529 
530  BOARD * brd = GetBoard();
531 
532  if( margin == 0 )
533  margin = brd->GetDesignSettings().m_SolderPasteMargin;
534 
535  if( mratio == 0.0 )
536  mratio = module->GetLocalSolderPasteMarginRatio();
537 
538  if( mratio == 0.0 )
539  {
541  }
542  }
543 
544  wxSize pad_margin;
545  pad_margin.x = margin + KiROUND( m_Size.x * mratio );
546  pad_margin.y = margin + KiROUND( m_Size.y * mratio );
547 
548  // ensure mask have a size always >= 0
549  if( pad_margin.x < -m_Size.x / 2 )
550  pad_margin.x = -m_Size.x / 2;
551 
552  if( pad_margin.y < -m_Size.y / 2 )
553  pad_margin.y = -m_Size.y / 2;
554 
555  return pad_margin;
556 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
int m_SolderPasteMargin
Solder paste margin absolute value.
int m_LocalSolderPasteMargin
Local solder paste margin absolute value.
Definition: class_pad.h:664
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
MODULE * GetParent() const
Definition: class_pad.h:108
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:173
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
int GetLocalSolderPasteMargin() const
Definition: class_module.h:170
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
double m_LocalSolderPasteMarginRatio
Local solder mask margin ratio value of pad size The final margin is the sum of these 2 values...
Definition: class_pad.h:666
double m_SolderPasteMarginRatio
Solder pask margin ratio value of pad size The final margin is the sum of these 2 values...
STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 250 of file base_struct.h.

References EDA_ITEM::m_Status.

250 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:161
int D_PAD::GetSubRatsnest ( ) const
inline

Function GetSubRatsnest.

Returns
int - the netcode

Definition at line 474 of file class_pad.h.

References m_SubRatsnest.

Referenced by CreatePadsShapesSection(), CreateShapesSection(), GetMsgPanelInfo(), tst_links_between_blocks(), and tst_links_between_pads().

474 { return m_SubRatsnest; }
int m_SubRatsnest
variable used in rats nest computations handle subnet (block) number in ratsnest connection ...
Definition: class_pad.h:611
int D_PAD::GetThermalGap ( ) const

Definition at line 581 of file class_pad.cpp.

References GetParent(), MODULE::GetThermalGap(), and m_ThermalGap.

Referenced by ZONE_CONTAINER::GetThermalReliefGap(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

582 {
583  MODULE* module = GetParent();
584 
585  if( m_ThermalGap == 0 && module )
586  return module->GetThermalGap();
587  else
588  return m_ThermalGap;
589 }
int m_ThermalGap
Definition: class_pad.h:672
int GetThermalGap() const
Definition: class_module.h:183
MODULE * GetParent() const
Definition: class_pad.h:108
int D_PAD::GetThermalWidth ( ) const

Definition at line 570 of file class_pad.cpp.

References GetParent(), MODULE::GetThermalWidth(), and m_ThermalWidth.

Referenced by ZONE_CONTAINER::GetThermalReliefCopperBridge(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

571 {
572  MODULE* module = GetParent();
573 
574  if( m_ThermalWidth == 0 && module )
575  return module->GetThermalWidth();
576  else
577  return m_ThermalWidth;
578 }
MODULE * GetParent() const
Definition: class_pad.h:108
int m_ThermalWidth
Definition: class_pad.h:671
int GetThermalWidth() const
Definition: class_module.h:180
int BOARD_ITEM::getTrailingInt ( wxString  aStr)
staticprotectedinherited

Definition at line 200 of file class_board_item.cpp.

Referenced by MODULE::GetNextPadName().

201 {
202  int number = 0;
203  int base = 1;
204 
205  // Trim and extract the trailing numeric part
206  int index = aStr.Len() - 1;
207  while( index >= 0 )
208  {
209  const char chr = aStr.GetChar( index );
210 
211  if( chr < '0' || chr > '9' )
212  break;
213 
214  number += ( chr - '0' ) * base;
215  base *= 10;
216  index--;
217  }
218 
219  return number;
220 }
ZoneConnection D_PAD::GetZoneConnection ( ) const

Definition at line 559 of file class_pad.cpp.

References GetParent(), MODULE::GetZoneConnection(), m_ZoneConnection, and PAD_ZONE_CONN_INHERITED.

Referenced by ZONE_CONTAINER::GetPadConnection(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

560 {
561  MODULE* module = GetParent();
562 
563  if( m_ZoneConnection == PAD_ZONE_CONN_INHERITED && module )
564  return module->GetZoneConnection();
565  else
566  return m_ZoneConnection;
567 }
MODULE * GetParent() const
Definition: class_pad.h:108
ZoneConnection GetZoneConnection() const
Definition: class_module.h:177
ZoneConnection m_ZoneConnection
how the connection to zone is made: no connection, thermal relief ...
Definition: class_pad.h:669
int BOARD_CONNECTED_ITEM::GetZoneSubNet ( ) const
inlineinherited

Function GetZoneSubNet.

Returns
int - the sub net code in zone connections.

Definition at line 142 of file class_board_connected_item.h.

References BOARD_CONNECTED_ITEM::m_ZoneSubnet.

Referenced by CmpZoneSubnetValue(), GetMsgPanelInfo(), Merge_SubNets_Connected_By_CopperAreas(), and BOARD::Test_Connections_To_Copper_Areas().

143  {
144  return m_ZoneSubnet;
145  }
virtual bool BOARD_ITEM::HitTest ( const EDA_RECT aRect,
bool  aContained = true,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Function HitTest tests if the aRect intersects or contains this object (depending on aContained).

Parameters
aRectA reference to an EDA_RECT object containg the area to test.
aContainedTest if aRect contains this object completly.
aAccuracyIncrease the item bounding box by this amount.
Returns
bool - True if aRect contains this object completly or if aRect intersects the object and aContained is False, otherwise false.

Reimplemented in VIA, MODULE, ZONE_CONTAINER, TRACK, DIMENSION, DRAWSEGMENT, PCB_TARGET, and TEXTE_PCB.

Definition at line 297 of file class_board_item.h.

298  {
299  return false; // derived classes should override this function
300  }
bool D_PAD::HitTest ( const wxPoint aPosition) const
overridevirtual

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

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
Returns
True if aPosition is within or on the item bounding area.

Reimplemented from BOARD_ITEM.

Definition at line 700 of file class_pad.cpp.

References abs, BuildPadPolygon(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), delta, dist, EuclideanNorm(), GetBoundingRadius(), GetRoundRectCornerRadius(), GetShape(), GetSize(), KiROUND(), m_Orient, m_Size, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_TRAPEZOID, SHAPE_LINE_CHAIN::PointCount(), RotatePoint(), ShapePos(), TestPointInsidePolygon(), TestSegmentHit(), TransformRoundRectToPolygon(), wxPoint::x, and wxPoint::y.

Referenced by TRACKS_CLEANER::buildTrackConnectionInfo(), DRAG_LIST::fillList(), RN_NET::processPads(), CONNECTIONS::SearchConnectionsPadsToIntersectingPads(), and CONNECTIONS::SearchTracksConnectedToPads().

701 {
702  int dx, dy;
703 
704  wxPoint shape_pos = ShapePos();
705 
706  wxPoint delta = aPosition - shape_pos;
707 
708  // first test: a test point must be inside a minimum sized bounding circle.
709  int radius = GetBoundingRadius();
710 
711  if( ( abs( delta.x ) > radius ) || ( abs( delta.y ) > radius ) )
712  return false;
713 
714  dx = m_Size.x >> 1; // dx also is the radius for rounded pads
715  dy = m_Size.y >> 1;
716 
717  switch( GetShape() )
718  {
719  case PAD_SHAPE_CIRCLE:
720  if( KiROUND( EuclideanNorm( delta ) ) <= dx )
721  return true;
722 
723  break;
724 
725  case PAD_SHAPE_TRAPEZOID:
726  {
727  wxPoint poly[4];
728  BuildPadPolygon( poly, wxSize(0,0), 0 );
729  RotatePoint( &delta, -m_Orient );
730  return TestPointInsidePolygon( poly, 4, delta );
731  }
732 
733  case PAD_SHAPE_OVAL:
734  {
735  RotatePoint( &delta, -m_Orient );
736  // An oval pad has the same shape as a segment with rounded ends
737  // After rotation, the test point is relative to an horizontal pad
738  int dist;
739  wxPoint offset;
740  if( dy > dx ) // shape is a vertical oval
741  {
742  offset.y = dy - dx;
743  dist = dx;
744  }
745  else //if( dy <= dx ) shape is an horizontal oval
746  {
747  offset.x = dy - dx;
748  dist = dy;
749  }
750  return TestSegmentHit( delta, - offset, offset, dist );
751  }
752  break;
753 
754  case PAD_SHAPE_RECT:
755  RotatePoint( &delta, -m_Orient );
756 
757  if( (abs( delta.x ) <= dx ) && (abs( delta.y ) <= dy) )
758  return true;
759 
760  break;
761 
762  case PAD_SHAPE_ROUNDRECT:
763  {
764  // Check for hit in polygon
765  SHAPE_POLY_SET outline;
766  const int segmentToCircleCount = 32;
768  GetRoundRectCornerRadius(), segmentToCircleCount );
769 
770  const SHAPE_LINE_CHAIN &poly = outline.COutline( 0 );
771  return TestPointInsidePolygon( (const wxPoint*)&poly.CPoint(0), poly.PointCount(), delta );
772  }
773  break;
774  }
775 
776  return false;
777 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:104
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
void BuildPadPolygon(wxPoint aCoord[4], wxSize aInflateValue, double aRotation) const
Function BuildPadPolygon Has meaning only for polygonal pads (trapezoid and rectangular) Build the Co...
int PointCount() const
Function PointCount()
void TransformRoundRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, int aCircleToSegmentsCount)
Function TransformRoundRectToPolygon convert a rectangle with rounded corners to a polygon Convert ar...
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:351
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:618
static const int dist[10][10]
Definition: dist.cpp:57
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
#define abs(a)
Definition: auxiliary.h:84
static const int delta[8][2]
Definition: solve.cpp:112
bool TestPointInsidePolygon(const CPOLYGONS_LIST &aPolysList, int aIdxstart, int aIdxend, int aRefx, int aRefy)
Function TestPointInsidePolygon test if a point is inside or outside a polygon.
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: class_pad.h:428
Class SHAPE_POLY_SET.
const wxSize & GetSize() const
Definition: class_pad.h:182
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Class SHAPE_LINE_CHAIN.
wxPoint ShapePos() const
Definition: class_pad.cpp:367
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Function TestSegmentHit test for hit on line segment i.e.
Definition: trigo.cpp:142
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
void D_PAD::ImportSettingsFromMaster ( const D_PAD aMasterPad)

Imports the pad settings from aMasterPad.

The result is "this" has the same settinds (sizes, shapes ... ) as aMasterPad

Parameters
aMasterPad= the template pad

Definition at line 1050 of file class_pad.cpp.

References GetAttribute(), GetDelta(), GetDrillShape(), GetDrillSize(), GetLayerSet(), GetOffset(), MODULE::GetOrientation(), GetOrientation(), GetParent(), GetRoundRectRadiusRatio(), GetShape(), GetSize(), PAD_ATTRIB_CONN, PAD_ATTRIB_SMD, PAD_SHAPE_CIRCLE, PAD_SHAPE_TRAPEZOID, SetAttribute(), SetDelta(), SetDrillShape(), SetDrillSize(), SetLayerSet(), SetOffset(), SetOrientation(), SetRoundRectRadiusRatio(), SetShape(), and SetSize().

Referenced by PAD_TOOL::applyPadSettings(), PAD_TOOL::copyPadSettings(), PCB_BASE_FRAME::Export_Pad_Settings(), and PCB_BASE_FRAME::Import_Pad_Settings().

1051 {
1052  SetShape( aMasterPad.GetShape() );
1053  SetLayerSet( aMasterPad.GetLayerSet() );
1054  SetAttribute( aMasterPad.GetAttribute() );
1055 
1056  // The pad orientation, for historical reasons is the
1057  // pad rotation + parent rotation.
1058  // So we have to manage this parent rotation
1059  double pad_rot = aMasterPad.GetOrientation();
1060 
1061  if( aMasterPad.GetParent() )
1062  pad_rot -= aMasterPad.GetParent()->GetOrientation();
1063 
1064  if( GetParent() )
1065  pad_rot += GetParent()->GetOrientation();
1066 
1067  SetOrientation( pad_rot );
1068 
1069  SetSize( aMasterPad.GetSize() );
1070  SetDelta( wxSize( 0, 0 ) );
1071  SetOffset( aMasterPad.GetOffset() );
1072  SetDrillSize( aMasterPad.GetDrillSize() );
1073  SetDrillShape( aMasterPad.GetDrillShape() );
1075 
1076  switch( aMasterPad.GetShape() )
1077  {
1078  case PAD_SHAPE_TRAPEZOID:
1079  SetDelta( aMasterPad.GetDelta() );
1080  break;
1081 
1082  case PAD_SHAPE_CIRCLE:
1083  // ensure size.y == size.x
1084  SetSize( wxSize( GetSize().x, GetSize().x ) );
1085  break;
1086 
1087  default:
1088  ;
1089  }
1090 
1091  switch( aMasterPad.GetAttribute() )
1092  {
1093  case PAD_ATTRIB_SMD:
1094  case PAD_ATTRIB_CONN:
1095  // These pads do not have hole (they are expected to be only on one
1096  // external copper layer)
1097  SetDrillSize( wxSize( 0, 0 ) );
1098  break;
1099 
1100  default:
1101  ;
1102  }
1103 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
MODULE * GetParent() const
Definition: class_pad.h:108
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:221
void SetDrillSize(const wxSize &aSize)
Definition: class_pad.h:187
const wxSize & GetDrillSize() const
Definition: class_pad.h:188
void SetRoundRectRadiusRatio(double aRadiusScale)
has meaning only for rounded rect pads Set the scaling factor between the smaller Y or Y size and the...
Definition: class_pad.h:462
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:166
double GetOrientation() const
Definition: class_module.h:148
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:235
const wxSize & GetSize() const
Definition: class_pad.h:182
void SetSize(const wxSize &aSize)
Definition: class_pad.h:181
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:60
void SetAttribute(PAD_ATTR_T aAttribute)
Definition: class_pad.cpp:297
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:234
double GetRoundRectRadiusRatio() const
has meaning only for rounded rect pads
Definition: class_pad.h:450
void SetDrillShape(PAD_DRILL_SHAPE_T aDrillShape)
Definition: class_pad.h:218
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:214
const wxSize & GetDelta() const
Definition: class_pad.h:185
void SetShape(PAD_SHAPE_T aShape)
Definition: class_pad.h:167
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: class_pad.cpp:306
void SetOffset(const wxPoint &aOffset)
Definition: class_pad.h:190
const wxPoint & GetOffset() const
Definition: class_pad.h:191
void SetDelta(const wxSize &aSize)
Definition: class_pad.h:184
bool D_PAD::IncrementPadName ( bool  aSkipUnconnectable,
bool  aFillSequenceGaps 
)

Function IncrementPadName.

Increments the pad name to the next available name in the module.

Parameters
aSkipUnconnectableskips any pads that are not connectable (for example NPTH)
aFillSequenceGapsif true, the next reference in a sequence like A1,A3,A4 will be A2. If false, it will be A5.
Returns
pad name incremented

Definition at line 424 of file class_pad.cpp.

References GetAttribute(), GetNextPadName(), GetParent(), PAD_ATTRIB_HOLE_NOT_PLATED, and SetPadName().

Referenced by CopyMarkedItems(), MODULE::Duplicate(), and MODULE_EDITOR_TOOLS::PlacePad().

425 {
426  bool skip = aSkipUnconnectable && ( GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED );
427 
428  if( !skip )
429  SetPadName( GetParent()->GetNextPadName( aFillSequenceGaps ) );
430 
431  return !skip;
432 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:63
MODULE * GetParent() const
Definition: class_pad.h:108
static wxString GetNextPadName(wxString aPadName)
Compute the 'next' pad number for autoincrement aPadName is the last pad name used.
void SetPadName(const wxString &name)
Set the pad name (sometimes called pad number, although it can be an array ref like AA12 the pad name...
Definition: class_pad.cpp:404
bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 224 of file base_struct.h.

References BRIGHTENED.

Referenced by SELECTION_TOOL::disambiguationMenu().

224 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
bool BOARD_CONNECTED_ITEM::IsConnected ( ) const
inlineoverridevirtualinherited

>

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 from BOARD_ITEM.

Definition at line 81 of file class_board_connected_item.h.

82  {
83  return true;
84  }
bool EDA_ITEM::IsDragging ( ) const
inlineinherited
bool D_PAD::IsFlipped ( ) const
Returns
true if the pad has a footprint parent flipped (on the back/bottom layer)

Definition at line 124 of file class_pad.cpp.

References B_Cu, BOARD_ITEM::GetLayer(), and GetParent().

Referenced by DIALOG_PAD_PROPERTIES::initValues().

125 {
126  if( GetParent() && GetParent()->GetLayer() == B_Cu )
127  return true;
128  return false;
129 }
MODULE * GetParent() const
Definition: class_pad.h:108
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

References HIGHLIGHTED.

223 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
virtual bool BOARD_ITEM::IsLocked ( ) const
inlinevirtualinherited

Function IsLocked.

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

Reimplemented in MODULE, and TRACK.

Definition at line 202 of file class_board_item.h.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), GENERAL_COLLECTOR::Inspect(), PCB_EDITOR_CONTROL::modifyLockSelected(), and PCB_EDIT_FRAME::OnHotkeyDeleteItem().

203  {
204  // only MODULEs & TRACKs can be locked at this time.
205  return false;
206  }
bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 217 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

217 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:109
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 216 of file base_struct.h.

References IS_NEW.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToList(), SCH_EDIT_FRAME::addJunctionMenuEntries(), AddMenusForBus(), AddMenusForWire(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteCurrentSegment(), LIB_ARC::drawEditGraphics(), LIB_ARC::drawGraphic(), DrawMovePin(), SCH_EDIT_FRAME::EditSheetPin(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_EDIT_FRAME::ReSizeSheet(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), and DIALOG_LABEL_EDITOR::TextPropertiesAccept().

216 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
bool D_PAD::IsOnLayer ( PCB_LAYER_ID  aLayer) const
inlineoverridevirtual

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 from BOARD_ITEM.

Definition at line 479 of file class_pad.h.

References m_layerMask.

Referenced by CINFO3D_VISU::AddPadsShapesWithClearanceToContainer(), CINFO3D_VISU::createLayers(), Draw(), GENERAL_COLLECTOR::Inspect(), DSN::SPECCTRA_DB::makePADSTACK(), DRC::testTexts(), MODULE::TransformPadsShapesWithClearanceToPolygon(), CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon(), and ViewGetLayers().

480  {
481  return m_layerMask[aLayer];
482  }
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:641
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_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 444 of file base_struct.h.

Referenced by EDA_ITEM::Matches(), and EDA_ITEM::Replace().

444 { return false; }
bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 222 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

222 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:114
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 193 of file class_board_item.h.

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

Referenced by PCB_EDIT_FRAME::OnHotKey(), and PCB_EDIT_FRAME::OnHotkeyDeleteItem().

194  {
195  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
196  }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 220 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by abortMoveItem(), and SCH_FIELD::Draw().

220 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:117
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:175
SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes.

Parameters
listStartThe first in a list of EDA_ITEMs to iterate over.
inspectorIs an INSPECTOR to call on each object that is one of the requested scanTypes.
testDataIs an aid to testFunc, and should be sufficient to allow it to fully determine if an item meets the match criteria, but it may also be used to collect output.
scanTypesA KICAD_T array that is EOT terminated, and provides both the order and interest level of of the types of objects to be iterated over.
Returns
SEARCH_RESULT SEARCH_QUIT if the called INSPECTOR returned SEARCH_QUIT, else SCAN_CONTINUE;

Definition at line 132 of file base_struct.cpp.

References EDA_ITEM::Pnext, SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Visit().

Referenced by SCH_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), SCH_TYPE_COLLECTOR::Collect(), MODULE::Visit(), and BOARD::Visit().

136 {
137  EDA_ITEM* p = listStart;
138 
139  for( ; p; p = p->Pnext )
140  {
141  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
142  return SEARCH_QUIT;
143  }
144 
145  return SEARCH_CONTINUE;
146 }
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...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:164
virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData,
wxPoint aFindLocation 
)
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.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_SHEET, SCH_COMPONENT, SCH_SHEET_PIN, SCH_FIELD, SCH_TEXT, LIB_PIN, and SCH_MARKER.

Definition at line 400 of file base_struct.h.

Referenced by SCH_FIND_COLLECTOR::Inspect(), SCH_MARKER::Matches(), LIB_PIN::Matches(), SCH_TEXT::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), and SCH_SHEET::Matches().

401  {
402  return false;
403  }
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 184 of file base_struct.cpp.

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

185 {
186  wxString text = aText;
187  wxString searchText = aSearchData.GetFindString();
188 
189  // Don't match if searching for replaceable item and the item doesn't support text replace.
190  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
191  return false;
192 
193  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
194  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
195 
196  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
197  {
198  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
199  return text.Matches( searchText );
200 
201  return text.MakeUpper().Matches( searchText.MakeUpper() );
202  }
203 
204  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
205  return aText.Find( searchText ) != wxNOT_FOUND;
206 
207  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
208 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:444
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
void D_PAD::Move ( const wxPoint aMoveVector)
inlineoverridevirtual

Function Move move this object.

Parameters
aMoveVector- the move vector for this object.

Reimplemented from BOARD_ITEM.

Definition at line 507 of file class_pad.h.

References m_Pos, and SetLocalCoord().

508  {
509  m_Pos += aMoveVector;
510  SetLocalCoord();
511  }
void SetLocalCoord()
Set relative coordinates.
Definition: class_pad.cpp:282
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
D_PAD* D_PAD::Next ( ) const
inline

Definition at line 106 of file class_pad.h.

References EDA_ITEM::Pnext.

Referenced by RN_DATA::Add(), C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container(), RN_DATA::AddBlocked(), CINFO3D_VISU::AddPadsShapesWithClearanceToContainer(), RN_DATA::AddSimple(), build_pad_testpoints(), PCB_BASE_FRAME::build_ratsnest_module(), DRAG_LIST::BuildDragListe(), ZONE_CONTAINER::buildFeatureHoleList(), EXCELLON_WRITER::buildHolesList(), NETINFO_LIST::buildPadsFullList(), BuildUnconnectedThermalStubsPolygonList(), MODULE::ClearAllNets(), GRID_HELPER::computeAnchors(), CopyMarkedItems(), MODULE::CopyNetlistSettings(), PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), CINFO3D_VISU::createLayers(), MWAVE::CreateMicrowaveInductor(), CreateShapesSection(), CreateSignalsSection(), DeleteMarkedItems(), PCB_EDIT_FRAME::DoGenFootprintsReport(), MODULE::Draw(), BOARD::DrawHighLight(), DrawMovingBlockOutlines(), MODULE::DrawOutlinesWhenMoving(), PCB_EDIT_FRAME::Edit_Gap(), MODULE_EDITOR_TOOLS::EnumeratePads(), export_vrml_module(), MODULE::FindPadByName(), MODULE::Flip(), PCB_IO::format(), C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads(), genModuleOnRoutingMatrix(), MODULE::GetFootprintRect(), NETINFO_ITEM::GetMsgPanelInfo(), MODULE::GetNextPadName(), getOptimalModulePlacement(), MODULE::GetPad(), MODULE::GetPadCount(), MODULE::GetTopLeftPad(), MODULE::GetUniquePadCount(), PCB_BASE_FRAME::GlobalChange_PadSettings(), globalChangePadSettings(), HasNonSMDPins(), idf_export_module(), DIALOG_GENDRILL::InitDisplayParams(), EAGLE_PLUGIN::loadElements(), MarkItemsInBloc(), MirrorMarkedItems(), MODULE::MODULE(), MODULE::MoveAnchorPosition(), MoveMarkedItems(), MoveMarkedItemsExactly(), PCB_BASE_FRAME::OnTogglePadDrawMode(), MODULE::operator=(), MODULE::PadCoverageRatio(), PCBNEW_CONTROL::PadDisplayMode(), MODULE_EDITOR_TOOLS::PasteItems(), BRDITEMS_PLOTTER::PlotDrillMarks(), PlotLayerOutlines(), PlotSilkScreen(), PlotStandardLayer(), Print_Module(), RN_DATA::ProcessBoard(), RN_DATA::Remove(), BOARD::ReplaceNetlist(), RotateMarkedItems(), MODULE::RunOnChildren(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SELECTION_TOOL::selectAllItemsOnSheet(), MODULE::SetOrientation(), MODULE::SetPosition(), PCB_EDIT_FRAME::Show_1_Ratsnest(), PNS_KICAD_IFACE::SyncWorld(), BOARD::Test_Connections_To_Copper_Areas(), ZONE_CONTAINER::TestForCopperIslandAndRemoveInsulatedIslands(), Trace_Pads_Only(), MODULE::TransformPadsShapesWithClearanceToPolygon(), CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon(), NETINFO_MAPPING::Update(), and BOARD_NETLIST_UPDATER::updateComponentPadConnections().

106 { return static_cast<D_PAD*>( Pnext ); }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:164
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 241 of file base_struct.cpp.

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

242 {
243  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
244  GetChars( GetClass() ) ) );
245 
246  return false;
247 }
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:92
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:205
bool D_PAD::PadNameEqual ( const D_PAD other) const
inline

Definition at line 157 of file class_pad.h.

References m_NumPadName.

Referenced by DRC::doPadToPadsDrc().

158  {
159  return m_NumPadName == other->m_NumPadName; // hide tricks behind sensible API
160  }
wxUint32 m_NumPadName
Definition: class_pad.h:601
bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
inherited

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 211 of file base_struct.cpp.

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

Referenced by SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

212 {
213  wxCHECK_MSG( IsReplaceable(), false,
214  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
215 
216  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
217 
218  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
219  aSearchData.GetFindString() :
220  aSearchData.GetFindString().Upper() );
221 
222  if( result == wxNOT_FOUND )
223  return false;
224 
225  wxString prefix = aText.Left( result );
226  wxString suffix;
227 
228  if( aSearchData.GetFindString().length() + result < aText.length() )
229  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
230 
231  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
232  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
233  GetChars( suffix ) );
234 
235  aText = prefix + aSearchData.GetReplaceString() + suffix;
236 
237  return true;
238 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:444
const wxString traceFindReplace(wxT("KicadFindReplace"))
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:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
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_SHEET, SCH_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 432 of file base_struct.h.

432 { return false; }
void D_PAD::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 836 of file class_pad.cpp.

References m_Orient, m_Pos, NormalizeAngle360(), RotatePoint(), and SetLocalCoord().

Referenced by MoveMarkedItemsExactly(), and MODULE_EDITOR_TOOLS::PlacePad().

837 {
838  RotatePoint( &m_Pos, aRotCentre, aAngle );
839 
840  m_Orient = NormalizeAngle360( m_Orient + aAngle );
841 
842  SetLocalCoord();
843 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void SetLocalCoord()
Set relative coordinates.
Definition: class_pad.cpp:282
double m_Orient
in 1/10 degrees
Definition: class_pad.h:652
T NormalizeAngle360(T Angle)
Normalize angle to be in the -360.0 .. 360.0:
Definition: trigo.h:202
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
void D_PAD::SetAttribute ( PAD_ATTR_T  aAttribute)

Definition at line 297 of file class_pad.cpp.

References m_Attribute, m_Drill, and PAD_ATTRIB_SMD.

Referenced by PCAD2KICAD::PCB_PAD::AddToModule(), MWAVE::CreateMicrowaveInductor(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), ImportSettingsFromMaster(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::packageHole(), EAGLE_PLUGIN::packageSMD(), GPCB_FPL_CACHE::parseMODULE(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

298 {
299  m_Attribute = aAttribute;
300 
301  if( aAttribute == PAD_ATTRIB_SMD )
302  m_Drill = wxSize( 0, 0 );
303 }
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
PAD_ATTR_T m_Attribute
PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED.
Definition: class_pad.h:650
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:614
void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 229 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by SELECTION_TOOL::disambiguationMenu().

229 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
void D_PAD::SetDelta ( const wxSize &  aSize)
inline

Definition at line 184 of file class_pad.h.

References m_boundingRadius, and m_DeltaSize.

Referenced by PCAD2KICAD::PCB_PAD::AddToModule(), ImportSettingsFromMaster(), DIALOG_PAD_PROPERTIES::initValues(), mirrorPadX(), PCB_BASE_FRAME::RotatePad(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

184 { m_DeltaSize = aSize; m_boundingRadius = -1; }
int m_boundingRadius
radius of the circle containing the pad shape
Definition: class_pad.h:592
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:645
void D_PAD::SetDrawCoord ( )

Set absolute coordinates.

Definition at line 266 of file class_pad.cpp.

References PNS::angle(), MODULE::GetOrientation(), MODULE::GetPosition(), EDA_ITEM::m_Parent, m_Pos, m_Pos0, RotatePoint(), wxPoint::x, and wxPoint::y.

267 {
268  MODULE* module = (MODULE*) m_Parent;
269 
270  m_Pos = m_Pos0;
271 
272  if( module == NULL )
273  return;
274 
275  double angle = module->GetOrientation();
276 
277  RotatePoint( &m_Pos.x, &m_Pos.y, angle );
278  m_Pos += module->GetPosition();
279 }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:168
const wxPoint & GetPosition() const override
Definition: class_module.h:144
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
double GetOrientation() const
Definition: class_module.h:148
wxPoint m_Pos0
Initial Pad position (i.e.
Definition: class_pad.h:647
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:605
void D_PAD::SetDrillShape ( PAD_DRILL_SHAPE_T  aDrillShape)
inline

Definition at line 218 of file class_pad.h.

References m_drillShape.

Referenced by PCAD2KICAD::PCB_PAD::AddToModule(), D_PAD(), ImportSettingsFromMaster(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

219  { m_drillShape = aDrillShape; }
PAD_DRILL_SHAPE_T m_drillShape
PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG.
Definition: class_pad.h:620
void D_PAD::SetDrillSize ( const wxSize &  aSize)
inline
void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 253 of file base_struct.h.

Referenced by SCH_SCREEN::addConnectedItemsToBlock(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_PART::CopySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::EditDimension(), LIB_PIN::EnableEditMode(), PCB_EDIT_FRAME::FlipTextePcb(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), PCB_BASE_FRAME::LoadModuleFromLibrary(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), moveBitmap(), SCH_EDIT_FRAME::MoveImage(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnSelectUnit(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_SCREEN::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), LIB_PIN::SetNumber(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and