KiCad PCB EDA Suite
class_pad.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef PAD_H_
31 #define PAD_H_
32 
33 
34 #include <class_board_item.h>
35 #include <board_connected_item.h>
36 #include <pad_shapes.h>
37 #include <PolyLine.h>
38 #include <config_params.h> // PARAM_CFG_ARRAY
39 #include "zones.h"
40 
41 class DRAWSEGMENT;
42 
44 {
47 };
48 
49 class LINE_READER;
50 class EDA_3D_CANVAS;
51 class EDA_DRAW_PANEL;
52 class MODULE;
53 class EDGE_MODULE;
54 class TRACK;
55 class MSG_PANEL_INFO;
56 
57 namespace KIGFX
58 {
59  class VIEW;
60 }
61 
62 // Helper class to store parameters used to draw a pad
64 {
65 public:
66  EDA_DRAW_PANEL* m_DrawPanel; // the EDA_DRAW_PANEL used to draw a PAD ; can be null
67  GR_DRAWMODE m_DrawMode; // the draw mode
68  COLOR4D m_Color; // color used to draw the pad shape , from pad layers and
69  // visible layers
70  COLOR4D m_HoleColor; // color used to draw the pad hole
71  COLOR4D m_NPHoleColor; // color used to draw a pad Not Plated hole
72  COLOR4D m_NoNetMarkColor; // color used to draw a mark on pads having no net
73  int m_PadClearance; // clearance value, used to draw the pad area outlines
74  wxSize m_Mask_margin; // margin, used to draw solder paste when only one layer is shown
75  bool m_Display_padnum; // true to show pad number
76  bool m_Display_netname; // true to show net name
77  bool m_ShowPadFilled; // true to show pad as solid area, false to show pas in
78  // sketch mode
79  bool m_ShowNCMark; // true to show pad not connected mark
80  bool m_ShowNotPlatedHole; // true when the pad hole in not plated, to draw a specific
81  // pad shape
82  bool m_IsPrinting; // true to print, false to display on screen.
83  wxPoint m_Offset; // general draw offset
84 
85  PAD_DRAWINFO();
86 };
87 
92 {
93 public:
96  // if thickness is not = 0 S_CIRCLE shape is a ring
98  int m_Radius;
99  double m_ArcAngle;
102  std::vector<wxPoint> m_Poly;
103 
105  m_Shape( aShape ), m_Thickness( 0 ), m_Radius( 0 ), m_ArcAngle( 0 )
106  {
107  }
108 
109  // Accessors (helpers for arc and circle shapes)
110  wxPoint GetCenter() { return m_Start; }
111  wxPoint GetArcStart() { return m_End; }
112 
113  // Geometric transform
117  void Move( wxPoint aMoveVector );
118 
123  void ExportTo( DRAWSEGMENT* aTarget );
124 
129  void ExportTo( EDGE_MODULE* aTarget );
130 };
131 
132 
134 {
135 public:
137 
139 public:
140  D_PAD( MODULE* parent );
141 
142  // Do not create a copy constructor & operator=.
143  // The ones generated by the compiler are adequate.
144 
145  /* Default layers used for pads, according to the pad type.
146  * this is default values only, they can be changed for a given pad
147  */
148  static LSET StandardMask();
149  static LSET SMDMask();
150  static LSET ConnSMDMask();
151  static LSET UnplatedHoleMask();
153  static LSET ApertureMask();
154 
155  static inline bool ClassOf( const EDA_ITEM* aItem )
156  {
157  return aItem && PCB_PAD_T == aItem->Type();
158  }
159 
160  D_PAD* Next() const { return static_cast<D_PAD*>( Pnext ); }
161 
162  MODULE* GetParent() const { return (MODULE*) m_Parent; }
163 
170  void ImportSettingsFromMaster( const D_PAD& aMasterPad );
171 
176  bool IsFlipped() const;
177 
182  void SetName( const wxString& aName )
183  {
184  m_name = aName;
185  }
186 
190  const wxString& GetName() const
191  {
192  return m_name;
193  }
194 
205  bool IncrementPadName( bool aSkipUnconnectable, bool aFillSequenceGaps );
206 
207  bool PadNameEqual( const D_PAD* other ) const
208  {
209  return m_name == other->m_name; // hide tricks behind sensible API
210  }
211 
216  PAD_SHAPE_T GetShape() const { return m_padShape; }
217  void SetShape( PAD_SHAPE_T aShape ) { m_padShape = aShape; m_boundingRadius = -1; }
218 
219  void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; }
220  const wxPoint GetPosition() const override { return m_Pos; }
221 
226  PAD_SHAPE_T GetAnchorPadShape() const { return m_anchorPadShape; }
227 
233  {
234  return m_customShapeClearanceArea;
235  }
236 
243  {
244  m_customShapeClearanceArea = aOption;
245  }
246 
254  {
255  m_anchorPadShape = ( aShape == PAD_SHAPE_RECT ) ? PAD_SHAPE_RECT : PAD_SHAPE_CIRCLE;
256  m_boundingRadius = -1;
257  }
258 
259  void SetY( int y ) { m_Pos.y = y; }
260  void SetX( int x ) { m_Pos.x = x; }
261 
262  void SetPos0( const wxPoint& aPos ) { m_Pos0 = aPos; }
263  const wxPoint& GetPos0() const { return m_Pos0; }
264 
265  void SetY0( int y ) { m_Pos0.y = y; }
266  void SetX0( int x ) { m_Pos0.x = x; }
267 
268  void SetSize( const wxSize& aSize ) { m_Size = aSize; m_boundingRadius = -1; }
269  const wxSize& GetSize() const { return m_Size; }
270 
271  void SetDelta( const wxSize& aSize ) { m_DeltaSize = aSize; m_boundingRadius = -1; }
272  const wxSize& GetDelta() const { return m_DeltaSize; }
273 
274  void SetDrillSize( const wxSize& aSize ) { m_Drill = aSize; }
275  const wxSize& GetDrillSize() const { return m_Drill; }
276 
277  void SetOffset( const wxPoint& aOffset ) { m_Offset = aOffset; }
278  const wxPoint& GetOffset() const { return m_Offset; }
279 
289  void AddPrimitive( const SHAPE_POLY_SET& aPoly, int aThickness );
290  void AddPrimitive( const std::vector<wxPoint>& aPoly, int aThickness );
291  void AddPrimitive( wxPoint aStart, wxPoint aEnd, int aThickness );
292  void AddPrimitive( wxPoint aCenter, int aRadius, int aThickness );
293  void AddPrimitive( wxPoint aCenter, wxPoint aStart,
294  int aArcAngle, int aThickness );
295 
296 
297  bool GetBestAnchorPosition( VECTOR2I& aPos );
298 
310  bool MergePrimitivesAsPolygon( SHAPE_POLY_SET * aMergedPolygon = NULL,
311  int aCircleToSegmentsCount = 32 );
312 
316  void DeletePrimitivesList();
317 
330  void CustomShapeAsPolygonToBoardPosition( SHAPE_POLY_SET * aMergedPolygon,
331  wxPoint aPosition, double aRotation ) const;
332 
336  const std::vector<PAD_CS_PRIMITIVE>& GetPrimitives() const { return m_basicShapes; }
337 
341  const SHAPE_POLY_SET& GetCustomShapeAsPolygon() const { return m_customShapeAsPolygon; }
342 
343  void Flip( const wxPoint& aCentre ) override;
344 
348  void FlipPrimitives();
349 
355  bool SetPrimitives( const std::vector<PAD_CS_PRIMITIVE>& aPrimitivesList );
356 
362  bool AddPrimitives( const std::vector<PAD_CS_PRIMITIVE>& aPrimitivesList );
363 
364 
371  void SetOrientation( double aAngle );
372 
376  void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation*10.0 ); }
377 
382  double GetOrientation() const { return m_Orient; }
383  double GetOrientationDegrees() const { return m_Orient/10.0; }
384  double GetOrientationRadians() const { return m_Orient*M_PI/1800; }
385 
386  void SetDrillShape( PAD_DRILL_SHAPE_T aDrillShape )
387  { m_drillShape = aDrillShape; }
388  PAD_DRILL_SHAPE_T GetDrillShape() const { return m_drillShape; }
389 
399  void GetOblongDrillGeometry( wxPoint& aStartPoint, wxPoint& aEndPoint, int& aWidth ) const;
400 
401  void SetLayerSet( LSET aLayerMask ) { m_layerMask = aLayerMask; }
402  LSET GetLayerSet() const override { return m_layerMask; }
403 
404  void SetAttribute( PAD_ATTR_T aAttribute );
405  PAD_ATTR_T GetAttribute() const { return m_Attribute; }
406 
407  // We don't currently have an attribute for APERTURE, and adding one will change the file
408  // format, so for now just infer a copper-less pad to be an APERTURE pad.
409  bool IsAperturePad() const { return ( m_layerMask & LSET::AllCuMask() ).none(); }
410 
411  void SetPadToDieLength( int aLength ) { m_LengthPadToDie = aLength; }
412  int GetPadToDieLength() const { return m_LengthPadToDie; }
413 
414  int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; }
415  void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
416 
417  int GetLocalClearance() const { return m_LocalClearance; }
418  void SetLocalClearance( int aClearance ) { m_LocalClearance = aClearance; }
419 
420  int GetLocalSolderPasteMargin() const { return m_LocalSolderPasteMargin; }
421  void SetLocalSolderPasteMargin( int aMargin ) { m_LocalSolderPasteMargin = aMargin; }
422 
423  double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; }
424  void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; }
425 
426 
439  void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
440  int aClearanceValue,
441  int aCircleToSegmentsCount,
442  double aCorrectionFactor ) const override;
443 
453  int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const override;
454 
455  // Mask margins handling:
456 
468  int GetSolderMaskMargin() const;
469 
484  wxSize GetSolderPasteMargin() const;
485 
486  void SetZoneConnection( ZoneConnection aType ) { m_ZoneConnection = aType; }
487  ZoneConnection GetZoneConnection() const;
488 
489  void SetThermalWidth( int aWidth ) { m_ThermalWidth = aWidth; }
490  int GetThermalWidth() const;
491 
492  void SetThermalGap( int aGap ) { m_ThermalGap = aGap; }
493  int GetThermalGap() const;
494 
495  /* drawing functions */
496  void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
497  GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset ) override;
498 
509  void DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo );
510 
521  void BuildPadPolygon( wxPoint aCoord[4], wxSize aInflateValue, double aRotation ) const;
522 
529  {
530  return GetRoundRectCornerRadius( m_Size );
531  }
532 
542  int GetRoundRectCornerRadius( const wxSize& aSize ) const;
543 
563  void BuildPadShapePolygon( SHAPE_POLY_SET& aCornerBuffer,
564  wxSize aInflateValue, int aSegmentsPerCircle,
565  double aCorrectionFactor ) const;
566 
578  bool BuildPadDrillShapePolygon( SHAPE_POLY_SET& aCornerBuffer,
579  int aInflateValue, int aSegmentsPerCircle ) const;
580 
595  int BuildSegmentFromOvalShape( wxPoint& aSegStart, wxPoint& aSegEnd,
596  double aRotation, const wxSize& aMargin ) const;
597 
603  int GetBoundingRadius() const
604  {
605  // Any member function which would affect this calculation should set
606  // m_boundingRadius to -1 to re-trigger the calculation from here.
607  // Currently that is only m_Size, m_DeltaSize, and m_padShape accessors.
608  if( m_boundingRadius == -1 )
609  {
610  m_boundingRadius = boundingRadius();
611  }
612 
613  return m_boundingRadius;
614  }
615 
616  wxPoint ShapePos() const;
617 
625  double GetRoundRectRadiusRatio() const
626  {
627  return m_padRoundRectRadiusScale;
628  }
629 
637  void SetRoundRectRadiusRatio( double aRadiusScale )
638  {
639  if( aRadiusScale < 0.0 )
640  aRadiusScale = 0.0;
641 
642  m_padRoundRectRadiusScale = std::min( aRadiusScale, 0.5 );
643  }
644 
649  int GetSubRatsnest() const { return m_SubRatsnest; }
650  void SetSubRatsnest( int aSubRatsnest ) { m_SubRatsnest = aSubRatsnest; }
651 
652  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;
653 
654  bool IsOnLayer( PCB_LAYER_ID aLayer ) const override
655  {
656  return m_layerMask[aLayer];
657  }
658 
659  bool HitTest( const wxPoint& aPosition ) const override;
660 
661  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
662 
663  wxString GetClass() const override
664  {
665  return wxT( "PAD" );
666  }
667 
668  // Virtual function:
669  const EDA_RECT GetBoundingBox() const override;
670 
672  void SetDrawCoord();
673 
675  void SetLocalCoord();
676 
682  static int Compare( const D_PAD* padref, const D_PAD* padcmp );
683 
684  void Move( const wxPoint& aMoveVector ) override
685  {
686  m_Pos += aMoveVector;
687  SetLocalCoord();
688  }
689 
690  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
691 
692  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
693 
694  BITMAP_DEF GetMenuImage() const override;
695 
700  wxString ShowPadShape() const;
701 
706  wxString ShowPadAttr() const;
707 
714  void AppendConfigs( PARAM_CFG_ARRAY* aResult );
715 
716  EDA_ITEM* Clone() const override;
717 
723  D_PAD* Duplicate() const
724  {
725  return (D_PAD*) Clone();
726  }
727 
733  bool PadShouldBeNPTH() const;
734 
735  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
736 
737  virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
738 
739  virtual const BOX2I ViewBBox() const override;
740 
756  void CopyNetlistSettings( D_PAD* aPad, bool aCopyLocalSettings );
757 
758  virtual void SwapData( BOARD_ITEM* aImage ) override;
759 
760 #if defined(DEBUG)
761  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
762 #endif
763 
764 
765 private:
770  int boundingRadius() const;
771 
772  bool buildCustomPadPolygon( SHAPE_POLY_SET* aMergedPolygon,
773  int aCircleToSegmentsCount );
774 
775 private: // Private variable members:
776 
777  // Actually computed and cached on demand by the accessor
778  mutable int m_boundingRadius;
779 
780  wxString m_name;
781 
783 
785 
792  std::vector<PAD_CS_PRIMITIVE> m_basicShapes;
793 
798 
806 
808 
810  wxSize m_Drill;
811 
814  wxSize m_Size;
815 
817 
819 
822 
839 
841 
844  wxSize m_DeltaSize;
845 
847 
850  double m_Orient;
852 
854 
859 
861 
864 
866  ZoneConnection m_ZoneConnection;
869 
872 };
873 
874 #endif // PAD_H_
int m_LocalClearance
Local clearance.
Definition: class_pad.h:858
int m_ThermalGap
Definition: class_pad.h:871
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:673
int m_LocalSolderMaskMargin
Local mask margins: when 0, the parent footprint design values are used.
Definition: class_pad.h:862
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
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:136
double m_padRoundRectRadiusScale
scaling factor from smallest m_Size coord to corner radius, default 0.25
Definition: class_pad.h:818
A list of parameters type.
int m_boundingRadius
radius of the circle containing the pad shape
Definition: class_pad.h:778
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: class_pad.h:226
static bool ClassOf(const EDA_ITEM *aItem)
Definition: class_pad.h:155
bool PadNameEqual(const D_PAD *other) const
Definition: class_pad.h:207
std::vector< PAD_CS_PRIMITIVE > m_basicShapes
for free shape pads: a list of basic shapes, in local coordinates, orient 0, coordinates relative to ...
Definition: class_pad.h:792
const std::vector< PAD_CS_PRIMITIVE > & GetPrimitives() const
Accessor to the basic shape list.
Definition: class_pad.h:336
bool IsAperturePad() const
Definition: class_pad.h:409
bool m_Display_padnum
Definition: class_pad.h:75
PNG memory record (file in memory).
Definition: bitmap_types.h:41
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:405
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
PAD_ATTR_T
Enum PAD_ATTR_T is the set of pad shapes, used with D_PAD::{Set,Get}Attribute() The double name is fo...
Definition: pad_shapes.h:58
int m_LocalSolderPasteMargin
Local solder paste margin absolute value.
Definition: class_pad.h:863
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
const SHAPE_POLY_SET & GetCustomShapeAsPolygon() const
Accessor to the custom shape as one polygon.
Definition: class_pad.h:341
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
int GetPadToDieLength() const
Definition: class_pad.h:412
int GetRoundRectCornerRadius() const
Function GetRoundRectCornerRadius Has meaning only for rounded rect pads.
Definition: class_pad.h:528
wxPoint m_Start
angle of an arc, from its starting point, in 0.1 deg
Definition: class_pad.h:100
ZoneConnection
How pads are covered by copper in zone.
Definition: zones.h:50
int GetLocalSolderMaskMargin() const
Definition: class_pad.h:414
wxSize m_Size
X and Y size ( relative to orient 0)
Definition: class_pad.h:814
MODULE * GetParent() const
Definition: class_pad.h:162
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
void SetPosition(const wxPoint &aPos) override
Definition: class_pad.h:219
The common library.
const wxPoint & GetPos0() const
Definition: class_pad.h:263
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: class_pad.h:388
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
COLOR4D m_NoNetMarkColor
Definition: class_pad.h:72
int m_SubRatsnest
variable used in rats nest computations handle subnet (block) number in ratsnest connection ...
Definition: class_pad.h:807
void SetSubRatsnest(int aSubRatsnest)
Definition: class_pad.h:650
void SetDrillSize(const wxSize &aSize)
Definition: class_pad.h:274
bool m_ShowNCMark
Definition: class_pad.h:79
PAD_CS_PRIMITIVE(STROKE_T aShape)
Definition: class_pad.h:104
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_pad.h:663
const wxSize & GetDrillSize() const
Definition: class_pad.h:275
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:637
void SetY0(int y)
Definition: class_pad.h:265
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:216
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
PAD_DRILL_SHAPE_T
Enum PAD_DRILL_SHAPE_T is the set of pad drill shapes, used with D_PAD::{Set,Get}DrillShape() ...
Definition: pad_shapes.h:46
bool m_IsPrinting
Definition: class_pad.h:82
PAD_SHAPE_T
Enum PAD_SHAPE_T is the set of pad shapes, used with D_PAD::{Set,Get}Shape()
Definition: pad_shapes.h:31
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: class_pad.h:253
PCB_LAYER_ID
A quick note on layer IDs:
wxString m_name
Definition: class_pad.h:780
int m_Radius
thickness of segment or outline For filled S_CIRCLE shape, thickness = 0.
Definition: class_pad.h:98
Class LSET is a set of PCB_LAYER_IDs.
std::vector< wxPoint > m_Poly
is also the start point of the arc
Definition: class_pad.h:102
void SetZoneConnection(ZoneConnection aType)
Definition: class_pad.h:486
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12)...
Definition: class_pad.h:182
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: class_pad.h:603
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
Class SHAPE_POLY_SET.
void SetPos0(const wxPoint &aPos)
Definition: class_pad.h:262
int GetSubRatsnest() const
Function GetSubRatsnest.
Definition: class_pad.h:649
GR_DRAWMODE m_DrawMode
Definition: class_pad.h:67
EDA_DRAW_PANEL * m_DrawPanel
Definition: class_pad.h:66
Helper class to handle a primitive (basic shape: polygon, segment, circle or arc) to build a custom p...
Definition: class_pad.h:91
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:402
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
How to build the custom shape in zone, to create the clearance area: CUST_PAD_SHAPE_IN_ZONE_OUTLINE =...
Definition: class_pad.h:805
D_PAD * Next() const
Definition: class_pad.h:160
double GetOrientationRadians() const
Definition: class_pad.h:384
void SetThermalWidth(int aWidth)
Definition: class_pad.h:489
void Move(const wxPoint &aMoveVector) override
Function Move move this object.
Definition: class_pad.h:684
COLOR4D m_HoleColor
Definition: class_pad.h:70
const wxSize & GetSize() const
Definition: class_pad.h:269
void SetSize(const wxSize &aSize)
Definition: class_pad.h:268
STROKE_T
Enum STROKE_T is the set of shapes for segments (graphic segments and tracks) which are often in the ...
void SetOrientationDegrees(double aOrientation)
Set orientation in degrees.
Definition: class_pad.h:376
const wxString & GetName() const
Definition: class_pad.h:190
int m_ThermalWidth
Definition: class_pad.h:870
bool m_ShowNotPlatedHole
Definition: class_pad.h:80
int GetLocalSolderPasteMargin() const
Definition: class_pad.h:420
SHAPE_POLY_SET m_customShapeAsPolygon
for free shape pads: the set of basic shapes, merged as one polygon, in local coordinates, orient 0, coordinates relative to m_Pos
Definition: class_pad.h:797
PAD_SHAPE_T m_anchorPadShape
for custom shaped pads: shape of pad anchor, PAD_SHAPE_RECT, PAD_SHAPE_CIRCLE
Definition: class_pad.h:821
void SetPadToDieLength(int aLength)
Definition: class_pad.h:411
wxSize m_DeltaSize
delta on rectangular shapes
Definition: class_pad.h:844
wxPoint m_End
is also the center of the circle and arc
Definition: class_pad.h:101
PAD_DRILL_SHAPE_T m_drillShape
PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG.
Definition: class_pad.h:816
STROKE_T m_Shape
Definition: class_pad.h:94
int m_PadClearance
Definition: class_pad.h:73
int GetLocalClearance() const
Definition: class_pad.h:417
CUST_PAD_SHAPE_IN_ZONE
Definition: class_pad.h:43
void SetLocalClearance(int aClearance)
Definition: class_pad.h:418
double GetLocalSolderPasteMarginRatio() const
Definition: class_pad.h:423
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_pad.h:424
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:380
int m_Thickness
S_SEGMENT, S_ARC, S_CIRCLE, S_POLYGON only (same as DRAWSEGMENT)
Definition: class_pad.h:95
wxPoint GetArcStart()
returns the center of a circle or arc
Definition: class_pad.h:111
LSET m_layerMask
Bitwise layer :1= copper layer, 15= cmp, 2..14 = internal layers 16 .
Definition: class_pad.h:840
void SetLayerSet(LSET aLayerMask)
Definition: class_pad.h:401
D_PAD * Duplicate() const
same as Clone, but returns a D_PAD item.
Definition: class_pad.h:723
void SetY(int y)
Definition: class_pad.h:259
wxPoint m_Offset
Definition: class_pad.h:83
double GetRoundRectRadiusRatio() const
has meaning only for rounded rect pads
Definition: class_pad.h:625
void SetDrillShape(PAD_DRILL_SHAPE_T aDrillShape)
Definition: class_pad.h:386
wxPoint m_Pos0
Initial Pad position (i.e.
Definition: class_pad.h:846
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_pad.h:415
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: class_pad.h:232
int m_LengthPadToDie
Length net from pad to die, inside the package.
Definition: class_pad.h:853
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees, but soon degrees.
Definition: class_pad.h:382
wxPoint GetCenter()
Definition: class_pad.h:110
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const wxSize & GetDelta() const
Definition: class_pad.h:272
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
void SetShape(PAD_SHAPE_T aShape)
Definition: class_pad.h:217
bool m_ShowPadFilled
Definition: class_pad.h:77
COLOR4D m_NPHoleColor
Definition: class_pad.h:71
PAD_ATTR_T m_Attribute
PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED.
Definition: class_pad.h:849
COLOR4D m_Color
Definition: class_pad.h:68
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_pad.h:421
void SetCustomShapeInZoneOpt(CUST_PAD_SHAPE_IN_ZONE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones. ...
Definition: class_pad.h:242
wxSize m_Drill
Drill diam (drill shape = PAD_CIRCLE) or drill size (shape = OVAL) for drill shape = PAD_CIRCLE...
Definition: class_pad.h:810
void SetX0(int x)
Definition: class_pad.h:266
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:865
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:838
Class VIEW.
Definition: view.h:58
bool m_Display_netname
Definition: class_pad.h:76
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:654
Class BOARD_CONNECTED_ITEM.
const wxPoint GetPosition() const override
Definition: class_pad.h:220
void SetOffset(const wxPoint &aOffset)
Definition: class_pad.h:277
wxSize m_Mask_margin
Definition: class_pad.h:74
void Flip(T &aValue)
void SetX(int x)
Definition: class_pad.h:260
void SetThermalGap(int aGap)
Definition: class_pad.h:492
double GetOrientationDegrees() const
Definition: class_pad.h:383
EDA_UNITS_T
Definition: common.h:159
const wxPoint & GetOffset() const
Definition: class_pad.h:278
double m_ArcAngle
radius of a circle
Definition: class_pad.h:99
void SetDelta(const wxSize &aSize)
Definition: class_pad.h:271
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:784
#define min(a, b)
Definition: auxiliary.h:85
wxPoint m_Pos
pad Position on board
Definition: class_pad.h:782
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39