![]() |
KiCad PCB EDA Suite
|
Abstract interface for drawing on a 2D-surface. More...
#include <graphics_abstraction_layer.h>
Classes | |
struct | TEXT_PROPERTIES |
Public Member Functions | |
GAL (GAL_DISPLAY_OPTIONS &aOptions) | |
virtual | ~GAL () |
virtual bool | IsInitialized () const |
Return the initialization status for the canvas. More... | |
virtual bool | IsVisible () const |
Return true if the GAL canvas is visible on the screen. More... | |
virtual bool | IsCairoEngine () |
Return true if the GAL engine is a Cairo based type. More... | |
virtual bool | IsOpenGlEngine () |
Return true if the GAL engine is a OpenGL based type. More... | |
virtual void | DrawLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) |
Draw a line. More... | |
virtual void | DrawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) |
Draw a rounded segment. More... | |
virtual void | DrawPolyline (const std::deque< VECTOR2D > &aPointList) |
Draw a polyline. More... | |
virtual void | DrawPolyline (const VECTOR2D aPointList[], int aListSize) |
virtual void | DrawPolyline (const SHAPE_LINE_CHAIN &aLineChain) |
virtual void | DrawCircle (const VECTOR2D &aCenterPoint, double aRadius) |
Draw a circle using world coordinates. More... | |
virtual void | DrawArc (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) |
Draw an arc. More... | |
virtual void | DrawArcSegment (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) |
Draw an arc segment. More... | |
virtual void | DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) |
Draw a rectangle. More... | |
virtual void | DrawPolygon (const std::deque< VECTOR2D > &aPointList) |
Draw a polygon. More... | |
virtual void | DrawPolygon (const VECTOR2D aPointList[], int aListSize) |
virtual void | DrawPolygon (const SHAPE_POLY_SET &aPolySet) |
virtual void | DrawPolygon (const SHAPE_LINE_CHAIN &aPolySet) |
virtual void | DrawCurve (const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0) |
Draw a cubic bezier spline. More... | |
virtual void | DrawBitmap (const BITMAP_BASE &aBitmap) |
Draw a bitmap image. More... | |
virtual void | ResizeScreen (int aWidth, int aHeight) |
Resize the canvas. More... | |
virtual bool | Show (bool aShow) |
Show/hide the GAL canvas. More... | |
const VECTOR2I & | GetScreenPixelSize () const |
Return GAL canvas size in pixels. More... | |
virtual void | Flush () |
Force all remaining objects to be drawn. More... | |
void | SetClearColor (const COLOR4D &aColor) |
const COLOR4D & | GetClearColor () const |
virtual void | ClearScreen () |
Clear the screen. More... | |
virtual void | SetIsFill (bool aIsFillEnabled) |
Enable/disable fill. More... | |
virtual void | SetIsStroke (bool aIsStrokeEnabled) |
Enable/disable stroked outlines. More... | |
virtual void | SetFillColor (const COLOR4D &aColor) |
Set the fill color. More... | |
const COLOR4D & | GetFillColor () const |
Get the fill color. More... | |
virtual void | SetStrokeColor (const COLOR4D &aColor) |
Set the stroke color. More... | |
const COLOR4D & | GetStrokeColor () const |
Get the stroke color. More... | |
virtual void | SetLineWidth (float aLineWidth) |
Set the line width. More... | |
float | GetLineWidth () const |
Get the line width. More... | |
virtual void | SetLayerDepth (double aLayerDepth) |
Set the depth of the layer (position on the z-axis) More... | |
const STROKE_FONT & | GetStrokeFont () const |
virtual void | StrokeText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle) |
Draw a vector type text using preloaded Newstroke font. More... | |
virtual void | BitmapText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle) |
Draw a text using a bitmap font. More... | |
VECTOR2D | GetTextLineSize (const UTF8 &aText) const |
Compute the X and Y size of a given text. More... | |
virtual void | SetTextAttributes (const EDA_TEXT *aText) |
Loads attributes of the given text (bold/italic/underline/mirrored and so on). More... | |
void | ResetTextAttributes () |
Reset text attributes to default styling. More... | |
void | SetGlyphSize (const VECTOR2D aSize) |
Set the font glyph size. More... | |
const VECTOR2D & | GetGlyphSize () const |
void | SetFontBold (const bool aBold) |
Set bold property of current font. More... | |
bool | IsFontBold () const |
void | SetFontItalic (bool aItalic) |
Set italic property of current font. More... | |
bool | IsFontItalic () const |
void | SetFontUnderlined (bool aUnderlined) |
bool | IsFontUnderlined () const |
void | SetTextMirrored (const bool aMirrored) |
Set a mirrored property of text. More... | |
bool | IsTextMirrored () const |
void | SetHorizontalJustify (const EDA_TEXT_HJUSTIFY_T aHorizontalJustify) |
Set the horizontal justify for text drawing. More... | |
EDA_TEXT_HJUSTIFY_T | GetHorizontalJustify () const |
Return current text horizontal justification setting. More... | |
void | SetVerticalJustify (const EDA_TEXT_VJUSTIFY_T aVerticalJustify) |
Set the vertical justify for text drawing. More... | |
EDA_TEXT_VJUSTIFY_T | GetVerticalJustify () const |
Returns current text vertical justification setting. More... | |
virtual void | Transform (const MATRIX3x3D &aTransformation) |
Transform the context. More... | |
virtual void | Rotate (double aAngle) |
Rotate the context. More... | |
virtual void | Translate (const VECTOR2D &aTranslation) |
Translate the context. More... | |
virtual void | Scale (const VECTOR2D &aScale) |
Scale the context. More... | |
virtual void | Save () |
Save the context. More... | |
virtual void | Restore () |
Restore the context. More... | |
virtual int | BeginGroup () |
Begin a group. More... | |
virtual void | EndGroup () |
End the group. More... | |
virtual void | DrawGroup (int aGroupNumber) |
Draw the stored group. More... | |
virtual void | ChangeGroupColor (int aGroupNumber, const COLOR4D &aNewColor) |
Change the color used to draw the group. More... | |
virtual void | ChangeGroupDepth (int aGroupNumber, int aDepth) |
Change the depth (Z-axis position) of the group. More... | |
virtual void | DeleteGroup (int aGroupNumber) |
Delete the group from the memory. More... | |
virtual void | ClearCache () |
Delete all data created during caching of graphic items. More... | |
virtual void | ComputeWorldScreenMatrix () |
Compute the world <-> screen transformation matrix. More... | |
const MATRIX3x3D & | GetWorldScreenMatrix () const |
Get the world <-> screen transformation matrix. More... | |
const MATRIX3x3D & | GetScreenWorldMatrix () const |
Get the screen <-> world transformation matrix. More... | |
void | SetWorldScreenMatrix (const MATRIX3x3D &aMatrix) |
Set the world <-> screen transformation matrix. More... | |
void | SetWorldUnitLength (double aWorldUnitLength) |
Set the unit length. More... | |
void | SetScreenSize (const VECTOR2I &aSize) |
void | SetScreenDPI (double aScreenDPI) |
Set the dots per inch of the screen. More... | |
void | SetLookAtPoint (const VECTOR2D &aPoint) |
Set the Point in world space to look at. More... | |
const VECTOR2D & | GetLookAtPoint () const |
Get the look at point. More... | |
void | SetZoomFactor (double aZoomFactor) |
Set the zoom factor of the scene. More... | |
double | GetZoomFactor () const |
Get the zoom factor. More... | |
void | SetRotation (double aRotation) |
Set the rotation angle. More... | |
double | GetRotation () const |
Get the rotation angle. More... | |
void | SetDepthRange (const VECTOR2D &aDepthRange) |
Set the range of the layer depth. More... | |
double | GetMinDepth () const |
Return the minimum depth in the currently used range (the top). More... | |
double | GetMaxDepth () const |
Return the maximum depth in the currently used range (the bottom). More... | |
double | GetWorldScale () const |
Get the world scale. More... | |
void | SetFlip (bool xAxis, bool yAxis) |
Sets flipping of the screen. More... | |
bool | IsFlippedX () const |
Return true if flip flag for the X axis is set. More... | |
bool | IsFlippedY () const |
Return true if flip flag for the Y axis is set. More... | |
virtual void | SetTarget (RENDER_TARGET aTarget) |
Set the target for rendering. More... | |
virtual RENDER_TARGET | GetTarget () const |
Get the currently used target for rendering. More... | |
virtual void | ClearTarget (RENDER_TARGET aTarget) |
Clear the target for rendering. More... | |
virtual bool | HasTarget (RENDER_TARGET aTarget) |
Return true if the target exists. More... | |
virtual void | SetNegativeDrawMode (bool aSetting) |
Set negative draw mode in the renderer. More... | |
void | SetGridVisibility (bool aVisibility) |
Set the visibility setting of the grid. More... | |
bool | GetGridVisibility () const |
bool | GetGridSnapping () const |
void | SetGridOrigin (const VECTOR2D &aGridOrigin) |
Set the origin point for the grid. More... | |
const VECTOR2D & | GetGridOrigin () const |
void | SetGridSize (const VECTOR2D &aGridSize) |
Set the grid size. More... | |
const VECTOR2D & | GetGridSize () const |
Return the grid size. More... | |
void | SetGridColor (const COLOR4D &aGridColor) |
Set the grid color. More... | |
void | SetAxesColor (const COLOR4D &aAxesColor) |
Set the axes color. More... | |
void | SetAxesEnabled (bool aAxesEnabled) |
Enable drawing the axes. More... | |
void | SetCoarseGrid (int aInterval) |
Draw every tick line wider. More... | |
float | GetGridLineWidth () const |
Get the grid line width. More... | |
virtual void | DrawGrid () |
VECTOR2D | GetGridPoint (const VECTOR2D &aPoint) const |
For a given point it returns the nearest point belonging to the grid in world coordinates. More... | |
VECTOR2D | ToWorld (const VECTOR2D &aPoint) const |
Compute the point position in world coordinates from given screen coordinates. More... | |
VECTOR2D | ToScreen (const VECTOR2D &aPoint) const |
Compute the point position in screen coordinates from given world coordinates. More... | |
void | SetCursorEnabled (bool aCursorEnabled) |
Enable/disable cursor. More... | |
bool | IsCursorEnabled () const |
Return information about cursor visibility. More... | |
void | SetCursorColor (const COLOR4D &aCursorColor) |
Set the cursor color. More... | |
virtual void | DrawCursor (const VECTOR2D &aCursorPosition) |
Draw the cursor. More... | |
void | AdvanceDepth () |
Change the current depth to deeper, so it is possible to draw objects right beneath other. More... | |
void | PushDepth () |
Store current drawing depth on the depth stack. More... | |
void | PopDepth () |
Restore previously stored drawing depth for the depth stack. More... | |
virtual void | EnableDepthTest (bool aEnabled=false) |
virtual bool | IsContextLocked () |
Checks the state of the context lock. More... | |
Protected Member Functions | |
virtual void | lockContext (int aClientCookie) |
Use GAL_CONTEXT_LOCKER RAII object. More... | |
virtual void | unlockContext (int aClientCookie) |
virtual void | beginUpdate () |
Enable item update mode. More... | |
virtual void | endUpdate () |
Disable item update mode. More... | |
virtual void | beginDrawing () |
Begin the drawing, needs to be called for every new frame. More... | |
virtual void | endDrawing () |
End the drawing, needs to be called for every new frame. More... | |
void | computeWorldScale () |
Compute the scaling factor for the world->screen matrix. More... | |
double | computeMinGridSpacing () const |
compute minimum grid spacing from the grid settings More... | |
COLOR4D | getCursorColor () const |
Get the actual cursor color to draw. More... | |
void | OnGalDisplayOptionsChanged (const GAL_DISPLAY_OPTIONS &aOptions) override |
Handler for observer settings changes. More... | |
virtual bool | updatedGalDisplayOptions (const GAL_DISPLAY_OPTIONS &aOptions) |
Handle updating display options. More... | |
Protected Attributes | |
GAL_DISPLAY_OPTIONS & | options |
UTIL::LINK | observerLink |
std::stack< double > | depthStack |
Stored depth values. More... | |
VECTOR2I | screenSize |
Screen size in screen coordinates. More... | |
double | worldUnitLength |
The unit length of the world coordinates [inch]. More... | |
double | screenDPI |
The dots per inch of the screen. More... | |
VECTOR2D | lookAtPoint |
Point to be looked at in world space. More... | |
double | zoomFactor |
The zoom factor. More... | |
double | rotation |
Rotation transformation (radians) More... | |
MATRIX3x3D | worldScreenMatrix |
World transformation. More... | |
MATRIX3x3D | screenWorldMatrix |
Screen transformation. More... | |
double | worldScale |
The scale factor world->screen. More... | |
bool | globalFlipX |
Flag for X axis flipping. More... | |
bool | globalFlipY |
Flag for Y axis flipping. More... | |
float | lineWidth |
The line width. More... | |
bool | isFillEnabled |
Is filling of graphic objects enabled ? More... | |
bool | isStrokeEnabled |
Are the outlines stroked ? More... | |
COLOR4D | fillColor |
The fill color. More... | |
COLOR4D | strokeColor |
The color of the outlines. More... | |
COLOR4D | m_clearColor |
double | layerDepth |
The actual layer depth. More... | |
VECTOR2D | depthRange |
Range of the depth. More... | |
bool | gridVisibility |
Should the grid be shown. More... | |
GRID_STYLE | gridStyle |
Grid display style. More... | |
VECTOR2D | gridSize |
The grid size. More... | |
VECTOR2D | gridOrigin |
The grid origin. More... | |
VECTOR2D | gridOffset |
The grid offset to compensate cursor position. More... | |
COLOR4D | gridColor |
Color of the grid. More... | |
COLOR4D | axesColor |
Color of the axes. More... | |
bool | axesEnabled |
Should the axes be drawn. More... | |
int | gridTick |
Every tick line gets the double width. More... | |
float | gridLineWidth |
Line width of the grid. More... | |
int | gridMinSpacing |
Minimum screen size of the grid (pixels) below which the grid is not drawn. More... | |
bool | isCursorEnabled |
Is the cursor enabled? More... | |
bool | forceDisplayCursor |
Always show cursor. More... | |
COLOR4D | cursorColor |
Cursor color. More... | |
bool | fullscreenCursor |
Shape of the cursor (fullscreen or small cross) More... | |
VECTOR2D | cursorPosition |
Current cursor position (world coordinates) More... | |
STROKE_FONT | strokeFont |
Instance of object that stores information about how to draw texts. More... | |
Static Protected Attributes | |
static const int | MIN_DEPTH = -1024 |
Possible depth range. More... | |
static const int | MAX_DEPTH = 1023 |
static const int | GRID_DEPTH = MAX_DEPTH - 1 |
Depth level on which the grid is drawn. More... | |
Private Attributes | |
struct KIGFX::GAL::TEXT_PROPERTIES | textProperties |
Friends | |
class | GAL_CONTEXT_LOCKER |
class | GAL_UPDATE_CONTEXT |
class | GAL_DRAWING_CONTEXT |
Abstract interface for drawing on a 2D-surface.
The functions are optimized for drawing shapes of an EDA-program such as KiCad. Most methods are abstract and need to be implemented by a lower layer, for example by a Cairo or OpenGL implementation. Almost all methods use world coordinates as arguments. The board design is defined in world space units for drawing purposes these are transformed to screen units with this layer. So zooming is handled here as well.
Definition at line 59 of file graphics_abstraction_layer.h.
GAL::GAL | ( | GAL_DISPLAY_OPTIONS & | aOptions | ) |
Definition at line 39 of file graphics_abstraction_layer.cpp.
References computeWorldScale(), forceDisplayCursor, fullscreenCursor, gridLineWidth, gridMinSpacing, gridStyle, KIGFX::LINES, KIGFX::STROKE_FONT::LoadNewStrokeFont(), MAX_DEPTH, MIN_DEPTH, newstroke_font, newstroke_font_bufsize, observerLink, options, ResetTextAttributes(), SetAxesEnabled(), SetCoarseGrid(), SetCursorColor(), SetCursorEnabled(), SetDepthRange(), SetFillColor(), SetFlip(), SetGridVisibility(), SetIsFill(), SetIsStroke(), SetLayerDepth(), SetLineWidth(), SetLookAtPoint(), SetRotation(), SetScreenDPI(), SetStrokeColor(), SetWorldUnitLength(), SetZoomFactor(), strokeFont, and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().
|
virtual |
Definition at line 87 of file graphics_abstraction_layer.cpp.
|
inline |
Change the current depth to deeper, so it is possible to draw objects right beneath other.
Definition at line 1005 of file graphics_abstraction_layer.h.
References layerDepth.
Referenced by KIGFX::VIEW_GROUP::ViewDraw().
|
inlineprotectedvirtual |
Begin the drawing, needs to be called for every new frame.
Private: use GAL_DRAWING_CONTEXT RAII object
Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 1053 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_DRAWING_CONTEXT::GAL_DRAWING_CONTEXT().
|
inlinevirtual |
Begin a group.
A group is a collection of graphic items. Hierarchical groups are possible, attributes and transformations can be used.
Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 531 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::updateItemGeometry().
|
inlineprotectedvirtual |
Enable item update mode.
Private: use GAL_UPDATE_CONTEXT RAII object
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1046 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_UPDATE_CONTEXT::GAL_UPDATE_CONTEXT().
|
inlinevirtual |
Draw a text using a bitmap font.
It should be faster than StrokeText(), but can be used only for non-Gerber elements.
aText | is the text to be drawn. |
aPosition | is the text position in world coordinates. |
aRotationAngle | is the text rotation angle. |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 360 of file graphics_abstraction_layer.h.
References globalFlipX, lineWidth, KIGFX::GAL::TEXT_PROPERTIES::m_glyphSize, KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, StrokeText(), and textProperties.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), and KIGFX::VIEW_OVERLAY::COMMAND_BITMAP_TEXT::Execute().
|
inlinevirtual |
Change the color used to draw the group.
aGroupNumber | is the group number. |
aNewColor | is the new color. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 549 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::updateItemsColor::operator()(), KIGFX::VIEW::UpdateAllLayersColor(), and KIGFX::VIEW::updateItemColor().
|
inlinevirtual |
Change the depth (Z-axis position) of the group.
aGroupNumber | is the group number. |
aDepth | is the new depth. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 557 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::changeItemsDepth::operator()(), and KIGFX::VIEW::UpdateAllLayersOrder().
|
inlinevirtual |
Delete all data created during caching of graphic items.
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 569 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::Clear().
|
inlinevirtual |
Clear the screen.
aColor | is the color used for clearing. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 231 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().
|
inlinevirtual |
Clear the target for rendering.
aTarget | is the target to be cleared. |
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 792 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::ClearTargets().
|
protected |
compute minimum grid spacing from the grid settings
Definition at line 212 of file graphics_abstraction_layer.cpp.
References gridMinSpacing.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), and KIGFX::CAIRO_GAL_BASE::DrawGrid().
|
inlineprotected |
Compute the scaling factor for the world->screen matrix.
Definition at line 1060 of file graphics_abstraction_layer.h.
References screenDPI, worldScale, worldUnitLength, and zoomFactor.
Referenced by ComputeWorldScreenMatrix(), and GAL().
|
virtual |
Compute the world <-> screen transformation matrix.
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_PRINT_GAL.
Definition at line 183 of file graphics_abstraction_layer.cpp.
References computeWorldScale(), globalFlipX, globalFlipY, MATRIX3x3< T >::Inverse(), lookAtPoint, rotation, scale, screenSize, screenWorldMatrix, MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetRotation(), MATRIX3x3< T >::SetScale(), MATRIX3x3< T >::SetTranslation(), worldScale, and worldScreenMatrix.
Referenced by KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::resetContext(), KIGFX::VIEW::SetCenter(), and KIGFX::VIEW::SetScale().
|
inlinevirtual |
Delete the group from the memory.
aGroupNumber | is the group number. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 564 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::recacheItem::operator()(), KIGFX::VIEW::Remove(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().
|
inlinevirtual |
Draw an arc.
aCenterPoint | is the center point of the arc. |
aRadius | is the arc radius. |
aStartAngle | is the start angle of the arc. |
aEndAngle | is the end angle of the arc. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 136 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), and KIGFX::VIEW_OVERLAY::COMMAND_ARC::Execute().
|
inlinevirtual |
Draw an arc segment.
This method differs from DrawArc() in what happens when fill/stroke are on or off. DrawArc() draws a "pie piece" when fill is turned on, and a thick stroke when fill is off. DrawArcSegment() with fill on behaves like DrawArc() with fill off. DrawArcSegment() with fill off draws the outline of what it would have drawn with fill on.
TODO: Unify Arc routines
aCenterPoint | is the center point of the arc. |
aRadius | is the arc radius. |
aStartAngle | is the start angle of the arc. |
aEndAngle | is the end angle of the arc. |
aWidth | is the thickness of the arc (pen size). |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 156 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_PAINTER::draw().
|
inlinevirtual |
Draw a bitmap image.
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 195 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw().
|
inlinevirtual |
Draw a circle using world coordinates.
aCenterPoint | is the center point of the circle. |
aRadius | is the radius of the circle. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 125 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::SCH_PAINTER::drawPinDanglingSymbol(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::VIEW_OVERLAY::COMMAND_CIRCLE::Execute(), and screenSpaceCircle().
|
inlinevirtual |
Draw the cursor.
aCursorPosition | is the cursor position in screen coordinates. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 999 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().
|
inlinevirtual |
Draw a cubic bezier spline.
startPoint | is the start point of the spline. |
controlPointA | is the first control point. |
controlPointB | is the second control point. |
endPoint | is the end point of the spline. |
aFilterValue | is used by Bezier to segments approximation, if the Bezier curve is not supported and needs a curve to polyline conversion. aFilterValue = 0 means no filtering. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 188 of file graphics_abstraction_layer.h.
Referenced by KIGFX::PCB_PAINTER::draw().
|
inlinevirtual |
Reimplemented in KIGFX::CAIRO_GAL_BASE, and KIGFX::OPENGL_GAL.
Definition at line 932 of file graphics_abstraction_layer.h.
Referenced by SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), and EDA_DRAW_PANEL_GAL::DoRePaint().
|
inlinevirtual |
Draw the stored group.
aGroupNumber | is the group number. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 541 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::draw().
|
inlinevirtual |
Draw a line.
Start and end points are defined as 2D-Vectors.
aStartPoint | is the start point of the line. |
aEndPoint | is the end point of the line. |
Reimplemented in BASIC_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 96 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), drawBacksideTicks(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), ROUTER_PREVIEW_ITEM::drawLineChain(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), KIGFX::PREVIEW::CENTRELINE_RECT_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::STROKE_FONT::drawSingleLineText(), drawTicksAlongLine(), KIGFX::VIEW_OVERLAY::COMMAND_LINE::Execute(), screenSpaceLine(), KIGFX::SCH_PAINTER::triLine(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inlinevirtual |
Draw a polygon.
aPointList | is the list of the polygon points. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 172 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), KIGFX::PREVIEW::CENTRELINE_RECT_ITEM::drawPreviewShape(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::VIEW_OVERLAY::COMMAND_POLYGON::Execute(), KIGFX::VIEW_OVERLAY::COMMAND_POLY_POLYGON::Execute(), and KIGFX::VIEW_OVERLAY::COMMAND_POINT_POLYGON::Execute().
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 173 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 174 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 175 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Draw a polyline.
aPointList | is a list of 2D-Vectors containing the polyline points. |
Reimplemented in KIGFX::OPENGL_GAL, BASIC_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 115 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), and KIGFX::STROKE_FONT::drawSingleLineText().
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, BASIC_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 116 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 117 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Draw a rectangle.
aStartPoint | is the start point of the rectangle. |
aEndPoint | is the end point of the rectangle. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 165 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::VIEW_OVERLAY::COMMAND_RECTANGLE::Execute(), BRIGHT_BOX::ViewDraw(), and KIGFX::PREVIEW::SELECTION_AREA::ViewDraw().
|
inlinevirtual |
Draw a rounded segment.
Start and end points are defined as 2D-Vectors.
aStartPoint | is the start point of the segment. |
aEndPoint | is the end point of the segment. |
aWidth | is a width of the segment |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 107 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), and ROUTER_PREVIEW_ITEM::drawShape().
|
inlinevirtual |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 1027 of file graphics_abstraction_layer.h.
|
inlineprotectedvirtual |
End the drawing, needs to be called for every new frame.
Private: use GAL_DRAWING_CONTEXT RAII object
Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 1057 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_DRAWING_CONTEXT::~GAL_DRAWING_CONTEXT().
|
inlinevirtual |
End the group.
Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 534 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW::updateItemGeometry().
|
inlineprotectedvirtual |
Disable item update mode.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1049 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_UPDATE_CONTEXT::~GAL_UPDATE_CONTEXT().
|
inlinevirtual |
Force all remaining objects to be drawn.
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 214 of file graphics_abstraction_layer.h.
|
inline |
|
protected |
Get the actual cursor color to draw.
Definition at line 242 of file graphics_abstraction_layer.cpp.
References color, cursorColor, and isCursorEnabled.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), and KIGFX::OPENGL_GAL::blitCursor().
|
inline |
Get the fill color.
Definition at line 272 of file graphics_abstraction_layer.h.
References fillColor.
|
inline |
Definition at line 415 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_glyphSize, and textProperties.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::STROKE_FONT::computeOverbarVerticalPosition(), KIGFX::STROKE_FONT::computeTextLineSize(), KIGFX::STROKE_FONT::computeUnderlineVerticalPosition(), KIGFX::STROKE_FONT::Draw(), KIGFX::STROKE_FONT::drawSingleLineText(), and KIGFX::PREVIEW::SetConstantGlyphHeight().
|
inline |
Get the grid line width.
Definition at line 926 of file graphics_abstraction_layer.h.
References gridLineWidth.
|
inline |
Definition at line 851 of file graphics_abstraction_layer.h.
References gridOrigin.
Referenced by GRID_HELPER::GetOrigin().
For a given point it returns the nearest point belonging to the grid in world coordinates.
aPoint | is the point for which the grid point is searched. |
Definition at line 220 of file graphics_abstraction_layer.cpp.
References gridOffset, gridSize, KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition().
|
inline |
Return the grid size.
Definition at line 878 of file graphics_abstraction_layer.h.
References gridSize.
Referenced by COMMON_TOOLS::CursorControl(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), GRID_HELPER::GetGrid(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_DRAW_FRAME::GetNearestHalfGridPosition(), EE_SELECTION_TOOL::GetNode(), COMMON_TOOLS::PanControl(), and EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Definition at line 830 of file graphics_abstraction_layer.h.
References KIGFX::ALWAYS, gridVisibility, KIGFX::GAL_DISPLAY_OPTIONS::m_gridSnapping, options, and KIGFX::WITH_GRID.
Referenced by GRID_HELPER::canUseGrid(), KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
|
inline |
Definition at line 828 of file graphics_abstraction_layer.h.
References gridVisibility.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Return current text horizontal justification setting.
Definition at line 457 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_horizontalJustify, and textProperties.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::STROKE_FONT::drawSingleLineText().
|
inline |
Get the line width.
Definition at line 312 of file graphics_abstraction_layer.h.
References lineWidth.
Referenced by KIGFX::STROKE_FONT::computeTextLineSize(), KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::STROKE_FONT::drawSingleLineText(), and KIGFX::PREVIEW::DrawTextNextToCursor().
|
inline |
Get the look at point.
Definition at line 657 of file graphics_abstraction_layer.h.
References lookAtPoint.
|
inline |
Return the maximum depth in the currently used range (the bottom).
Definition at line 726 of file graphics_abstraction_layer.h.
References depthRange, and VECTOR2< T >::y.
|
inline |
Return the minimum depth in the currently used range (the top).
Definition at line 718 of file graphics_abstraction_layer.h.
References depthRange, and VECTOR2< T >::x.
Referenced by KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inline |
Get the rotation angle.
Definition at line 697 of file graphics_abstraction_layer.h.
References rotation.
|
inline |
Return GAL canvas size in pixels.
Definition at line 208 of file graphics_abstraction_layer.h.
References screenSize.
Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), KIGFX::VIEW::GetScreenPixelSize(), KIGFX::VIEW::GetViewport(), EDA_DRAW_PANEL_GAL::onSize(), KIGFX::VIEW::Redraw(), KIGFX::VIEW::SetCenter(), KIGFX::WX_VIEW_CONTROLS::SetCrossHairCursorPosition(), KIGFX::VIEW::SetViewport(), and KIGFX::WX_VIEW_CONTROLS::WarpCursor().
|
inline |
Get the screen <-> world transformation matrix.
Definition at line 593 of file graphics_abstraction_layer.h.
References screenWorldMatrix.
Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::getShadowWidth(), KIGFX::OPENGL_GAL::getWorldPixelSize(), screenSpaceCircle(), screenSpaceLine(), and KIGFX::VIEW::ToWorld().
|
inline |
Get the stroke color.
Definition at line 292 of file graphics_abstraction_layer.h.
References strokeColor.
Referenced by KIGFX::PREVIEW::DrawTextNextToCursor(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inline |
Definition at line 334 of file graphics_abstraction_layer.h.
References strokeFont.
Referenced by EDA_TEXT::GetTextBox().
|
inlinevirtual |
Get the currently used target for rendering.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 785 of file graphics_abstraction_layer.h.
References KIGFX::TARGET_CACHED.
Compute the X and Y size of a given text.
The text is expected to be a only one line text.
aText | is the text string (one line). |
Definition at line 174 of file graphics_abstraction_layer.cpp.
References KIGFX::STROKE_FONT::computeTextLineSize(), and strokeFont.
Referenced by GraphicTextWidth(), and EDA_TEXT::LenSize().
|
inline |
Returns current text vertical justification setting.
Definition at line 475 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_verticalJustify, and textProperties.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::STROKE_FONT::Draw().
|
inline |
Get the world scale.
Definition at line 736 of file graphics_abstraction_layer.h.
References worldScale.
Referenced by PCB_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestDragOrigin(), PCB_GRID_HELPER::BestSnapAnchor(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), KIGFX::PREVIEW::SetConstantGlyphHeight(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inline |
Get the world <-> screen transformation matrix.
Definition at line 583 of file graphics_abstraction_layer.h.
References worldScreenMatrix.
Referenced by KIGFX::VIEW::ToScreen().
|
inline |
Get the zoom factor.
Definition at line 677 of file graphics_abstraction_layer.h.
References zoomFactor.
Referenced by COMMON_TOOLS::doZoomInOut(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), EDA_DRAW_FRAME::OnUpdateSelectZoom(), ZOOM_MENU::update(), and EDA_DRAW_FRAME::UpdateZoomSelectBox().
|
inlinevirtual |
Return true if the target exists.
aTarget | is the target to be checked. |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 799 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().
|
inlinevirtual |
Return true if the GAL engine is a Cairo based type.
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 79 of file graphics_abstraction_layer.h.
Referenced by getShadowLayer().
|
inlinevirtual |
Checks the state of the context lock.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1033 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_PANEL_GAL::onSize().
|
inline |
Return information about cursor visibility.
Definition at line 979 of file graphics_abstraction_layer.h.
References forceDisplayCursor, and isCursorEnabled.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), and KIGFX::OPENGL_GAL::blitCursor().
|
inline |
Return true if flip flag for the X axis is set.
Definition at line 756 of file graphics_abstraction_layer.h.
References globalFlipX.
Referenced by KIGFX::CAIRO_GAL_BASE::angle_xform(), KIGFX::CAIRO_GAL_BASE::arc_angles_xform_and_normalize(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inline |
Return true if flip flag for the Y axis is set.
Definition at line 764 of file graphics_abstraction_layer.h.
References globalFlipY.
|
inline |
Definition at line 423 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_bold, and textProperties.
Referenced by KIGFX::STROKE_FONT::Draw().
|
inline |
Definition at line 431 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_italic, and textProperties.
Referenced by KIGFX::STROKE_FONT::ComputeStringBoundaryLimits(), and KIGFX::STROKE_FONT::drawSingleLineText().
|
inline |
Definition at line 434 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_underlined, and textProperties.
Referenced by KIGFX::STROKE_FONT::drawSingleLineText().
|
inlinevirtual |
Return the initialization status for the canvas.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 73 of file graphics_abstraction_layer.h.
Referenced by SCH_DRAW_PANEL::onPaint(), and EDA_DRAW_PANEL_GAL::onRefreshTimer().
|
inlinevirtual |
Return true if the GAL engine is a OpenGL based type.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 82 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_PAINTER::draw().
|
inline |
Definition at line 442 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, and textProperties.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::STROKE_FONT::drawSingleLineText().
|
inlinevirtual |
Return true if the GAL canvas is visible on the screen.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 76 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), SCH_DRAW_PANEL::onPaint(), EDA_DRAW_PANEL_GAL::onShowTimer(), KIGFX::VIEW::UpdateAllLayersColor(), KIGFX::VIEW::UpdateAllLayersOrder(), KIGFX::VIEW::UpdateItems(), and KIGFX::VIEW::UpdateLayerColor().
|
inlineprotectedvirtual |
Use GAL_CONTEXT_LOCKER RAII object.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1040 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_CONTEXT_LOCKER::GAL_CONTEXT_LOCKER().
|
overrideprotectedvirtual |
Handler for observer settings changes.
Implements KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER.
Definition at line 92 of file graphics_abstraction_layer.cpp.
References updatedGalDisplayOptions().
|
inline |
Restore previously stored drawing depth for the depth stack.
Definition at line 1021 of file graphics_abstraction_layer.h.
References depthStack, and layerDepth.
Referenced by KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::VIEW_GROUP::ViewDraw().
|
inline |
Store current drawing depth on the depth stack.
Definition at line 1013 of file graphics_abstraction_layer.h.
References depthStack, and layerDepth.
Referenced by KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::VIEW_GROUP::ViewDraw().
void GAL::ResetTextAttributes | ( | ) |
Reset text attributes to default styling.
Normally, custom attributes will be set individually after this, otherwise you can use SetTextAttributes()
Definition at line 158 of file graphics_abstraction_layer.cpp.
References GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().
Referenced by KIGFX::PCB_PAINTER::draw(), GAL(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), and KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().
|
inlinevirtual |
Resize the canvas.
Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 202 of file graphics_abstraction_layer.h.
Referenced by EDA_DRAW_FRAME::OnMove(), EDA_DRAW_PANEL_GAL::onSize(), and EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inlinevirtual |
Restore the context.
Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.
Definition at line 517 of file graphics_abstraction_layer.h.
Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::STROKE_FONT::drawSingleLineText(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inlinevirtual |
Rotate the context.
aAngle | is the rotation angle in radians. |
Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.
Definition at line 497 of file graphics_abstraction_layer.h.
Referenced by KIGFX::STROKE_FONT::Draw(), and KIGFX::PCB_PAINTER::draw().
|
inlinevirtual |
Save the context.
Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.
Definition at line 514 of file graphics_abstraction_layer.h.
Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::STROKE_FONT::drawSingleLineText(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inlinevirtual |
Scale the context.
aScale | is the scale factor for the x- and y-axis. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 511 of file graphics_abstraction_layer.h.
Referenced by KIGFX::SCH_PAINTER::draw(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inline |
Set the axes color.
aAxesColor | is the color to draw the axes if enabled. |
Definition at line 898 of file graphics_abstraction_layer.h.
References axesColor.
Referenced by KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), KIGFX::OPENGL_GAL::OPENGL_GAL(), SYMBOL_EDIT_FRAME::SwitchCanvas(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), and PCB_DRAW_PANEL_GAL::UpdateColors().
|
inline |
Enable drawing the axes.
Definition at line 906 of file graphics_abstraction_layer.h.
References axesEnabled.
Referenced by FOOTPRINT_EDIT_FRAME::ActivateGalCanvas(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GAL(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), SYMBOL_EDIT_FRAME::SwitchCanvas(), FOOTPRINT_EDIT_FRAME::SwitchCanvas(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().
|
inline |
Definition at line 216 of file graphics_abstraction_layer.h.
References m_clearColor.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), and PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview().
|
inline |
Draw every tick line wider.
aInterval | increase the width of every aInterval line, if 0 do not use this feature. |
Definition at line 916 of file graphics_abstraction_layer.h.
References gridTick.
Referenced by GAL().
|
inline |
Set the cursor color.
aCursorColor | is the color of the cursor. |
Definition at line 989 of file graphics_abstraction_layer.h.
References cursorColor.
Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), GAL(), and PCB_DRAW_PANEL_GAL::UpdateColors().
|
inline |
Enable/disable cursor.
aCursorEnabled | is true if the cursor should be drawn, else false. |
Definition at line 969 of file graphics_abstraction_layer.h.
References isCursorEnabled.
Referenced by GAL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and KIGFX::VIEW_CONTROLS::ShowCursor().
|
inline |
Set the range of the layer depth.
Usually required for the OpenGL implementation, any object outside this range is not drawn.
aDepthRange | is the depth range where component x is the near clipping plane and y is the far clipping plane. |
Definition at line 710 of file graphics_abstraction_layer.h.
References depthRange.
Referenced by GAL().
|
inlinevirtual |
Set the fill color.
aColor | is the color for filling. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 262 of file graphics_abstraction_layer.h.
References fillColor.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), GAL(), KIGFX::SCH_PAINTER::setDeviceColors(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inline |
Sets flipping of the screen.
xAxis | is the flip flag for the X axis. |
yAxis | is the flip flag for the Y axis. |
Definition at line 747 of file graphics_abstraction_layer.h.
References globalFlipX, and globalFlipY.
Referenced by GAL(), KIGFX::VIEW::SetMirror(), and BOARD_PRINTOUT::setupGal().
|
inline |
Set bold property of current font.
aBold | tells if the font should be bold or not. |
Definition at line 422 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_bold, and textProperties.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), GraphicTextWidth(), EDA_TEXT::LenSize(), ResetTextAttributes(), and SetTextAttributes().
|
inline |
Set italic property of current font.
aItalic | tells if the font should be italic or not. |
Definition at line 430 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_italic, and textProperties.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), GraphicTextWidth(), EDA_TEXT::LenSize(), ResetTextAttributes(), and SetTextAttributes().
|
inline |
Definition at line 433 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_underlined, and textProperties.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), EDA_TEXT::LenSize(), ResetTextAttributes(), and SetTextAttributes().
|
inline |
Set the font glyph size.
aGlyphSize | is the new font glyph size. |
Definition at line 414 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_glyphSize, and textProperties.
Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::VIEW_OVERLAY::COMMAND_GLYPH_SIZE::Execute(), GraphicTextWidth(), EDA_TEXT::LenSize(), ResetTextAttributes(), KIGFX::PREVIEW::SetConstantGlyphHeight(), and SetTextAttributes().
|
inline |
Set the grid color.
aGridColor | is the grid color, it should have a low alpha value for the best effect. |
Definition at line 888 of file graphics_abstraction_layer.h.
References gridColor.
Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::OPENGL_GAL::OPENGL_GAL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), GERBVIEW_FRAME::SetGridColor(), and PCB_DRAW_PANEL_GAL::UpdateColors().
|
inline |
Set the origin point for the grid.
aGridOrigin | is a vector containing the grid origin point, in world coordinates. |
Definition at line 840 of file graphics_abstraction_layer.h.
References gridOffset, gridOrigin, gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_CONTROL::DoSetGridOrigin(), and PCB_BASE_EDIT_FRAME::SetBoard().
|
inline |
Set the grid size.
aGridSize | is a vector containing the grid size in x and y direction. |
Definition at line 861 of file graphics_abstraction_layer.h.
References gridOffset, gridOrigin, gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by COMMON_TOOLS::OnGridChanged(), DIALOG_PAD_PROPERTIES::prepareCanvas(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Set the visibility setting of the grid.
aVisibility | is the new visibility setting of the grid. |
Definition at line 826 of file graphics_abstraction_layer.h.
References gridVisibility.
Referenced by GAL(), COMMON_TOOLS::OnGridChanged(), GERBER_LAYER_WIDGET::OnRenderEnable(), DIALOG_PAD_PROPERTIES::prepareCanvas(), EDA_DRAW_FRAME::SetGridVisibility(), EDA_DRAW_PANEL_GAL::SwitchBackend(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().
|
inline |
Set the horizontal justify for text drawing.
aHorizontalJustify | is the horizontal justify value. |
Definition at line 449 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_horizontalJustify, and textProperties.
Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), ResetTextAttributes(), and SetTextAttributes().
|
inlinevirtual |
Enable/disable fill.
aIsFillEnabled | is true, when the graphics objects should be filled, else false. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 242 of file graphics_abstraction_layer.h.
References isFillEnabled.
Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), ROUTER_PREVIEW_ITEM::drawLineChain(), KIGFX::SCH_PAINTER::drawPinDanglingSymbol(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), KIGFX::VIEW_OVERLAY::COMMAND_SET_FILL::Execute(), KIGFX::SCH_PAINTER::fillIfSelection(), GAL(), GRText(), KIGFX::SCH_PAINTER::setDeviceColors(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), BRIGHT_BOX::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlinevirtual |
Enable/disable stroked outlines.
aIsStrokeEnabled | is true, if the outline of an object should be stroked. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 252 of file graphics_abstraction_layer.h.
References isStrokeEnabled.
Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), KIGFX::SCH_PAINTER::drawPinDanglingSymbol(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::VIEW_OVERLAY::COMMAND_SET_STROKE::Execute(), GAL(), KIGFX::SCH_PAINTER::setDeviceColors(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), PCB_BRIGHT_BOX::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), BRIGHT_BOX::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlinevirtual |
Set the depth of the layer (position on the z-axis)
aLayerDepth | the layer depth for the objects. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 322 of file graphics_abstraction_layer.h.
References depthRange, layerDepth, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::VIEW::draw(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), GAL(), KIGFX::VIEW::redrawRect(), KIGFX::CAIRO_GAL_BASE::SetLayerDepth(), KIGFX::VIEW::updateItemGeometry(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlinevirtual |
Set the line width.
aLineWidth | is the line width. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 302 of file graphics_abstraction_layer.h.
References lineWidth.
Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::OPENGL_GAL::DrawArcSegment(), drawBacksideTicks(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::SCH_PAINTER::drawDanglingSymbol(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), KIGFX::SCH_PAINTER::drawPinDanglingSymbol(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::OPENGL_GAL::DrawSegment(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), KIGFX::VIEW_OVERLAY::COMMAND_SET_WIDTH::Execute(), GAL(), GRText(), EDA_TEXT::LenSize(), screenSpaceCircle(), screenSpaceLine(), KIGFX::SCH_PAINTER::setDeviceColors(), KIGFX::CAIRO_GAL_BASE::SetLineWidth(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), BRIGHT_BOX::ViewDraw(), and KIGFX::PREVIEW::SELECTION_AREA::ViewDraw().
|
inline |
Set the Point in world space to look at.
This point corresponds with the center of the actual drawing area.
aPoint | is the look at point (center of the actual drawing area). |
Definition at line 647 of file graphics_abstraction_layer.h.
References lookAtPoint.
Referenced by GAL(), and KIGFX::VIEW::SetCenter().
|
inlinevirtual |
Set negative draw mode in the renderer.
When negative mode is enabled, drawn items will subtract from previously drawn items. This is mainly needed for Gerber negative item support in Cairo, since unlike in OpenGL, objects drawn with zero opacity on top of other objects would not normally mask objects in Cairo. This method is a no-op in OpenGL.
aSetting | is true if negative mode should be enabled |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 815 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GERBVIEW_PAINTER::draw().
|
inline |
Set the rotation angle.
aRotation | is the new rotation angle (radians). |
Definition at line 687 of file graphics_abstraction_layer.h.
References rotation.
Referenced by GAL().
|
inline |
Set the dots per inch of the screen.
This value depends on the user screen, it should be configurable by the application. For instance a typical notebook with HD+ resolution (1600x900) has 106 DPI.
aScreenDPI | are the screen DPI. |
Definition at line 635 of file graphics_abstraction_layer.h.
References screenDPI.
Referenced by KIGFX::CAIRO_PRINT_GAL::CAIRO_PRINT_GAL(), and GAL().
|
inline |
Definition at line 622 of file graphics_abstraction_layer.h.
References screenSize.
Referenced by KIGFX::CAIRO_PRINT_GAL::SetSheetSize().
|
inlinevirtual |
Set the stroke color.
aColor | is the color for stroking the outline. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 282 of file graphics_abstraction_layer.h.
References strokeColor.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), GAL(), KIGFX::SCH_PAINTER::setDeviceColors(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), BRIGHT_BOX::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlinevirtual |
Set the target for rendering.
aTarget | is the new target for rendering. |
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 778 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::VIEW::redrawRect(), KIGFX::VIEW::updateItemGeometry(), and MY_DRAWING::ViewDraw().
|
virtual |
Loads attributes of the given text (bold/italic/underline/mirrored and so on).
aText | is the text item. |
Definition at line 146 of file graphics_abstraction_layer.cpp.
References EDA_TEXT::GetHorizJustify(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), EDA_TEXT::IsBold(), EDA_TEXT::IsItalic(), EDA_TEXT::IsMirrored(), SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), and GRText().
|
inline |
Set a mirrored property of text.
aMirrored | tells if the text should be mirrored or not. |
Definition at line 441 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, and textProperties.
Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), ResetTextAttributes(), SetTextAttributes(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inline |
Set the vertical justify for text drawing.
aVerticalJustify | is the vertical justify value. |
Definition at line 467 of file graphics_abstraction_layer.h.
References KIGFX::GAL::TEXT_PROPERTIES::m_verticalJustify, and textProperties.
Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), ResetTextAttributes(), and SetTextAttributes().
|
inline |
Set the world <-> screen transformation matrix.
aMatrix | is the 3x3 world <-> screen transformation matrix. |
Definition at line 603 of file graphics_abstraction_layer.h.
References worldScreenMatrix.
|
inline |
Set the unit length.
This defines the length [inch] per one integer. For instance a value 0.001 means that the coordinate [1000, 1000] corresponds with a point at (1 inch, 1 inch) or 1 mil resolution per integer.
aWorldUnitLength | is the world Unit length. |
Definition at line 617 of file graphics_abstraction_layer.h.
References worldUnitLength.
Referenced by GAL(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), GERBVIEW_PRINTOUT::setupGal(), PCBNEW_PRINTOUT::setupGal(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), PL_DRAW_PANEL_GAL::SwitchBackend(), SCH_DRAW_PANEL::SwitchBackend(), and PCB_DRAW_PANEL_GAL::SwitchBackend().
|
inline |
Set the zoom factor of the scene.
aZoomFactor | is the zoom factor. |
Definition at line 667 of file graphics_abstraction_layer.h.
References zoomFactor.
Referenced by GAL(), and KIGFX::VIEW::SetScale().
|
inlinevirtual |
Show/hide the GAL canvas.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 205 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Draw a vector type text using preloaded Newstroke font.
aText | is the text to be drawn. |
aPosition | is the text position in world coordinates. |
aRotationAngle | is the text rotation angle. |
Definition at line 346 of file graphics_abstraction_layer.h.
References KIGFX::STROKE_FONT::Draw(), and strokeFont.
Referenced by BitmapText(), KIGFX::SCH_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), GRText(), and KIGFX::SCH_PAINTER::strokeText().
Compute the point position in screen coordinates from given world coordinates.
aPoint | the pointposition in world coordinates. |
Definition at line 959 of file graphics_abstraction_layer.h.
References worldScreenMatrix.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor().
Compute the point position in world coordinates from given screen coordinates.
aPoint | the pointposition in screen coordinates. |
Definition at line 948 of file graphics_abstraction_layer.h.
References screenWorldMatrix.
|
inlinevirtual |
Transform the context.
aTransformation | is the transformation matrix. |
Reimplemented in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.
Definition at line 490 of file graphics_abstraction_layer.h.
|
inlinevirtual |
Translate the context.
aTranslation | is the translation vector. |
Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.
Definition at line 504 of file graphics_abstraction_layer.h.
Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::STROKE_FONT::drawSingleLineText(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inlineprotectedvirtual |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1042 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_CONTEXT_LOCKER::~GAL_CONTEXT_LOCKER().
|
protectedvirtual |
Handle updating display options.
Derived classes should call up to this to set base-class methods.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 101 of file graphics_abstraction_layer.cpp.
References axesEnabled, forceDisplayCursor, fullscreenCursor, gridLineWidth, gridMinSpacing, gridStyle, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth, KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing, KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle, and options.
Referenced by OnGalDisplayOptionsChanged(), KIGFX::OPENGL_GAL::updatedGalDisplayOptions(), and KIGFX::CAIRO_GAL::updatedGalDisplayOptions().
|
friend |
Definition at line 63 of file graphics_abstraction_layer.h.
|
friend |
Definition at line 65 of file graphics_abstraction_layer.h.
|
friend |
Definition at line 64 of file graphics_abstraction_layer.h.
|
protected |
Color of the axes.
Definition at line 1140 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::DrawGrid(), and SetAxesColor().
|
protected |
Should the axes be drawn.
Definition at line 1141 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), SetAxesEnabled(), and updatedGalDisplayOptions().
|
protected |
Cursor color.
Definition at line 1150 of file graphics_abstraction_layer.h.
Referenced by getCursorColor(), and SetCursorColor().
|
protected |
Current cursor position (world coordinates)
Definition at line 1152 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), KIGFX::CAIRO_GAL_BASE::DrawCursor(), and KIGFX::OPENGL_GAL::DrawCursor().
|
protected |
Range of the depth.
Definition at line 1131 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GetMaxDepth(), GetMinDepth(), SetDepthRange(), and SetLayerDepth().
|
protected |
Stored depth values.
Definition at line 1105 of file graphics_abstraction_layer.h.
Referenced by PopDepth(), and PushDepth().
|
protected |
The fill color.
Definition at line 1126 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetFillColor(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), SetFillColor(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protected |
Always show cursor.
Definition at line 1149 of file graphics_abstraction_layer.h.
Referenced by GAL(), IsCursorEnabled(), and updatedGalDisplayOptions().
|
protected |
Shape of the cursor (fullscreen or small cross)
Definition at line 1151 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), GAL(), and updatedGalDisplayOptions().
|
protected |
Flag for X axis flipping.
Definition at line 1118 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), BitmapText(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), IsFlippedX(), and SetFlip().
|
protected |
Flag for Y axis flipping.
Definition at line 1119 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), IsFlippedY(), and SetFlip().
|
staticprotected |
Depth level on which the grid is drawn.
Definition at line 1077 of file graphics_abstraction_layer.h.
|
protected |
Color of the grid.
Definition at line 1139 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCross(), KIGFX::CAIRO_GAL_BASE::drawGridLine(), KIGFX::CAIRO_GAL_BASE::drawGridPoint(), and SetGridColor().
|
protected |
Line width of the grid.
Definition at line 1143 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GAL(), GetGridLineWidth(), and updatedGalDisplayOptions().
|
protected |
Minimum screen size of the grid (pixels) below which the grid is not drawn.
Definition at line 1144 of file graphics_abstraction_layer.h.
Referenced by computeMinGridSpacing(), GAL(), and updatedGalDisplayOptions().
|
protected |
The grid offset to compensate cursor position.
Definition at line 1138 of file graphics_abstraction_layer.h.
Referenced by GetGridPoint(), SetGridOrigin(), and SetGridSize().
|
protected |
The grid origin.
Definition at line 1137 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GetGridOrigin(), SetGridOrigin(), and SetGridSize().
|
protected |
The grid size.
Definition at line 1136 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GetGridPoint(), GetGridSize(), SetGridOrigin(), and SetGridSize().
|
protected |
Grid display style.
Definition at line 1135 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GAL(), and updatedGalDisplayOptions().
|
protected |
Every tick line gets the double width.
Definition at line 1142 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), and SetCoarseGrid().
|
protected |
Should the grid be shown.
Definition at line 1134 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GetGridSnapping(), GetGridVisibility(), and SetGridVisibility().
|
protected |
Is the cursor enabled?
Definition at line 1148 of file graphics_abstraction_layer.h.
Referenced by getCursorColor(), IsCursorEnabled(), and SetCursorEnabled().
|
protected |
Is filling of graphic objects enabled ?
Definition at line 1123 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), KIGFX::CAIRO_GAL_BASE::SetIsFill(), SetIsFill(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protected |
Are the outlines stroked ?
Definition at line 1124 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), KIGFX::CAIRO_GAL_BASE::roundp(), KIGFX::CAIRO_GAL_BASE::SetIsStroke(), SetIsStroke(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protected |
The actual layer depth.
Definition at line 1130 of file graphics_abstraction_layer.h.
Referenced by AdvanceDepth(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::drawFilledSemiCircle(), KIGFX::OPENGL_GAL::drawLineQuad(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::OPENGL_GAL::drawStrokedSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), PopDepth(), PushDepth(), and SetLayerDepth().
|
protected |
The line width.
Definition at line 1121 of file graphics_abstraction_layer.h.
Referenced by BitmapText(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::drawLineQuad(), KIGFX::OPENGL_GAL::drawStrokedSemiCircle(), GetLineWidth(), KIGFX::CAIRO_GAL_BASE::resetContext(), KIGFX::CAIRO_GAL_BASE::SetLineWidth(), SetLineWidth(), and KIGFX::CAIRO_GAL_BASE::syncLineWidth().
|
protected |
Point to be looked at in world space.
Definition at line 1110 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), GetLookAtPoint(), and SetLookAtPoint().
|
protected |
Definition at line 1128 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_PRINT_GAL::CAIRO_PRINT_GAL(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::OPENGL_GAL::ClearTarget(), GetClearColor(), and SetClearColor().
|
staticprotected |
Definition at line 1074 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
staticprotected |
Possible depth range.
Definition at line 1073 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
protected |
Definition at line 1103 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
protected |
Definition at line 1102 of file graphics_abstraction_layer.h.
Referenced by GAL(), GetGridSnapping(), KIGFX::OPENGL_GAL::OPENGL_GAL(), KIGFX::CAIRO_GAL::setCompositor(), KIGFX::OPENGL_GAL::updatedGalDisplayOptions(), KIGFX::CAIRO_GAL::updatedGalDisplayOptions(), and updatedGalDisplayOptions().
|
protected |
Rotation transformation (radians)
Definition at line 1113 of file graphics_abstraction_layer.h.
Referenced by ComputeWorldScreenMatrix(), GetRotation(), and SetRotation().
|
protected |
The dots per inch of the screen.
Definition at line 1109 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), SetScreenDPI(), and KIGFX::CAIRO_PRINT_GAL::SetSheetSize().
|
protected |
Screen size in screen coordinates.
Definition at line 1106 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL::allocateBitmaps(), KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::CAIRO_GAL::CAIRO_GAL(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::CAIRO_GAL::endDrawing(), GetScreenPixelSize(), KIGFX::OPENGL_GAL::getScreenPixelSize(), KIGFX::CAIRO_GAL::initSurface(), KIGFX::OPENGL_GAL::OPENGL_GAL(), KIGFX::CAIRO_GAL_BASE::ResizeScreen(), KIGFX::OPENGL_GAL::ResizeScreen(), KIGFX::CAIRO_GAL::setCompositor(), and SetScreenSize().
|
protected |
Screen transformation.
Definition at line 1115 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), GetScreenWorldMatrix(), and ToWorld().
|
protected |
The color of the outlines.
Definition at line 1127 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::OPENGL_GAL::drawBitmapOverbar(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetStrokeColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), SetStrokeColor(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protected |
Instance of object that stores information about how to draw texts.
Definition at line 1155 of file graphics_abstraction_layer.h.
Referenced by GAL(), GetStrokeFont(), GetTextLineSize(), and StrokeText().
|
private |
|
protected |
The scale factor world->screen.
Definition at line 1116 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::blitCursor(), computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), and GetWorldScale().
|
protected |
World transformation.
Definition at line 1114 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), GetWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::resetContext(), SetWorldScreenMatrix(), and ToScreen().
|
protected |
The unit length of the world coordinates [inch].
Definition at line 1108 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::DrawBitmap(), KIGFX::OPENGL_GAL::DrawBitmap(), and SetWorldUnitLength().
|
protected |
The zoom factor.
Definition at line 1112 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), GetZoomFactor(), and SetZoomFactor().