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)
 Function ClipAndDrawPoly 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. More...
 
static void GRSRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, 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, COLOR4D Color, int width, wxPenStyle style)
 Function GRSetColorPen sets a pen style, width, color, and alpha into the given device context. More...
 
void GRSetBrush (wxDC *DC, COLOR4D Color, bool fill)
 
void GRForceBlackPen (bool flagforce)
 Function GRForceBlackPen. More...
 
bool GetGRForceBlackPenState (void)
 Function GetGRForceBlackPenState. More...
 
void GRPutPixel (EDA_RECT *ClipBox, wxDC *DC, int x, int y, COLOR4D Color)
 
void GRLine (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
 
void GRLine (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor, wxPenStyle aStyle)
 
void GRMoveTo (int x, int y)
 
void GRLineTo (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
 
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 GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
 
void GRCSegm (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRCSegm (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
 
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)
 
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, COLOR4D Color, COLOR4D BgColor)
 
static void GRSClosedPoly (EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *aPoints, bool aFill, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
 
void GRPoly (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRClosedPoly (EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, COLOR4D Color, COLOR4D BgColor)
 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 *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
 Function GRClosedPoly draws 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, COLOR4D Color)
 
void GRCircle (EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, COLOR4D Color)
 Function GRCircle draws a circle onto the drawing context aDC centered at the user coordinates (x,y) More...
 
void GRCircle (EDA_RECT *aClipBox, wxDC *aDC, wxPoint aPos, int aRadius, int aWidth, COLOR4D aColor)
 
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 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, int width, COLOR4D Color, COLOR4D BgColor)
 
void GRFilledArc (EDA_RECT *ClipBox, wxDC *DC, int x, int y, double StAngle, double EndAngle, int r, COLOR4D Color, COLOR4D BgColor)
 
void GRArc (EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, 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 GRRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
 
void GRRectPs (EDA_RECT *aClipBox, wxDC *aDC, const EDA_RECT &aRect, COLOR4D aColor, wxPenStyle aStyle)
 
void GRRect (EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
 
void GRRect (EDA_RECT *aClipBox, wxDC *aDC, const EDA_RECT &aRect, int aWidth, COLOR4D aColor)
 
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 GRSFilledRect (EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
 
void GRBezier (EDA_RECT *aClipBox, wxDC *aDC, std::vector< wxPoint > &aPoint, int aWidth, 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, 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 = NULL
 

Macro Definition Documentation

◆ DEBUG_DUMP_CLIP_COORDS

#define DEBUG_DUMP_CLIP_COORDS   0

Definition at line 66 of file gr_basic.cpp.

◆ DEBUG_DUMP_CLIP_ERROR_COORDS

#define DEBUG_DUMP_CLIP_ERROR_COORDS   0

Definition at line 65 of file gr_basic.cpp.

Function Documentation

◆ ClipAndDrawPoly()

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

Function ClipAndDrawPoly 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 955 of file gr_basic.cpp.

956 {
957  if( aClipBox == NULL )
958  {
959  aDC->DrawPolygon( n, Points );
960  return;
961  }
962 
963  // A clip box exists: clip and draw the polygon.
964  static std::vector<wxPoint> clippedPolygon;
965  static pointVector inputPolygon, outputPolygon;
966 
967  inputPolygon.clear();
968  outputPolygon.clear();
969  clippedPolygon.clear();
970 
971  for( int ii = 0; ii < n; ii++ )
972  inputPolygon.push_back( PointF( (REAL) Points[ii].x, (REAL) Points[ii].y ) );
973 
974  RectF window( (REAL) aClipBox->GetX(), (REAL) aClipBox->GetY(),
975  (REAL) aClipBox->GetWidth(), (REAL) aClipBox->GetHeight() );
976 
977  SutherlandHodgman sh( window );
978  sh.Clip( inputPolygon, outputPolygon );
979 
980  for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit )
981  {
982  clippedPolygon.emplace_back( KiROUND( cit->X ), KiROUND( cit->Y ) );
983  }
984 
985  if( clippedPolygon.size() )
986  aDC->DrawPolygon( clippedPolygon.size(), &clippedPolygon[0] );
987 }
int GetX() const
Definition: eda_rect.h:111
int GetWidth() const
Definition: eda_rect.h:119
#define NULL
int GetHeight() const
Definition: eda_rect.h:120
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:68
int GetY() const
Definition: eda_rect.h:112

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

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

565 {
566  // Clip circles that are outside the ClipBox.
567  if( aClipBox )
568  {
569  int x0, y0, xm, ym;
570  x0 = aClipBox->GetX();
571  y0 = aClipBox->GetY();
572  xm = aClipBox->GetRight();
573  ym = aClipBox->GetBottom();
574 
575  r += aWidth;
576 
577  if( xc < ( x0 - r ) )
578  return true;
579 
580  if( yc < ( y0 - r ) )
581  return true;
582 
583  if( xc > ( r + xm ) )
584  return true;
585 
586  if( yc > ( r + ym ) )
587  return true;
588  }
589 
590  return false;
591 }
int GetX() const
Definition: eda_rect.h:111
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
int GetY() const
Definition: eda_rect.h:112

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

Referenced by GRCircle(), and GRFilledCircle().

◆ GetGRForceBlackPenState()

bool GetGRForceBlackPenState ( void  )

Function GetGRForceBlackPenState.

Returns
s_ForceBlackPen (True if a black pen was forced)

Definition at line 209 of file gr_basic.cpp.

210 {
211  return s_ForceBlackPen;
212 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:86

References s_ForceBlackPen.

Referenced by BITMAP_BASE::DrawBitmap(), and LIB_PART::Print().

◆ GRArc() [1/2]

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

Definition at line 747 of file gr_basic.cpp.

749 {
750  int x1, y1, x2, y2;
751 
752  /* Clip arcs off screen */
753  if( ClipBox )
754  {
755  int radius = r + 1;
756  int x0, y0, xm, ym, x, y;
757  x0 = ClipBox->GetX();
758  y0 = ClipBox->GetY();
759  xm = ClipBox->GetRight();
760  ym = ClipBox->GetBottom();
761  x = xc;
762  y = yc;
763 
764  if( x < ( x0 - radius ) )
765  return;
766  if( y < ( y0 - radius ) )
767  return;
768  if( x > ( xm + radius ) )
769  return;
770  if( y > ( ym + radius ) )
771  return;
772  }
773 
774  x1 = r;
775  y1 = 0;
776  RotatePoint( &x1, &y1, EndAngle );
777 
778  x2 = r;
779  y2 = 0;
780  RotatePoint( &x2, &y2, StAngle );
781 
782  GRSetBrush( DC, Color, NOT_FILLED );
783  GRSetColorPen( DC, Color );
784  DC->DrawArc( xc + x1, yc - y1, xc + x2, yc - y2, xc, yc );
785 }
int GetX() const
Definition: eda_rect.h:111
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
int GetBottom() const
Definition: eda_rect.h:124
static const bool NOT_FILLED
Definition: gr_basic.cpp:40
int GetRight() const
Definition: eda_rect.h:121
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131
int GetY() const
Definition: eda_rect.h:112

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,
COLOR4D  Color 
)

Definition at line 791 of file gr_basic.cpp.

800 {
801  int x1, y1, x2, y2;
802 
803  /* Clip arcs off screen. */
804  if( ClipBox )
805  {
806  int x0, y0, xm, ym;
807  x0 = ClipBox->GetX();
808  y0 = ClipBox->GetY();
809  xm = ClipBox->GetRight();
810  ym = ClipBox->GetBottom();
811 
812  if( x < ( x0 - r - width ) )
813  return;
814 
815  if( y < ( y0 - r - width ) )
816  return;
817 
818  if( x > ( r + xm + width ) )
819  return;
820 
821  if( y > ( r + ym + width ) )
822  return;
823  }
824 
825  x1 = r;
826  y1 = 0;
827  RotatePoint( &x1, &y1, EndAngle );
828 
829  x2 = r;
830  y2 = 0;
831  RotatePoint( &x2, &y2, StAngle );
832 
833  GRSetBrush( DC, Color );
834  GRSetColorPen( DC, Color, width );
835  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
836 }
int GetX() const
Definition: eda_rect.h:111
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131
int GetY() const
Definition: eda_rect.h:112

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,
COLOR4D  Color 
)

Definition at line 638 of file gr_basic.cpp.

640 {
641  GRArc1( ClipBox, DC, x1, y1, x2, y2, xc, yc, 0, Color );
642 }
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:638

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,
COLOR4D  Color 
)

Definition at line 648 of file gr_basic.cpp.

650 {
651  /* Clip arcs off screen. */
652  if( ClipBox )
653  {
654  int x0, y0, xm, ym, r;
655  x0 = ClipBox->GetX();
656  y0 = ClipBox->GetY();
657  xm = ClipBox->GetRight();
658  ym = ClipBox->GetBottom();
659  r = KiROUND( Distance( x1, y1, xc, yc ) );
660  if( xc < ( x0 - r ) )
661  return;
662  if( yc < ( y0 - r ) )
663  return;
664  if( xc > ( r + xm ) )
665  return;
666  if( yc > ( r + ym ) )
667  return;
668  }
669 
670  GRSetBrush( DC, Color );
671  GRSetColorPen( DC, Color, width );
672  DC->DrawArc( x1, y1, x2, y2, xc, yc );
673 }
int GetX() const
Definition: eda_rect.h:111
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131
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:68
int GetY() const
Definition: eda_rect.h:112

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,
wxPoint  aStart,
wxPoint  aEnd,
wxPoint  aCenter,
int  aWidth,
COLOR4D  aColor 
)

Definition at line 676 of file gr_basic.cpp.

678 {
679  GRArc1( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aCenter.x, aCenter.y,
680  aWidth, aColor );
681 }
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:638

References GRArc1().

◆ GRBezier()

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

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

Definition at line 990 of file gr_basic.cpp.

993 {
994  std::vector<wxPoint> output;
995 
996  BEZIER_POLY converter( aPoint );
997  converter.GetPoly( output, aWidth );
998 
999  GRPoly( aClipBox, aDC, output.size(), &output[0], false, aWidth, aColor, aColor );
1000 }
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:540
Bezier curves to polygon converter.
Definition: bezier_curves.h:35

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

◆ GRCircle() [1/3]

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

Definition at line 594 of file gr_basic.cpp.

595 {
596  if( clipCircle( ClipBox, xc, yc, r, width ) || r <= 0 )
597  return;
598 
599  GRSetBrush( DC, Color, NOT_FILLED );
600  GRSetColorPen( DC, Color, width );
601  DC->DrawEllipse( xc - r, yc - r, r + r, r + r );
602 }
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:564
static const bool NOT_FILLED
Definition: gr_basic.cpp:40
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131

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

Referenced by D_CODE::DrawFlashedShape(), GRCircle(), LIB_CIRCLE::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,
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 605 of file gr_basic.cpp.

606 {
607  GRCircle( ClipBox, DC, x, y, r, 0, Color );
608 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:594

References GRCircle().

◆ GRCircle() [3/3]

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

Definition at line 611 of file gr_basic.cpp.

612 {
613  GRCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, aWidth, aColor );
614 }
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:594

References GRCircle().

◆ GRClosedPoly() [1/2]

void GRClosedPoly ( EDA_RECT ClipBox,
wxDC *  aDC,
int  aPointCount,
const 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 550 of file gr_basic.cpp.

552 {
553  GRClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor );
554 }
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const 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:550

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,
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 557 of file gr_basic.cpp.

559 {
560  GRSClosedPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
561 }
static void GRSClosedPoly(EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *aPoints, bool aFill, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:503

References GRSClosedPoly().

◆ GRCSegm() [1/3]

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

Definition at line 310 of file gr_basic.cpp.

312 {
313  GRLastMoveToX = x2;
314  GRLastMoveToY = y2;
315 
316  if( ClipBox )
317  {
318  EDA_RECT clipbox(*ClipBox);
319  clipbox.Inflate(width/2);
320 
321  if( ClipLine( &clipbox, x1, y1, x2, y2 ) )
322  return;
323  }
324 
325 
326  if( width <= 2 ) /* single line or 2 pixels */
327  {
328  GRSetColorPen( DC, Color, width );
329  DC->DrawLine( x1, y1, x2, y2 );
330  return;
331  }
332 
333  GRSetBrush( DC, Color, NOT_FILLED );
334  GRSetColorPen( DC, Color, aPenSize );
335 
336  int radius = (width + 1) >> 1;
337  int dx = x2 - x1;
338  int dy = y2 - y1;
339  double angle = -ArcTangente( dy, dx );
340  wxPoint start;
341  wxPoint end;
342  wxPoint org( x1, y1);
343  int len = (int) hypot( dx, dy );
344 
345  // We know if the DC is mirrored, to draw arcs
346  int slx = DC->DeviceToLogicalX( 1 ) - DC->DeviceToLogicalX( 0 );
347  int sly = DC->DeviceToLogicalY( 1 ) - DC->DeviceToLogicalY( 0 );
348  bool mirrored = (slx > 0 && sly < 0) || (slx < 0 && sly > 0);
349 
350  // first edge
351  start.x = 0;
352  start.y = radius;
353  end.x = len;
354  end.y = radius;
355  RotatePoint( &start, angle);
356  RotatePoint( &end, angle);
357 
358  start += org;
359  end += org;
360 
361  DC->DrawLine( start, end );
362 
363  // first rounded end
364  end.x = 0;
365  end.y = -radius;
366  RotatePoint( &end, angle);
367  end += org;
368 
369  if( !mirrored )
370  DC->DrawArc( end, start, org );
371  else
372  DC->DrawArc( start, end, org );
373 
374 
375  // second edge
376  start.x = len;
377  start.y = -radius;
378  RotatePoint( &start, angle);
379  start += org;
380 
381  DC->DrawLine( start, end );
382 
383  // second rounded end
384  end.x = len;
385  end.y = radius;
386  RotatePoint( &end, angle);
387  end += org;
388 
389  if( !mirrored )
390  DC->DrawArc( end.x, end.y, start.x, start.y, x2, y2 );
391  else
392  DC->DrawArc( start.x, start.y, end.x, end.y, x2, y2 );
393 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
static int GRLastMoveToX
Definition: gr_basic.cpp:85
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 const bool NOT_FILLED
Definition: gr_basic.cpp:40
static int GRLastMoveToY
Definition: gr_basic.cpp:85
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
double ArcTangente(int dy, int dx)
Definition: trigo.cpp:162

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,
COLOR4D  Color 
)

Definition at line 396 of file gr_basic.cpp.

398 {
399  GRCSegm( ClipBox, DC, x1, y1, x2, y2, width, 0, Color );
400 }
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:310

References GRCSegm().

◆ GRCSegm() [3/3]

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

Definition at line 403 of file gr_basic.cpp.

405 {
406  GRCSegm( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, 0, aColor );
407 }
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:310

References GRCSegm().

◆ GRDrawAnchor()

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

Definition at line 1003 of file gr_basic.cpp.

1005 {
1006  int anchor_size = aDC->DeviceToLogicalXRel( aSize );
1007 
1008  GRLine( aClipBox, aDC,
1009  x - anchor_size, y,
1010  x + anchor_size, y, 0, aColor );
1011  GRLine( aClipBox, aDC,
1012  x, y - anchor_size,
1013  x, y + anchor_size, 0, aColor );
1014 }
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:228

References GRLine().

◆ GRDrawWrappedText()

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

1018 {
1019  wxStringTokenizer tokenizer( aText, " " );
1020  wxSize const dc_size = aDC.GetSize();
1021  wxSize const margin = aDC.GetTextExtent( " " );
1022  std::vector<wxString> lines;
1023  wxString line_accumulator;
1024  int total_height = 0;
1025 
1026  while( tokenizer.HasMoreTokens() )
1027  {
1028  wxString word = tokenizer.GetNextToken();
1029  wxSize linesize = aDC.GetTextExtent( line_accumulator + " " + word );
1030 
1031  if( linesize.x >= dc_size.x - margin.x && !line_accumulator.IsEmpty() )
1032  {
1033  lines.push_back( line_accumulator );
1034  line_accumulator = word;
1035  }
1036  else
1037  {
1038  line_accumulator += " ";
1039  line_accumulator += word;
1040  }
1041  }
1042 
1043  if( !line_accumulator.IsEmpty() )
1044  {
1045  lines.push_back( line_accumulator );
1046  }
1047 
1048  for( auto const& line: lines )
1049  {
1050  wxSize linesize = aDC.GetTextExtent( line );
1051  total_height += linesize.y;
1052  }
1053 
1054  int top = ( dc_size.y - total_height ) / 2;
1055  int pos = top;
1056 
1057  for( auto const& line: lines )
1058  {
1059  wxSize linesize = aDC.GetTextExtent( line );
1060  aDC.DrawText( line, ( dc_size.x - linesize.x ) / 2, pos );
1061  pos += linesize.y;
1062  }
1063 }

◆ GRFillCSegm()

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

Definition at line 413 of file gr_basic.cpp.

415 {
416  GRSetColorPen( DC, Color, width );
417  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
418 }
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:98
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:131

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,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 687 of file gr_basic.cpp.

697 {
698  int x1, y1, x2, y2;
699 
700  /* Clip arcs off screen */
701  if( ClipBox )
702  {
703  int x0, y0, xm, ym;
704  x0 = ClipBox->GetX();
705  y0 = ClipBox->GetY();
706  xm = ClipBox->GetRight();
707  ym = ClipBox->GetBottom();
708 
709  if( x < ( x0 - r - 1 ) )
710  return;
711 
712  if( y < ( y0 - r - 1 ) )
713  return;
714 
715  if( x > ( r + xm + 1 ) )
716  return;
717 
718  if( y > ( r + ym + 1 ) )
719  return;
720  }
721 
722  x1 = r;
723  y1 = 0;
724  RotatePoint( &x1, &y1, EndAngle );
725 
726  x2 = r;
727  y2 = 0;
728  RotatePoint( &x2, &y2, StAngle );
729 
730  GRSetBrush( DC, BgColor, FILLED );
731  GRSetColorPen( DC, Color, width );
732  DC->DrawArc( x + x1, y - y1, x + x2, y - y2, x, y );
733 }
static const bool FILLED
Definition: gr_basic.cpp:39
int GetX() const
Definition: eda_rect.h:111
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131
int GetY() const
Definition: eda_rect.h:112

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,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 736 of file gr_basic.cpp.

739 {
740  GRFilledArc( ClipBox, DC, x, y, StAngle, EndAngle, r, 0, Color, BgColor );
741 }
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:687

References GRFilledArc().

◆ GRFilledCircle() [1/2]

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

Definition at line 617 of file gr_basic.cpp.

619 {
620  if( clipCircle( ClipBox, x, y, r, width ) || r <= 0 )
621  return;
622 
623  GRSetBrush( DC, BgColor, FILLED );
624  GRSetColorPen( DC, Color, width );
625  DC->DrawEllipse( x - r, y - r, r + r, r + r );
626 }
static const bool FILLED
Definition: gr_basic.cpp:39
static bool clipCircle(EDA_RECT *aClipBox, int xc, int yc, int r, int aWidth)
Definition: gr_basic.cpp:564
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
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:131

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,
wxPoint  aPos,
int  aRadius,
COLOR4D  aColor 
)

Definition at line 629 of file gr_basic.cpp.

630 {
631  GRFilledCircle( aClipBox, aDC, aPos.x, aPos.y, aRadius, 0, aColor, aColor );
632 }
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:617

References GRFilledCircle().

◆ GRFilledRect() [1/2]

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

Definition at line 882 of file gr_basic.cpp.

884 {
885  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
886 }
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:917

References GRSFilledRect().

Referenced by D_CODE::DrawFlashedShape(), LIB_RECTANGLE::print(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

◆ GRFilledRect() [2/2]

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

Definition at line 892 of file gr_basic.cpp.

894 {
895  GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, width, Color, BgColor );
896 }
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:917

References GRSFilledRect().

◆ GRFilledSegment()

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

Definition at line 421 of file gr_basic.cpp.

423 {
424  GRSetColorPen( aDC, aColor, aWidth );
425  WinClipAndDrawLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth );
426 }
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:98
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:131

References GRSetColorPen(), and WinClipAndDrawLine().

Referenced by GERBER_DRAW_ITEM::Print().

◆ GRForceBlackPen()

void GRForceBlackPen ( bool  flagforce)

Function GRForceBlackPen.

Parameters
flagforceTrue to force a black pen whenever the asked color

Definition at line 199 of file gr_basic.cpp.

200 {
201  s_ForceBlackPen = flagforce;
202 }
static bool s_ForceBlackPen
Definition: gr_basic.cpp:86

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,
COLOR4D  Color,
wxPenStyle  aStyle 
)

Definition at line 228 of file gr_basic.cpp.

237 {
238  GRSetColorPen( DC, Color, width, aStyle );
239  WinClipAndDrawLine( ClipBox, DC, x1, y1, x2, y2, width );
240  GRLastMoveToX = x2;
241  GRLastMoveToY = y2;
242 }
static int GRLastMoveToX
Definition: gr_basic.cpp:85
static int GRLastMoveToY
Definition: gr_basic.cpp:85
static void WinClipAndDrawLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width)
Definition: gr_basic.cpp:98
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:131

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 WS_DRAW_ITEM_LINE::PrintWsItem().

◆ GRLine() [2/2]

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

Definition at line 245 of file gr_basic.cpp.

246 {
247  GRLine( aClipBox, aDC, aStart.x, aStart.y, aEnd.x, aEnd.y, aWidth, aColor, aStyle );
248 }
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:228

References GRLine().

◆ GRLineArray()

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= color to draw the lines
See also
COLOR4D

Definition at line 282 of file gr_basic.cpp.

284 {
285  if( aLines.empty() )
286  return;
287 
288  GRSetColorPen( aDC, aColor, aWidth );
289 
290  if( aClipBox )
291  aClipBox->Inflate( aWidth / 2 );
292 
293  for( unsigned i = 0; i < aLines.size(); i += 2 )
294  {
295  int x1 = aLines[i].x;
296  int y1 = aLines[i].y;
297  int x2 = aLines[i + 1].x;
298  int y2 = aLines[i + 1].y;
299  if( ( aClipBox == NULL ) || !ClipLine( aClipBox, x1, y1, x2, y2 ) )
300  aDC->DrawLine( x1, y1, x2, y2 );
301  }
302 
303  GRMoveTo( aLines[aLines.size() - 1].x, aLines[aLines.size() - 1].y );
304 
305  if( aClipBox )
306  aClipBox->Inflate(-aWidth/2);
307 }
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.
#define NULL
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:254
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:131
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

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

◆ GRLineTo()

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

Definition at line 264 of file gr_basic.cpp.

265 {
266  GRLine( ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color );
267 }
static int GRLastMoveToX
Definition: gr_basic.cpp:85
static int GRLastMoveToY
Definition: gr_basic.cpp:85
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:228

References GRLastMoveToX, GRLastMoveToY, and GRLine().

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

◆ GRMoveTo()

void GRMoveTo ( int  x,
int  y 
)

Definition at line 254 of file gr_basic.cpp.

255 {
256  GRLastMoveToX = x;
257  GRLastMoveToY = y;
258 }
static int GRLastMoveToX
Definition: gr_basic.cpp:85
static int GRLastMoveToY
Definition: gr_basic.cpp:85

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,
COLOR4D  Color,
COLOR4D  BgColor 
)

Definition at line 540 of file gr_basic.cpp.

542 {
543  GRSPoly( ClipBox, DC, n, Points, Fill, width, Color, BgColor );
544 }
static void GRSPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:471

References GRSPoly().

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

◆ GRPutPixel()

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

Definition at line 215 of file gr_basic.cpp.

216 {
217  if( ClipBox && !ClipBox->Contains( x, y ) )
218  return;
219 
220  GRSetColorPen( DC, Color );
221  DC->DrawPoint( x, y );
222 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
Definition: eda_rect.cpp:57
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:131

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

◆ GRRect() [1/3]

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

Definition at line 842 of file gr_basic.cpp.

843 {
844  GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor );
845 }
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:903

References GRSRect().

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

◆ GRRect() [2/3]

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

Definition at line 862 of file gr_basic.cpp.

863 {
864  GRSRect( ClipBox, DC, x1, y1, x2, y2, width, Color );
865 }
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:903

References GRSRect().

◆ GRRect() [3/3]

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

Definition at line 868 of file gr_basic.cpp.

869 {
870  int x1 = aRect.GetX();
871  int y1 = aRect.GetY();
872  int x2 = aRect.GetRight();
873  int y2 = aRect.GetBottom();
874 
875  GRSRect( aClipBox, aDC, x1, y1, x2, y2, aWidth, aColor );
876 }
int GetX() const
Definition: eda_rect.h:111
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
int GetY() const
Definition: eda_rect.h:112
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:903

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,
COLOR4D  aColor,
wxPenStyle  aStyle 
)

Definition at line 848 of file gr_basic.cpp.

849 {
850  int x1 = aRect.GetX();
851  int y1 = aRect.GetY();
852  int x2 = aRect.GetRight();
853  int y2 = aRect.GetBottom();
854 
855  GRSRect( aClipBox, aDC, x1, y1, x2, y2, 0, aColor, aStyle );
856 }
int GetX() const
Definition: eda_rect.h:111
int GetBottom() const
Definition: eda_rect.h:124
int GetRight() const
Definition: eda_rect.h:121
int GetY() const
Definition: eda_rect.h:112
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:903

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

◆ GRResetPenAndBrush()

void GRResetPenAndBrush ( wxDC *  DC)

Definition at line 118 of file gr_basic.cpp.

119 {
120  GRSetBrush( DC, BLACK ); // Force no fill
121  s_DC_lastbrushcolor = COLOR4D::UNSPECIFIED;
122  s_DC_lastcolor = COLOR4D::UNSPECIFIED;
123  s_DC_lastDC = NULL;
124 }
Definition: color4d.h:45
#define NULL
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:96
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:168

References BLACK, GRSetBrush(), NULL, 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::UpdatePageLayoutExample().

◆ GRSClosedPoly()

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

Definition at line 503 of file gr_basic.cpp.

505 {
506  if( !IsGRSPolyDrawable( aClipBox, aPointCount, aPoints ) )
507  return;
508 
509  if( aFill && ( aPointCount > 2 ) )
510  {
511  GRLastMoveToX = aPoints[aPointCount - 1].x;
512  GRLastMoveToY = aPoints[aPointCount - 1].y;
513  GRSetBrush( aDC, aBgColor, FILLED );
514  GRSetColorPen( aDC, aColor, aWidth );
515  ClipAndDrawPoly( aClipBox, aDC, aPoints, aPointCount );
516  }
517  else
518  {
519 
520  GRMoveTo( aPoints[0].x, aPoints[0].y );
521  for( int i = 1; i < aPointCount; ++i )
522  {
523  GRLineTo( aClipBox, aDC, aPoints[i].x, aPoints[i].y, aWidth, aColor );
524  }
525 
526  int lastpt = aPointCount - 1;
527 
528  // Close the polygon
529  if( aPoints[lastpt] != aPoints[0] )
530  {
531  GRLineTo( aClipBox, aDC, aPoints[0].x, aPoints[0].y, aWidth, aColor );
532  }
533  }
534 }
static const bool FILLED
Definition: gr_basic.cpp:39
static int GRLastMoveToX
Definition: gr_basic.cpp:85
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
Definition: gr_basic.cpp:264
static int GRLastMoveToY
Definition: gr_basic.cpp:85
static bool IsGRSPolyDrawable(EDA_RECT *ClipBox, int n, const wxPoint *Points)
Definition: gr_basic.cpp:429
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:254
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const 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:955
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:131

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

Referenced by GRClosedPoly(), and GRSRect().

◆ GRSetBrush()

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

Definition at line 168 of file gr_basic.cpp.

169 {
170  if( s_ForceBlackPen )
171  Color = COLOR4D::BLACK;
172 
173  if( s_DC_lastbrushcolor != Color
174  || s_DC_lastbrushfill != fill
175  || s_DC_lastDC != DC )
176  {
177  wxBrush brush;
178 
179  brush.SetColour( Color.ToColour() );
180 
181  if( fill )
182  brush.SetStyle( wxBRUSHSTYLE_SOLID );
183  else
184  brush.SetStyle( wxBRUSHSTYLE_TRANSPARENT );
185 
186  DC->SetBrush( brush );
187 
188  s_DC_lastbrushcolor = Color;
189  s_DC_lastbrushfill = fill;
190  s_DC_lastDC = DC;
191  }
192 }
Definition: color4d.h:45
static wxDC * s_DC_lastDC
Definition: gr_basic.cpp:96
static COLOR4D s_DC_lastbrushcolor(0, 0, 0, 0)
static bool s_DC_lastbrushfill
Definition: gr_basic.cpp:95
static bool s_ForceBlackPen
Definition: gr_basic.cpp:86

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

◆ GRSetColorPen()

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 at line 131 of file gr_basic.cpp.

132 {
133  wxDash dots[2] = { 1, 3 };
134  // Under OSX and while printing when wxPen is set to 0, renderer follows the request drawing
135  // nothing & in the bitmap world the minimum is enough to light a pixel, in vectorial one not
136  if( width <= 1 )
137  width = DC->DeviceToLogicalXRel( 1 );
138 
139  if( s_ForceBlackPen )
140  Color = COLOR4D::BLACK;
141 
142  const wxPen& curr_pen = DC->GetPen();
143 
144  if( !curr_pen.IsOk() || curr_pen.GetColour() != Color.ToColour()
145  || curr_pen.GetWidth() != width
146  || curr_pen.GetStyle() != style )
147  {
148  wxPen pen;
149  pen.SetColour( Color.ToColour() );
150  if( style == wxPENSTYLE_DOT )
151  {
152  style = wxPENSTYLE_USER_DASH;
153  pen.SetDashes( 2, dots );
154  }
155  pen.SetWidth( width );
156  pen.SetStyle( style );
157  DC->SetPen( pen );
158  }
159  else
160  // Should be not needed, but on Linux, in printing process
161  // the curr pen settings needs to be sometimes re-initialized
162  // Clearly, this is due to a bug, related to SetBrush(),
163  // but we have to live with it, at least on wxWidgets 3.0
164  DC->SetPen( curr_pen );
165 }
Definition: color4d.h:45
static bool s_ForceBlackPen
Definition: gr_basic.cpp:86

References BLACK, 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,
COLOR4D  aColor,
COLOR4D  aBgColor 
)

Definition at line 917 of file gr_basic.cpp.

919 {
920  wxPoint points[5];
921  points[0] = wxPoint(x1, y1);
922  points[1] = wxPoint(x1, y2);
923  points[2] = wxPoint(x2, y2);
924  points[3] = wxPoint(x2, y1);
925  points[4] = points[0];
926 
927  GRSetBrush( aDC, aBgColor, FILLED );
928  GRSetColorPen( aDC, aBgColor, aWidth );
929 
930  if( aClipBox && (aWidth > 0) )
931  {
932  EDA_RECT clipbox(*aClipBox);
933  clipbox.Inflate(aWidth);
934  ClipAndDrawPoly(&clipbox, aDC, points, 5); // polygon approach is more accurate
935  }
936  else
937  ClipAndDrawPoly(aClipBox, aDC, points, 5 );
938 }
static const bool FILLED
Definition: gr_basic.cpp:39
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const 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:955
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:131
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

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,
COLOR4D  Color,
COLOR4D  BgColor 
)
static

Definition at line 471 of file gr_basic.cpp.

473 {
474  if( !IsGRSPolyDrawable( ClipBox, n, Points ) )
475  return;
476 
477  if( Fill && ( n > 2 ) )
478  {
479  GRSetBrush( DC, BgColor, FILLED );
480  GRSetColorPen( DC, Color, width );
481 
482  /* clip before send the filled polygon to wxDC, because under linux
483  * (GTK?) polygons having large coordinates are incorrectly drawn
484  * (integer overflow in coordinates, I am guessing)
485  */
486  ClipAndDrawPoly( ClipBox, DC, Points, n );
487  }
488  else
489  {
490 
491  GRMoveTo( Points[0].x, Points[0].y );
492  for( int i = 1; i < n; ++i )
493  {
494  GRLineTo( ClipBox, DC, Points[i].x, Points[i].y, width, Color );
495  }
496  }
497 }
static const bool FILLED
Definition: gr_basic.cpp:39
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
Definition: gr_basic.cpp:264
static bool IsGRSPolyDrawable(EDA_RECT *ClipBox, int n, const wxPoint *Points)
Definition: gr_basic.cpp:429
void GRSetBrush(wxDC *DC, COLOR4D Color, bool fill)
Definition: gr_basic.cpp:168
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:254
static void ClipAndDrawPoly(EDA_RECT *ClipBox, wxDC *DC, const 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:955
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:131

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,
COLOR4D  aColor,
wxPenStyle  aStyle = wxPENSTYLE_SOLID 
)
static

Definition at line 903 of file gr_basic.cpp.

905 {
906  wxPoint points[5];
907  points[0] = wxPoint(x1, y1);
908  points[1] = wxPoint(x1, y2);
909  points[2] = wxPoint(x2, y2);
910  points[3] = wxPoint(x2, y1);
911  points[4] = points[0];
912  GRSClosedPoly( aClipBox, aDC, 5, points, NOT_FILLED, aWidth,
913  aColor, aColor );
914 }
static const bool NOT_FILLED
Definition: gr_basic.cpp:40
static void GRSClosedPoly(EDA_RECT *aClipBox, wxDC *aDC, int aPointCount, const wxPoint *aPoints, bool aFill, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:503

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

430 {
431  if( !ClipBox )
432  return true;
433 
434  if( n <= 0 )
435  return false;
436 
437  int Xmin, Xmax, Ymin, Ymax;
438 
439  Xmin = Xmax = Points[0].x;
440  Ymin = Ymax = Points[0].y;
441 
442  for( int ii = 1; ii < n; ii++ ) // calculate rectangle
443  {
444  Xmin = std::min( Xmin, Points[ii].x );
445  Xmax = std::max( Xmax, Points[ii].x );
446  Ymin = std::min( Ymin, Points[ii].y );
447  Ymax = std::max( Ymax, Points[ii].y );
448  }
449 
450  xcliplo = ClipBox->GetX();
451  ycliplo = ClipBox->GetY();
452  xcliphi = ClipBox->GetRight();
453  ycliphi = ClipBox->GetBottom();
454 
455  if( Xmax < xcliplo )
456  return false;
457  if( Xmin > xcliphi )
458  return false;
459  if( Ymax < ycliplo )
460  return false;
461  if( Ymin > ycliphi )
462  return false;
463 
464  return true;
465 }
static int ycliplo
Definition: gr_basic.cpp:89
static int ycliphi
Definition: gr_basic.cpp:91
int GetX() const
Definition: eda_rect.h:111
static int xcliphi
Definition: gr_basic.cpp:90
int GetBottom() const
Definition: eda_rect.h:124
static int xcliplo
Definition: gr_basic.cpp:88
int GetRight() const
Definition: eda_rect.h:121
int GetY() const
Definition: eda_rect.h:112

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

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

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

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

◆ g_XorMode

GR_DRAWMODE g_XorMode = GR_NXOR

Definition at line 70 of file gr_basic.cpp.

◆ GRLastMoveToX

int GRLastMoveToX
static

Definition at line 85 of file gr_basic.cpp.

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

◆ GRLastMoveToY

int GRLastMoveToY
static

Definition at line 85 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 40 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 95 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 = NULL
static

Definition at line 96 of file gr_basic.cpp.

Referenced by GRResetPenAndBrush(), and GRSetBrush().

◆ s_ForceBlackPen

bool s_ForceBlackPen
static

Definition at line 86 of file gr_basic.cpp.

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

◆ xcliphi

int xcliphi = 2000
static

Definition at line 90 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ xcliplo

int xcliplo = 0
static

Definition at line 88 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ ycliphi

int ycliphi = 2000
static

Definition at line 91 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().

◆ ycliplo

int ycliplo = 0
static

Definition at line 89 of file gr_basic.cpp.

Referenced by IsGRSPolyDrawable().