KiCad PCB EDA Suite
gr_basic.h File Reference
#include <gal/color4d.h>
#include <math/box2.h>
#include <vector>
#include <wx/pen.h>
#include <wx/dc.h>

Go to the source code of this file.

Enumerations

enum  GR_DRAWMODE {
  GR_OR = 0x01000000 , GR_XOR = 0x02000000 , GR_AND = 0x04000000 , GR_NXOR = 0x08000000 ,
  GR_INVERT = 0x10000000 , GR_ALLOW_HIGHCONTRAST = 0x20000000 , GR_COPY = 0x40000000 , GR_HIGHLIGHT = 0x80000000 ,
  UNSPECIFIED_DRAWMODE = -1
}
 Drawmode. Compositing mode plus a flag or two. More...
 
enum  GRLineStypeType { GR_SOLID_LINE = 0 , GR_DOTTED_LINE = 1 , GR_DASHED_LINE = 3 }
 

Functions

GR_DRAWMODE operator~ (const GR_DRAWMODE &a)
 
GR_DRAWMODE operator| (const GR_DRAWMODE &a, const GR_DRAWMODE &b)
 
GR_DRAWMODE operator& (const GR_DRAWMODE &a, const GR_DRAWMODE &b)
 
void GRResetPenAndBrush (wxDC *DC)
 
void GRSetColorPen (wxDC *DC, const COLOR4D &Color, int width=1, wxPenStyle stype=wxPENSTYLE_SOLID)
 
void GRSetBrush (wxDC *DC, const COLOR4D &Color, bool fill=false)
 
void GRForceBlackPen (bool flagforce)
 
bool GetGRForceBlackPenState (void)
 
void GRLine (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
void GRLine (wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
void GRMoveTo (int x, int y)
 
void GRLineTo (wxDC *DC, int x, int y, int width, const COLOR4D &Color)
 
void GRPoly (wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 Draw a new polyline and fill it if Fill, in drawing space. More...
 
void GRClosedPoly (wxDC *aDC, int aPointCount, const VECTOR2I *aPoints, bool doFill, const COLOR4D &aColor)
 Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it. More...
 
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). More...
 
void GRCircle (wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aColor)
 
void GRArc (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, int aWidth, const COLOR4D &aColor)
 
void GRFilledArc (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRFilledSegment (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
 
void GRCSegm (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
 
void GRFilledRect (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
 
void GRRect (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
 
void GRSFilledRect (wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 

Variables

GR_DRAWMODE g_XorMode
 

Enumeration Type Documentation

◆ GR_DRAWMODE

Drawmode. Compositing mode plus a flag or two.

Enumerator
GR_OR 
GR_XOR 
GR_AND 
GR_NXOR 
GR_INVERT 
GR_ALLOW_HIGHCONTRAST 
GR_COPY 
GR_HIGHLIGHT 
UNSPECIFIED_DRAWMODE 

Definition at line 35 of file gr_basic.h.

35 {
36 GR_OR = 0x01000000,
37 GR_XOR = 0x02000000,
38 GR_AND = 0x04000000,
39 GR_NXOR = 0x08000000,
40 GR_INVERT = 0x10000000,
41 GR_ALLOW_HIGHCONTRAST = 0x20000000,
42 GR_COPY = 0x40000000,
43 GR_HIGHLIGHT = 0x80000000,
45};
@ GR_OR
Definition: gr_basic.h:36
@ GR_INVERT
Definition: gr_basic.h:40
@ GR_HIGHLIGHT
Definition: gr_basic.h:43
@ GR_ALLOW_HIGHCONTRAST
Definition: gr_basic.h:41
@ GR_NXOR
Definition: gr_basic.h:39
@ UNSPECIFIED_DRAWMODE
Definition: gr_basic.h:44
@ GR_COPY
Definition: gr_basic.h:42
@ GR_XOR
Definition: gr_basic.h:37
@ GR_AND
Definition: gr_basic.h:38

◆ GRLineStypeType

Enumerator
GR_SOLID_LINE 
GR_DOTTED_LINE 
GR_DASHED_LINE 

Definition at line 64 of file gr_basic.h.

64 {
65 /* Line styles for Get/SetLineStyle. */
66 GR_SOLID_LINE = 0,
GRLineStypeType
Definition: gr_basic.h:64
@ GR_DOTTED_LINE
Definition: gr_basic.h:67
@ GR_DASHED_LINE
Definition: gr_basic.h:68
@ GR_SOLID_LINE
Definition: gr_basic.h:66

Function Documentation

◆ GetGRForceBlackPenState()

◆ GRArc()

void GRArc ( wxDC *  aDC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
const VECTOR2I aCenter,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 369 of file gr_basic.cpp.

371{
372 GRSetBrush( aDC, aColor );
373 GRSetColorPen( aDC, aColor, aWidth );
374 aDC->DrawArc( aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y );
375}
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:80
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:123

References GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_SHAPE::Print(), LIB_SHAPE::print(), and GERBER_DRAW_ITEM::Print().

◆ GRCircle()

void GRCircle ( wxDC *  aDC,
const VECTOR2I aPos,
int  aRadius,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 348 of file gr_basic.cpp.

349{
350 GRSetBrush( aDC, aColor, NOT_FILLED );
351 GRSetColorPen( aDC, aColor, aWidth );
352
353 // Draw two arcs here to make a circle. Unfortunately, the printerDC doesn't handle
354 // transparent brushes when used with circles. It does work for for arcs, however
355 aDC->DrawArc(aPos.x + aRadius, aPos.y, aPos.x - aRadius, aPos.y, aPos.x, aPos.y );
356 aDC->DrawArc(aPos.x - aRadius, aPos.y, aPos.x + aRadius, aPos.y, aPos.x, aPos.y );
357}
static const bool NOT_FILLED
Definition: gr_basic.cpp:30

References GRSetBrush(), GRSetColorPen(), NOT_FILLED, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by D_CODE::DrawFlashedShape(), SCH_SHAPE::Print(), LIB_PIN::print(), LIB_SHAPE::print(), GERBER_DRAW_ITEM::Print(), and LIB_PIN::printPinSymbol().

◆ GRClosedPoly()

void GRClosedPoly ( wxDC *  DC,
int  n,
const VECTOR2I Points,
bool  Fill,
const COLOR4D Color 
)

Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it.

Parameters
aDCthe device context into which drawing should occur.
aPointCountthe number of points in the array aPoints.
aPointsThe points to draw.
doFilltrue if polygon is to be filled, else false and only the boundary is drawn.
aColorthe color of the border and the fill.

Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it.

Definition at line 342 of file gr_basic.cpp.

343{
344 GRSClosedPoly( DC, n, Points, Fill, 0, Color, Color );
345}
static void GRSClosedPoly(wxDC *aDC, int aPointCount, const VECTOR2I *aPoints, bool aFill, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Draw a new closed polyline and fill it if Fill, in screen space.
Definition: gr_basic.cpp:302

References GRSClosedPoly().

Referenced by APERTURE_MACRO::DrawApertureMacroShape(), D_CODE::DrawFlashedPolygon(), GRPrintText(), GERBER_DRAW_ITEM::PrintGerberPoly(), and MARKER_BASE::PrintMarker().

◆ GRCSegm()

void GRCSegm ( wxDC *  aDC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 192 of file gr_basic.cpp.

193{
194 GRLastMoveToX = B.x;
195 GRLastMoveToY = B.y;
196
197 if( width <= 2 ) /* single line or 2 pixels */
198 {
199 GRSetColorPen( DC, Color, width );
200 DC->DrawLine( A.x, A.y, B.x, B.y );
201 return;
202 }
203
204 GRSetBrush( DC, Color, NOT_FILLED );
205 GRSetColorPen( DC, Color, 0 );
206
207 int radius = ( width + 1 ) >> 1;
208 int dx = B.x - A.x;
209 int dy = B.y - A.y;
210 EDA_ANGLE angle( VECTOR2I( dx, dy ) );
211
212 angle = -angle;
213
214 VECTOR2I start;
215 VECTOR2I end;
216 VECTOR2I org( A.x, A.y );
217 int len = (int) hypot( dx, dy );
218
219 // We know if the DC is mirrored, to draw arcs
220 int slx = DC->DeviceToLogicalX( 1 ) - DC->DeviceToLogicalX( 0 );
221 int sly = DC->DeviceToLogicalY( 1 ) - DC->DeviceToLogicalY( 0 );
222 bool mirrored = ( slx > 0 && sly < 0 ) || ( slx < 0 && sly > 0 );
223
224 // first edge
225 start.x = 0;
226 start.y = radius;
227 end.x = len;
228 end.y = radius;
229 RotatePoint( start, angle );
230 RotatePoint( end, angle );
231
232 start += org;
233 end += org;
234
235 DC->DrawLine( (wxPoint) start, (wxPoint) end );
236
237 // first rounded end
238 end.x = 0;
239 end.y = -radius;
240 RotatePoint( end, angle );
241 end += org;
242
243 if( !mirrored )
244 DC->DrawArc( (wxPoint) end, (wxPoint) start, (wxPoint) org );
245 else
246 DC->DrawArc( (wxPoint) start, (wxPoint) end, (wxPoint) org );
247
248 // second edge
249 start.x = len;
250 start.y = -radius;
251 RotatePoint( start, angle );
252 start += org;
253
254 DC->DrawLine( (wxPoint) start, (wxPoint) end );
255
256 // second rounded end
257 end.x = len;
258 end.y = radius;
259 RotatePoint( end, angle);
260 end += org;
261
262 if( !mirrored )
263 DC->DrawArc( end.x, end.y, start.x, start.y, B.x, B.y );
264 else
265 DC->DrawArc( start.x, start.y, end.x, end.y, B.x, B.y );
266}
static int GRLastMoveToY
Definition: gr_basic.cpp:44
static int GRLastMoveToX
Definition: gr_basic.cpp:44
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References PNS::angle(), GRLastMoveToX, GRLastMoveToY, GRSetBrush(), GRSetColorPen(), NOT_FILLED, RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by D_CODE::DrawFlashedShape(), GRPrintText(), and GERBER_DRAW_ITEM::Print().

◆ GRFilledArc()

void GRFilledArc ( wxDC *  DC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
const VECTOR2I aCenter,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 378 of file gr_basic.cpp.

380{
381 GRSetBrush( DC, BgColor, FILLED );
382 GRSetColorPen( DC, Color, width );
383 DC->DrawArc( aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y );
384}
static const bool FILLED
Definition: gr_basic.cpp:29

References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by LIB_SHAPE::print(), and SCH_SHAPE::PrintBackground().

◆ GRFilledCircle()

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).

Parameters
aDCthe device context into which drawing should occur.
xThe x coordinate in user space of the center of the circle.
yThe y coordinate in user space of the center of the circle.
aRadiusis the radius of the circle.
aColoris the color to draw.
See also
COLOR4D

Definition at line 360 of file gr_basic.cpp.

362{
363 GRSetBrush( aDC, aFillColor, FILLED );
364 GRSetColorPen( aDC, aStrokeColor, aWidth );
365 aDC->DrawEllipse( aPos.x - aRadius, aPos.y - aRadius, 2 * aRadius, 2 * aRadius );
366}

References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by D_CODE::DrawFlashedShape(), SCH_JUNCTION::Print(), LIB_SHAPE::print(), and SCH_SHAPE::PrintBackground().

◆ GRFilledRect()

void GRFilledRect ( wxDC *  DC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
const COLOR4D aColor,
const COLOR4D aBgColor 
)

Definition at line 394 of file gr_basic.cpp.

396{
397 GRSFilledRect( DC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor, aBgColor );
398}
void GRSFilledRect(wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:413

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

Referenced by D_CODE::DrawFlashedShape(), SCH_SHEET::Print(), LIB_SHAPE::print(), LIB_TEXTBOX::print(), SCH_TEXTBOX::Print(), SCH_SHAPE::PrintBackground(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ GRFilledSegment()

void GRFilledSegment ( wxDC *  aDC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 269 of file gr_basic.cpp.

271{
272 GRSetColorPen( aDC, aColor, aWidth );
273 winDrawLine( aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth );
274}
static void winDrawLine(wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:64

References GRSetColorPen(), winDrawLine(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by D_CODE::DrawFlashedShape(), and GERBER_DRAW_ITEM::Print().

◆ GRForceBlackPen()

void GRForceBlackPen ( bool  flagforce)
Parameters
flagforceTrue to force a black pen whenever the asked color.

Definition at line 150 of file gr_basic.cpp.

151{
152 s_ForceBlackPen = flagforce;
153}

References s_ForceBlackPen.

Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), PLEDITOR_PRINTOUT::PrintPage(), and SCH_PRINTOUT::PrintPage().

◆ GRLine() [1/2]

void GRLine ( wxDC *  aDC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
const COLOR4D aColor,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)

Definition at line 172 of file gr_basic.cpp.

174{
175 GRLine( aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor, aStyle );
176}
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:162

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

◆ GRLine() [2/2]

void GRLine ( wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
const COLOR4D Color,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)

◆ GRLineTo()

void GRLineTo ( wxDC *  DC,
int  x,
int  y,
int  width,
const COLOR4D Color 
)

Definition at line 186 of file gr_basic.cpp.

187{
188 GRLine( DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color );
189}

References GRLastMoveToX, GRLastMoveToY, and GRLine().

Referenced by GRSClosedPoly(), GRSPoly(), and LIB_PIN::printPinSymbol().

◆ GRMoveTo()

void GRMoveTo ( int  x,
int  y 
)

Definition at line 179 of file gr_basic.cpp.

180{
181 GRLastMoveToX = x;
182 GRLastMoveToY = y;
183}

References GRLastMoveToX, and GRLastMoveToY.

Referenced by GRSClosedPoly(), GRSPoly(), and LIB_PIN::printPinSymbol().

◆ GRPoly()

void GRPoly ( wxDC *  DC,
int  n,
const VECTOR2I Points,
bool  Fill,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)

Draw a new polyline and fill it if Fill, in drawing space.

Definition at line 332 of file gr_basic.cpp.

334{
335 GRSPoly( DC, n, Points, Fill, width, Color, BgColor );
336}
static void GRSPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in screen space.
Definition: gr_basic.cpp:279

References GRSPoly().

Referenced by SCH_SHAPE::Print(), LIB_SHAPE::print(), SCH_LABEL_BASE::Print(), SCH_SHAPE::PrintBackground(), and DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem().

◆ GRRect()

void GRRect ( wxDC *  DC,
const VECTOR2I aStart,
const VECTOR2I aEnd,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 387 of file gr_basic.cpp.

389{
390 GRSRect( DC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor );
391}
static void GRSRect(wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:401

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

Referenced by D_CODE::DrawFlashedShape(), SCH_SHAPE::Print(), SCH_SHEET::Print(), LIB_SHAPE::print(), LIB_TEXTBOX::print(), SCH_TEXTBOX::Print(), and DS_DRAW_ITEM_RECT::PrintWsItem().

◆ GRResetPenAndBrush()

void GRResetPenAndBrush ( wxDC *  DC)

◆ GRSetBrush()

void GRSetBrush ( wxDC *  DC,
const COLOR4D Color,
bool  fill = false 
)

Definition at line 123 of file gr_basic.cpp.

124{
125 COLOR4D color = Color;
126
127 if( s_ForceBlackPen )
129
130 if( s_DC_lastbrushcolor != color || s_DC_lastbrushfill != fill || s_DC_lastDC != DC )
131 {
132 wxBrush brush;
133
134 brush.SetColour( color.ToColour() );
135
136 if( fill )
137 brush.SetStyle( wxBRUSHSTYLE_SOLID );
138 else
139 brush.SetStyle( wxBRUSHSTYLE_TRANSPARENT );
140
141 DC->SetBrush( brush );
142
144 s_DC_lastbrushfill = fill;
145 s_DC_lastDC = DC;
146 }
147}
int color
Definition: DXF_plotter.cpp:57
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static bool s_DC_lastbrushfill
Definition: gr_basic.cpp:48

References BLACK, color, s_DC_lastbrushcolor, s_DC_lastbrushfill, s_DC_lastDC, and s_ForceBlackPen.

Referenced by GRArc(), GRCircle(), GRCSegm(), GRFilledArc(), GRFilledCircle(), GRResetPenAndBrush(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().

◆ GRSetColorPen()

void GRSetColorPen ( wxDC *  DC,
const COLOR4D Color,
int  width = 1,
wxPenStyle  stype = wxPENSTYLE_SOLID 
)

Definition at line 80 of file gr_basic.cpp.

81{
82 COLOR4D color = Color;
83
84 wxDash dots[2] = { 1, 3 };
85
86 // Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
87 // nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
88 if( width <= 1 && DC->GetBrush().GetStyle() != wxBRUSHSTYLE_SOLID )
89 width = DC->DeviceToLogicalXRel( 1 );
90
91 if( s_ForceBlackPen )
93
94 const wxPen& curr_pen = DC->GetPen();
95
96 if( !curr_pen.IsOk() || curr_pen.GetColour() != color.ToColour()
97 || curr_pen.GetWidth() != width || curr_pen.GetStyle() != style )
98 {
99 wxPen pen;
100 pen.SetColour( color.ToColour() );
101
102 if( style == wxPENSTYLE_DOT )
103 {
104 style = wxPENSTYLE_USER_DASH;
105 pen.SetDashes( 2, dots );
106 }
107
108 pen.SetWidth( width );
109 pen.SetStyle( style );
110 DC->SetPen( pen );
111 }
112 else
113 {
114 // Should be not needed, but on Linux, in printing process
115 // the curr pen settings needs to be sometimes re-initialized
116 // Clearly, this is due to a bug, related to SetBrush(),
117 // but we have to live with it, at least on wxWidgets 3.0
118 DC->SetPen( curr_pen );
119 }
120}

References BLACK, color, and s_ForceBlackPen.

Referenced by GRArc(), GRCircle(), GRCSegm(), GRFilledArc(), GRFilledCircle(), GRFilledSegment(), GRLine(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().

◆ GRSFilledRect()

void GRSFilledRect ( wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 413 of file gr_basic.cpp.

415{
416 VECTOR2I points[5];
417 points[0] = VECTOR2I( x1, y1 );
418 points[1] = VECTOR2I( x1, y2 );
419 points[2] = VECTOR2I( x2, y2 );
420 points[3] = VECTOR2I( x2, y1 );
421 points[4] = points[0];
422
423 GRSetBrush( aDC, aBgColor, FILLED );
424 GRSetColorPen( aDC, aBgColor, aWidth );
425
426 vector2IwxDrawPolygon( aDC, points, 5 );
427}
static void vector2IwxDrawPolygon(wxDC *aDC, const VECTOR2I *Points, int n)
Definition: gr_basic.cpp:52

References FILLED, GRSetBrush(), GRSetColorPen(), and vector2IwxDrawPolygon().

Referenced by GRFilledRect(), and SCH_PRINTOUT::PrintPage().

◆ operator&()

GR_DRAWMODE operator& ( const GR_DRAWMODE a,
const GR_DRAWMODE b 
)
inline

Definition at line 57 of file gr_basic.h.

58{
59 return static_cast<GR_DRAWMODE>( int( a ) & int( b ) );
60}
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:35

◆ operator|()

GR_DRAWMODE operator| ( const GR_DRAWMODE a,
const GR_DRAWMODE b 
)
inline

Definition at line 52 of file gr_basic.h.

53{
54 return static_cast<GR_DRAWMODE>( int( a ) | int( b ) );
55}

◆ operator~()

GR_DRAWMODE operator~ ( const GR_DRAWMODE a)
inline

Definition at line 47 of file gr_basic.h.

48{
49 return static_cast<GR_DRAWMODE>( ~int( a ) );
50}

Variable Documentation

◆ g_XorMode

GR_DRAWMODE g_XorMode
extern

Definition at line 33 of file gr_basic.cpp.