|
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 | DrawRectangle (const VECTOR2I &aC1, const VECTOR2I &aC2, bool aDeEmphasised) |
| Draw a rectangle on the current layer. | |
| 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 | DrawEllipse (const VECTOR2I &aOrigin, double aA, double aB, EDA_ANGLE aRot, bool aDeEmphasised) |
| Draw a preview ellipse on the current layer. | |
| void | DrawEllipse (const ELLIPSE< int > &aEllipse, bool aDeEmphasised) |
| 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 41 of file draw_context.h.
| DRAW_CONTEXT::DRAW_CONTEXT | ( | KIGFX::VIEW & | aView | ) |
Definition at line 44 of file draw_context.cpp.
References LAYER_AUX_ITEMS, m_currLayer, m_gal, m_lineWidth, and m_render_settings.
| 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-emphasized. |
Definition at line 65 of file draw_context.cpp.
References deemphasise(), m_currLayer, m_gal, m_lineWidth, and m_render_settings.
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-emphasized. |
Definition at line 77 of file draw_context.cpp.
References deemphasise(), DEGREES_T, m_currLayer, m_gal, m_lineWidth, and m_render_settings.
| void DRAW_CONTEXT::DrawEllipse | ( | const ELLIPSE< int > & | aEllipse, |
| bool | aDeEmphasised ) |
Definition at line 95 of file draw_context.cpp.
References ELLIPSE< NumericType >::Center, DrawEllipse(), ELLIPSE< NumericType >::MajorRadius, ELLIPSE< NumericType >::MinorRadius, and ELLIPSE< NumericType >::Rotation.
| void DRAW_CONTEXT::DrawEllipse | ( | const VECTOR2I & | aOrigin, |
| double | aA, | ||
| double | aB, | ||
| EDA_ANGLE | aRot, | ||
| bool | aDeEmphasised ) |
Draw a preview ellipse on the current layer.
Definition at line 101 of file draw_context.cpp.
References deemphasise(), m_currLayer, m_gal, m_lineWidth, and m_render_settings.
Referenced by DrawEllipse(), and KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
Draw a simple line on the current layer.
| aStart | line start point. |
| aEnd | line end point. |
| aDeEmphasised | draw the line de-. |
Definition at line 113 of file draw_context.cpp.
References deemphasise(), m_currLayer, m_gal, m_lineWidth, and m_render_settings.
Referenced by KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw(), and 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-emphasized. |
Definition at line 124 of file draw_context.cpp.
References deemphasise(), delta, m_currLayer, m_gal, m_lineWidth, and m_render_settings.
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-emphasized. |
Definition at line 146 of file draw_context.cpp.
References angleIsSpecial(), deemphasise(), getSpecialAngleColour(), m_currLayer, m_gal, m_lineWidth, and m_render_settings.
Referenced by KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), and KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
Draw a rectangle on the current layer.
| aC1 | rectangle corner 1. |
| aC2 | rectangle corner 2. |
Definition at line 53 of file draw_context.cpp.
References deemphasise(), m_currLayer, m_gal, m_lineWidth, and m_render_settings.
Referenced by KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
|
private |
The GAL to draw into.
Definition at line 162 of file draw_context.cpp.
References m_render_settings.
Referenced by DrawLineWithAngleHighlight().
|
private |
Definition at line 138 of file draw_context.h.
Referenced by DRAW_CONTEXT(), DrawCircle(), DrawCircleDashed(), DrawEllipse(), DrawLine(), DrawLineDashed(), DrawLineWithAngleHighlight(), and DrawRectangle().
|
private |
Definition at line 133 of file draw_context.h.
Referenced by DRAW_CONTEXT(), DrawCircle(), DrawCircleDashed(), DrawEllipse(), DrawLine(), DrawLineDashed(), DrawLineWithAngleHighlight(), and DrawRectangle().
|
private |
The line width to use for items.
Definition at line 141 of file draw_context.h.
Referenced by DRAW_CONTEXT(), DrawCircle(), DrawCircleDashed(), DrawEllipse(), DrawLine(), DrawLineDashed(), DrawLineWithAngleHighlight(), and DrawRectangle().
|
private |
The current layer to draw onto.
Definition at line 135 of file draw_context.h.
Referenced by DRAW_CONTEXT(), DrawCircle(), DrawCircleDashed(), DrawEllipse(), DrawLine(), DrawLineDashed(), DrawLineWithAngleHighlight(), DrawRectangle(), and getSpecialAngleColour().