KiCad PCB EDA Suite
gr_basic.cpp File Reference
#include <gr_basic.h>
#include <trigo.h>
#include <eda_item.h>
#include <base_screen.h>
#include <bezier_curves.h>
#include <math_for_graphics.h>
#include <wx/graphics.h>
#include <geometry/geometry_utils.h>
#include <math/util.h>
#include <algorithm>
#include <SutherlandHodgmanClipPoly.h>

Go to the source code of this file.

Macros

#define DEBUG_DUMP_CLIP_ERROR_COORDS   0
 
#define DEBUG_DUMP_CLIP_COORDS   0
 

Functions

static void ClipAndDrawPoly (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint *Points, int n)
 Used to clip a polygon and draw it as Filled Polygon. More...
 
static void GRSRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
 
static void WinClipAndDrawLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
 
void GRResetPenAndBrush (wxDC *DC)
 
void GRSetColorPen (wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
 
void GRSetBrush (wxDC *DC, const COLOR4D &Color, bool fill)
 
void GRForceBlackPen (bool flagforce)
 
bool GetGRForceBlackPenState (void)
 
void GRPutPixel (EDA_RECT *ClipBox, wxDC *DC, int x, int y, const COLOR4D &Color)
 
void GRLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
 
void GRLine (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle)
 
void GRMoveTo (int x, int y)
 
void GRLineTo (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, const COLOR4D &Color)
 
void GRLineArray (EDA_RECT *aClipBox, wxDC *aDC, std::vector< wxPoint > &aLines, int aWidth, const COLOR4D &aColor)
 Draw an array of lines (not a polygon). More...
 
void GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, const COLOR4D &Color)
 
void GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color)
 
void GRCSegm (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, const COLOR4D &aColor)
 
void GRFillCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color)
 
void GRFilledSegment (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, const COLOR4D &aColor)
 
static bool IsGRSPolyDrawable (EDA_RECT *ClipBox, int n, const wxPoint *Points)
 
static void GRSPoly (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 Draw a new polyline and fill it if Fill, in screen space. More...
 
static void GRSClosedPoly (EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *aPoints, bool aFill, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
 Draw a new closed polyline and fill it if Fill, in screen space. More...
 
void GRPoly (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *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 (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, const COLOR4D &Color, const COLOR4D &BgColor)
 Draw a closed polyline and fill it if Fill, in object space. More...
 
void GRClosedPoly (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it. More...
 
static bool clipCircle (EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
 
void GRCircle (EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, const COLOR4D &Color)
 
void GRCircle (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, const COLOR4D &Color)
 Draw a circle onto the drawing context aDC centered at the user coordinates (x,y). More...
 
void GRCircle (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, int aRadius, int aWidth, const COLOR4D &aColor)
 
void GRFilledCircle (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRFilledCircle (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, int aRadius, const COLOR4D &aColor)
 
void GRArc1 (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, const COLOR4D &Color)
 
void GRArc1 (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, int width, const COLOR4D &Color)
 
void GRArc1 (EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aCenter, int aWidth, const COLOR4D &aColor)
 
void GRFilledArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRFilledArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRArc (EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, double StAngle, double EndAngle, int r, const COLOR4D &Color)
 
void GRArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, const COLOR4D &Color)
 
void GRRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, const COLOR4D &aColor)
 
void GRRectPs (EDA_RECT *aClipBox, wxDC *aDC, const EDA_RECT &aRect, const COLOR4D &aColor, wxPenStyle aStyle)
 
void GRRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color)
 
void GRRect (EDA_RECT *aClipBox, wxDC *aDC, const EDA_RECT &aRect, int aWidth, const COLOR4D &aColor)
 
void GRFilledRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRFilledRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, const COLOR4D &BgColor)
 
void GRSFilledRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
 
void GRBezier (EDA_RECT *aClipBox, wxDC *aDC, std::vector< wxPoint > &aPoint, int aWidth, const COLOR4D &aColor)
 Draw cubic (4 points: start control1, control2, end) bezier curve. More...
 
void GRDrawAnchor (EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, const COLOR4D &aColor)
 
void GRDrawWrappedText (wxDC &aDC, wxString const &aText)
 Draw text centered on a wxDC with wrapping. More...
 

Variables

static const bool FILLED = true
 
static const bool NOT_FILLED = false
 
GR_DRAWMODE g_XorMode = GR_NXOR
 
static int GRLastMoveToX
 
static int GRLastMoveToY
 
static bool s_ForceBlackPen
 
static int xcliplo = 0
 
static int ycliplo = 0
 
static int xcliphi = 2000
 
static int ycliphi = 2000
 
static COLOR4D s_DC_lastcolor (0, 0, 0, 0)
 
static COLOR4D s_DC_lastbrushcolor (0, 0, 0, 0)
 
static bool s_DC_lastbrushfill = false
 
static wxDC * s_DC_lastDC = nullptr
 

Macro Definition Documentation

◆ DEBUG_DUMP_CLIP_COORDS

#define DEBUG_DUMP_CLIP_COORDS   0

Definition at line 61 of file gr_basic.cpp.

◆ DEBUG_DUMP_CLIP_ERROR_COORDS

#define DEBUG_DUMP_CLIP_ERROR_COORDS   0

Definition at line 60 of file gr_basic.cpp.

Function Documentation

◆ ClipAndDrawPoly()

void ClipAndDrawPoly ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint *  Points,
int  n 
)
static

Used to clip a polygon and draw it as Filled Polygon.

Uses the Sutherland and Hodgman algo to clip the given poly against a rectangle. This rectangle is the drawing area this is useful under Linux (2009) because filled polygons are incorrectly drawn if they have too large coordinates (seems due to integer overflows in calculations). Could be removed in some years, if become unnecessary.

Definition at line 874 of file gr_basic.cpp.

875 {
876  if( aClipBox == nullptr )
877  {
878  aDC->DrawPolygon( n, Points );
879  return;
880  }
881 
882  // A clip box exists: clip and draw the polygon.
883  static std::vector<wxPoint> clippedPolygon;
884  static pointVector inputPolygon, outputPolygon;
885 
886  inputPolygon.clear();
887  outputPolygon.clear();
888  clippedPolygon.clear();
889 
890  for( int ii = 0; ii < n; ii++ )
891  inputPolygon.push_back( PointF( (REAL) Points[ii].x, (REAL) Points[ii].y ) );
892 
893  RectF window( (REAL) aClipBox->GetX(), (REAL) aClipBox->GetY(),
894  (REAL) aClipBox->GetWidth(), (REAL) aClipBox->GetHeight() );
895 
896  SutherlandHodgman sh( window );
897  sh.Clip( inputPolygon, outputPolygon );
898 
899  for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit )
900  {
901  clippedPolygon.emplace_back( KiROUND( cit->X ), KiROUND( cit->Y ) );
902  }
903 
904  if( clippedPolygon.size() )
905  aDC->DrawPolygon( clippedPolygon.size(), &clippedPolygon[0] );
906 }
int GetX() const
Definition: eda_rect.h:98
int GetWidth() const
Definition: eda_rect.h:109
int GetHeight() const
Definition: eda_rect.h:110
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
int GetY() const
Definition: eda_rect.h:99

References EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), EDA_RECT::GetX(), EDA_RECT::GetY(), and KiROUND().

Referenced by GRSClosedPoly(), GRSFilledRect(), and GRSPoly().

◆ clipCircle()

static bool clipCircle ( EDA_RECT aClipBox,
int  xc,
int  yc,
int  r,
int  aWidth 
)
static

Definition at line 521 of file gr_basic.cpp.

522 {
523  // Clip circles that are outside the ClipBox.
524  if( aClipBox )
525  {
526  int x0, y0, xm, ym;
527  x0 = aClipBox->GetX();
528  y0 = aClipBox->GetY();
529  xm = aClipBox->GetRight();
530  ym = aClipBox->GetBottom();
531 
532  r += aWidth;
533 
534  if( xc < ( x0 - r ) )
535  return true;
536 
537  if( yc < ( y0 - r ) )
538  return true;
539 
540  if( xc > ( r + xm ) )
541  return true;
542 
543  if( yc > ( r + ym ) )
544  return true;
545  }
546 
547  return false;
548 }
int GetX() const
Definition: eda_rect.h:98
int GetBottom() const
Definition: eda_rect.h:114
int GetRight() const
Definition: eda_rect.h:111
int GetY() const
Definition: eda_rect.h:99

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

Referenced by GRCircle(), and GRFilledCircle().

◆ GetGRForceBlackPenState()

bool GetGRForceBlackPenState ( void  )
Returns
True if a black pen was forced or false if not forced.

Definition at line 196 of file gr_basic.cpp.

197 {
198  return s_ForceBlackPen;
199 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:81

References s_ForceBlackPen.

Referenced by BITMAP_BASE::DrawBitmap(), SCH_SHEET::Print(), and LIB_SYMBOL::Print().

◆ GRArc() [1/2]

void GRArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  xc,
int  yc,
double  StAngle,
double  EndAngle,
int  r,
const COLOR4D Color 
)

Definition at line 689 of file gr_basic.cpp.

691 {
692  int x1, y1, x2, y2;
693 
694  /* Clip arcs off screen */
695  if( ClipBox )
696  {
697  int radius = r + 1;
698  int x0, y0, xm, ym, x, y;
699  x0 = ClipBox->GetX();
700  y0 = ClipBox->GetY();
701  xm = ClipBox->GetRight();
702  ym = ClipBox->GetBottom();
703  x = xc;
704  y = yc;
705 
706  if( x < ( x0 - radius ) )
707  return;
708 
709  if( y < ( y0 - radius ) )
710  return;
711 
712  if( x > ( xm + radius ) )
713  return;
714 
715  if( y > ( ym + radius ) )
716  return;
717  }
718 
719  x1 = r;
720  y1 = 0;
721  RotatePoint( &x1, &y1, EndAngle );
722 
723  x2 = r;
724  y2 = 0;
725  RotatePoint( &x2, &y2, StAngle );
726 
727  GRSetBrush( DC, Color, NOT_FILLED );
728  GRSetColorPen( DC, Color );
729  DC->DrawArc( xc + x1, yc - y1, xc + x2, yc - y2, xc, yc );
730 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
int GetX() const
Definition: eda_rect.h:98
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
int GetBottom() const
Definition: eda_rect.h:114
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static const bool NOT_FILLED
Definition: gr_basic.cpp:35
int GetRight() const
Definition: eda_rect.h:111
int GetY() const
Definition: eda_rect.h:99

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

◆ GRArc() [2/2]

void GRArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
int  width,
const COLOR4D Color 
)

Definition at line 733 of file gr_basic.cpp.

735 {
736  int x1, y1, x2, y2;
737 
738  /* Clip arcs off screen. */
739  if( ClipBox )
740  {
741  int x0, y0, xm, ym;
742  x0 = ClipBox->GetX();
743  y0 = ClipBox->GetY();
744  xm = ClipBox->GetRight();
745  ym = ClipBox->GetBottom();
746 
747  if( x < ( x0 - r - width ) )
748  return;
749 
750  if( y < ( y0 - r - width ) )
751  return;
752 
753  if( x > ( r + xm + width ) )
754  return;
755 
756  if( y > ( r + ym + width ) )
757  return;
758  }
759 
760  x1 = r;
761  y1 = 0;
762  RotatePoint( &x1, &y1, EndAngle );
763 
764  x2 = r;
765  y2 = 0;
766  RotatePoint( &x2, &y2, StAngle );
767 
768  GRSetBrush( DC, Color );
769  GRSetColorPen( DC, Color, width );
770  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
771 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
int GetX() const
Definition: eda_rect.h:98
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
int GetBottom() const
Definition: eda_rect.h:114
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
int GetRight() const
Definition: eda_rect.h:111
int GetY() const
Definition: eda_rect.h:99

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

◆ GRArc1() [1/3]

void GRArc1 ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  xc,
int  yc,
const COLOR4D Color 
)

Definition at line 594 of file gr_basic.cpp.

596 {
597  GRArc1( ClipBox, DC, x1, y1, x2, y2, xc, yc, 0, Color );
598 }
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, const COLOR4D &Color)
Definition: gr_basic.cpp:594

References GRArc1().

Referenced by GRArc1(), LIB_ARC::print(), and GERBER_DRAW_ITEM::Print().

◆ GRArc1() [2/3]

void GRArc1 ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  xc,
int  yc,
int  width,
const COLOR4D Color 
)

Definition at line 601 of file gr_basic.cpp.

603 {
604  /* Clip arcs off screen. */
605  if( ClipBox )
606  {
607  int x0, y0, xm, ym, r;
608  x0 = ClipBox->GetX();
609  y0 = ClipBox->GetY();
610  xm = ClipBox->GetRight();
611  ym = ClipBox->GetBottom();
612  r = KiROUND( Distance( x1, y1, xc, yc ) );
613 
614  if( xc < ( x0 - r ) )
615  return;
616 
617  if( yc < ( y0 - r ) )
618  return;
619 
620  if( xc > ( r + xm ) )
621  return;
622 
623  if( yc > ( r + ym ) )
624  return;
625  }
626 
627  GRSetBrush( DC, Color );
628  GRSetColorPen( DC, Color, width );
629  DC->DrawArc( x1, y1, x2, y2, xc, yc );
630 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
int GetX() const
Definition: eda_rect.h:98
int GetBottom() const
Definition: eda_rect.h:114
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
int GetRight() const
Definition: eda_rect.h:111
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
int GetY() const
Definition: eda_rect.h:99

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

◆ GRArc1() [3/3]

void GRArc1 ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aStart,
const wxPoint &  aEnd,
const wxPoint &  aCenter,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 633 of file gr_basic.cpp.

635 {
636  GRArc1( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y,
637  aWidth, aColor );
638 }
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, const COLOR4D &Color)
Definition: gr_basic.cpp:594

References GRArc1().

◆ GRBezier()

void GRBezier ( EDA_RECT aClipBox,
wxDC *  aDC,
std::vector< wxPoint > &  aPoint,
int  aWidth,
const COLOR4D aColor 
)

Draw cubic (4 points: start control1, control2, end) bezier curve.

Definition at line 909 of file gr_basic.cpp.

911 {
912  std::vector<wxPoint> output;
913 
914  BEZIER_POLY converter( aPoint );
915  converter.GetPoly( output, aWidth );
916 
917  GRPoly( aClipBox, aDC, output.size(), &output[0], false, aWidth, aColor, aColor );
918 }
Bezier curves to polygon converter.
Definition: bezier_curves.h:36
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
Definition: gr_basic.cpp:497

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

◆ GRCircle() [1/3]

void GRCircle ( EDA_RECT ClipBox,
wxDC *  DC,
int  xc,
int  yc,
int  r,
int  width,
const COLOR4D Color 
)

Definition at line 551 of file gr_basic.cpp.

552 {
553  if( clipCircle( ClipBox, xc, yc, r, width ) || r <= 0 )
554  return;
555 
556  GRSetBrush( DC, Color, NOT_FILLED );
557  GRSetColorPen( DC, Color, width );
558  DC->DrawEllipse( xc - r, yc - r, r + r, r + r );
559 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:521
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static const bool NOT_FILLED
Definition: gr_basic.cpp:35

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

Referenced by D_CODE::DrawFlashedShape(), GRCircle(), LIB_CIRCLE::print(), LIB_PIN::print(), GERBER_DRAW_ITEM::Print(), and LIB_PIN::printPinSymbol().

◆ GRCircle() [2/3]

void GRCircle ( EDA_RECT ClipBox,
wxDC *  aDC,
int  x,
int  y,
int  aRadius,
const COLOR4D aColor 
)

Draw 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 562 of file gr_basic.cpp.

563 {
564  GRCircle( ClipBox, DC, x, y, r, 0, Color );
565 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:551

References GRCircle().

◆ GRCircle() [3/3]

void GRCircle ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aPos,
int  aRadius,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 568 of file gr_basic.cpp.

570 {
571  GRCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, aWidth, aColor );
572 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:551

References GRCircle().

◆ GRClosedPoly() [1/2]

void GRClosedPoly ( EDA_RECT ClipBox,
wxDC *  DC,
int  n,
const wxPoint *  Points,
bool  Fill,
const COLOR4D Color,
const COLOR4D BgColor 
)

Draw a closed polyline and fill it if Fill, in object space.

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

Definition at line 507 of file gr_basic.cpp.

509 {
510  GRClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor );
511 }
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a closed polyline and fill it if Fill, in object space.
Definition: gr_basic.cpp:507

References GRClosedPoly().

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

◆ GRClosedPoly() [2/2]

void GRClosedPoly ( EDA_RECT ClipBox,
wxDC *  aDC,
int  aPointCount,
const wxPoint *  aPoints,
bool  doFill,
int  aPenWidth,
const COLOR4D aPenColor,
const COLOR4D aFillColor 
)

Draw 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 514 of file gr_basic.cpp.

516 {
517  GRSClosedPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
518 }
static void GRSClosedPoly(EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *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:459

References GRSClosedPoly().

◆ GRCSegm() [1/3]

void GRCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
int  aPenSize,
const COLOR4D Color 
)

Definition at line 271 of file gr_basic.cpp.

273 {
274  GRLastMoveToX = x2;
275  GRLastMoveToY = y2;
276 
277  if( ClipBox )
278  {
279  EDA_RECT clipbox( *ClipBox );
280  clipbox.Inflate( width / 2 );
281 
282  if( ClipLine( &clipbox, x1, y1, x2, y2 ) )
283  return;
284  }
285 
286  if( width <= 2 ) /* single line or 2 pixels */
287  {
288  GRSetColorPen( DC, Color, width );
289  DC->DrawLine( x1, y1, x2, y2 );
290  return;
291  }
292 
293  GRSetBrush( DC, Color, NOT_FILLED );
294  GRSetColorPen( DC, Color, aPenSize );
295 
296  int radius = ( width + 1 ) >> 1;
297  int dx = x2 - x1;
298  int dy = y2 - y1;
299  double angle = -ArcTangente( dy, dx );
300  wxPoint start;
301  wxPoint end;
302  wxPoint org( x1, y1 );
303  int len = (int) hypot( dx, dy );
304 
305  // We know if the DC is mirrored, to draw arcs
306  int slx = DC->DeviceToLogicalX( 1 ) - DC->DeviceToLogicalX( 0 );
307  int sly = DC->DeviceToLogicalY( 1 ) - DC->DeviceToLogicalY( 0 );
308  bool mirrored = ( slx > 0 && sly < 0 ) || ( slx < 0 && sly > 0 );
309 
310  // first edge
311  start.x = 0;
312  start.y = radius;
313  end.x = len;
314  end.y = radius;
315  RotatePoint( &start, angle );
316  RotatePoint( &end, angle );
317 
318  start += org;
319  end += org;
320 
321  DC->DrawLine( start, end );
322 
323  // first rounded end
324  end.x = 0;
325  end.y = -radius;
326  RotatePoint( &end, angle );
327  end += org;
328 
329  if( !mirrored )
330  DC->DrawArc( end, start, org );
331  else
332  DC->DrawArc( start, end, org );
333 
334  // second edge
335  start.x = len;
336  start.y = -radius;
337  RotatePoint( &start, angle );
338  start += org;
339 
340  DC->DrawLine( start, end );
341 
342  // second rounded end
343  end.x = len;
344  end.y = radius;
345  RotatePoint( &end, angle);
346  end += org;
347 
348  if( !mirrored )
349  DC->DrawArc( end.x, end.y, start.x, start.y, x2, y2 );
350  else
351  DC->DrawArc( start.x, start.y, end.x, end.y, x2, y2 );
352 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
static int GRLastMoveToX
Definition: gr_basic.cpp:80
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.
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static const bool NOT_FILLED
Definition: gr_basic.cpp:35
static int GRLastMoveToY
Definition: gr_basic.cpp:80
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
Handle the component boundary box.
Definition: eda_rect.h:42
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:183

References PNS::angle(), ArcTangente(), ClipLine(), GRLastMoveToX, GRLastMoveToY, GRSetBrush(), GRSetColorPen(), EDA_RECT::Inflate(), NOT_FILLED, and RotatePoint().

Referenced by BASIC_GAL::doDrawPolyline(), D_CODE::DrawFlashedShape(), BASIC_GAL::DrawLine(), GRCSegm(), and GERBER_DRAW_ITEM::Print().

◆ GRCSegm() [2/3]

void GRCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
const COLOR4D Color 
)

Definition at line 355 of file gr_basic.cpp.

357 {
358  GRCSegm( ClipBox, DC, x1, y1, x2, y2, width, 0, Color );
359 }
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, const COLOR4D &Color)
Definition: gr_basic.cpp:271

References GRCSegm().

◆ GRCSegm() [3/3]

void GRCSegm ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aStart,
const wxPoint &  aEnd,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 362 of file gr_basic.cpp.

364 {
365  GRCSegm( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, 0, aColor );
366 }
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, const COLOR4D &Color)
Definition: gr_basic.cpp:271

References GRCSegm().

◆ GRDrawAnchor()

void GRDrawAnchor ( EDA_RECT aClipBox,
wxDC *  aDC,
int  x,
int  y,
int  aSize,
const COLOR4D aColor 
)

Definition at line 921 of file gr_basic.cpp.

922 {
923  int anchor_size = aDC->DeviceToLogicalXRel( aSize );
924 
925  GRLine( aClipBox, aDC, x - anchor_size, y, x + anchor_size, y, 0, aColor );
926  GRLine( aClipBox, aDC, x, y - anchor_size, x, y + anchor_size, 0, aColor );
927 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:212

References GRLine().

◆ GRDrawWrappedText()

void GRDrawWrappedText ( wxDC &  aDC,
const wxString &  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 930 of file gr_basic.cpp.

931 {
932  wxStringTokenizer tokenizer( aText, " " );
933  wxSize const dc_size = aDC.GetSize();
934  wxSize const margin = aDC.GetTextExtent( " " );
935  std::vector<wxString> lines;
936  wxString line_accumulator;
937  int total_height = 0;
938 
939  while( tokenizer.HasMoreTokens() )
940  {
941  wxString word = tokenizer.GetNextToken();
942  wxSize linesize = aDC.GetTextExtent( line_accumulator + " " + word );
943 
944  if( linesize.x >= dc_size.x - margin.x && !line_accumulator.IsEmpty() )
945  {
946  lines.push_back( line_accumulator );
947  line_accumulator = word;
948  }
949  else
950  {
951  line_accumulator += " ";
952  line_accumulator += word;
953  }
954  }
955 
956  if( !line_accumulator.IsEmpty() )
957  {
958  lines.push_back( line_accumulator );
959  }
960 
961  for( auto const& line: lines )
962  {
963  wxSize linesize = aDC.GetTextExtent( line );
964  total_height += linesize.y;
965  }
966 
967  int top = ( dc_size.y - total_height ) / 2;
968  int pos = top;
969 
970  for( auto const& line: lines )
971  {
972  wxSize linesize = aDC.GetTextExtent( line );
973  aDC.DrawText( line, ( dc_size.x - linesize.x ) / 2, pos );
974  pos += linesize.y;
975  }
976 }

◆ GRFillCSegm()

void GRFillCSegm ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
const COLOR4D Color 
)

Definition at line 369 of file gr_basic.cpp.

371 {
372  GRSetColorPen( DC, Color, width );
373  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
374 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:93

References GRSetColorPen(), and WinClipAndDrawLine().

Referenced by D_CODE::DrawFlashedShape().

◆ GRFilledArc() [1/2]

void GRFilledArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 641 of file gr_basic.cpp.

643 {
644  int x1, y1, x2, y2;
645 
646  /* Clip arcs off screen */
647  if( ClipBox )
648  {
649  int x0, y0, xm, ym;
650  x0 = ClipBox->GetX();
651  y0 = ClipBox->GetY();
652  xm = ClipBox->GetRight();
653  ym = ClipBox->GetBottom();
654 
655  if( x < ( x0 - r - 1 ) )
656  return;
657 
658  if( y < ( y0 - r - 1 ) )
659  return;
660 
661  if( x > ( r + xm + 1 ) )
662  return;
663 
664  if( y > ( r + ym + 1 ) )
665  return;
666  }
667 
668  x1 = r;
669  y1 = 0;
670  RotatePoint( &x1, &y1, EndAngle );
671 
672  x2 = r;
673  y2 = 0;
674  RotatePoint( &x2, &y2, StAngle );
675 
676  GRSetBrush( DC, BgColor, FILLED );
677  GRSetColorPen( DC, Color, width );
678  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
679 }
static const bool FILLED
Definition: gr_basic.cpp:34
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
int GetX() const
Definition: eda_rect.h:98
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
int GetBottom() const
Definition: eda_rect.h:114
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
int GetRight() const
Definition: eda_rect.h:111
int GetY() const
Definition: eda_rect.h:99

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

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

◆ GRFilledArc() [2/2]

void GRFilledArc ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
double  StAngle,
double  EndAngle,
int  r,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 682 of file gr_basic.cpp.

684 {
685  GRFilledArc( ClipBox, DC, x, y, StAngle, EndAngle, r, 0, Color, BgColor );
686 }
void GRFilledArc(EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Definition: gr_basic.cpp:641

References GRFilledArc().

◆ GRFilledCircle() [1/2]

void GRFilledCircle ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
int  r,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 575 of file gr_basic.cpp.

577 {
578  if( clipCircle( ClipBox, x, y, r, width ) || r <= 0 )
579  return;
580 
581  GRSetBrush( DC, BgColor, FILLED );
582  GRSetColorPen( DC, Color, width );
583  DC->DrawEllipse( x - r, y - r, r + r, r + r );
584 }
static const bool FILLED
Definition: gr_basic.cpp:34
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:521
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163

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

Referenced by D_CODE::DrawFlashedShape(), GRFilledCircle(), SCH_JUNCTION::Print(), and LIB_CIRCLE::print().

◆ GRFilledCircle() [2/2]

void GRFilledCircle ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aPos,
int  aRadius,
const COLOR4D aColor 
)

Definition at line 587 of file gr_basic.cpp.

589 {
590  GRFilledCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, 0, aColor, aColor );
591 }
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Definition: gr_basic.cpp:575

References GRFilledCircle().

◆ GRFilledRect() [1/2]

void GRFilledRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
const COLOR4D Color,
const COLOR4D BgColor 
)

Definition at line 811 of file gr_basic.cpp.

813 {
814  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
815 }
void GRSFilledRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:838

References GRSFilledRect().

Referenced by D_CODE::DrawFlashedShape(), LIB_RECTANGLE::print(), SCH_SHEET::Print(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ GRFilledRect() [2/2]

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

Definition at line 818 of file gr_basic.cpp.

820 {
821  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, width, Color, BgColor );
822 }
void GRSFilledRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:838

References GRSFilledRect().

◆ GRFilledSegment()

void GRFilledSegment ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aStart,
const wxPoint &  aEnd,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 377 of file gr_basic.cpp.

379 {
380  GRSetColorPen( aDC, aColor, aWidth );
381  WinClipAndDrawLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth );
382 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:93

References GRSetColorPen(), and WinClipAndDrawLine().

Referenced by GERBER_DRAW_ITEM::Print().

◆ GRForceBlackPen()

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

Definition at line 190 of file gr_basic.cpp.

191 {
192  s_ForceBlackPen = flagforce;
193 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:81

References s_ForceBlackPen.

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

◆ GRLine() [1/2]

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

Definition at line 212 of file gr_basic.cpp.

214 {
215  GRSetColorPen( DC, Color, width, aStyle );
216  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
217  GRLastMoveToX = x2;
218  GRLastMoveToY = y2;
219 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static int GRLastMoveToX
Definition: gr_basic.cpp:80
static int GRLastMoveToY
Definition: gr_basic.cpp:80
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:93

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

Referenced by BASIC_GAL::DrawLine(), GRDrawAnchor(), GRLine(), GRLineTo(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), SCH_NO_CONNECT::Print(), SCH_BUS_ENTRY_BASE::Print(), SCH_LINE::Print(), LIB_PIN::printPinSymbol(), and DS_DRAW_ITEM_LINE::PrintWsItem().

◆ GRLine() [2/2]

void GRLine ( EDA_RECT aClipBox,
wxDC *  aDC,
const wxPoint &  aStart,
const wxPoint &  aEnd,
int  aWidth,
const COLOR4D aColor,
wxPenStyle  aStyle 
)

Definition at line 222 of file gr_basic.cpp.

224 {
225  GRLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor, aStyle );
226 }
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:212

References GRLine().

◆ GRLineArray()

void GRLineArray ( EDA_RECT aClipBox,
wxDC *  aDC,
std::vector< wxPoint > &  aLines,
int  aWidth,
const COLOR4D aColor 
)

Draw an array of lines (not a polygon).

Parameters
aClipBoxthe clip box.
aDCthe device context into which drawing should occur.
aLinesa list of pair of coordinate in user space: a pair for each line.
aWidththe width of each line.
aColorthe color of the lines.
See also
COLOR4D

Definition at line 242 of file gr_basic.cpp.

244 {
245  if( aLines.empty() )
246  return;
247 
248  GRSetColorPen( aDC, aColor, aWidth );
249 
250  if( aClipBox )
251  aClipBox->Inflate( aWidth / 2 );
252 
253  for( unsigned i = 0; i < aLines.size(); i += 2 )
254  {
255  int x1 = aLines[i].x;
256  int y1 = aLines[i].y;
257  int x2 = aLines[i + 1].x;
258  int y2 = aLines[i + 1].y;
259 
260  if( ( aClipBox == nullptr ) || !ClipLine( aClipBox, x1, y1, x2, y2 ) )
261  aDC->DrawLine( x1, y1, x2, y2 );
262  }
263 
264  GRMoveTo( aLines[aLines.size() - 1].x, aLines[aLines.size() - 1].y );
265 
266  if( aClipBox )
267  aClipBox->Inflate( -aWidth / 2 );
268 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
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.
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:229
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:364

References ClipLine(), GRMoveTo(), GRSetColorPen(), and EDA_RECT::Inflate().

◆ GRLineTo()

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

Definition at line 236 of file gr_basic.cpp.

237 {
238  GRLine( ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color );
239 }
static int GRLastMoveToX
Definition: gr_basic.cpp:80
static int GRLastMoveToY
Definition: gr_basic.cpp:80
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:212

References GRLastMoveToX, GRLastMoveToY, and GRLine().

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

◆ GRMoveTo()

void GRMoveTo ( int  x,
int  y 
)

Definition at line 229 of file gr_basic.cpp.

230 {
231  GRLastMoveToX = x;
232  GRLastMoveToY = y;
233 }
static int GRLastMoveToX
Definition: gr_basic.cpp:80
static int GRLastMoveToY
Definition: gr_basic.cpp:80

References GRLastMoveToX, and GRLastMoveToY.

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

◆ GRPoly()

void GRPoly ( EDA_RECT ClipBox,
wxDC *  DC,
int  n,
const wxPoint *  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 497 of file gr_basic.cpp.

499 {
500  GRSPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
501 }
static void GRSPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *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:426

References GRSPoly().

Referenced by BASIC_GAL::doDrawPolyline(), GRBezier(), LIB_BEZIER::print(), LIB_POLYLINE::print(), SCH_GLOBALLABEL::Print(), SCH_HIERLABEL::Print(), and DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem().

◆ GRPutPixel()

void GRPutPixel ( EDA_RECT ClipBox,
wxDC *  DC,
int  x,
int  y,
const COLOR4D Color 
)

Definition at line 202 of file gr_basic.cpp.

203 {
204  if( ClipBox && !ClipBox->Contains( x, y ) )
205  return;
206 
207  GRSetColorPen( DC, Color );
208  DC->DrawPoint( x, y );
209 }
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57

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

◆ GRRect() [1/3]

void GRRect ( EDA_RECT aClipBox,
wxDC *  aDC,
int  x1,
int  y1,
int  x2,
int  y2,
const COLOR4D aColor 
)

Definition at line 774 of file gr_basic.cpp.

775 {
776  GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor );
777 }
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:825

References GRSRect().

Referenced by D_CODE::DrawFlashedShape(), LIB_RECTANGLE::print(), SCH_SHEET::Print(), and DS_DRAW_ITEM_RECT::PrintWsItem().

◆ GRRect() [2/3]

void GRRect ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width,
const COLOR4D Color 
)

Definition at line 792 of file gr_basic.cpp.

794 {
795  GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
796 }
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:825

References GRSRect().

◆ GRRect() [3/3]

void GRRect ( EDA_RECT aClipBox,
wxDC *  aDC,
const EDA_RECT aRect,
int  aWidth,
const COLOR4D aColor 
)

Definition at line 799 of file gr_basic.cpp.

801 {
802  int x1 = aRect.GetX();
803  int y1 = aRect.GetY();
804  int x2 = aRect.GetRight();
805  int y2 = aRect.GetBottom();
806 
807  GRSRect( aClipBox, aDC, x1, y1, x2, y2, aWidth, aColor );
808 }
int GetX() const
Definition: eda_rect.h:98
int GetBottom() const
Definition: eda_rect.h:114
int GetRight() const
Definition: eda_rect.h:111
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:825
int GetY() const
Definition: eda_rect.h:99

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

◆ GRRectPs()

void GRRectPs ( EDA_RECT aClipBox,
wxDC *  aDC,
const EDA_RECT aRect,
const COLOR4D aColor,
wxPenStyle  aStyle 
)

Definition at line 780 of file gr_basic.cpp.

782 {
783  int x1 = aRect.GetX();
784  int y1 = aRect.GetY();
785  int x2 = aRect.GetRight();
786  int y2 = aRect.GetBottom();
787 
788  GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor, aStyle );
789 }
int GetX() const
Definition: eda_rect.h:98
int GetBottom() const
Definition: eda_rect.h:114
int GetRight() const
Definition: eda_rect.h:111
static void GRSRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID)
Definition: gr_basic.cpp:825
int GetY() const
Definition: eda_rect.h:99

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

◆ GRResetPenAndBrush()

void GRResetPenAndBrush ( wxDC *  DC)

Definition at line 111 of file gr_basic.cpp.

112 {
113  GRSetBrush( DC, BLACK ); // Force no fill
114  s_DC_lastbrushcolor = COLOR4D::UNSPECIFIED;
115  s_DC_lastcolor = COLOR4D::UNSPECIFIED;
116  s_DC_lastDC = nullptr;
117 }
Definition: color4d.h:44
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:91
static COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
static COLOR4D s_DC_lastcolor(0, 0, 0, 0)

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

Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), DIALOG_PIN_PROPERTIES::OnPaintShowPanel(), PLEDITOR_PRINTOUT::PrintPage(), SCH_PRINTOUT::PrintPage(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ GRSClosedPoly()

static void GRSClosedPoly ( EDA_RECT aClipBox,
wxDC *  aDC,
int  aPointCount,
const wxPoint *  aPoints,
bool  aFill,
int  aWidth,
const COLOR4D aColor,
const COLOR4D aBgColor 
)
static

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

Definition at line 459 of file gr_basic.cpp.

461 {
462  if( !IsGRSPolyDrawable( aClipBox, aPointCount, aPoints ) )
463  return;
464 
465  if( aFill && ( aPointCount > 2 ) )
466  {
467  GRLastMoveToX = aPoints[aPointCount - 1].x;
468  GRLastMoveToY = aPoints[aPointCount - 1].y;
469  GRSetBrush( aDC, aBgColor, FILLED );
470  GRSetColorPen( aDC, aColor, aWidth );
471  ClipAndDrawPoly( aClipBox, aDC, aPoints, aPointCount );
472  }
473  else
474  {
475 
476  GRMoveTo( aPoints[0].x, aPoints[0].y );
477 
478  for( int i = 1; i < aPointCount; ++i )
479  {
480  GRLineTo( aClipBox, aDC, aPoints[i].x, aPoints[i].y, aWidth, aColor );
481  }
482 
483  int lastpt = aPointCount - 1;
484 
485  // Close the polygon
486  if( aPoints[lastpt] != aPoints[0] )
487  {
488  GRLineTo( aClipBox, aDC, aPoints[0].x, aPoints[0].y, aWidth, aColor );
489  }
490  }
491 }
static const bool FILLED
Definition: gr_basic.cpp:34
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
static int GRLastMoveToX
Definition: gr_basic.cpp:80
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static int GRLastMoveToY
Definition: gr_basic.cpp:80
static bool IsGRSPolyDrawable(EDA_RECT *ClipBox, int n, const wxPoint *Points)
Definition: gr_basic.cpp:384
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:236
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:229
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const wxPoint *Points, int n)
Used to clip a polygon and draw it as Filled Polygon.
Definition: gr_basic.cpp:874

References ClipAndDrawPoly(), FILLED, GRLastMoveToX, GRLastMoveToY, GRLineTo(), GRMoveTo(), GRSetBrush(), GRSetColorPen(), and IsGRSPolyDrawable().

Referenced by GRClosedPoly(), and GRSRect().

◆ GRSetBrush()

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

Definition at line 163 of file gr_basic.cpp.

164 {
165  COLOR4D color = Color;
166 
167  if( s_ForceBlackPen )
169 
170  if( s_DC_lastbrushcolor != color || s_DC_lastbrushfill != fill || s_DC_lastDC != DC )
171  {
172  wxBrush brush;
173 
174  brush.SetColour( color.ToColour() );
175 
176  if( fill )
177  brush.SetStyle( wxBRUSHSTYLE_SOLID );
178  else
179  brush.SetStyle( wxBRUSHSTYLE_TRANSPARENT );
180 
181  DC->SetBrush( brush );
182 
184  s_DC_lastbrushfill = fill;
185  s_DC_lastDC = DC;
186  }
187 }
int color
Definition: DXF_plotter.cpp:60
Definition: color4d.h:44
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:91
static COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
static bool s_DC_lastbrushfill
Definition: gr_basic.cpp:90
static bool s_ForceBlackPen
Definition: gr_basic.cpp:81
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References BLACK, color, 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().

◆ GRSetColorPen()

void GRSetColorPen ( wxDC *  DC,
const COLOR4D Color,
int  width,
wxPenStyle  style 
)

Definition at line 120 of file gr_basic.cpp.

121 {
122  COLOR4D color = Color;
123 
124  wxDash dots[2] = { 1, 3 };
125 
126  // Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
127  // nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
128  if( width <= 1 )
129  width = DC->DeviceToLogicalXRel( 1 );
130 
131  if( s_ForceBlackPen )
133 
134  const wxPen& curr_pen = DC->GetPen();
135 
136  if( !curr_pen.IsOk() || curr_pen.GetColour() != color.ToColour()
137  || curr_pen.GetWidth() != width || curr_pen.GetStyle() != style )
138  {
139  wxPen pen;
140  pen.SetColour( color.ToColour() );
141 
142  if( style == wxPENSTYLE_DOT )
143  {
144  style = wxPENSTYLE_USER_DASH;
145  pen.SetDashes( 2, dots );
146  }
147 
148  pen.SetWidth( width );
149  pen.SetStyle( style );
150  DC->SetPen( pen );
151  }
152  else
153  {
154  // Should be not needed, but on Linux, in printing process
155  // the curr pen settings needs to be sometimes re-initialized
156  // Clearly, this is due to a bug, related to SetBrush(),
157  // but we have to live with it, at least on wxWidgets 3.0
158  DC->SetPen( curr_pen );
159  }
160 }
int color
Definition: DXF_plotter.cpp:60
Definition: color4d.h:44
static bool s_ForceBlackPen
Definition: gr_basic.cpp:81
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References BLACK, color, and s_ForceBlackPen.

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

◆ GRSFilledRect()

void GRSFilledRect ( EDA_RECT aClipBox,
wxDC *  aDC,
int  x1,
int  y1,
int  x2,
int  y2,
int  aWidth,
const COLOR4D aColor,
const COLOR4D aBgColor 
)

Definition at line 838 of file gr_basic.cpp.

840 {
841  wxPoint points[5];
842  points[0] = wxPoint( x1, y1 );
843  points[1] = wxPoint( x1, y2 );
844  points[2] = wxPoint( x2, y2 );
845  points[3] = wxPoint( x2, y1 );
846  points[4] = points[0];
847 
848  GRSetBrush( aDC, aBgColor, FILLED );
849  GRSetColorPen( aDC, aBgColor, aWidth );
850 
851  if( aClipBox && ( aWidth > 0 ) )
852  {
853  EDA_RECT clipbox( *aClipBox );
854  clipbox.Inflate( aWidth );
855  ClipAndDrawPoly( &clipbox, aDC, points, 5 ); // polygon approach is more accurate
856  }
857  else
858  {
859  ClipAndDrawPoly(aClipBox, aDC, points, 5 );
860  }
861 }
static const bool FILLED
Definition: gr_basic.cpp:34
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const wxPoint *Points, int n)
Used to clip a polygon and draw it as Filled Polygon.
Definition: gr_basic.cpp:874
Handle the component boundary box.
Definition: eda_rect.h:42

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

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

◆ GRSPoly()

static void GRSPoly ( EDA_RECT ClipBox,
wxDC *  DC,
int  n,
const wxPoint *  Points,
bool  Fill,
int  width,
const COLOR4D Color,
const COLOR4D BgColor 
)
static

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

Definition at line 426 of file gr_basic.cpp.

428 {
429  if( !IsGRSPolyDrawable( ClipBox, n, Points ) )
430  return;
431 
432  if( Fill && ( n > 2 ) )
433  {
434  GRSetBrush( DC, BgColor, FILLED );
435  GRSetColorPen( DC, Color, width );
436 
437  /* clip before send the filled polygon to wxDC, because under linux
438  * (GTK?) polygons having large coordinates are incorrectly drawn
439  * (integer overflow in coordinates, I am guessing)
440  */
441  ClipAndDrawPoly( ClipBox, DC, Points, n );
442  }
443  else
444  {
445 
446  GRMoveTo( Points[0].x, Points[0].y );
447 
448  for( int i = 1; i < n; ++i )
449  {
450  GRLineTo( ClipBox, DC, Points[i].x, Points[i].y, width, Color );
451  }
452  }
453 }
static const bool FILLED
Definition: gr_basic.cpp:34
void GRSetColorPen(wxDC *DC, const COLOR4D &Color, int width, wxPenStyle style)
Definition: gr_basic.cpp:120
void GRSetBrush(wxDC *DC, const COLOR4D &Color, bool fill)
Definition: gr_basic.cpp:163
static bool IsGRSPolyDrawable(EDA_RECT *ClipBox, int n, const wxPoint *Points)
Definition: gr_basic.cpp:384
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:236
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:229
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const wxPoint *Points, int n)
Used to clip a polygon and draw it as Filled Polygon.
Definition: gr_basic.cpp:874

References ClipAndDrawPoly(), FILLED, GRLineTo(), GRMoveTo(), GRSetBrush(), GRSetColorPen(), and IsGRSPolyDrawable().

Referenced by GRPoly().

◆ GRSRect()

void GRSRect ( EDA_RECT aClipBox,
wxDC *  aDC,
int  x1,
int  y1,
int  x2,
int  y2,
int  aWidth,
const COLOR4D aColor,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)
static

Definition at line 825 of file gr_basic.cpp.

827 {
828  wxPoint points[5];
829  points[0] = wxPoint( x1, y1 );
830  points[1] = wxPoint( x1, y2 );
831  points[2] = wxPoint( x2, y2 );
832  points[3] = wxPoint( x2, y1 );
833  points[4] = points[0];
834  GRSClosedPoly( aClipBox, aDC, 5, points, NOT_FILLED, aWidth, aColor, aColor );
835 }
static void GRSClosedPoly(EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *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:459
static const bool NOT_FILLED
Definition: gr_basic.cpp:35

References GRSClosedPoly(), and NOT_FILLED.

Referenced by GRRect(), and GRRectPs().

◆ IsGRSPolyDrawable()

static bool IsGRSPolyDrawable ( EDA_RECT ClipBox,
int  n,
const wxPoint *  Points 
)
static

Definition at line 384 of file gr_basic.cpp.

385 {
386  if( !ClipBox )
387  return true;
388 
389  if( n <= 0 )
390  return false;
391 
392  int Xmin, Xmax, Ymin, Ymax;
393 
394  Xmin = Xmax = Points[0].x;
395  Ymin = Ymax = Points[0].y;
396 
397  for( int ii = 1; ii < n; ii++ ) // calculate rectangle
398  {
399  Xmin = std::min( Xmin, Points[ii].x );
400  Xmax = std::max( Xmax, Points[ii].x );
401  Ymin = std::min( Ymin, Points[ii].y );
402  Ymax = std::max( Ymax, Points[ii].y );
403  }
404 
405  xcliplo = ClipBox->GetX();
406  ycliplo = ClipBox->GetY();
407  xcliphi = ClipBox->GetRight();
408  ycliphi = ClipBox->GetBottom();
409 
410  if( Xmax < xcliplo )
411  return false;
412  if( Xmin > xcliphi )
413  return false;
414  if( Ymax < ycliplo )
415  return false;
416  if( Ymin > ycliphi )
417  return false;
418 
419  return true;
420 }
static int ycliplo
Definition: gr_basic.cpp:84
static int ycliphi
Definition: gr_basic.cpp:86
int GetX() const
Definition: eda_rect.h:98
static int xcliphi
Definition: gr_basic.cpp:85
int GetBottom() const
Definition: eda_rect.h:114
static int xcliplo
Definition: gr_basic.cpp:83
int GetRight() const
Definition: eda_rect.h:111
int GetY() const
Definition: eda_rect.h:99

References EDA_RECT::GetBottom(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), xcliphi, xcliplo, ycliphi, and ycliplo.

Referenced by GRSClosedPoly(), and GRSPoly().

◆ WinClipAndDrawLine()

static void WinClipAndDrawLine ( EDA_RECT ClipBox,
wxDC *  DC,
int  x1,
int  y1,
int  x2,
int  y2,
int  width 
)
static

Definition at line 93 of file gr_basic.cpp.

95 {
96  GRLastMoveToX = x2;
97  GRLastMoveToY = y2;
98 
99  if( ClipBox )
100  {
101  EDA_RECT clipbox(*ClipBox);
102  clipbox.Inflate(width/2);
103  if( ClipLine( &clipbox, x1, y1, x2, y2 ) )
104  return;
105  }
106 
107  DC->DrawLine( x1, y1, x2, y2 );
108 }
static int GRLastMoveToX
Definition: gr_basic.cpp:80
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.
static int GRLastMoveToY
Definition: gr_basic.cpp:80
Handle the component boundary box.
Definition: eda_rect.h:42

References ClipLine(), GRLastMoveToX, GRLastMoveToY, and EDA_RECT::Inflate().

Referenced by GRFillCSegm(), GRFilledSegment(), and GRLine().

Variable Documentation

◆ FILLED

const bool FILLED = true
static

Definition at line 34 of file gr_basic.cpp.

Referenced by GRFilledArc(), GRFilledCircle(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().

◆ g_XorMode

GR_DRAWMODE g_XorMode = GR_NXOR

Definition at line 65 of file gr_basic.cpp.

◆ GRLastMoveToX

int GRLastMoveToX
static

Definition at line 80 of file gr_basic.cpp.

Referenced by GRCSegm(), GRLine(), GRLineTo(), GRMoveTo(), GRSClosedPoly(), and WinClipAndDrawLine().

◆ GRLastMoveToY

int GRLastMoveToY
static

Definition at line 80 of file gr_basic.cpp.

Referenced by GRCSegm(), GRLine(), GRLineTo(), GRMoveTo(), GRSClosedPoly(), and WinClipAndDrawLine().

◆ NOT_FILLED

const bool NOT_FILLED = false
static

Definition at line 35 of file gr_basic.cpp.

Referenced by GRArc(), GRCircle(), GRCSegm(), and GRSRect().

◆ s_DC_lastbrushcolor

COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
static

Referenced by GRResetPenAndBrush(), and GRSetBrush().

◆ s_DC_lastbrushfill

bool s_DC_lastbrushfill = false
static

Definition at line 90 of file gr_basic.cpp.

Referenced by GRSetBrush().

◆ s_DC_lastcolor

COLOR4D s_DC_lastcolor(0, 0, 0, 0)
static

Referenced by GRResetPenAndBrush().

◆ s_DC_lastDC

wxDC* s_DC_lastDC = nullptr
static

Definition at line 91 of file gr_basic.cpp.

Referenced by GRResetPenAndBrush(), and GRSetBrush().

◆ s_ForceBlackPen

bool s_ForceBlackPen
static

Definition at line 81 of file gr_basic.cpp.

Referenced by GetGRForceBlackPenState(), GRForceBlackPen(), GRSetBrush(), and GRSetColorPen().

◆ xcliphi

int xcliphi = 2000
static

Definition at line 85 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ xcliplo

int xcliplo = 0
static

Definition at line 83 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ ycliphi

int ycliphi = 2000
static

Definition at line 86 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ ycliplo

int ycliplo = 0
static

Definition at line 84 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().