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. More... | |
void | DrawLine (const VECTOR2I &aStart, const VECTOR2I &aEnd, bool aDeEmphasised) |
Draw a simple line on the current layer. More... | |
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. More... | |
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. More... | |
Private Member Functions | |
COLOR4D | getSpecialAngleColour () const |
The GAL to draw into. More... | |
Private Attributes | |
KIGFX::GAL & | m_gal |
const KIGFX::RENDER_SETTINGS & | m_render_settings |
The current layer to draw onto. More... | |
GAL_LAYER_ID | m_currLayer |
float | m_lineWidth |
The line width to use for items. More... | |
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().
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 69 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::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 80 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 96 of file draw_context.cpp.
References KIGFX::RENDER_SETTINGS::IsBackgroundDark(), and m_render_settings.
Referenced by DrawLineWithAngleHighlight().
|
private |
Definition at line 104 of file draw_context.h.
Referenced by DrawCircle(), DrawLine(), and DrawLineWithAngleHighlight().
|
private |
Definition at line 99 of file draw_context.h.
Referenced by DrawCircle(), DrawLine(), and DrawLineWithAngleHighlight().
|
private |
The line width to use for items.
Definition at line 107 of file draw_context.h.
Referenced by DrawCircle(), DrawLine(), and DrawLineWithAngleHighlight().
|
private |
The current layer to draw onto.
Definition at line 101 of file draw_context.h.
Referenced by DrawCircle(), DrawLine(), DrawLineWithAngleHighlight(), and getSpecialAngleColour().