KiCad PCB EDA Suite
|
A KIGFX::PREVIEW::DRAW_CONTEXT is a wrapper around a GAL and some other settings that makes it easy to draw preview items consistently. More...
#include <draw_context.h>
Public Member Functions | |
DRAW_CONTEXT (KIGFX::VIEW &aView) | |
void | DrawCircle (const VECTOR2I &aOrigin, double aRad, bool aDeEmphasised) |
Draw a preview circle on the current layer. | |
void | DrawCircleDashed (const VECTOR2I &aOrigin, double aRad, double aStepAngle, double aFillAngle, bool aDeEmphasised) |
Draw a dashed preview circle on the current layer. | |
void | DrawLine (const VECTOR2I &aStart, const VECTOR2I &aEnd, bool aDeEmphasised) |
Draw a simple line on the current layer. | |
void | DrawLineDashed (const VECTOR2I &aStart, const VECTOR2I &aEn, int aDashStep, int aDashFill, bool aDeEmphasised) |
Draw a dashed line on the current layer. | |
void | DrawLineWithAngleHighlight (const VECTOR2I &aStart, const VECTOR2I &aEnd, bool aDeEmphasised) |
Draw a straight line on the current layer, with a special highlight when the line angle is a multiple of 45 degrees. | |
void | DrawArcWithAngleHighlight (const VECTOR2I &aOrigin, double aRad, double aStartAngle, double aEndAngle) |
Draw an arc on the current layer, with a special highlight when the line angle is a multiple of 45 degrees. | |
Private Member Functions | |
COLOR4D | getSpecialAngleColour () const |
The GAL to draw into. | |
Private Attributes | |
KIGFX::GAL & | m_gal |
const KIGFX::RENDER_SETTINGS & | m_render_settings |
The current layer to draw onto. | |
GAL_LAYER_ID | m_currLayer |
float | m_lineWidth |
The line width to use for items. | |
A KIGFX::PREVIEW::DRAW_CONTEXT is a wrapper around a GAL and some other settings that makes it easy to draw preview items consistently.
This class provides some graphical items that are often used by preview items. Complex items can be composed from these.
Definition at line 44 of file draw_context.h.
DRAW_CONTEXT::DRAW_CONTEXT | ( | KIGFX::VIEW & | aView | ) |
Definition at line 48 of file draw_context.cpp.
void KIGFX::PREVIEW::DRAW_CONTEXT::DrawArcWithAngleHighlight | ( | const VECTOR2I & | aOrigin, |
double | aRad, | ||
double | aStartAngle, | ||
double | aEndAngle | ||
) |
Draw an arc on the current layer, with a special highlight when the line angle is a multiple of 45 degrees.
aOrigin | the arc centre |
aRad | the arc radius |
aStartAngle | the arc start angle |
aEndAngle | the arc end angle |
void DRAW_CONTEXT::DrawCircle | ( | const VECTOR2I & | aOrigin, |
double | aRad, | ||
bool | aDeEmphasised | ||
) |
Draw a preview circle on the current layer.
aOrigin | circle origin |
aRad | circle radius |
aDeEmphasised | draw the circle de-emphasised |
Definition at line 57 of file draw_context.cpp.
References color, deemphasise(), KIGFX::GAL::DrawCircle(), KIGFX::RENDER_SETTINGS::GetLayerColor(), m_currLayer, m_gal, m_lineWidth, m_render_settings, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().
Referenced by KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw().
void DRAW_CONTEXT::DrawCircleDashed | ( | const VECTOR2I & | aOrigin, |
double | aRad, | ||
double | aStepAngle, | ||
double | aFillAngle, | ||
bool | aDeEmphasised | ||
) |
Draw a dashed preview circle on the current layer.
aOrigin | circle origin |
aRad | circle radius |
aStepAngle | dash step angle |
aFillAngle | dash fill angle |
aDeEmphasised | draw the circle de-emphasised |
Definition at line 69 of file draw_context.cpp.
References color, deemphasise(), DEGREES_T, KIGFX::GAL::DrawArc(), KIGFX::RENDER_SETTINGS::GetLayerColor(), m_currLayer, m_gal, m_lineWidth, m_render_settings, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().
Draw a simple line on the current layer.
aStart | line start point |
aEnd | line end point |
aDeEmphasised | draw the line de-emphasised |
Definition at line 87 of file draw_context.cpp.
References deemphasise(), KIGFX::GAL::DrawLine(), KIGFX::RENDER_SETTINGS::GetLayerColor(), m_currLayer, m_gal, m_lineWidth, m_render_settings, KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().
Referenced by KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().
void DRAW_CONTEXT::DrawLineDashed | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEn, | ||
int | aDashStep, | ||
int | aDashFill, | ||
bool | aDeEmphasised | ||
) |
Draw a dashed line on the current layer.
aStart | line start point |
aEnd | line end point |
aDashStep | dash step distance |
aDashFill | dash fill distance |
aDeEmphasised | draw the line de-emphasised |
Definition at line 98 of file draw_context.cpp.
References deemphasise(), delta, KIGFX::GAL::DrawLine(), KIGFX::RENDER_SETTINGS::GetLayerColor(), m_currLayer, m_gal, m_lineWidth, m_render_settings, KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().
Referenced by KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), and PCB_TUNING_PATTERN::ViewDraw().
void DRAW_CONTEXT::DrawLineWithAngleHighlight | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
bool | aDeEmphasised | ||
) |
Draw a straight line on the current layer, with a special highlight when the line angle is a multiple of 45 degrees.
aStart | line start point |
aEnd | line end point |
aDeEmphasised | draw the line de-emphasised |
Definition at line 120 of file draw_context.cpp.
References angleIsSpecial(), deemphasise(), KIGFX::GAL::DrawLine(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getSpecialAngleColour(), m_currLayer, m_gal, m_lineWidth, m_render_settings, KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), and KIGFX::GAL::SetStrokeColor().
Referenced by KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw().
|
private |
The GAL to draw into.
Definition at line 136 of file draw_context.cpp.
References KIGFX::RENDER_SETTINGS::IsBackgroundDark(), and m_render_settings.
Referenced by DrawLineWithAngleHighlight().
|
private |
Definition at line 126 of file draw_context.h.
Referenced by DrawCircle(), DrawCircleDashed(), DrawLine(), DrawLineDashed(), and DrawLineWithAngleHighlight().
|
private |
Definition at line 121 of file draw_context.h.
Referenced by DrawCircle(), DrawCircleDashed(), DrawLine(), DrawLineDashed(), and DrawLineWithAngleHighlight().
|
private |
The line width to use for items.
Definition at line 129 of file draw_context.h.
Referenced by DrawCircle(), DrawCircleDashed(), DrawLine(), DrawLineDashed(), and DrawLineWithAngleHighlight().
|
private |
The current layer to draw onto.
Definition at line 123 of file draw_context.h.
Referenced by DrawCircle(), DrawCircleDashed(), DrawLine(), DrawLineDashed(), DrawLineWithAngleHighlight(), and getSpecialAngleColour().