| 
    KiCad PCB EDA Suite
    
   | 
 
#include <gal/color4d.h>#include <math/box2.h>#include <vector>#include <wx/pen.h>#include <wx/dc.h>Go to the source code of this file.
Enumerations | |
| enum | GR_DRAWMODE {  GR_OR = 0x01000000 , GR_XOR = 0x02000000 , GR_AND = 0x04000000 , GR_NXOR = 0x08000000 , GR_INVERT = 0x10000000 , GR_ALLOW_HIGHCONTRAST = 0x20000000 , GR_COPY = 0x40000000 , GR_HIGHLIGHT = 0x80000000 , UNSPECIFIED_DRAWMODE = -1 }  | 
| Drawmode. Compositing mode plus a flag or two.  More... | |
| enum | GRLineStypeType { GR_SOLID_LINE = 0 , GR_DOTTED_LINE = 1 , GR_DASHED_LINE = 3 } | 
Functions | |
| GR_DRAWMODE | operator~ (const GR_DRAWMODE &a) | 
| GR_DRAWMODE | operator| (const GR_DRAWMODE &a, const GR_DRAWMODE &b) | 
| GR_DRAWMODE | operator& (const GR_DRAWMODE &a, const GR_DRAWMODE &b) | 
| void | GRResetPenAndBrush (wxDC *DC) | 
| void | GRSetColorPen (wxDC *DC, const COLOR4D &Color, int width=1, wxPenStyle stype=wxPENSTYLE_SOLID) | 
| void | GRSetBrush (wxDC *DC, const COLOR4D &Color, bool fill=false) | 
| void | GRForceBlackPen (bool flagforce) | 
| bool | GetGRForceBlackPenState (void) | 
| void | GRLine (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, wxPenStyle aStyle=wxPENSTYLE_SOLID) | 
| void | GRLine (wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle=wxPENSTYLE_SOLID) | 
| void | GRMoveTo (int x, int y) | 
| void | GRLineTo (wxDC *DC, int x, int y, int width, const COLOR4D &Color) | 
| void | GRPoly (wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor) | 
| Draw a new polyline and fill it if Fill, in drawing space.   | |
| void | GRClosedPoly (wxDC *aDC, int aPointCount, const VECTOR2I *aPoints, bool doFill, const COLOR4D &aColor) | 
| Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it.   | |
| void | GRFilledCircle (wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aStrokeColor, const COLOR4D &aFillColor) | 
| Draw a circle onto the drawing context aDC centered at the user coordinates (x,y).   | |
| void | GRCircle (wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aColor) | 
| void | GRArc (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, int aWidth, const COLOR4D &aColor) | 
| void | GRFilledArc (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, int width, const COLOR4D &Color, const COLOR4D &BgColor) | 
| void | GRFilledSegment (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor) | 
| void | GRCSegm (wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor) | 
| void | GRFilledRect (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor) | 
| void | GRRect (wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor) | 
| void | GRSFilledRect (wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, const COLOR4D &BgColor) | 
Variables | |
| GR_DRAWMODE | g_XorMode | 
| enum GR_DRAWMODE | 
Drawmode. Compositing mode plus a flag or two.
| Enumerator | |
|---|---|
| GR_OR | |
| GR_XOR | |
| GR_AND | |
| GR_NXOR | |
| GR_INVERT | |
| GR_ALLOW_HIGHCONTRAST | |
| GR_COPY | |
| GR_HIGHLIGHT | |
| UNSPECIFIED_DRAWMODE | |
Definition at line 35 of file gr_basic.h.
| enum GRLineStypeType | 
| Enumerator | |
|---|---|
| GR_SOLID_LINE | |
| GR_DOTTED_LINE | |
| GR_DASHED_LINE | |
Definition at line 64 of file gr_basic.h.
| bool GetGRForceBlackPenState | ( | void | ) | 
Definition at line 165 of file gr_basic.cpp.
References s_ForceBlackPen.
Referenced by BITMAP_BASE::DrawBitmap().
| void GRArc | ( | wxDC * | aDC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| const VECTOR2I & | aCenter, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor ) | 
Definition at line 379 of file gr_basic.cpp.
References GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GERBER_DRAW_ITEM::Print().
| void GRCircle | ( | wxDC * | aDC, | 
| const VECTOR2I & | aPos, | ||
| int | aRadius, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor ) | 
Definition at line 358 of file gr_basic.cpp.
References GRSetBrush(), GRSetColorPen(), NOT_FILLED, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), and GERBER_DRAW_ITEM::Print().
Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it.
| aDC | the device context into which drawing should occur. | 
| aPointCount | the number of points in the array aPoints. | 
| aPoints | The points to draw. | 
| doFill | true if polygon is to be filled, else false and only the boundary is drawn. | 
| aColor | the color of the border and the fill. | 
Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around it.
Definition at line 352 of file gr_basic.cpp.
References GRSClosedPoly().
Referenced by D_CODE::DrawFlashedPolygon(), GRPrintText(), and GERBER_DRAW_ITEM::PrintGerberPoly().
| void GRCSegm | ( | wxDC * | aDC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor ) | 
Definition at line 201 of file gr_basic.cpp.
References end, GRLastMoveToX, GRLastMoveToY, GRSetBrush(), GRSetColorPen(), NOT_FILLED, radius, RotatePoint(), ToWxPoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), GRPrintText(), and GERBER_DRAW_ITEM::Print().
| void GRFilledArc | ( | wxDC * | DC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| const VECTOR2I & | aCenter, | ||
| int | width, | ||
| const COLOR4D & | Color, | ||
| const COLOR4D & | BgColor ) | 
Definition at line 388 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
| void GRFilledCircle | ( | wxDC * | aDC, | 
| const VECTOR2I & | aPos, | ||
| int | aRadius, | ||
| int | aWidth, | ||
| const COLOR4D & | aStrokeColor, | ||
| const COLOR4D & | aFillColor ) | 
Draw a circle onto the drawing context aDC centered at the user coordinates (x,y).
| aDC | the device context into which drawing should occur. | 
| x | The x coordinate in user space of the center of the circle. | 
| y | The y coordinate in user space of the center of the circle. | 
| aRadius | is the radius of the circle. | 
| aColor | is the color to draw. | 
Definition at line 370 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape().
| void GRFilledRect | ( | wxDC * | DC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor, | ||
| const COLOR4D & | aBgColor ) | 
Definition at line 404 of file gr_basic.cpp.
References GRSFilledRect(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
| void GRFilledSegment | ( | wxDC * | aDC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor ) | 
Definition at line 278 of file gr_basic.cpp.
References GRSetColorPen(), winDrawLine(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), and GERBER_DRAW_ITEM::Print().
| void GRForceBlackPen | ( | bool | flagforce | ) | 
| flagforce | True to force a black pen whenever the asked color. | 
Definition at line 159 of file gr_basic.cpp.
References s_ForceBlackPen.
Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), and PLEDITOR_PRINTOUT::PrintPage().
| void GRLine | ( | wxDC * | aDC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor, | ||
| wxPenStyle | aStyle = wxPENSTYLE_SOLID ) | 
Definition at line 181 of file gr_basic.cpp.
References GRLine(), VECTOR2< T >::x, and VECTOR2< T >::y.
| void GRLine | ( | wxDC * | DC, | 
| int | x1, | ||
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| int | width, | ||
| const COLOR4D & | Color, | ||
| wxPenStyle | aStyle = wxPENSTYLE_SOLID ) | 
Definition at line 171 of file gr_basic.cpp.
References GRLastMoveToX, GRLastMoveToY, GRSetColorPen(), and winDrawLine().
Referenced by GRLine(), GRLineTo(), GRPrintText(), and DS_DRAW_ITEM_LINE::PrintWsItem().
| void GRLineTo | ( | wxDC * | DC, | 
| int | x, | ||
| int | y, | ||
| int | width, | ||
| const COLOR4D & | Color ) | 
Definition at line 195 of file gr_basic.cpp.
References GRLastMoveToX, GRLastMoveToY, and GRLine().
Referenced by GRSClosedPoly(), and GRSPoly().
| void GRMoveTo | ( | int | x, | 
| int | y ) | 
Definition at line 188 of file gr_basic.cpp.
References GRLastMoveToX, and GRLastMoveToY.
Referenced by GRSClosedPoly(), and GRSPoly().
| void GRPoly | ( | wxDC * | DC, | 
| int | n, | ||
| const VECTOR2I * | Points, | ||
| bool | Fill, | ||
| int | width, | ||
| const COLOR4D & | Color, | ||
| const COLOR4D & | BgColor ) | 
Draw a new polyline and fill it if Fill, in drawing space.
Definition at line 342 of file gr_basic.cpp.
References GRSPoly().
Referenced by DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem().
| void GRRect | ( | wxDC * | DC, | 
| const VECTOR2I & | aStart, | ||
| const VECTOR2I & | aEnd, | ||
| int | aWidth, | ||
| const COLOR4D & | aColor ) | 
Definition at line 397 of file gr_basic.cpp.
References GRSRect(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), and DS_DRAW_ITEM_RECT::PrintWsItem().
| void GRResetPenAndBrush | ( | wxDC * | DC | ) | 
Definition at line 73 of file gr_basic.cpp.
References BLACK, GRSetBrush(), s_DC_lastbrushcolor, s_DC_lastDC, and COLOR4D::UNSPECIFIED.
Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), PLEDITOR_PRINTOUT::PrintPage(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().
| void GRSetBrush | ( | wxDC * | DC, | 
| const COLOR4D & | Color, | ||
| bool | fill = false ) | 
Definition at line 132 of file gr_basic.cpp.
References COLOR4D::BLACK, color, s_DC_lastbrushcolor, s_DC_lastbrushfill, s_DC_lastDC, and s_ForceBlackPen.
Referenced by GRArc(), GRCircle(), GRCSegm(), GRFilledArc(), GRFilledCircle(), GRResetPenAndBrush(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().
| void GRSetColorPen | ( | wxDC * | DC, | 
| const COLOR4D & | Color, | ||
| int | width = 1, | ||
| wxPenStyle | stype = wxPENSTYLE_SOLID ) | 
Definition at line 81 of file gr_basic.cpp.
References COLOR4D::BLACK, color, s_ForceBlackPen, and COLOR4D::UNSPECIFIED.
Referenced by GRArc(), GRCircle(), GRCSegm(), GRFilledArc(), GRFilledCircle(), GRFilledSegment(), GRLine(), GRSClosedPoly(), GRSFilledRect(), and GRSPoly().
| void GRSFilledRect | ( | wxDC * | DC, | 
| int | x1, | ||
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| int | width, | ||
| const COLOR4D & | Color, | ||
| const COLOR4D & | BgColor ) | 
Definition at line 423 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), and vector2IwxDrawPolygon().
Referenced by GRFilledRect().
      
  | 
  inline | 
Definition at line 57 of file gr_basic.h.
      
  | 
  inline | 
Definition at line 52 of file gr_basic.h.
      
  | 
  inline | 
Definition at line 47 of file gr_basic.h.
      
  | 
  extern | 
Definition at line 34 of file gr_basic.cpp.