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(), SCH_FIELD::Print(), SCH_PIN::Print(), SCH_SHAPE::Print(), SCH_SHEET::Print(), SCH_LABEL_BASE::Print(), SCH_TEXT::Print(), SCH_TEXTBOX::Print(), LIB_SYMBOL::PrintBackground(), SCH_PIN::printPinElectricalTypeName(), SCH_PIN::printPinSymbol(), and SCH_PIN::printPinTexts().
void GRArc | ( | wxDC * | aDC, |
const VECTOR2I & | aStart, | ||
const VECTOR2I & | aEnd, | ||
const VECTOR2I & | aCenter, | ||
int | aWidth, | ||
const COLOR4D & | aColor | ||
) |
Definition at line 378 of file gr_basic.cpp.
References GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SCH_SHAPE::Print(), and GERBER_DRAW_ITEM::Print().
void GRCircle | ( | wxDC * | aDC, |
const VECTOR2I & | aPos, | ||
int | aRadius, | ||
int | aWidth, | ||
const COLOR4D & | aColor | ||
) |
Definition at line 357 of file gr_basic.cpp.
References GRSetBrush(), GRSetColorPen(), NOT_FILLED, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), SCH_PIN::Print(), SCH_SHAPE::Print(), SCH_LABEL_BASE::Print(), GERBER_DRAW_ITEM::Print(), and SCH_PIN::printPinSymbol().
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 351 of file gr_basic.cpp.
References GRSClosedPoly().
Referenced by D_CODE::DrawFlashedPolygon(), GRPrintText(), GERBER_DRAW_ITEM::PrintGerberPoly(), and MARKER_BASE::PrintMarker().
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 GRLastMoveToX, GRLastMoveToY, GRSetBrush(), GRSetColorPen(), NOT_FILLED, 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 387 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SCH_SHAPE::Print(), and SCH_SHAPE::PrintBackground().
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 369 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), SCH_JUNCTION::Print(), SCH_SHAPE::Print(), SCH_LABEL_BASE::Print(), and SCH_SHAPE::PrintBackground().
void GRFilledRect | ( | wxDC * | DC, |
const VECTOR2I & | aStart, | ||
const VECTOR2I & | aEnd, | ||
int | aWidth, | ||
const COLOR4D & | aColor, | ||
const COLOR4D & | aBgColor | ||
) |
Definition at line 403 of file gr_basic.cpp.
References GRSFilledRect(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), SCH_SHAPE::Print(), SCH_SHEET::Print(), SCH_TEXTBOX::Print(), SCH_SHAPE::PrintBackground(), 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(), SCH_SHEET::Print(), SCH_SYMBOL::Print(), 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(), PLEDITOR_PRINTOUT::PrintPage(), and SCH_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(), SCH_BUS_ENTRY_BASE::Print(), SCH_LINE::Print(), SCH_NO_CONNECT::Print(), SCH_SHAPE::Print(), SCH_LABEL_BASE::Print(), SCH_TABLE::Print(), SCH_TEXTBOX::Print(), SCH_PIN::printPinSymbol(), 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(), GRSPoly(), and SCH_PIN::printPinSymbol().
void GRMoveTo | ( | int | x, |
int | y | ||
) |
Definition at line 188 of file gr_basic.cpp.
References GRLastMoveToX, and GRLastMoveToY.
Referenced by GRSClosedPoly(), GRSPoly(), and SCH_PIN::printPinSymbol().
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 341 of file gr_basic.cpp.
References GRSPoly().
Referenced by SCH_SHAPE::Print(), SCH_LABEL_BASE::Print(), SCH_SHAPE::PrintBackground(), and DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem().
void GRRect | ( | wxDC * | DC, |
const VECTOR2I & | aStart, | ||
const VECTOR2I & | aEnd, | ||
int | aWidth, | ||
const COLOR4D & | aColor | ||
) |
Definition at line 396 of file gr_basic.cpp.
References GRSRect(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by D_CODE::DrawFlashedShape(), SCH_SHAPE::Print(), SCH_SHEET::Print(), SCH_TABLE::Print(), SCH_TEXTBOX::Print(), 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 KIGFX::COLOR4D::UNSPECIFIED.
Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), DIALOG_PIN_PROPERTIES::OnPaintShowPanel(), PLEDITOR_PRINTOUT::PrintPage(), SCH_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 KIGFX::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 KIGFX::COLOR4D::BLACK, color, s_ForceBlackPen, and KIGFX::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 422 of file gr_basic.cpp.
References FILLED, GRSetBrush(), GRSetColorPen(), and vector2IwxDrawPolygon().
Referenced by GRFilledRect(), and SCH_PRINTOUT::PrintPage().
|
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.