KiCad PCB EDA Suite
D_CODE Class Reference

A gerber DCODE (also called Aperture) definition. More...

#include <dcode.h>

Public Member Functions

 D_CODE (int num_dcode)
 
 ~D_CODE ()
 
void Clear_D_CODE_Data ()
 
void AppendParam (double aValue)
 Add a parameter to the D_CODE parameter list. More...
 
unsigned GetParamCount () const
 Return the number of parameters stored in parameter list. More...
 
double GetParam (unsigned aIdx) const
 Return a parameter stored in parameter list. More...
 
void SetMacro (APERTURE_MACRO *aMacro)
 
APERTURE_MACROGetMacro () const
 
void DrawFlashedShape (const GERBER_DRAW_ITEM *aParent, wxDC *aDC, const COLOR4D &aColor, const VECTOR2I &aShapePos, bool aFilledShape)
 Draw the dcode shape for flashed items. More...
 
void DrawFlashedPolygon (const GERBER_DRAW_ITEM *aParent, wxDC *aDC, const COLOR4D &aColor, bool aFilled, const VECTOR2I &aPosition)
 A helper function used to draw the polygon stored in m_PolyCorners. More...
 
void ConvertShapeToPolygon (const GERBER_DRAW_ITEM *aParent)
 Convert a shape to an equivalent polygon. More...
 
int GetShapeDim (GERBER_DRAW_ITEM *aParent)
 Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item. More...
 

Static Public Member Functions

static const wxChar * ShowApertureType (APERTURE_T aType)
 Return a character string telling what type of aperture type aType is. More...
 

Public Attributes

wxSize m_Size
 Horizontal and vertical dimensions. More...
 
APERTURE_T m_Shape
 shape ( Line, rectangle, circle , oval .. ) More...
 
int m_Num_Dcode
 D code value ( >= 10 ) More...
 
wxSize m_Drill
 dimension of the hole (if any) (drill file) More...
 
APERTURE_DEF_HOLETYPE m_DrillShape
 shape of the hole (0 = no hole, round = 1, rect = 2). More...
 
EDA_ANGLE m_Rotation
 shape rotation More...
 
int m_EdgesCount
 in aperture definition Polygon only: number of edges for the polygon More...
 
bool m_InUse
 false if the aperture (previously defined) is not used to draw something More...
 
bool m_Defined
 false if the aperture is not defined in the header More...
 
wxString m_AperFunction
 the aperture attribute (created by a TA.AperFunction command). More...
 
SHAPE_POLY_SET m_Polygon
 

Private Attributes

APERTURE_MACROm_Macro
 no ownership, points to GERBER.m_aperture_macros element. More...
 
std::vector< double > m_am_params
 parameters used only when this D_CODE holds a reference to an aperture macro, and these parameters would customize the macro. More...
 

Detailed Description

A gerber DCODE (also called Aperture) definition.

Definition at line 79 of file dcode.h.

Constructor & Destructor Documentation

◆ D_CODE()

D_CODE::D_CODE ( int  num_dcode)

Definition at line 58 of file dcode.cpp.

59{
60 m_Num_Dcode = num_dcode;
62}
void Clear_D_CODE_Data()
Definition: dcode.cpp:70
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:191

References Clear_D_CODE_Data(), and m_Num_Dcode.

◆ ~D_CODE()

D_CODE::~D_CODE ( )

Definition at line 65 of file dcode.cpp.

66{
67}

Member Function Documentation

◆ AppendParam()

void D_CODE::AppendParam ( double  aValue)
inline

Add a parameter to the D_CODE parameter list.

Used to customize the corresponding aperture macro.

Definition at line 91 of file dcode.h.

92 {
93 m_am_params.push_back( aValue );
94 }
std::vector< double > m_am_params
parameters used only when this D_CODE holds a reference to an aperture macro, and these parameters wo...
Definition: dcode.h:216

References m_am_params.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ Clear_D_CODE_Data()

void D_CODE::Clear_D_CODE_Data ( )

Definition at line 70 of file dcode.cpp.

71{
75 m_Drill.x = m_Drill.y = 0;
77 m_InUse = false;
78 m_Defined = false;
79 m_Macro = nullptr;
81 m_EdgesCount = 0;
83}
EDA_ANGLE m_Rotation
shape rotation
Definition: dcode.h:195
wxSize m_Drill
dimension of the hole (if any) (drill file)
Definition: dcode.h:192
int m_EdgesCount
in aperture definition Polygon only: number of edges for the polygon
Definition: dcode.h:196
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:190
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:200
APERTURE_DEF_HOLETYPE m_DrillShape
shape of the hole (0 = no hole, round = 1, rect = 2).
Definition: dcode.h:193
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:204
bool m_InUse
false if the aperture (previously defined) is not used to draw something
Definition: dcode.h:198
APERTURE_MACRO * m_Macro
no ownership, points to GERBER.m_aperture_macros element.
Definition: dcode.h:210
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:189
#define DCODE_DEFAULT_SIZE
Definition: dcode.cpp:37
@ APT_DEF_NO_HOLE
Definition: dcode.h:61
@ APT_CIRCLE
Definition: dcode.h:49
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:412

References ANGLE_0, APT_CIRCLE, APT_DEF_NO_HOLE, DCODE_DEFAULT_SIZE, m_Defined, m_Drill, m_DrillShape, m_EdgesCount, m_InUse, m_Macro, m_Polygon, m_Rotation, m_Shape, m_Size, and SHAPE_POLY_SET::RemoveAllContours().

Referenced by D_CODE().

◆ ConvertShapeToPolygon()

void D_CODE::ConvertShapeToPolygon ( const GERBER_DRAW_ITEM aParent)

Convert a shape to an equivalent polygon.

Arcs and circles are approximated by segments. Useful when a shape is not a graphic primitive (shape with hole, rotated shape ... ) and cannot be easily drawn.

Parameters
aParentis the GERBER_DRAW_ITEM using this DCode. Not used in all shapes, used for APT_MACRO

Definition at line 297 of file dcode.cpp.

298{
299 VECTOR2I initialpos;
300 VECTOR2I currpos;
301
303
304 switch( m_Shape )
305 {
306 case APT_CIRCLE: // creates only a circle with rectangular hole
308 ERROR_INSIDE );
310 break;
311
312 case APT_RECT:
314 currpos.x = m_Size.x / 2;
315 currpos.y = m_Size.y / 2;
316 initialpos = currpos;
317 m_Polygon.Append( VECTOR2I( currpos ) );
318 currpos.x -= m_Size.x;
319 m_Polygon.Append( VECTOR2I( currpos ) );
320 currpos.y -= m_Size.y;
321 m_Polygon.Append( VECTOR2I( currpos ) );
322 currpos.x += m_Size.x;
323 m_Polygon.Append( VECTOR2I( currpos ) );
324 currpos.y += m_Size.y;
325 m_Polygon.Append( VECTOR2I( currpos ) ); // close polygon
326 m_Polygon.Append( VECTOR2I( initialpos ) );
327
329 break;
330
331 case APT_OVAL:
332 {
334 int delta, radius;
335
336 // we create an horizontal oval shape. then rotate if needed
337 if( m_Size.x > m_Size.y ) // horizontal oval
338 {
339 delta = ( m_Size.x - m_Size.y ) / 2;
340 radius = m_Size.y / 2;
341 }
342 else // vertical oval
343 {
344 delta = (m_Size.y - m_Size.x) / 2;
345 radius = m_Size.x / 2;
346 }
347
348 currpos.y = radius;
349 initialpos = currpos;
350 m_Polygon.Append( VECTOR2I( currpos ) );
351
352 // build the right arc of the shape
353 unsigned ii = 0;
354
355 for( ; ii <= SEGS_CNT / 2; ii++ )
356 {
357 currpos = initialpos;
358 RotatePoint( currpos, ANGLE_360 * ii / SEGS_CNT );
359 currpos.x += delta;
360 m_Polygon.Append( VECTOR2I( currpos ) );
361 }
362
363 // build the left arc of the shape
364 for( ii = SEGS_CNT / 2; ii <= SEGS_CNT; ii++ )
365 {
366 currpos = initialpos;
367 RotatePoint( currpos, ANGLE_360 * ii / SEGS_CNT );
368 currpos.x -= delta;
369 m_Polygon.Append( currpos );
370 }
371
372 m_Polygon.Append( initialpos ); // close outline
373
374 if( m_Size.y > m_Size.x ) // vertical oval, rotate polygon.
376
378 }
379 break;
380
381 case APT_POLYGON:
383 currpos.x = m_Size.x >> 1; // first point is on X axis
384 initialpos = currpos;
385
386 // rs274x said: m_EdgesCount = 3 ... 12
387 if( m_EdgesCount < 3 )
388 m_EdgesCount = 3;
389
390 if( m_EdgesCount > 12 )
391 m_EdgesCount = 12;
392
393 for( int ii = 0; ii < m_EdgesCount; ii++ )
394 {
395 currpos = initialpos;
396 RotatePoint( currpos, ANGLE_360 * ii / m_EdgesCount );
397 m_Polygon.Append( currpos );
398 }
399
401
402 if( !m_Rotation.IsZero() ) // rotate polygonal shape:
404
405 break;
406
407 case APT_MACRO:
408 APERTURE_MACRO* macro = GetMacro();
409 SHAPE_POLY_SET* macroShape = macro->GetApertureMacroShape( aParent, initialpos );
410 m_Polygon.Append( *macroShape );
411 break;
412 }
413}
constexpr int ARC_HIGH_DEF
Definition: base_units.h:121
Support the "aperture macro" defined within standard RS274X.
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, const VECTOR2I &aShapePos)
Calculate the primitive shape for flashed items.
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:124
bool IsZero() const
Definition: eda_angle.h:169
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
int NewOutline()
Creates a new hole in a given outline.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
#define SEGS_CNT
Definition: dcode.cpp:289
static void addHoleToPolygon(SHAPE_POLY_SET *aPolygon, APERTURE_DEF_HOLETYPE aHoleShape, const VECTOR2I &aSize, const VECTOR2I &aAnchorPos)
Definition: dcode.cpp:418
@ APT_RECT
Definition: dcode.h:50
@ APT_OVAL
Definition: dcode.h:51
@ APT_POLYGON
Definition: dcode.h:52
@ APT_MACRO
Definition: dcode.h:54
static constexpr EDA_ANGLE & ANGLE_360
Definition: eda_angle.h:418
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:414
@ ERROR_INSIDE
constexpr int delta
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References addHoleToPolygon(), ANGLE_360, ANGLE_90, SHAPE_POLY_SET::Append(), APT_CIRCLE, APT_MACRO, APT_OVAL, APT_POLYGON, APT_RECT, ARC_HIGH_DEF, delta, ERROR_INSIDE, APERTURE_MACRO::GetApertureMacroShape(), GetMacro(), EDA_ANGLE::IsZero(), m_Drill, m_DrillShape, m_EdgesCount, m_Polygon, m_Rotation, m_Shape, m_Size, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::RemoveAllContours(), SHAPE_POLY_SET::Rotate(), RotatePoint(), SEGS_CNT, TransformCircleToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), GBR_TO_PCB_EXPORTER::export_flashed_copper_item(), GBR_TO_PCB_EXPORTER::export_non_copper_item(), GERBER_DRAW_ITEM::GetBoundingBox(), and GetShapeDim().

◆ DrawFlashedPolygon()

void D_CODE::DrawFlashedPolygon ( const GERBER_DRAW_ITEM aParent,
wxDC *  aDC,
const COLOR4D aColor,
bool  aFilled,
const VECTOR2I aPosition 
)

A helper function used to draw the polygon stored in m_PolyCorners.

Draw some Apertures shapes when they are defined as filled polygons. APT_POLYGON is always a polygon, but some complex shapes are also converted to polygons (shapes with holes, some rotated shapes).

Parameters
aParentis the GERBER_DRAW_ITEM being drawn.
aDCis the device context.
aColoris the normal color to use.
aFilledset to true to draw in filled mode, false to draw in sketch mode.
aPositionis the actual shape position.

Definition at line 266 of file dcode.cpp.

269{
270 if( m_Polygon.OutlineCount() == 0 )
271 return;
272
273 int pointCount = m_Polygon.VertexCount();
274 std::vector<VECTOR2I> points;
275 points.reserve( pointCount );
276
277 for( int ii = 0; ii < pointCount; ii++ )
278 {
279 VECTOR2I p( m_Polygon.CVertex( ii ).x, m_Polygon.CVertex( ii ).y );
280 points[ii] = p + aPosition;
281 points[ii] = aParent->GetABPosition( points[ii] );
282 }
283
284 GRClosedPoly( aDC, pointCount, &points[0], aFilled, aColor );
285}
VECTOR2I GetABPosition(const VECTOR2I &aXYPosition) const
Return the image position of aPosition for this object.
int VertexCount(int aOutline=-1, int aHole=-1) const
Return the number of points in the shape poly set.
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void GRClosedPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, const COLOR4D &Color)
Draw a closed polyline and fill it if Fill, in object space.
Definition: gr_basic.cpp:342

References SHAPE_POLY_SET::CVertex(), GERBER_DRAW_ITEM::GetABPosition(), GRClosedPoly(), m_Polygon, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::VertexCount(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DrawFlashedShape().

◆ DrawFlashedShape()

void D_CODE::DrawFlashedShape ( const GERBER_DRAW_ITEM aParent,
wxDC *  aDC,
const COLOR4D aColor,
const VECTOR2I aShapePos,
bool  aFilledShape 
)

Draw the dcode shape for flashed items.

When an item is flashed, the DCode shape is the shape of the item.

Parameters
aParentis the GERBER_DRAW_ITEM being drawn.
aDCis the device context.
aColoris the normal color to use.
aShapePosis the actual shape position
aFilledShapeset to true to draw in filled mode, false to draw in sketch mode

Definition at line 153 of file dcode.cpp.

155{
156 int radius;
157
158 switch( m_Shape )
159 {
160 case APT_CIRCLE:
161 radius = m_Size.x >> 1;
162
163 if( !aFilledShape )
164 {
165 GRCircle( aDC, aParent->GetABPosition(aShapePos), radius, 0, aColor );
166 }
167 else if( m_DrillShape == APT_DEF_NO_HOLE )
168 {
169 GRFilledCircle( aDC, aParent->GetABPosition(aShapePos), radius, 0, aColor, aColor );
170 }
171 else if( m_DrillShape == APT_DEF_ROUND_HOLE ) // round hole in shape
172 {
173 int width = (m_Size.x - m_Drill.x ) / 2;
174 GRCircle( aDC, aParent->GetABPosition(aShapePos), radius - (width / 2), width, aColor );
175 }
176 else // rectangular hole
177 {
178 if( m_Polygon.OutlineCount() == 0 )
179 ConvertShapeToPolygon( aParent );
180
181 DrawFlashedPolygon( aParent, aDC, aColor, aFilledShape, aShapePos );
182 }
183
184 break;
185
186 case APT_RECT:
187 {
188 VECTOR2I start;
189 start.x = aShapePos.x - m_Size.x / 2;
190 start.y = aShapePos.y - m_Size.y / 2;
191 VECTOR2I end = start + m_Size;
192 start = aParent->GetABPosition( start );
193 end = aParent->GetABPosition( end );
194
195 if( !aFilledShape )
196 {
197 GRRect( aDC, start, end, 0, aColor );
198 }
199 else if( m_DrillShape == APT_DEF_NO_HOLE )
200 {
201 GRFilledRect( aDC, start, end, 0, aColor, aColor );
202 }
203 else
204 {
205 if( m_Polygon.OutlineCount() == 0 )
206 ConvertShapeToPolygon( aParent );
207
208 DrawFlashedPolygon( aParent, aDC, aColor, aFilledShape, aShapePos );
209 }
210 }
211 break;
212
213 case APT_OVAL:
214 {
215 VECTOR2I start = aShapePos;
216 VECTOR2I end = aShapePos;
217
218 if( m_Size.x > m_Size.y ) // horizontal oval
219 {
220 int delta = ( m_Size.x - m_Size.y ) / 2;
221 start.x -= delta;
222 end.x += delta;
223 radius = m_Size.y; // Width in fact
224 }
225 else // vertical oval
226 {
227 int delta = ( m_Size.y - m_Size.x ) / 2;
228 start.y -= delta;
229 end.y += delta;
230 radius = m_Size.x; // Width in fact
231 }
232
233 start = aParent->GetABPosition( start );
234 end = aParent->GetABPosition( end );
235
236 if( !aFilledShape )
237 {
238 GRCSegm( aDC, start, end, radius, aColor );
239 }
240 else if( m_DrillShape == APT_DEF_NO_HOLE )
241 {
242 GRFilledSegment( aDC, start, end, radius, aColor );
243 }
244 else
245 {
246 if( m_Polygon.OutlineCount() == 0 )
247 ConvertShapeToPolygon( aParent );
248
249 DrawFlashedPolygon( aParent, aDC, aColor, aFilledShape, aShapePos );
250 }
251 }
252
253 break;
254
255 case APT_MACRO:
256 case APT_POLYGON:
257 if( m_Polygon.OutlineCount() == 0 )
258 ConvertShapeToPolygon( aParent );
259
260 DrawFlashedPolygon( aParent, aDC, aColor, aFilledShape, aShapePos );
261 break;
262 }
263}
void DrawFlashedPolygon(const GERBER_DRAW_ITEM *aParent, wxDC *aDC, const COLOR4D &aColor, bool aFilled, const VECTOR2I &aPosition)
A helper function used to draw the polygon stored in m_PolyCorners.
Definition: dcode.cpp:266
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent)
Convert a shape to an equivalent polygon.
Definition: dcode.cpp:297
@ APT_DEF_ROUND_HOLE
Definition: dcode.h:62
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:387
void GRCSegm(wxDC *DC, const VECTOR2I &A, const VECTOR2I &B, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:192
void GRCircle(wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:348
void GRFilledSegment(wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:269
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:394
void GRFilledCircle(wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aStrokeColor, const COLOR4D &aFillColor)
Draw a circle onto the drawing context aDC centered at the user coordinates (x,y).
Definition: gr_basic.cpp:360

References APT_CIRCLE, APT_DEF_NO_HOLE, APT_DEF_ROUND_HOLE, APT_MACRO, APT_OVAL, APT_POLYGON, APT_RECT, ConvertShapeToPolygon(), delta, DrawFlashedPolygon(), GERBER_DRAW_ITEM::GetABPosition(), GRCircle(), GRCSegm(), GRFilledCircle(), GRFilledRect(), GRFilledSegment(), GRRect(), m_Drill, m_DrillShape, m_Polygon, m_Shape, m_Size, SHAPE_POLY_SET::OutlineCount(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GERBER_DRAW_ITEM::Print().

◆ GetMacro()

◆ GetParam()

double D_CODE::GetParam ( unsigned  aIdx) const
inline

Return a parameter stored in parameter list.

Parameters
aIdxis the index of parameter.

Definition at line 109 of file dcode.h.

110 {
111 wxASSERT( aIdx <= m_am_params.size() );
112
113 if( aIdx <= m_am_params.size() )
114 return m_am_params[aIdx - 1];
115 else
116 return 0;
117 }

References m_am_params.

Referenced by AM_PARAM::GetValue().

◆ GetParamCount()

unsigned D_CODE::GetParamCount ( ) const
inline

Return the number of parameters stored in parameter list.

Definition at line 99 of file dcode.h.

100 {
101 return m_am_params.size();
102 }

References m_am_params.

Referenced by AM_PARAM::GetValue().

◆ GetShapeDim()

int D_CODE::GetShapeDim ( GERBER_DRAW_ITEM aParent)

Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item.

Due to the complexity of some shapes, one cannot calculate the "size" of a shape (only a bounding box) but here, the "dimension" of the shape is the diameter of the primitive or for lines the width of the line if the shape is a line.

Parameters
aParentis the parent GERBER_DRAW_ITEM which is actually drawn.
Returns
a dimension, or -1 if no dim to calculate.

Definition at line 115 of file dcode.cpp.

116{
117 int dim = 0;
118
119 switch( m_Shape )
120 {
121 case APT_CIRCLE:
122 dim = m_Size.x;
123 break;
124
125 case APT_RECT:
126 case APT_OVAL:
127 dim = std::min( m_Size.x, m_Size.y );
128 break;
129
130 case APT_POLYGON:
131 dim = std::min( m_Size.x, m_Size.y );
132 break;
133
134 case APT_MACRO:
135 if( m_Macro )
136 {
137 if( m_Polygon.OutlineCount() == 0 )
138 ConvertShapeToPolygon( aParent );
139
140 BOX2I bbox = m_Polygon.BBox();
141 dim = std::min( bbox.GetWidth(), bbox.GetHeight() );
142 }
143 break;
144
145 default:
146 break;
147 }
148
149 return dim;
150}
coord_type GetHeight() const
Definition: box2.h:188
coord_type GetWidth() const
Definition: box2.h:187
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.

References APT_CIRCLE, APT_MACRO, APT_OVAL, APT_POLYGON, APT_RECT, SHAPE_POLY_SET::BBox(), ConvertShapeToPolygon(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), m_Macro, m_Polygon, m_Shape, m_Size, and SHAPE_POLY_SET::OutlineCount().

Referenced by GERBER_DRAW_ITEM::GetTextD_CodePrms().

◆ SetMacro()

void D_CODE::SetMacro ( APERTURE_MACRO aMacro)
inline

Definition at line 119 of file dcode.h.

120 {
121 m_Macro = aMacro;
122 }

References m_Macro.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ ShowApertureType()

const wxChar * D_CODE::ShowApertureType ( APERTURE_T  aType)
static

Return a character string telling what type of aperture type aType is.

Parameters
aTypeis the aperture type to show.

Definition at line 86 of file dcode.cpp.

87{
88 const wxChar* ret;
89
90 switch( aType )
91 {
92 case APT_CIRCLE:
93 ret = wxT( "Round" ); break;
94
95 case APT_RECT:
96 ret = wxT( "Rect" ); break;
97
98 case APT_OVAL:
99 ret = wxT( "Oval" ); break;
100
101 case APT_POLYGON:
102 ret = wxT( "Poly" ); break;
103
104 case APT_MACRO:
105 ret = wxT( "Macro" ); break;
106
107 default:
108 ret = wxT( "???" ); break;
109 }
110
111 return ret;
112}

References APT_CIRCLE, APT_MACRO, APT_OVAL, APT_POLYGON, and APT_RECT.

Referenced by GERBVIEW_INSPECTION_TOOL::ShowDCodes(), and GERBVIEW_FRAME::updateDCodeSelectBox().

Member Data Documentation

◆ m_am_params

std::vector<double> D_CODE::m_am_params
private

parameters used only when this D_CODE holds a reference to an aperture macro, and these parameters would customize the macro.

Definition at line 216 of file dcode.h.

Referenced by AppendParam(), GetParam(), and GetParamCount().

◆ m_AperFunction

◆ m_Defined

◆ m_Drill

wxSize D_CODE::m_Drill

dimension of the hole (if any) (drill file)

Definition at line 192 of file dcode.h.

Referenced by Clear_D_CODE_Data(), ConvertShapeToPolygon(), DrawFlashedShape(), and GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ m_DrillShape

APERTURE_DEF_HOLETYPE D_CODE::m_DrillShape

shape of the hole (0 = no hole, round = 1, rect = 2).

Definition at line 193 of file dcode.h.

Referenced by Clear_D_CODE_Data(), ConvertShapeToPolygon(), DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), and GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ m_EdgesCount

int D_CODE::m_EdgesCount

in aperture definition Polygon only: number of edges for the polygon

Definition at line 196 of file dcode.h.

Referenced by Clear_D_CODE_Data(), ConvertShapeToPolygon(), and GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ m_InUse

◆ m_Macro

APERTURE_MACRO* D_CODE::m_Macro
private

no ownership, points to GERBER.m_aperture_macros element.

Definition at line 210 of file dcode.h.

Referenced by Clear_D_CODE_Data(), GetMacro(), GetShapeDim(), and SetMacro().

◆ m_Num_Dcode

◆ m_Polygon

◆ m_Rotation

EDA_ANGLE D_CODE::m_Rotation

shape rotation

Definition at line 195 of file dcode.h.

Referenced by Clear_D_CODE_Data(), ConvertShapeToPolygon(), and GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ m_Shape

◆ m_Size


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