KiCad PCB EDA Suite
gr_basic.h File Reference
#include <gal/color4d.h>
#include <vector>

Go to the source code of this file.

Macros

#define GR_M_LEFT_DOWN   0x10000000
 
#define GR_M_RIGHT_DOWN   0x20000000
 
#define GR_M_MIDDLE_DOWN   0x40000000
 
#define GR_M_DCLICK   0x80000000
 

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

void DrawModeAddHighlight (GR_DRAWMODE *mode)
 
void DrawModeAllowHighContrast (GR_DRAWMODE *mode)
 
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 GRSetDrawMode (wxDC *DC, GR_DRAWMODE mode)
 
GR_DRAWMODE GRGetDrawMode (wxDC *DC)
 
void GRResetPenAndBrush (wxDC *DC)
 
void GRSetColorPen (wxDC *DC, COLOR4D Color, int width=1, wxPenStyle stype=wxPENSTYLE_SOLID)
 Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context. More...
 
void GRSetBrush (wxDC *DC, COLOR4D Color, bool fill=false)
 
void GRForceBlackPen (bool flagforce)
 Function GRForceBlackPen. More...
 
bool GetGRForceBlackPenState (void)
 Function GetGRForceBlackPenState. More...
 
void GRLine (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
void GRLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
void GRMixedLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRDashedLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRDottedLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRMoveTo (int x, int y)
 
void GRLineTo (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
 
void GRPoly (EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRBezier (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int x3, int y3, int width, COLOR4D Color)
 
void GRBezier (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int width, COLOR4D Color)
 
void GRClosedPoly (EDA_RECT *ClipBox, wxDC *aDC, int aPointCount, wxPoint aPoints[], bool doFill, COLOR4D aPenColor, COLOR4D aFillColor)
 Function GRClosedPoly draws a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it. More...
 
void GRClosedPoly (EDA_RECT *ClipBox, wxDC *aDC, int aPointCount, wxPoint aPoints[], bool doFill, int aPenWidth, COLOR4D aPenColor, COLOR4D aFillColor)
 Function GRClosedPoly draws a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it. More...
 
void GRCircle (EDA_RECT *ClipBox, wxDC *aDC, int x, int y, int aRadius, COLOR4D aColor)
 Function GRCircle draws a circle onto the drawing context aDC centered at the user coordinates (x,y) More...
 
void GRCircle (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color)
 
void GRFilledCircle (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRFilledCircle (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aPos, int aRadius, COLOR4D aColor)
 
void GRCircle (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aPos, int aRadius, int aWidth, COLOR4D aColor)
 
void GRArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, COLOR4D Color)
 
void GRArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, COLOR4D Color)
 
void GRArc1 (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
 
void GRArc1 (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, int width, COLOR4D Color)
 
void GRArc1 (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, wxPoint aCenter, int aWidth, COLOR4D aColor)
 
void GRFilledArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, COLOR4D Color, COLOR4D BgColor)
 
void GRFilledArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRFillCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRFilledSegment (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
 
void GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
 
void GRCSegm (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
 
void GRSetColor (COLOR4D Color)
 
void GRSetDefaultPalette ()
 
COLOR4D GRGetColor ()
 
void GRPutPixel (EDA_RECT *ClipBox, wxDC *DC, int x, int y, COLOR4D color)
 
void GRFilledRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, COLOR4D Color, COLOR4D BgColor)
 
void GRFilledRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, COLOR4D Color)
 
void GRRect (EDA_RECT *ClipBox, wxDC *DC, const EDA_RECT &aRect, int aWidth, COLOR4D Color)
 
void GRRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRRectPs (EDA_RECT *aClipBox, wxDC *aDC, const EDA_RECT &aRect, int aWidth, COLOR4D aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
void GRSFilledRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRLineArray (EDA_RECT *aClipBox, wxDC *aDC, std::vector< wxPoint > &aLines, int aWidth, COLOR4D aColor)
 Function GRLineArray draws an array of lines (not a polygon). More...
 
void GRDrawAnchor (EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
 
void GRDrawWrappedText (wxDC &aDC, wxString const &aText)
 Draw text centered on a wxDC with wrapping. More...
 

Variables

GR_DRAWMODE g_XorMode
 

Macro Definition Documentation

#define GR_M_DCLICK   0x80000000

Definition at line 77 of file gr_basic.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

#define GR_M_LEFT_DOWN   0x10000000

Definition at line 74 of file gr_basic.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

#define GR_M_MIDDLE_DOWN   0x40000000

Definition at line 76 of file gr_basic.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

#define GR_M_RIGHT_DOWN   0x20000000

Definition at line 75 of file gr_basic.h.

Enumeration Type Documentation

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 37 of file gr_basic.h.

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

Definition at line 82 of file gr_basic.h.

82  {
83  /* Line styles for Get/SetLineStyle. */
84  GR_SOLID_LINE = 0,
85  GR_DOTTED_LINE = 1,
86  GR_DASHED_LINE = 3
GRLineStypeType
Definition: gr_basic.h:82

Function Documentation

void DrawModeAddHighlight ( GR_DRAWMODE mode)
inline

Definition at line 49 of file gr_basic.h.

References GR_HIGHLIGHT.

Referenced by GBR_LAYOUT::Draw().

50 {
51  *mode = static_cast<GR_DRAWMODE>( int( *mode ) | GR_HIGHLIGHT );
52 }
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
void DrawModeAllowHighContrast ( GR_DRAWMODE mode)
inline

Definition at line 54 of file gr_basic.h.

References GR_ALLOW_HIGHCONTRAST.

55 {
56  *mode = static_cast<GR_DRAWMODE>( int( *mode ) | GR_ALLOW_HIGHCONTRAST );
57 }
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
bool GetGRForceBlackPenState ( void  )

Function GetGRForceBlackPenState.

Returns
ForceBlackPen (True if a black pen was forced)
s_ForceBlackPen (True if a black pen was forced)

Definition at line 309 of file gr_basic.cpp.

References s_ForceBlackPen.

Referenced by VIA::Draw(), LIB_PART::Draw(), D_PAD::DrawShape(), and PCB_EDIT_FRAME::PrintPage().

310 {
311  return s_ForceBlackPen;
312 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:90
void GRArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
COLOR4D  Color 
)

Definition at line 1003 of file gr_basic.cpp.

References EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), GRSetBrush(), GRSetColorPen(), NOT_FILLED, and RotatePoint().

Referenced by EDGE_MODULE::Draw(), DRAWSEGMENT::Draw(), and LIB_ARC::drawGraphic().

1005 {
1006  int x1, y1, x2, y2;
1007 
1008  /* Clip arcs off screen */
1009  if( ClipBox )
1010  {
1011  int radius = r + 1;
1012  int x0, y0, xm, ym, x, y;
1013  x0 = ClipBox->GetX();
1014  y0 = ClipBox->GetY();
1015  xm = ClipBox->GetRight();
1016  ym = ClipBox->GetBottom();
1017  x = xc;
1018  y = yc;
1019 
1020  if( x < ( x0 - radius ) )
1021  return;
1022  if( y < ( y0 - radius ) )
1023  return;
1024  if( x > ( xm + radius ) )
1025  return;
1026  if( y > ( ym + radius ) )
1027  return;
1028  }
1029 
1030  x1 = r;
1031  y1 = 0;
1032  RotatePoint( &x1, &y1, EndAngle );
1033 
1034  x2 = r;
1035  y2 = 0;
1036  RotatePoint( &x2, &y2, StAngle );
1037 
1038  GRSetBrush( DC, Color, NOT_FILLED );
1039  GRSetColorPen( DC, Color );
1040  DC->DrawArc( xc + x1, yc - y1, xc + x2, yc - y2, xc, yc );
1041 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
static const bool NOT_FILLED
Definition: gr_basic.cpp:43
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
int GetX() const
Definition: eda_rect.h:109
int GetY() const
Definition: eda_rect.h:110
void GRArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
int  width,
COLOR4D  Color 
)

Definition at line 1047 of file gr_basic.cpp.

References EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), GRSetBrush(), GRSetColorPen(), and RotatePoint().

1056 {
1057  int x1, y1, x2, y2;
1058 
1059  /* Clip arcs off screen. */
1060  if( ClipBox )
1061  {
1062  int x0, y0, xm, ym;
1063  x0 = ClipBox->GetX();
1064  y0 = ClipBox->GetY();
1065  xm = ClipBox->GetRight();
1066  ym = ClipBox->GetBottom();
1067 
1068  if( x < ( x0 - r - width ) )
1069  return;
1070 
1071  if( y < ( y0 - r - width ) )
1072  return;
1073 
1074  if( x > ( r + xm + width ) )
1075  return;
1076 
1077  if( y > ( r + ym + width ) )
1078  return;
1079  }
1080 
1081  x1 = r;
1082  y1 = 0;
1083  RotatePoint( &x1, &y1, EndAngle );
1084 
1085  x2 = r;
1086  y2 = 0;
1087  RotatePoint( &x2, &y2, StAngle );
1088 
1089  GRSetBrush( DC, Color );
1090  GRSetColorPen( DC, Color, width );
1091  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
1092 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
int GetX() const
Definition: eda_rect.h:109
int GetY() const
Definition: eda_rect.h:110
void GRArc1 ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  xc,
int  yc,
COLOR4D  Color 
)

Definition at line 894 of file gr_basic.cpp.

References GRArc1().

Referenced by GERBER_DRAW_ITEM::Draw(), LIB_ARC::drawGraphic(), GRArc1(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

896 {
897  GRArc1( ClipBox, DC, x1, y1, x2, y2, xc, yc, 0, Color );
898 }
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:894
void GRArc1 ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  xc,
int  yc,
int  width,
COLOR4D  Color 
)

Definition at line 904 of file gr_basic.cpp.

References Distance(), EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), GRSetBrush(), GRSetColorPen(), and KiROUND().

906 {
907  /* Clip arcs off screen. */
908  if( ClipBox )
909  {
910  int x0, y0, xm, ym, r;
911  x0 = ClipBox->GetX();
912  y0 = ClipBox->GetY();
913  xm = ClipBox->GetRight();
914  ym = ClipBox->GetBottom();
915  r = KiROUND( Distance( x1, y1, xc, yc ) );
916  if( xc < ( x0 - r ) )
917  return;
918  if( yc < ( y0 - r ) )
919  return;
920  if( xc > ( r + xm ) )
921  return;
922  if( yc > ( r + ym ) )
923  return;
924  }
925 
926  GRSetBrush( DC, Color );
927  GRSetColorPen( DC, Color, width );
928  DC->DrawArc( x1, y1, x2, y2, xc, yc );
929 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:106
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
int GetX() const
Definition: eda_rect.h:109
int GetY() const
Definition: eda_rect.h:110
double Distance(double x1, double y1, double x2, double y2)
void GRArc1 ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aStart,
wxPoint  aEnd,
wxPoint  aCenter,
int  aWidth,
COLOR4D  aColor 
)

Definition at line 932 of file gr_basic.cpp.

References GRArc1(), wxPoint::x, and wxPoint::y.

934 {
935  GRArc1( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y,
936  aWidth, aColor );
937 }
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:894
void GRBezier ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
int  width,
COLOR4D  Color 
)

Definition at line 1246 of file gr_basic.cpp.

References BEZIER_POLY::GetPoly(), and GRPoly().

1256 {
1257  std::vector<wxPoint> points;
1258 
1259  BEZIER_POLY converter( x1, y1, x2, y2, x3, y3 );
1260  converter.GetPoly( points );
1261 
1262  GRPoly( ClipBox, DC, points.size(), &points[0], false, width, Color, Color );
1263 }
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:796
Bezier curves to polygon converter.
Definition: bezier_curves.h:34
void GRBezier ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
int  x4,
int  y4,
int  width,
COLOR4D  Color 
)

Definition at line 1266 of file gr_basic.cpp.

References BEZIER_POLY::GetPoly(), and GRPoly().

1278 {
1279  std::vector<wxPoint> points;
1280 
1281  BEZIER_POLY converter( x1, y1, x2, y2, x3, y3, x4, y4 );
1282  converter.GetPoly( points );
1283 
1284  GRPoly( ClipBox, DC, points.size(), &points[0], false, width, Color, Color );
1285 }
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:796
Bezier curves to polygon converter.
Definition: bezier_curves.h:34
void GRCircle ( EDA_RECT ClipBox,
wxDC *  aDC,
int  x,
int  y,
int  aRadius,
COLOR4D  aColor 
)

Function GRCircle draws a circle onto the drawing context aDC centered at the user coordinates (x,y)

Parameters
ClipBoxdefines a rectangular boundary outside of which no drawing will occur.
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 861 of file gr_basic.cpp.

References GRCircle().

862 {
863  GRCircle( ClipBox, DC, x, y, r, 0, Color );
864 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:850
void GRCircle ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
int  r,
int  width,
COLOR4D  Color 
)

Definition at line 850 of file gr_basic.cpp.

References clipCircle(), GRSetBrush(), GRSetColorPen(), and NOT_FILLED.

Referenced by PCB_TARGET::Draw(), SCH_BUS_ENTRY_BASE::Draw(), EDGE_MODULE::Draw(), DRAWSEGMENT::Draw(), GERBER_DRAW_ITEM::Draw(), VIA::Draw(), EDA_DRAW_PANEL::DrawAuxiliaryAxis(), D_CODE::DrawFlashedShape(), LIB_CIRCLE::drawGraphic(), EDA_DRAW_PANEL::DrawGridAxis(), LIB_PIN::DrawPinSymbol(), D_PAD::DrawShape(), DrawViaCirclesWhenEditingNewTrack(), GRCircle(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

851 {
852  if( clipCircle( ClipBox, xc, yc, r, width ) || r <= 0 )
853  return;
854 
855  GRSetBrush( DC, Color, NOT_FILLED );
856  GRSetColorPen( DC, Color, width );
857  DC->DrawEllipse( xc - r, yc - r, r + r, r + r );
858 }
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:820
static const bool NOT_FILLED
Definition: gr_basic.cpp:43
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRCircle ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aPos,
int  aRadius,
int  aWidth,
COLOR4D  aColor 
)

Definition at line 867 of file gr_basic.cpp.

References GRCircle(), wxPoint::x, and wxPoint::y.

868 {
869  GRCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, aWidth, aColor );
870 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:850
void GRClosedPoly ( EDA_RECT ClipBox,
wxDC *  aDC,
int  aPointCount,
wxPoint  aPoints[],
bool  doFill,
COLOR4D  aPenColor,
COLOR4D  aFillColor 
)

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

Parameters
ClipBoxdefines a rectangular boundary outside of which no drawing will occur.
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.
aPenColorthe color of the border.
aFillColorthe fill color of the polygon's interior.

Definition at line 806 of file gr_basic.cpp.

References GRClosedPoly().

Referenced by DRAWSEGMENT::Draw(), APERTURE_MACRO::DrawApertureMacroShape(), D_CODE::DrawFlashedPolygon(), GERBER_DRAW_ITEM::DrawGbrPoly(), MARKER_BASE::DrawMarker(), D_PAD::DrawShape(), GRClosedPoly(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

808 {
809  GRClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor );
810 }
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:806
void GRClosedPoly ( EDA_RECT ClipBox,
wxDC *  aDC,
int  aPointCount,
wxPoint  aPoints[],
bool  doFill,
int  aPenWidth,
COLOR4D  aPenColor,
COLOR4D  aFillColor 
)

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

Parameters
ClipBoxdefines a rectangular boundary outside of which no drawing will occur.
aDCthe device context into which drawing should occur.
aPointCountthe number of points in the array aPointArray.
aPointsthe points to draw.
doFilltrue if polygon is to be filled, else false and only the boundary is drawn.
aPenWidthis the width of the pen to use on the perimeter, can be zero.
aPenColorthe color of the border.
aFillColorthe fill color of the polygon's interior.

Definition at line 813 of file gr_basic.cpp.

References GRSClosedPoly().

815 {
816  GRSClosedPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
817 }
static void GRSClosedPoly(EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, wxPoint aPoints[], bool aFill, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:729
void GRCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 596 of file gr_basic.cpp.

References GRCSegm().

598 {
599  GRCSegm( ClipBox, DC, x1, y1, x2, y2, width, 0, Color );
600 }
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:510
void GRCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
int  aPenSize,
COLOR4D  Color 
)

Definition at line 510 of file gr_basic.cpp.

References PNS::angle(), ArcTangente(), clipLine(), GRLastMoveToX, GRLastMoveToY, GRSetBrush(), GRSetColorPen(), EDA_RECT::Inflate(), NOT_FILLED, RotatePoint(), wxPoint::x, and wxPoint::y.

Referenced by PCB_TARGET::Draw(), EDGE_MODULE::Draw(), TRACK::Draw(), DIMENSION::Draw(), DRAWSEGMENT::Draw(), GERBER_DRAW_ITEM::Draw(), SEGZONE::Draw(), ZONE_CONTAINER::DrawFilledArea(), D_CODE::DrawFlashedShape(), BASIC_GAL::DrawLine(), BASIC_GAL::DrawPolyline(), D_PAD::DrawShape(), GRCSegm(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

512 {
513  GRLastMoveToX = x2;
514  GRLastMoveToY = y2;
515 
516  if( ClipBox )
517  {
518  EDA_RECT clipbox(*ClipBox);
519  clipbox.Inflate(width/2);
520 
521  if( clipLine( &clipbox, x1, y1, x2, y2 ) )
522  return;
523  }
524 
525 
526  if( width <= 2 ) /* single line or 2 pixels */
527  {
528  GRSetColorPen( DC, Color, width );
529  DC->DrawLine( x1, y1, x2, y2 );
530  return;
531  }
532 
533  GRSetBrush( DC, Color, NOT_FILLED );
534  GRSetColorPen( DC, Color, aPenSize );
535 
536  int radius = (width + 1) >> 1;
537  int dx = x2 - x1;
538  int dy = y2 - y1;
539  double angle = -ArcTangente( dy, dx );
540  wxPoint start;
541  wxPoint end;
542  wxPoint org( x1, y1);
543  int len = (int) hypot( dx, dy );
544 
545  // We know if the DC is mirrored, to draw arcs
546  int slx = DC->DeviceToLogicalX( 1 ) - DC->DeviceToLogicalX( 0 );
547  int sly = DC->DeviceToLogicalY( 1 ) - DC->DeviceToLogicalY( 0 );
548  bool mirrored = (slx > 0 && sly < 0) || (slx < 0 && sly > 0);
549 
550  // first edge
551  start.x = 0;
552  start.y = radius;
553  end.x = len;
554  end.y = radius;
555  RotatePoint( &start, angle);
556  RotatePoint( &end, angle);
557 
558  start += org;
559  end += org;
560 
561  DC->DrawLine( start, end );
562 
563  // first rounded end
564  end.x = 0;
565  end.y = -radius;
566  RotatePoint( &end, angle);
567  end += org;
568 
569  if( !mirrored )
570  DC->DrawArc( end, start, org );
571  else
572  DC->DrawArc( start, end, org );
573 
574 
575  // second edge
576  start.x = len;
577  start.y = -radius;
578  RotatePoint( &start, angle);
579  start += org;
580 
581  DC->DrawLine( start, end );
582 
583  // second rounded end
584  end.x = len;
585  end.y = radius;
586  RotatePoint( &end, angle);
587  end += org;
588 
589  if( !mirrored )
590  DC->DrawArc( end.x, end.y, start.x, start.y, x2, y2 );
591  else
592  DC->DrawArc( start.x, start.y, end.x, end.y, x2, y2 );
593 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
static int GRLastMoveToX
Definition: gr_basic.cpp:89
static const bool NOT_FILLED
Definition: gr_basic.cpp:43
static int GRLastMoveToY
Definition: gr_basic.cpp:89
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:170
static bool clipLine(const EDA_RECT *aClipBox, int &x1, int &y1, int &x2, int &y2)
Test if any part of a line falls within the bounds of a rectangle.
Definition: gr_basic.cpp:136
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void GRCSegm ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aStart,
wxPoint  aEnd,
int  aWidth,
COLOR4D  aColor 
)

Definition at line 603 of file gr_basic.cpp.

References GRCSegm(), wxPoint::x, and wxPoint::y.

605 {
606  GRCSegm( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, 0, aColor );
607 }
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:510
void GRDashedLine ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 403 of file gr_basic.cpp.

References GRLine().

Referenced by LIB_ARC::drawEditGraphics().

406 {
407  GRLine( ClipBox, DC, x1, y1, x2, y2, width, Color, wxPENSTYLE_SHORT_DASH );
408 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRDottedLine ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 411 of file gr_basic.cpp.

References GRLine().

414 {
415  GRLine( ClipBox, DC, x1, y1, x2, y2, width, Color, wxPENSTYLE_DOT );
416 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRDrawAnchor ( EDA_RECT aClipBox,
wxDC *  aDC,
int  x,
int  y,
int  aSize,
COLOR4D  aColor 
)

Definition at line 1288 of file gr_basic.cpp.

References GRLine().

Referenced by TEXTE_MODULE::Draw(), EDA_TEXT::Draw(), and MODULE::DrawAncre().

1290 {
1291  int anchor_size = aDC->DeviceToLogicalXRel( aSize );
1292 
1293  GRLine( aClipBox, aDC,
1294  x - anchor_size, y,
1295  x + anchor_size, y, 0, aColor );
1296  GRLine( aClipBox, aDC,
1297  x, y - anchor_size,
1298  x, y + anchor_size, 0, aColor );
1299 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRDrawWrappedText ( wxDC &  aDC,
wxString const &  aText 
)

Draw text centered on a wxDC with wrapping.

Parameters
aDCwxDC instance onto which the text will be drawn
aTextthe text to draw

Definition at line 1302 of file gr_basic.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::RenderPreview().

1303 {
1304  wxStringTokenizer tokenizer( aText, " " );
1305  wxSize const dc_size = aDC.GetSize();
1306  wxSize const margin = aDC.GetTextExtent( " " );
1307  std::vector<wxString> lines;
1308  wxString line_accumulator;
1309  int total_height = 0;
1310 
1311  while( tokenizer.HasMoreTokens() )
1312  {
1313  wxString word = tokenizer.GetNextToken();
1314  wxSize linesize = aDC.GetTextExtent( line_accumulator + " " + word );
1315 
1316  if( linesize.x >= dc_size.x - margin.x && !line_accumulator.IsEmpty() )
1317  {
1318  lines.push_back( line_accumulator );
1319  line_accumulator = word;
1320  }
1321  else
1322  {
1323  line_accumulator += " ";
1324  line_accumulator += word;
1325  }
1326  }
1327 
1328  if( !line_accumulator.IsEmpty() )
1329  {
1330  lines.push_back( line_accumulator );
1331  }
1332 
1333  for( auto const& line: lines )
1334  {
1335  wxSize linesize = aDC.GetTextExtent( line );
1336  total_height += linesize.y;
1337  }
1338 
1339  int top = ( dc_size.y - total_height ) / 2;
1340  int pos = top;
1341 
1342  for( auto const& line: lines )
1343  {
1344  wxSize linesize = aDC.GetTextExtent( line );
1345  aDC.DrawText( line, ( dc_size.x - linesize.x ) / 2, pos );
1346  pos += linesize.y;
1347  }
1348 }
void GRFillCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 613 of file gr_basic.cpp.

References GRSetColorPen(), and WinClipAndDrawLine().

Referenced by TRACK::Draw(), DRAWSEGMENT::Draw(), SEGZONE::Draw(), ZONE_CONTAINER::DrawFilledArea(), D_CODE::DrawFlashedShape(), and D_PAD::DrawShape().

615 {
616  GRSetColorPen( DC, Color, width );
617  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
618 }
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:198
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRFilledArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 992 of file gr_basic.cpp.

References GRFilledArc().

995 {
996  GRFilledArc( ClipBox, DC, x, y, StAngle, EndAngle, r, 0, Color, BgColor );
997 }
void GRFilledArc(EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:943
void GRFilledArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
int  width,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 943 of file gr_basic.cpp.

References FILLED, EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), GRSetBrush(), GRSetColorPen(), and RotatePoint().

Referenced by LIB_ARC::drawGraphic(), and GRFilledArc().

953 {
954  int x1, y1, x2, y2;
955 
956  /* Clip arcs off screen */
957  if( ClipBox )
958  {
959  int x0, y0, xm, ym;
960  x0 = ClipBox->GetX();
961  y0 = ClipBox->GetY();
962  xm = ClipBox->GetRight();
963  ym = ClipBox->GetBottom();
964 
965  if( x < ( x0 - r - 1 ) )
966  return;
967 
968  if( y < ( y0 - r - 1 ) )
969  return;
970 
971  if( x > ( r + xm + 1 ) )
972  return;
973 
974  if( y > ( r + ym + 1 ) )
975  return;
976  }
977 
978  x1 = r;
979  y1 = 0;
980  RotatePoint( &x1, &y1, EndAngle );
981 
982  x2 = r;
983  y2 = 0;
984  RotatePoint( &x2, &y2, StAngle );
985 
986  GRSetBrush( DC, BgColor, FILLED );
987  GRSetColorPen( DC, Color, width );
988  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
989 }
static const bool FILLED
Definition: gr_basic.cpp:42
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
int GetX() const
Definition: eda_rect.h:109
int GetY() const
Definition: eda_rect.h:110
void GRFilledCircle ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
int  r,
int  width,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 873 of file gr_basic.cpp.

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

Referenced by SCH_JUNCTION::Draw(), VIA::Draw(), SCH_SHEET::Draw(), D_CODE::DrawFlashedShape(), LIB_CIRCLE::drawGraphic(), drawMarker(), D_PAD::DrawShape(), GRFilledCircle(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), and PCB_EDIT_FRAME::PrintPage().

875 {
876  if( clipCircle( ClipBox, x, y, r, width ) || r <= 0 )
877  return;
878 
879  GRSetBrush( DC, BgColor, FILLED );
880  GRSetColorPen( DC, Color, width );
881  DC->DrawEllipse( x - r, y - r, r + r, r + r );
882 }
static const bool FILLED
Definition: gr_basic.cpp:42
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:820
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRFilledCircle ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aPos,
int  aRadius,
COLOR4D  aColor 
)

Definition at line 885 of file gr_basic.cpp.

References GRFilledCircle(), wxPoint::x, and wxPoint::y.

886 {
887  GRFilledCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, 0, aColor, aColor );
888 }
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:873
void GRFilledRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 1138 of file gr_basic.cpp.

References GRSFilledRect().

Referenced by GBR_LAYOUT::Draw(), D_CODE::DrawFlashedShape(), LIB_RECTANGLE::drawGraphic(), and drawMarker().

1140 {
1141  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
1142 }
void GRSFilledRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:1173
void GRFilledRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 1148 of file gr_basic.cpp.

References GRSFilledRect().

1150 {
1151  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, width, Color, BgColor );
1152 }
void GRSFilledRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:1173
void GRFilledSegment ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aStart,
wxPoint  aEnd,
int  aWidth,
COLOR4D  aColor 
)

Definition at line 621 of file gr_basic.cpp.

References GRSetColorPen(), WinClipAndDrawLine(), wxPoint::x, and wxPoint::y.

Referenced by GERBER_DRAW_ITEM::Draw(), D_PAD::DrawShape(), and DIALOG_PAD_PROPERTIES::OnPaintShowPanel().

623 {
624  GRSetColorPen( aDC, aColor, aWidth );
625  WinClipAndDrawLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth );
626 }
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:198
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRForceBlackPen ( bool  flagforce)

Function GRForceBlackPen.

Parameters
flagforceTrue to force a black pen whenever the asked color

Definition at line 299 of file gr_basic.cpp.

References s_ForceBlackPen.

Referenced by VIA::Draw(), PLEDITOR_PRINTOUT::DrawPage(), SCH_PRINTOUT::DrawPage(), BOARD_PRINTOUT_CONTROLLER::DrawPage(), DrawPageOnClipboard(), D_PAD::DrawShape(), and PCB_EDIT_FRAME::PrintPage().

300 {
301  s_ForceBlackPen = flagforce;
302 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:90
COLOR4D GRGetColor ( )
GR_DRAWMODE GRGetDrawMode ( wxDC *  DC)
void GRLine ( EDA_RECT aClipBox,
wxDC *  aDC,
wxPoint  aStart,
wxPoint  aEnd,
int  aWidth,
COLOR4D  aColor,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)

Definition at line 397 of file gr_basic.cpp.

References GRLine(), wxPoint::x, and wxPoint::y.

398 {
399  GRLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor, aStyle );
400 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRLine ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)

Definition at line 380 of file gr_basic.cpp.

References GRLastMoveToX, GRLastMoveToY, GRSetColorPen(), and WinClipAndDrawLine().

Referenced by Autoroute_One_Track(), SCH_NO_CONNECT::Draw(), PCB_TARGET::Draw(), SCH_BUS_ENTRY_BASE::Draw(), EDGE_MODULE::Draw(), SCH_LINE::Draw(), BLOCK_SELECTOR::Draw(), SCH_FIELD::Draw(), TRACK::Draw(), DIMENSION::Draw(), GERBER_DRAW_ITEM::Draw(), SEGZONE::Draw(), VIA::Draw(), LIB_PART::Draw(), EDA_DRAW_PANEL::DrawAuxiliaryAxis(), EDA_DRAW_PANEL::DrawBackGround(), EDA_DRAW_PANEL::DrawCrossHair(), LIB_ARC::drawEditGraphics(), PCB_BASE_FRAME::DrawGeneralRatsnest(), EDA_DRAW_PANEL::DrawGridAxis(), BASIC_GAL::DrawLine(), LIB_PIN::DrawPinSymbol(), D_PAD::DrawShape(), TEXTE_MODULE::DrawUmbilical(), ZONE_CONTAINER::DrawWhileCreateOutline(), WS_DRAW_ITEM_LINE::DrawWsItem(), GRDashedLine(), GRDottedLine(), GRDrawAnchor(), GRLine(), GRLineTo(), GRMixedLine(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), PCB_BASE_FRAME::TraceAirWiresToTargets(), and PCB_BASE_FRAME::TraceModuleRatsNest().

389 {
390  GRSetColorPen( DC, Color, width, aStyle );
391  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
392  GRLastMoveToX = x2;
393  GRLastMoveToY = y2;
394 }
static int GRLastMoveToX
Definition: gr_basic.cpp:89
static int GRLastMoveToY
Definition: gr_basic.cpp:89
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:198
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRLineArray ( EDA_RECT aClipBox,
wxDC *  aDC,
std::vector< wxPoint > &  aLines,
int  aWidth,
COLOR4D  aColor 
)

Function GRLineArray draws an array of lines (not a polygon).

Parameters
aClipBox= the clip box
aDC= the device context into which drawing should occur.
aLines= a list of pair of coordinate in user space: a pair for each line.
aWidth= the width of each line.
aColor= the color of the lines
See also
COLOR4D
Parameters
aClipBox= the clip box
aDC= the device context into which drawing should occur.
aLines= a list of pair of coordinate in user space: a pair for each line.
aWidth= the width of each line.
aColor= color to draw the lines
See also
COLOR4D

Definition at line 456 of file gr_basic.cpp.

References clipLine(), GRMoveTo(), GRSetColorPen(), i, and EDA_RECT::Inflate().

Referenced by ZONE_CONTAINER::Draw().

458 {
459  if( aLines.empty() )
460  return;
461 
462  GRSetColorPen( aDC, aColor, aWidth );
463 
464  if( aClipBox )
465  aClipBox->Inflate( aWidth / 2 );
466 
467 #if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
468  wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC );
469  if( gcdc )
470  {
471  wxGraphicsContext *gc = gcdc->GetGraphicsContext();
472 
473  // create path
474  wxGraphicsPath path = gc->CreatePath();
475  for( unsigned i = 0; i < aLines.size(); i += 2 )
476  {
477  int x1 = aLines[i].x;
478  int y1 = aLines[i].y;
479  int x2 = aLines[i+1].x;
480  int y2 = aLines[i+1].y;
481  if( ( aClipBox == NULL ) || !clipLine( aClipBox, x1, y1, x2, y2 ) )
482  {
483  path.MoveToPoint( x1, y1 );
484  path.AddLineToPoint( x2, y2 );
485  }
486  }
487  // draw path
488  gc->StrokePath( path );
489  }
490  else
491 #endif
492  {
493  for( unsigned i = 0; i < aLines.size(); i += 2 )
494  {
495  int x1 = aLines[i].x;
496  int y1 = aLines[i].y;
497  int x2 = aLines[i+1].x;
498  int y2 = aLines[i+1].y;
499  if( ( aClipBox == NULL ) || !clipLine( aClipBox, x1, y1, x2, y2 ) )
500  aDC->DrawLine( x1, y1, x2, y2 );
501  }
502  }
503  GRMoveTo( aLines[aLines.size() - 1].x, aLines[aLines.size() - 1].y );
504 
505  if( aClipBox )
506  aClipBox->Inflate(-aWidth/2);
507 }
static bool clipLine(const EDA_RECT *aClipBox, int &x1, int &y1, int &x2, int &y2)
Test if any part of a line falls within the bounds of a rectangle.
Definition: gr_basic.cpp:136
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:422
size_t i
Definition: json11.cpp:597
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void GRLineTo ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
int  width,
COLOR4D  Color 
)

Definition at line 432 of file gr_basic.cpp.

References GRLastMoveToX, GRLastMoveToY, and GRLine().

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

433 {
434  GRLine( ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color );
435 }
static int GRLastMoveToX
Definition: gr_basic.cpp:89
static int GRLastMoveToY
Definition: gr_basic.cpp:89
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRMixedLine ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 438 of file gr_basic.cpp.

References GRLine().

440 {
441  GRLine( ClipBox, DC, x1, y1, x2, y2, width, Color, wxPENSTYLE_DOT_DASH );
442 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:380
void GRMoveTo ( int  x,
int  y 
)

Definition at line 422 of file gr_basic.cpp.

References GRLastMoveToX, and GRLastMoveToY.

Referenced by LIB_PIN::DrawPinSymbol(), GRLineArray(), GRSClosedPoly(), and GRSPoly().

423 {
424  GRLastMoveToX = x;
425  GRLastMoveToY = y;
426 }
static int GRLastMoveToX
Definition: gr_basic.cpp:89
static int GRLastMoveToY
Definition: gr_basic.cpp:89
void GRPoly ( EDA_RECT ClipBox,
wxDC *  DC,
int  n,
wxPoint  Points[],
bool  Fill,
int  width,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 796 of file gr_basic.cpp.

References GRSPoly().

Referenced by EDGE_MODULE::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), ZONE_CONTAINER::DrawFilledArea(), LIB_POLYLINE::drawGraphic(), LIB_BEZIER::drawGraphic(), BASIC_GAL::DrawPolyline(), WS_DRAW_ITEM_POLYGON::DrawWsItem(), GRBezier(), and ShowBoundingBoxMicroWaveInductor().

798 {
799  GRSPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
800 }
static void GRSPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:671
void GRPutPixel ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
COLOR4D  color 
)

Definition at line 367 of file gr_basic.cpp.

References EDA_RECT::Contains(), and GRSetColorPen().

Referenced by DisplayRoutingMatrix(), and drawPlacementRoutingMatrix().

368 {
369  if( ClipBox && !ClipBox->Contains( x, y ) )
370  return;
371 
372  GRSetColorPen( DC, Color );
373  DC->DrawPoint( x, y );
374 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
void GRRect ( EDA_RECT ClipBox,
wxDC *  DC,
const EDA_RECT aRect,
int  aWidth,
COLOR4D  Color 
)

Definition at line 1124 of file gr_basic.cpp.

References EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), and GRSRect().

1125 {
1126  int x1 = aRect.GetX();
1127  int y1 = aRect.GetY();
1128  int x2 = aRect.GetRight();
1129  int y2 = aRect.GetBottom();
1130 
1131  GRSRect( aClipBox, aDC, x1, y1, x2, y2, aWidth, aColor );
1132 }
int GetBottom() const
Definition: eda_rect.h:122
int GetRight() const
Definition: eda_rect.h:119
int GetX() const
Definition: eda_rect.h:109
int GetY() const
Definition: eda_rect.h:110
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:1159
void GRRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color 
)

Definition at line 1118 of file gr_basic.cpp.

References GRSRect().

1119 {
1120  GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
1121 }
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:1159
void GRRectPs ( EDA_RECT aClipBox,
wxDC *  aDC,
const EDA_RECT aRect,
int  aWidth,
COLOR4D  aColor,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)
void GRResetPenAndBrush ( wxDC *  DC)

Definition at line 218 of file gr_basic.cpp.

References BLACK, GRSetBrush(), s_DC_lastbrushcolor, s_DC_lastcolor, and s_DC_lastDC.

Referenced by EDA_DRAW_PANEL::DoPrepareDC(), PLEDITOR_PRINTOUT::DrawPage(), SCH_PRINTOUT::DrawPage(), BOARD_PRINTOUT_CONTROLLER::DrawPage(), DrawPageOnClipboard(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), DIALOG_PAD_PROPERTIES::OnPaintShowPanel(), EDA_DRAW_PANEL::ReDraw(), DIALOG_CHOOSE_COMPONENT::RenderPreview(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

219 {
220  GRSetBrush( DC, BLACK ); // Force no fill
221  s_DC_lastbrushcolor = COLOR4D::UNSPECIFIED;
222  s_DC_lastcolor = COLOR4D::UNSPECIFIED;
223  s_DC_lastDC = NULL;
224 }
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:100
static COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
static COLOR4D s_DC_lastcolor(0, 0, 0, 0)
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
Definition: colors.h:45
void GRSetBrush ( wxDC *  DC,
COLOR4D  Color,
bool  fill = false 
)

Definition at line 268 of file gr_basic.cpp.

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

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

269 {
270  if( s_ForceBlackPen )
271  Color = COLOR4D::BLACK;
272 
273  if( s_DC_lastbrushcolor != Color
274  || s_DC_lastbrushfill != fill
275  || s_DC_lastDC != DC )
276  {
277  wxBrush brush;
278 
279  brush.SetColour( Color.ToColour() );
280 
281  if( fill )
282  brush.SetStyle( wxBRUSHSTYLE_SOLID );
283  else
284  brush.SetStyle( wxBRUSHSTYLE_TRANSPARENT );
285 
286  DC->SetBrush( brush );
287 
288  s_DC_lastbrushcolor = Color;
289  s_DC_lastbrushfill = fill;
290  s_DC_lastDC = DC;
291  }
292 }
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:100
static COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
Definition: colors.h:45
static bool s_DC_lastbrushfill
Definition: gr_basic.cpp:99
static bool s_ForceBlackPen
Definition: gr_basic.cpp:90
void GRSetColor ( COLOR4D  Color)
void GRSetColorPen ( wxDC *  DC,
COLOR4D  Color,
int  width = 1,
wxPenStyle  stype = wxPENSTYLE_SOLID 
)

Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context.

Definition at line 231 of file gr_basic.cpp.

References BLACK, and s_ForceBlackPen.

Referenced by EDA_DRAW_PANEL::DrawAuxiliaryAxis(), EDA_DRAW_PANEL::DrawGrid(), EDA_DRAW_PANEL::DrawGridAxis(), GRArc(), GRArc1(), GRCircle(), GRCSegm(), GRFillCSegm(), GRFilledArc(), GRFilledCircle(), GRFilledSegment(), GRLine(), GRLineArray(), GRPutPixel(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().

232 {
233  wxDash dots[2] = { 1, 3 };
234  // Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
235  // nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
236  if( width <= 1 )
237  width = DC->DeviceToLogicalXRel( 1 );
238 
239  if( s_ForceBlackPen )
240  Color = COLOR4D::BLACK;
241 
242  const wxPen& curr_pen = DC->GetPen();
243 
244  if( !curr_pen.IsOk() || curr_pen.GetColour() != Color.ToColour()
245  || curr_pen.GetWidth() != width
246  || curr_pen.GetStyle() != style )
247  {
248  wxPen pen;
249  pen.SetColour( Color.ToColour() );
250  if( style == wxPENSTYLE_DOT )
251  {
252  style = wxPENSTYLE_USER_DASH;
253  pen.SetDashes( 2, dots );
254  }
255  pen.SetWidth( width );
256  pen.SetStyle( style );
257  DC->SetPen( pen );
258  }
259  else
260  // Should be not needed, but on Linux, in printing process
261  // the curr pen settings needs to be sometimes re-initialized
262  // Clearly, this is due to a bug, related to SetBrush(),
263  // but we have to live with it, at least on wxWidgets 3.0
264  DC->SetPen( curr_pen );
265 }
Definition: colors.h:45
static bool s_ForceBlackPen
Definition: gr_basic.cpp:90
void GRSetDefaultPalette ( )
void GRSetDrawMode ( wxDC *  DC,
GR_DRAWMODE  mode 
)

Definition at line 318 of file gr_basic.cpp.

References GR_COPY, GR_INVERT, GR_NXOR, GR_OR, and GR_XOR.

Referenced by Autoroute_One_Track(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_Segment(), DisplayRoutingMatrix(), SCH_NO_CONNECT::Draw(), SCH_JUNCTION::Draw(), PCB_TARGET::Draw(), SCH_BUS_ENTRY_BASE::Draw(), SCH_BITMAP::Draw(), EDGE_MODULE::Draw(), ZONE_CONTAINER::Draw(), SCH_LINE::Draw(), GBR_LAYOUT::Draw(), BLOCK_SELECTOR::Draw(), SCH_TEXT::Draw(), SCH_FIELD::Draw(), TEXTE_MODULE::Draw(), TRACK::Draw(), DIMENSION::Draw(), DRAWSEGMENT::Draw(), LIB_ITEM::Draw(), GERBER_DRAW_ITEM::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), SEGZONE::Draw(), VIA::Draw(), SCH_SHEET::Draw(), LIB_PART::Draw(), MODULE::DrawAncre(), EDA_DRAW_PANEL::DrawAuxiliaryAxis(), EDA_DRAW_PANEL::DrawBackGround(), EDA_DRAW_PANEL::DrawCrossHair(), ZONE_CONTAINER::DrawFilledArea(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_TEXT::drawGraphic(), LIB_ARC::drawGraphic(), LIB_FIELD::drawGraphic(), EDA_DRAW_PANEL::DrawGridAxis(), GBR_LAYOUT::DrawItemsDCodeID(), MARKER_BASE::DrawMarker(), DrawMovingBlockOutlines(), EDA_TEXT::drawOneLineOfText(), LIB_PIN::DrawPinElectricalTypeName(), LIB_PIN::DrawPinSymbol(), LIB_PIN::DrawPinTexts(), drawPlacementRoutingMatrix(), D_PAD::DrawShape(), TRACK::DrawShortNetname(), TEXTE_MODULE::DrawUmbilical(), ZONE_CONTAINER::DrawWhileCreateOutline(), EDA_DRAW_FRAME::DrawWorkSheet(), WS_DRAW_ITEM_LINE::DrawWsItem(), WS_DRAW_ITEM_POLYGON::DrawWsItem(), WS_DRAW_ITEM_RECT::DrawWsItem(), WS_DRAW_ITEM_BITMAP::DrawWsItem(), PCB_EDIT_FRAME::End_Route(), EDA_DRAW_PANEL::EraseScreen(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::Remove_One_Track(), ShowBoundingBoxMicroWaveInductor(), and PCB_BASE_FRAME::TraceAirWiresToTargets().

319 {
320  if( draw_mode & GR_OR )
321 #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
322 
323  DC->SetLogicalFunction( wxCOPY );
324 #elif defined( USE_WX_GRAPHICS_CONTEXT )
325 
326  DC->SetLogicalFunction( wxCOPY );
327 #else
328 
329  DC->SetLogicalFunction( wxOR );
330 #endif
331  else if( draw_mode & GR_XOR )
332 #if defined( USE_WX_GRAPHICS_CONTEXT )
333 
334  DC->SetLogicalFunction( wxCOPY );
335 #else
336 
337  DC->SetLogicalFunction( wxXOR );
338 #endif
339  else if( draw_mode & GR_NXOR )
340 #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
341 
342  DC->SetLogicalFunction( wxXOR );
343 #elif defined( USE_WX_GRAPHICS_CONTEXT )
344 
345  DC->SetLogicalFunction( wxCOPY );
346 #else
347 
348  DC->SetLogicalFunction( wxEQUIV );
349 #endif
350  else if( draw_mode & GR_INVERT )
351 #if defined( USE_WX_GRAPHICS_CONTEXT )
352 
353  DC->SetLogicalFunction( wxCOPY );
354 #else
355 
356  DC->SetLogicalFunction( wxINVERT );
357 #endif
358  else if( draw_mode & GR_COPY )
359  DC->SetLogicalFunction( wxCOPY );
360 
361 #ifdef USE_WX_OVERLAY
362  DC->SetLogicalFunction( wxCOPY );
363 #endif
364 }
Definition: gr_basic.h:38
void GRSFilledRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 1173 of file gr_basic.cpp.

References ClipAndDrawPoly(), FILLED, GRSetBrush(), GRSetColorPen(), and EDA_RECT::Inflate().

Referenced by EDA_DRAW_PANEL::EraseScreen(), and GRFilledRect().

1175 {
1176  wxPoint points[5];
1177  points[0] = wxPoint(x1, y1);
1178  points[1] = wxPoint(x1, y2);
1179  points[2] = wxPoint(x2, y2);
1180  points[3] = wxPoint(x2, y1);
1181  points[4] = points[0];
1182 
1183  GRSetBrush( aDC, aBgColor, FILLED );
1184  GRSetColorPen( aDC, aBgColor, aWidth );
1185 
1186  if( aClipBox && (aWidth > 0) )
1187  {
1188  EDA_RECT clipbox(*aClipBox);
1189  clipbox.Inflate(aWidth);
1190  ClipAndDrawPoly(&clipbox, aDC, points, 5); // polygon approach is more accurate
1191  }
1192  else
1193  ClipAndDrawPoly(aClipBox, aDC, points, 5 );
1194 }
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, wxPoint Points[], int n)
Function ClipAndDrawPoly Used to clip a polygon and draw it as Filled Polygon uses the Sutherland and...
Definition: gr_basic.cpp:1211
static const bool FILLED
Definition: gr_basic.cpp:42
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:268
void GRSetColorPen(wxDC *DC, COLOR4D Color, int width, wxPenStyle style)
Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context...
Definition: gr_basic.cpp:231
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
GR_DRAWMODE operator& ( const GR_DRAWMODE a,
const GR_DRAWMODE b 
)
inline

Definition at line 69 of file gr_basic.h.

70 {
71  return static_cast<GR_DRAWMODE>( int( a ) & int( b ) );
72 }
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
GR_DRAWMODE operator| ( const GR_DRAWMODE a,
const GR_DRAWMODE b 
)
inline

Definition at line 64 of file gr_basic.h.

65 {
66  return static_cast<GR_DRAWMODE>( int( a ) | int( b ) );
67 }
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
GR_DRAWMODE operator~ ( const GR_DRAWMODE a)
inline

Definition at line 59 of file gr_basic.h.

60 {
61  return static_cast<GR_DRAWMODE>( ~int( a ) );
62 }
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37

Variable Documentation