KiCad PCB EDA Suite
APERTURE Class Reference

#include <gbr_plotter_apertures.h>

Public Types

enum  APERTURE_TYPE {
  AT_CIRCLE = 1 , AT_RECT = 2 , AT_PLOTTING = 3 , AT_OVAL = 4 ,
  AT_REGULAR_POLY = 5 , AT_REGULAR_POLY3 , AT_REGULAR_POLY4 , AT_REGULAR_POLY5 ,
  AT_REGULAR_POLY6 , AT_REGULAR_POLY7 , AT_REGULAR_POLY8 , AT_REGULAR_POLY9 ,
  AT_REGULAR_POLY10 , AT_REGULAR_POLY11 , AT_REGULAR_POLY12 , AM_ROUND_RECT ,
  AM_ROT_RECT , APER_MACRO_OUTLINE4P , APER_MACRO_OUTLINE5P , APER_MACRO_OUTLINE6P ,
  APER_MACRO_OUTLINE7P , APER_MACRO_OUTLINE8P , AM_ROTATED_OVAL , AM_FREE_POLYGON
}
 

Public Member Functions

void SetSize (const wxSize &aSize)
 
const VECTOR2I GetSize ()
 
void SetDiameter (int aDiameter)
 
int GetDiameter ()
 
void SetRegPolyVerticeCount (int aCount)
 
int GetRegPolyVerticeCount ()
 
void SetRotation (const EDA_ANGLE &aRotation)
 
EDA_ANGLE GetRotation ()
 

Public Attributes

APERTURE_TYPE m_Type
 
VECTOR2I m_Size
 
std::vector< VECTOR2Im_Corners
 
int m_Radius
 
EDA_ANGLE m_Rotation
 
int m_DCode
 
int m_ApertureAttribute
 

Detailed Description

Definition at line 44 of file gbr_plotter_apertures.h.

Member Enumeration Documentation

◆ APERTURE_TYPE

Enumerator
AT_CIRCLE 
AT_RECT 
AT_PLOTTING 
AT_OVAL 
AT_REGULAR_POLY 
AT_REGULAR_POLY3 
AT_REGULAR_POLY4 
AT_REGULAR_POLY5 
AT_REGULAR_POLY6 
AT_REGULAR_POLY7 
AT_REGULAR_POLY8 
AT_REGULAR_POLY9 
AT_REGULAR_POLY10 
AT_REGULAR_POLY11 
AT_REGULAR_POLY12 
AM_ROUND_RECT 
AM_ROT_RECT 
APER_MACRO_OUTLINE4P 
APER_MACRO_OUTLINE5P 
APER_MACRO_OUTLINE6P 
APER_MACRO_OUTLINE7P 
APER_MACRO_OUTLINE8P 
AM_ROTATED_OVAL 
AM_FREE_POLYGON 

Definition at line 47 of file gbr_plotter_apertures.h.

47 {
48 AT_CIRCLE = 1, // round aperture, to flash pads
49 AT_RECT = 2, // rect aperture, to flash pads
50 AT_PLOTTING = 3, // round aperture, to plot lines
51 AT_OVAL = 4, // oval aperture, to flash pads
52 AT_REGULAR_POLY = 5, // Regular polygon (n vertices, n = 3 .. 12, with rotation)
53 AT_REGULAR_POLY3, // Regular polygon 3 vertices, with rotation
54 AT_REGULAR_POLY4, // Regular polygon 4 vertices, with rotation
55 AT_REGULAR_POLY5, // Regular polygon 5 vertices, with rotation
56 AT_REGULAR_POLY6, // Regular polygon 6 vertices, with rotation
57 AT_REGULAR_POLY7, // Regular polygon 7 vertices, with rotation
58 AT_REGULAR_POLY8, // Regular polygon 8 vertices, with rotation
59 AT_REGULAR_POLY9, // Regular polygon 9 vertices, with rotation
60 AT_REGULAR_POLY10, // Regular polygon 10 vertices, with rotation
61 AT_REGULAR_POLY11, // Regular polygon 11 vertices, with rotation
62 AT_REGULAR_POLY12, // Regular polygon 12 vertices, with rotation
63 AM_ROUND_RECT, // Aperture macro for round rect pads
64 AM_ROT_RECT, // Aperture macro for rotated rect pads
65 APER_MACRO_OUTLINE4P, // Aperture macro for trapezoid pads (outline with 4 corners)
66 APER_MACRO_OUTLINE5P, // Aperture macro for pad polygons with 5 corners (chamfered pads)
67 APER_MACRO_OUTLINE6P, // Aperture macro for pad polygons with 6 corners (chamfered pads)
68 APER_MACRO_OUTLINE7P, // Aperture macro for pad polygons with 7 corners (chamfered pads)
69 APER_MACRO_OUTLINE8P, // Aperture macro for pad polygons with 8 corners (chamfered pads)
70 AM_ROTATED_OVAL, // Aperture macro for rotated oval pads
71 // (not rotated uses a primitive)
72 AM_FREE_POLYGON // Aperture macro to create on the fly a free polygon, with
73 // only one parameter: rotation
74 };

Member Function Documentation

◆ GetDiameter()

int APERTURE::GetDiameter ( )
inline

Definition at line 91 of file gbr_plotter_apertures.h.

92 {
93 // For round primitive, the diameter is the m_Size.x ot m_Size.y
94 if( m_Type == AT_CIRCLE || m_Type == AT_PLOTTING )
95 return m_Size.x;
96
97 // For rounded shapes (macro apertures), return m_Radius * 2
98 // but usually they use the radius (m_Radius)
99 return m_Radius*2;
100 }
APERTURE_TYPE m_Type

References AT_CIRCLE, AT_PLOTTING, m_Radius, m_Size, m_Type, and VECTOR2< T >::x.

◆ GetRegPolyVerticeCount()

int APERTURE::GetRegPolyVerticeCount ( )
inline

Definition at line 112 of file gbr_plotter_apertures.h.

113 {
114 return m_Type - AT_REGULAR_POLY3 + 3;
115 }

References AT_REGULAR_POLY3, and m_Type.

◆ GetRotation()

EDA_ANGLE APERTURE::GetRotation ( )
inline

Definition at line 118 of file gbr_plotter_apertures.h.

118{ return m_Rotation; }
EDA_ANGLE m_Rotation

References m_Rotation.

◆ GetSize()

const VECTOR2I APERTURE::GetSize ( )
inline

Definition at line 81 of file gbr_plotter_apertures.h.

82 {
83 return m_Size;
84 }

References m_Size.

◆ SetDiameter()

void APERTURE::SetDiameter ( int  aDiameter)
inline

Definition at line 86 of file gbr_plotter_apertures.h.

87 {
88 m_Radius = aDiameter/2;
89 }

References m_Radius.

◆ SetRegPolyVerticeCount()

void APERTURE::SetRegPolyVerticeCount ( int  aCount)
inline

Definition at line 102 of file gbr_plotter_apertures.h.

103 {
104 if( aCount < 3 )
105 aCount = 3;
106 else if( aCount > 12 )
107 aCount = 12;
108
109 m_Type = (APERTURE_TYPE)(AT_REGULAR_POLY3 - 3 + aCount);
110 }

References AT_REGULAR_POLY3, and m_Type.

◆ SetRotation()

void APERTURE::SetRotation ( const EDA_ANGLE aRotation)
inline

Definition at line 117 of file gbr_plotter_apertures.h.

117{ m_Rotation = aRotation; }

References m_Rotation.

◆ SetSize()

void APERTURE::SetSize ( const wxSize &  aSize)
inline

Definition at line 76 of file gbr_plotter_apertures.h.

77 {
78 m_Size = aSize;
79 }

References m_Size.

Member Data Documentation

◆ m_ApertureAttribute

int APERTURE::m_ApertureAttribute

Definition at line 141 of file gbr_plotter_apertures.h.

Referenced by GERBER_PLOTTER::GetOrCreateAperture().

◆ m_Corners

std::vector<VECTOR2I> APERTURE::m_Corners

Definition at line 127 of file gbr_plotter_apertures.h.

Referenced by GERBER_PLOTTER::GetOrCreateAperture().

◆ m_DCode

int APERTURE::m_DCode

Definition at line 136 of file gbr_plotter_apertures.h.

Referenced by GERBER_PLOTTER::GetOrCreateAperture().

◆ m_Radius

int APERTURE::m_Radius

◆ m_Rotation

EDA_ANGLE APERTURE::m_Rotation

◆ m_Size

VECTOR2I APERTURE::m_Size

◆ m_Type


The documentation for this class was generated from the following file: