KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::CAIRO_GAL Class Reference

#include <cairo_gal.h>

Inheritance diagram for KIGFX::CAIRO_GAL:
KIGFX::CAIRO_GAL_BASE KIGFX::GAL KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER

Public Member Functions

 CAIRO_GAL (GAL_DISPLAY_OPTIONS &aDisplayOptions, wxWindow *aParent, wxEvtHandler *aMouseListener=nullptr, wxEvtHandler *aPaintListener=nullptr, const wxString &aName=wxT("CairoCanvas"))
 
 ~CAIRO_GAL ()
 
bool IsVisible () const override
 Return true if the GAL canvas is visible on the screen.
 
void ResizeScreen (int aWidth, int aHeight) override
 Resize the canvas.
 
void SetOverlayExclusions (const std::vector< wxRect > &aRects)
 Set areas, in canvas coordinates, that the frame blit must leave alone.
 
bool Show (bool aShow) override
 Show/hide the GAL canvas.
 
int BeginGroup () override
 Begin a group.
 
void EndGroup () override
 End the group.
 
void SetTarget (RENDER_TARGET aTarget) override
 Set the target for rendering.
 
RENDER_TARGET GetTarget () const override
 Get the currently used target for rendering.
 
void ClearTarget (RENDER_TARGET aTarget) override
 Clear the target for rendering.
 
void StartDiffLayer () override
 Begins rendering of a differential layer.
 
void EndDiffLayer () override
 Ends rendering of a differential layer.
 
void StartNegativesLayer () override
 Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer().
 
void EndNegativesLayer () override
 Ends rendering of a negatives layer and draws it to the main layer.
 
void PostPaint (wxPaintEvent &aEvent)
 Post an event to m_paint_listener.
 
void SetMouseListener (wxEvtHandler *aMouseListener)
 
void SetPaintListener (wxEvtHandler *aPaintListener)
 
bool SetNativeCursorStyle (KICURSOR aCursor, bool aHiDPI) override
 Set the cursor in the native panel.
 
void BeginDrawing () override
 Start/end drawing functions, draw calls can be only made in between the calls to BeginDrawing()/EndDrawing().
 
void EndDrawing () override
 End the drawing, needs to be called for every new frame.
 
void initSurface ()
 Prepare Cairo surfaces for drawing.
 
void deinitSurface ()
 Destroy Cairo surfaces when are not needed anymore.
 
void allocateBitmaps ()
 Allocate the bitmaps for drawing.
 
void deleteBitmaps ()
 Allocate the bitmaps for drawing.
 
void setCompositor ()
 Prepare the compositor.
 
void onPaint (wxPaintEvent &aEvent)
 Paint event handler.
 
void skipMouseEvent (wxMouseEvent &aEvent)
 Mouse event handler, forwards the event to the child.
 
void skipGestureEvent (wxGestureEvent &aEvent)
 Skip the gesture event to the parent.
 
void onSetNativeCursor (wxSetCursorEvent &aEvent)
 Give the correct cursor image when the native widget asks for it.
 
bool updatedGalDisplayOptions (const GAL_DISPLAY_OPTIONS &aOptions) override
 Cairo-specific update handlers.
 
bool IsCairoEngine () override
 Return true if the GAL engine is a Cairo based type.
 
void DrawLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
 Draw a line.
 
void DrawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override
 Draw a rounded segment.
 
void DrawCircle (const VECTOR2D &aCenterPoint, double aRadius) override
 Draw a circle using world coordinates.
 
void DrawHoleWall (const VECTOR2D &aCenterPoint, double aHoleRadius, double aWallWidth) override
 Draw a hole wall ring.
 
void DrawArc (const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle) override
 Draw an arc.
 
void DrawArcSegment (const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aWidth, double aMaxError) override
 Draw an arc segment.
 
void DrawEllipse (const VECTOR2D &aCenterPoint, double aMajorRadius, double aMinorRadius, const EDA_ANGLE &aRotation) override
 Draw a closed ellipse.
 
void DrawEllipseArc (const VECTOR2D &aCenterPoint, double aMajorRadius, double aMinorRadius, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle) override
 Draw an elliptical arc in world coordinates.
 
void DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
 Draw a rectangle.
 
void DrawRectangle (const BOX2I &aRect)
 
void DrawSegmentChain (const std::vector< VECTOR2D > &aPointList, double aWidth) override
 Draw a chain of rounded segments.
 
void DrawSegmentChain (const SHAPE_LINE_CHAIN &aLineChain, double aWidth) override
 
void DrawPolyline (const std::deque< VECTOR2D > &aPointList) override
 Draw a polyline.
 
void DrawPolyline (const VECTOR2D aPointList[], int aListSize) override
 
void DrawPolyline (const SHAPE_LINE_CHAIN &aLineChain) override
 
virtual void DrawPolyline (const std::vector< VECTOR2D > &aPointList)
 
void DrawPolylines (const std::vector< std::vector< VECTOR2D > > &aPointLists) override
 Draw multiple polylines.
 
void DrawPolygon (const std::deque< VECTOR2D > &aPointList) override
 Draw a polygon.
 
void DrawPolygon (const VECTOR2D aPointList[], int aListSize) override
 
void DrawPolygon (const SHAPE_POLY_SET &aPolySet, bool aStrokeTriangulation=false) override
 
void DrawPolygon (const SHAPE_LINE_CHAIN &aPolySet) override
 
void DrawGlyph (const KIFONT::GLYPH &aPolySet, int aNth, int aTotal) override
 Draw a polygon representing a font glyph.
 
void DrawGlyphs (const std::vector< std::unique_ptr< KIFONT::GLYPH > > &aGlyphs) override
 Draw polygons representing font glyphs.
 
void DrawCurve (const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0) override
 Draw a cubic bezier spline.
 
void DrawBitmap (const BITMAP_BASE &aBitmap, double alphaBlend=1.0) override
 Draw a bitmap image.
 
void Flush () override
 Force all remaining objects to be drawn.
 
void ClearScreen () override
 Clear the screen.
 
void SetIsFill (bool aIsFillEnabled) override
 Enable/disable fill.
 
void SetIsStroke (bool aIsStrokeEnabled) override
 Enable/disable stroked outlines.
 
void SetStrokeColor (const COLOR4D &aColor) override
 Set the stroke color.
 
void SetFillColor (const COLOR4D &aColor) override
 Set the fill color.
 
void SetLineWidth (float aLineWidth) override
 Set the line width.
 
void SetLayerDepth (double aLayerDepth) override
 Set the depth of the layer (position on the z-axis)
 
void Transform (const MATRIX3x3D &aTransformation) override
 Transform the context.
 
void Rotate (double aAngle) override
 Rotate the context.
 
void Translate (const VECTOR2D &aTranslation) override
 Translate the context.
 
void Scale (const VECTOR2D &aScale) override
 Scale the context.
 
void Save () override
 Save the context.
 
void Restore () override
 Restore the context.
 
void DrawGroup (int aGroupNumber) override
 Draw the stored group.
 
void ChangeGroupColor (int aGroupNumber, const COLOR4D &aNewColor) override
 Change the color used to draw the group.
 
void ChangeGroupDepth (int aGroupNumber, int aDepth) override
 Change the depth (Z-axis position) of the group.
 
void DeleteGroup (int aGroupNumber) override
 Delete the group from the memory.
 
void ClearCache () override
 Delete all data created during caching of graphic items.
 
void SetNegativeDrawMode (bool aSetting) override
 Set negative draw mode in the renderer.
 
void DrawCursor (const VECTOR2D &aCursorPosition) override
 Draw the cursor.
 
void EnableDepthTest (bool aEnabled=false) override
 
void DrawGrid () override
 Draw the grid.
 
virtual bool IsInitialized () const
 Return the initialization status for the canvas.
 
virtual bool IsOpenGlEngine ()
 Return true if the GAL engine is a OpenGL based type.
 
virtual bool RefillsNonCachedTargets () const
 Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean.
 
virtual bool HasStaticRebuildPending () const
 Return true if the backend dropped its cached geometry and VIEW must draw the cached layers again, even when its own TARGET_CACHED is clean.
 
virtual bool HasRetainedScene () const
 Return true if the backend keeps cached groups in a persistent scene that it patches in place, so one changed item does not make VIEW emit every cached layer again.
 
virtual void BeginSceneLayer (int aLayer)
 Open a cached layer of the retained scene during a rebuild.
 
virtual void SetSceneLayerState (int aLayer, int aOrder, bool aVisible, bool aHasNegatives)
 Describe a cached layer to the retained scene.
 
virtual void SetSceneLayerDim (int aLayer, const COLOR4D &aToward, double aKeep)
 Fade a cached layer towards a colour in the shader, so dimming it recolours none of its groups.
 
virtual void SetSceneLayerOverlayAlpha (int aLayer)
 Blend a cached layer the way the other canvases blend the overlay they draw it in.
 
virtual void SetSceneDrawOrdered (bool aOrdered)
 Tell the retained scene whether cached groups are placed in an order that matters.
 
virtual void SetGroupPlacement (int aGroup, int aLayer, double aLodScale, bool aShown, const RETAINED_GROUP_ORDER &aOrder)
 Declare where a cached group belongs in the retained scene.
 
virtual void SetSceneScale (double aScale)
 Set the view scale that group placements are tested against.
 
virtual bool IsDrawingMode () const
 Return true if the GAL is inside a BeginDrawing/EndDrawing pair.
 
virtual bool SupportsTypedPads () const
 Return true if DrawPad() renders every standard pad shape.
 
virtual bool UsesPolygonTriangulationCache () const
 Return true if filled polygons are drawn from the SHAPE_POLY_SET triangulation cache, which painters should then fill before calling DrawPolygon.
 
virtual void DrawTrack (const VECTOR2D &aStart, const VECTOR2D &aEnd, double aWidth, const COLOR4D &aColor)
 Draw a filled track capsule in aColor without touching the fill and stroke state.
 
virtual void DrawPad (const VECTOR2D &aCenter, double aHalfWidth, double aHalfHeight, double aCornerRadius, float aShapeType, double aRotation, const COLOR4D &aColor)
 Draw a filled pad as one primitive in aColor.
 
const VECTOR2I & GetScreenPixelSize () const
 Return GAL canvas size in pixels.
 
virtual VECTOR2I GetLayoutPixelSize () const
 Return the size the view is centred in and panned by.
 
virtual int GetSwapInterval () const
 Return the swap interval. -1 for adaptive, 0 for disabled/unknown.
 
virtual void MarkStaticDirty ()
 Make a backend that keeps a static geometry pool rebuild it on the next frame.
 
void SetClearColor (const COLOR4D &aColor)
 
const COLOR4D & GetClearColor () const
 
bool GetIsFill () const
 Get the fill status.
 
bool GetIsStroke () const
 Get the stroke status.
 
const COLOR4D & GetFillColor () const
 Get the fill color.
 
virtual void SetHoverColor (const COLOR4D &aColor)
 
const COLOR4D & GetStrokeColor () const
 Get the stroke color.
 
virtual void SetMinLineWidth (float aLineWidth)
 Set the minimum line width in pixels.
 
float GetLineWidth () const
 Get the line width.
 
float GetMinLineWidth () const
 Get the minimum line width in pixels.
 
void AdvanceDepth ()
 Change the current depth to deeper, so it is possible to draw objects right beneath other.
 
virtual void BitmapText (const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle)
 Draw a text using a bitmap font.
 
void ResetTextAttributes ()
 Reset text attributes to default styling.
 
void SetGlyphSize (const VECTOR2I aSize)
 
const VECTOR2I & GetGlyphSize () const
 
void SetFontBold (const bool aBold)
 
bool IsFontBold () const
 
void SetFontItalic (bool aItalic)
 
bool IsFontItalic () const
 
void SetFontUnderlined (bool aUnderlined)
 
bool IsFontUnderlined () const
 
void SetTextMirrored (const bool aMirrored)
 
bool IsTextMirrored () const
 
void SetHorizontalJustify (const GR_TEXT_H_ALIGN_T aHorizontalJustify)
 
GR_TEXT_H_ALIGN_T GetHorizontalJustify () const
 
void SetVerticalJustify (const GR_TEXT_V_ALIGN_T aVerticalJustify)
 
GR_TEXT_V_ALIGN_T GetVerticalJustify () const
 
virtual std::array< uint64_t, 2 > GroupContentFingerprint (int aGroupNumber) const
 
virtual void ChangeGroupUndimmed (int aGroupNumber, bool aUndimmed)
 Exempt the group from its layer's dim, see SetSceneLayerDim().
 
virtual void ComputeWorldScreenMatrix ()
 Compute the world <-> screen transformation matrix.
 
const MATRIX3x3D & GetWorldScreenMatrix () const
 Get the world <-> screen transformation matrix.
 
const MATRIX3x3D & GetScreenWorldMatrix () const
 Get the screen <-> world transformation matrix.
 
void SetWorldScreenMatrix (const MATRIX3x3D &aMatrix)
 Set the world <-> screen transformation matrix.
 
BOX2D GetVisibleWorldExtents () const
 
void SetWorldUnitLength (double aWorldUnitLength)
 Set the unit length.
 
double GetWorldUnitLength () const
 
void SetScreenSize (const VECTOR2I &aSize)
 
void SetScreenDPI (double aScreenDPI)
 Set the dots per inch of the screen.
 
double GetScreenDPI () const
 
void SetLookAtPoint (const VECTOR2D &aPoint)
 Get/set the Point in world space to look at.
 
const VECTOR2D & GetLookAtPoint () const
 
void SetZoomFactor (double aZoomFactor)
 
double GetZoomFactor () const
 
void SetRotation (double aRotation)
 Get/set the rotation angle (in radians).
 
double GetRotation () const
 
void SetDepthRange (const VECTOR2D &aDepthRange)
 Set the range of the layer depth.
 
double GetMinDepth () const
 
double GetMaxDepth () const
 
double GetWorldScale () const
 Get the world scale.
 
double GetWorldScaleForScreenSpace () const
 Get the world scale to size something drawn in screen space mode.
 
bool WorldScaleBelow (double aLimit) const
 Tell whether the world scale is below a limit.
 
void TakeWorldScaleLimits (double &aBelow, double &aAbove) const
 Give and forget the nearest limits on either side of the scale passed to WorldScaleBelow().
 
bool TakeWorldScaleRead () const
 Tell whether GetWorldScale() or a transformation matrix was read since the last call.
 
void SetFlip (bool xAxis, bool yAxis)
 Sets flipping of the screen.
 
bool IsFlippedX () const
 
bool IsFlippedY () const
 
virtual bool HasTarget (RENDER_TARGET aTarget)
 Return true if the target exists.
 
virtual void SetScreenSpaceMode (bool aEnabled)
 Store sizes of what is drawn next in pixels rather than world units, so it keeps its pixel size through a zoom without being drawn again.
 
virtual bool SupportsStrokePixelPad () const
 Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad().
 
virtual bool SupportsStrokeLengthPad () const
 Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad().
 
virtual void SetStrokeLengthPad (double aPixels)
 Extend every stroke drawn from now on by aPixels at each end.
 
virtual void SetStrokePixelPad (double aPixels)
 Widen every stroke, circle and pad drawn from now on by aPixels.
 
virtual bool SupportsStrokeLevelOfDetail () const
 Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail().
 
virtual void SetStrokeLevelOfDetail (double aLod)
 Show every stroke drawn from now on only while the view scale is above aLod, as VIEW::IsShownAtScale() decides.
 
void SetGridVisibility (bool aVisibility)
 Set the visibility setting of the grid.
 
bool GetGridVisibility () const
 
bool GetGridSnapping () const
 
void SetGridOrigin (const VECTOR2D &aGridOrigin)
 Set the origin point for the grid.
 
const VECTOR2D & GetGridOrigin () const
 
void SetGridSize (const VECTOR2D &aGridSize)
 Set the grid size.
 
const VECTOR2D & GetGridSize () const
 Return the grid size.
 
VECTOR2D GetVisibleGridSize () const
 Return the visible grid size in x and y directions.
 
void SetGridColor (const COLOR4D &aGridColor)
 Set the grid color.
 
void SetAxesColor (const COLOR4D &aAxesColor)
 Set the axes color.
 
void SetAxesEnabled (bool aAxesEnabled)
 Enable drawing the axes.
 
void SetCoarseGrid (int aInterval)
 Draw every tick line wider.
 
float GetGridLineWidth () const
 Get the grid line width.
 
void SetGridSources (std::vector< GRID_SOURCE > aSources)
 Set the grid-source list rendered alongside the display grid.
 
const std::vector< GRID_SOURCE > & GetGridSources () const
 
GRID_STYLE GetGridStyle () const
 
int GetCoarseGrid () const
 
const COLOR4D & GetGridColor () const
 
VECTOR2D GetGridPoint (const VECTOR2D &aPoint) const
 For a given point it returns the nearest point belonging to the grid in world coordinates.
 
VECTOR2D ToWorld (const VECTOR2D &aPoint) const
 Compute the point position in world coordinates from given screen coordinates.
 
VECTOR2D ToScreen (const VECTOR2D &aPoint) const
 Compute the point position in screen coordinates from given world coordinates.
 
void SetCursorEnabled (bool aCursorEnabled)
 Enable/disable cursor.
 
bool IsCursorEnabled () const
 Return information about cursor visibility.
 
void SetCursorColor (const COLOR4D &aCursorColor)
 Set the cursor color.
 
virtual bool IsContextLocked ()
 Checks the state of the context lock.
 
virtual bool IsContextValid () const
 Check whether the locked context is actually the current one.
 
virtual GAL_CONTEXT_LOSS GetContextLoss () const
 Check whether a GPU reset destroyed this canvas' rendering context.
 
virtual bool IsResetSettled ()
 Check whether the driver has finished the reset that destroyed this canvas' context.
 
virtual void LockContext (int aClientCookie)
 Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing.
 
virtual void UnlockContext (int aClientCookie)
 

Protected Types

enum  GRAPHICS_COMMAND {
  CMD_SET_FILL , CMD_SET_STROKE , CMD_SET_FILLCOLOR , CMD_SET_STROKECOLOR ,
  CMD_SET_LINE_WIDTH , CMD_STROKE_PATH , CMD_FILL_PATH , CMD_ROTATE ,
  CMD_TRANSLATE , CMD_SCALE , CMD_SAVE , CMD_RESTORE ,
  CMD_CALL_GROUP
}
 Definitions for the command recorder. More...
 
typedef GAL super
 Super class definition.
 
typedef std::deque< GROUP_ELEMENT > GROUP
 A graphic group type definition.
 

Protected Member Functions

double xform (double x)
 
const VECTOR2D xform (double x, double y)
 
const VECTOR2D xform (const VECTOR2D &aP)
 
double angle_xform (double aAngle)
 Transform according to the rotation from m_currentWorld2Screen transform matrix.
 
void arc_angles_xform_and_normalize (double &aStartAngle, double &aEndAngle)
 Transform according to the rotation from m_currentWorld2Screen transform matrix for the start angle and the end angle of an arc.
 
void resetContext ()
 
void drawGridLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, const COLOR4D &aColor)
 Draw a grid line (usually a simplified line function).
 
void drawGridCross (const VECTOR2D &aPoint, const COLOR4D &aColor)
 
void drawGridPoint (const VECTOR2D &aPoint, double aWidth, double aHeight, const COLOR4D &aColor)
 
void drawAxes (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 
void drawGridSources ()
 Render m_gridSources precedence-ascending; each bounded source paints its coverage out first, so the last drawn wins.
 
void drawGridSource (const GRID_SOURCE &aSrc)
 Paint one source: coverage wash, grid content, then hairline.
 
void flushPath ()
 
void storePath ()
 Store the actual path.
 
void blitCursor (wxMemoryDC &clientDC)
 Blit cursor into the current screen.
 
void drawPoly (const std::deque< VECTOR2D > &aPointList)
 Drawing polygons & polylines is the same in Cairo, so here is the common code.
 
void drawPoly (const std::vector< VECTOR2D > &aPointList)
 
void drawPoly (const VECTOR2D aPointList[], int aListSize)
 
void drawPoly (const SHAPE_LINE_CHAIN &aLineChain)
 
unsigned int getNewGroupNumber ()
 Return a valid key that can be used as a new group number.
 
void syncLineWidth (bool aForceWidth=false, double aWidth=0.0)
 
void updateWorldScreenMatrix ()
 
const VECTOR2D roundp (const VECTOR2D &v)
 
virtual void beginUpdate ()
 Enable item update mode.
 
virtual void endUpdate ()
 Disable item update mode.
 
void computeWorldScale ()
 Compute the scaling factor for the world->screen matrix.
 
double computeMinGridSpacing () const
 Compute minimum grid spacing from the grid settings.
 
float gridMinorLineWidth (double aWorldPixelSize, double aScaleFactor) const
 Compute the world width of a minor grid line.
 
BOX2D gridScreenBBox (const GRID_SOURCE &aSrc) const
 
GRID_LATTICE gridLattice (const GRID_SOURCE &aSrc) const
 Thin a grid source's pitch out until its lines are far enough apart on screen.
 
COLOR4D gridSourceColor (const GRID_SOURCE &aSrc) const
 The colour a grid source is drawn in, brightened while it is being edited.
 
void drawGridCoverageShape (const GRID_SOURCE &aSrc)
 Draw the area a grid source covers in its own frame with the current fill and stroke.
 
COLOR4D getCursorColor () const
 Get the actual cursor color to draw.
 
void OnGalDisplayOptionsChanged (const GAL_DISPLAY_OPTIONS &aOptions) override
 Handler for observer settings changes.
 
template<typename T>
void normalize (T &a, T &b)
 Ensure that the first element is smaller than the second.
 

Static Protected Member Functions

static double calcAngleStep (double aRadius)
 Compute the angle step when drawing arcs/circles approximated with lines.
 

Protected Attributes

std::shared_ptr< CAIRO_COMPOSITOR > m_compositor
 Object for layers compositing.
 
unsigned int m_mainBuffer
 Handle to the main buffer.
 
unsigned int m_overlayBuffer
 Handle to the overlay buffer.
 
unsigned int m_tempBuffer
 Handle to the temp buffer.
 
unsigned int m_savedBuffer
 Handle to buffer to restore after rendering to temp buffer.
 
RENDER_TARGET m_currentTarget
 Current rendering target.
 
bool m_validCompositor
 Compositor initialization flag.
 
wxWindow * m_parentWindow
 Parent window.
 
wxEvtHandler * m_mouseListener
 Mouse listener.
 
wxEvtHandler * m_paintListener
 Paint listener.
 
unsigned int m_bufferSize
 Size of buffers cairoOutput, bitmapBuffers.
 
unsigned char * m_wxOutput
 wxImage compatible buffer
 
unsigned char * m_bitmapBuffer
 Storage of the Cairo image.
 
int m_stride
 Stride value for Cairo.
 
int m_wxBufferWidth
 
bool m_isInitialized
 Are Cairo image & surface ready to use.
 
COLOR4D m_backgroundColor
 Background color.
 
WX_CURSOR_TYPE m_currentwxCursor
 wx cursor showing the current native cursor
 
std::vector< wxRect > m_overlayExclusions
 Areas the frame blit must leave alone.
 
bool m_isGrouping
 Is grouping enabled ?
 
bool m_isElementAdded
 Was an graphic element added ?
 
std::map< int, GROUP > m_groups
 List of graphic groups.
 
unsigned int m_groupCounter
 Counter used for generating group keys.
 
GROUP * m_currentGroup
 Currently used group.
 
double m_lineWidthInPixels
 
bool m_lineWidthIsOdd
 
cairo_matrix_t m_cairoWorldScreenMatrix
 Cairo world to screen transform matrix.
 
cairo_matrix_t m_currentXform
 
cairo_matrix_t m_currentWorld2Screen
 
cairo_t * m_currentContext
 Currently used Cairo context for drawing.
 
cairo_t * m_context
 Cairo image.
 
cairo_surface_t * m_surface
 Cairo surface.
 
std::vector< cairo_surface_t * > m_imageSurfaces
 List of surfaces that were created by painting images, to be cleaned up later.
 
std::vector< cairo_matrix_t > m_xformStack
 
GAL_DISPLAY_OPTIONS & m_options
 
UTIL::LINK m_observerLink
 
std::stack< double > m_depthStack
 Stored depth values.
 
VECTOR2I m_screenSize
 Screen size in screen (wx logical) coordinates.
 
double m_worldUnitLength
 The unit length of the world coordinates [inch].
 
double m_screenDPI
 The dots per inch of the screen.
 
VECTOR2D m_lookAtPoint
 Point to be looked at in world space.
 
double m_zoomFactor
 The zoom factor.
 
double m_rotation
 Rotation transformation (radians)
 
MATRIX3x3D m_worldScreenMatrix
 World transformation.
 
MATRIX3x3D m_screenWorldMatrix
 Screen transformation.
 
double m_worldScale
 The scale factor world->screen.
 
bool m_worldScaleRead = false
 see TakeWorldScaleRead()
 
double m_scaleLimitBelow = 0.0
 see TakeWorldScaleLimits()
 
double m_scaleLimitAbove = std::numeric_limits<double>::max()
 
bool m_globalFlipX
 Flag for X axis flipping.
 
bool m_globalFlipY
 Flag for Y axis flipping.
 
float m_lineWidth
 The line width.
 
float m_minLineWidth
 Minimum line width in pixels.
 
bool m_isFillEnabled
 Is filling of graphic objects enabled ?
 
bool m_isStrokeEnabled
 Are the outlines stroked ?
 
COLOR4D m_fillColor
 The fill color.
 
COLOR4D m_strokeColor
 The color of the outlines.
 
COLOR4D m_clearColor
 
COLOR4D m_hoverColor
 Color for hovered (active) links.
 
double m_layerDepth
 The actual layer depth.
 
VECTOR2D m_depthRange
 Range of the depth.
 
bool m_gridVisibility
 Should the grid be shown.
 
GRID_STYLE m_gridStyle
 Grid display style.
 
VECTOR2D m_gridSize
 The grid size.
 
VECTOR2D m_gridOrigin
 The grid origin.
 
VECTOR2D m_gridOffset
 The grid offset to compensate cursor position.
 
COLOR4D m_gridColor
 Color of the grid.
 
COLOR4D m_axesColor
 Color of the axes.
 
bool m_axesEnabled
 Should the axes be drawn.
 
int m_gridTick
 Every tick line gets the double width.
 
float m_gridLineWidth
 Line width of the grid.
 
int m_gridMinSpacing
 Minimum screen size of the grid (pixels) below which the grid is not drawn.
 
std::vector< GRID_SOURCE > m_gridSources
 Sources overlayed on the display grid.
 
bool m_isCursorEnabled
 Is the cursor enabled?
 
bool m_forceDisplayCursor
 Always show cursor.
 
COLOR4D m_cursorColor
 Cursor color.
 
KIGFX::CROSS_HAIR_MODE m_crossHairMode
 Crosshair drawing mode.
 
VECTOR2D m_cursorPosition
 Current cursor position (world coordinates)
 
KICURSOR m_currentNativeCursor
 Current cursor.
 

Static Protected Attributes

static const int MAX_CAIRO_ARGUMENTS = 4
 Maximum number of arguments for one command.
 
static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32
 Format used to store pixels.
 
static constexpr int SEG_PER_CIRCLE_COUNT = 64
 The default number of segments approximating a full circle.
 
static const int MIN_DEPTH = -2*MAX_LAYERS_FOR_VIEW
 Possible depth range.
 
static const int MAX_DEPTH = 2*MAX_LAYERS_FOR_VIEW - 1
 
static const int GRID_DEPTH = MAX_DEPTH - 1
 Depth level on which the grid is drawn.
 

Private Member Functions

double getLayerDepth () const
 

Private Attributes

TEXT_ATTRIBUTES m_attributes
 

Detailed Description

Definition at line 399 of file cairo_gal.h.

Member Typedef Documentation

◆ GROUP

typedef std::deque<GROUP_ELEMENT> KIGFX::CAIRO_GAL_BASE::GROUP
protectedinherited

A graphic group type definition.

Definition at line 371 of file cairo_gal.h.

◆ super

typedef GAL KIGFX::CAIRO_GAL_BASE::super
protectedinherited

Super class definition.

Definition at line 335 of file cairo_gal.h.

Member Enumeration Documentation

◆ GRAPHICS_COMMAND

enum KIGFX::CAIRO_GAL_BASE::GRAPHICS_COMMAND
protectedinherited

Definitions for the command recorder.

Enumerator
CMD_SET_FILL 

Enable/disable filling.

CMD_SET_STROKE 

Enable/disable stroking.

CMD_SET_FILLCOLOR 

Set the fill color.

CMD_SET_STROKECOLOR 

Set the stroke color.

CMD_SET_LINE_WIDTH 

Set the line width.

CMD_STROKE_PATH 

Set the stroke path.

CMD_FILL_PATH 

Set the fill path.

CMD_ROTATE 

Rotate the context.

CMD_TRANSLATE 

Translate the context.

CMD_SCALE 

Scale the context.

CMD_SAVE 

Save the transformation matrix.

CMD_RESTORE 

Restore the transformation matrix.

CMD_CALL_GROUP 

Call a group.

Definition at line 341 of file cairo_gal.h.

Constructor & Destructor Documentation

◆ CAIRO_GAL()

CAIRO_GAL::CAIRO_GAL ( GAL_DISPLAY_OPTIONS & aDisplayOptions,
wxWindow * aParent,
wxEvtHandler * aMouseListener = nullptr,
wxEvtHandler * aPaintListener = nullptr,
const wxString & aName = wxT( "CairoCanvas" ) )
Parameters
aDisplayOptionsare the options for the GAL.
aParentis the wxWidgets immediate wxWindow parent of this object.
aMouseListeneris the wxEvtHandler that should receive the mouse events, this can be can be any wxWindow, but is often a wxFrame container.
aPaintListeneris the wxEvtHandler that should receive the paint event. This can be any wxWindow, but is often a derived instance of this class or a containing wxFrame. The "paint event" here is a wxCommandEvent holding EVT_GAL_REDRAW, as sent by PostPaint().
aNameis the name of the Cairo canvas.

Definition at line 1425 of file cairo_gal.cpp.

References allocateBitmaps(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), m_bitmapBuffer, m_currentTarget, m_isInitialized, m_mainBuffer, m_mouseListener, m_overlayBuffer, m_paintListener, m_parentWindow, m_savedBuffer, KIGFX::GAL::m_screenSize, m_tempBuffer, m_validCompositor, m_wxOutput, onPaint(), onSetNativeCursor(), SetTarget(), skipGestureEvent(), skipMouseEvent(), KIGFX::TARGET_NONCACHED, and ToVECTOR2I().

◆ ~CAIRO_GAL()

CAIRO_GAL::~CAIRO_GAL ( )

Definition at line 1495 of file cairo_gal.cpp.

References deleteBitmaps().

Member Function Documentation

◆ AdvanceDepth()

void KIGFX::GAL::AdvanceDepth ( )
inlineinherited

Change the current depth to deeper, so it is possible to draw objects right beneath other.

If you do this, you should consider using a GAL_SCOPED_ATTR to ensure the depth is reset to the original value.

Definition at line 683 of file graphics_abstraction_layer.h.

References m_layerDepth, and SetLayerDepth().

Referenced by KIGFX::VIEW_GROUP::ViewDraw().

◆ allocateBitmaps()

void CAIRO_GAL::allocateBitmaps ( )

Allocate the bitmaps for drawing.

Definition at line 1726 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::GAL_FORMAT, m_bitmapBuffer, m_bufferSize, KIGFX::GAL::m_screenSize, m_stride, m_wxBufferWidth, and m_wxOutput.

Referenced by CAIRO_GAL(), and ResizeScreen().

◆ angle_xform()

double CAIRO_GAL_BASE::angle_xform ( double aAngle)
protectedinherited

Transform according to the rotation from m_currentWorld2Screen transform matrix.

Parameters
aAngleis the angle in radians to transform.
Returns
the modified angle.

Definition at line 128 of file cairo_gal.cpp.

References KIGFX::GAL::IsFlippedX(), m_currentWorld2Screen, and M_PI.

Referenced by arc_angles_xform_and_normalize(), DrawEllipse(), and DrawEllipseArc().

◆ arc_angles_xform_and_normalize()

void CAIRO_GAL_BASE::arc_angles_xform_and_normalize ( double & aStartAngle,
double & aEndAngle )
protectedinherited

Transform according to the rotation from m_currentWorld2Screen transform matrix for the start angle and the end angle of an arc.

Parameters
aStartAngleis the arc starting point in radians to transform
aEndAngleis the arc ending point in radians to transform

Definition at line 142 of file cairo_gal.cpp.

References std::abs(), angle_xform(), KIGFX::GAL::IsFlippedX(), M_PI, and KIGFX::GAL::normalize().

Referenced by DrawArc(), DrawArcSegment(), and DrawEllipseArc().

◆ BeginDrawing()

void CAIRO_GAL::BeginDrawing ( )
overridevirtual

Start/end drawing functions, draw calls can be only made in between the calls to BeginDrawing()/EndDrawing().

Normally you should create a GAL_DRAWING_CONTEXT RAII object, but I'm leaving these functions public for more precise (i.e. timing/profiling) control of the drawing process - Tom Begin the drawing, needs to be called for every new frame. Use GAL_DRAWING_CONTEXT RAII object unless you know what you're doing.

Reimplemented from KIGFX::GAL.

Definition at line 1501 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::BeginDrawing(), initSurface(), m_compositor, KIGFX::CAIRO_GAL_BASE::m_context, m_mainBuffer, m_validCompositor, and setCompositor().

◆ BeginGroup()

int CAIRO_GAL::BeginGroup ( )
overridevirtual

Begin a group.

A group is a collection of graphic items. Hierarchical groups are possible, attributes and transformations can be used.

Returns
the number of the group.

Reimplemented from KIGFX::GAL.

Definition at line 1625 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::BeginGroup(), and initSurface().

◆ BeginSceneLayer()

virtual void KIGFX::GAL::BeginSceneLayer ( int aLayer)
inlinevirtualinherited

Open a cached layer of the retained scene during a rebuild.

Layers draw in the order they are opened, at the current layer depth.

Parameters
aLayeris the VIEW layer id.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 195 of file graphics_abstraction_layer.h.

◆ beginUpdate()

virtual void KIGFX::GAL::beginUpdate ( )
inlineprotectedvirtualinherited

Enable item update mode.

Private: use GAL_UPDATE_CONTEXT RAII object

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 1428 of file graphics_abstraction_layer.h.

◆ BitmapText()

void GAL::BitmapText ( const wxString & aText,
const VECTOR2I & aPosition,
const EDA_ANGLE & aAngle )
virtualinherited

Draw a text using a bitmap font.

It should be faster than StrokeText(), but can be used only for non-Gerber elements.

Parameters
aTextis the text to be drawn.
aPositionis the text position in world coordinates.
aAngleis the text rotation angle.

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 450 of file graphics_abstraction_layer.cpp.

References KIFONT::METRICS::Default(), KIFONT::FONT::Draw(), KIFONT::FONT::GetFont(), GetLineWidth(), TEXT_ATTRIBUTES::m_Angle, m_attributes, m_globalFlipX, TEXT_ATTRIBUTES::m_Mirrored, TEXT_ATTRIBUTES::m_Size, and TEXT_ATTRIBUTES::m_StrokeWidth.

Referenced by KIGFX::GAL_MODERN::BitmapText(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::bitmapText(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), and KIGFX::VIEW_OVERLAY::COMMAND_BITMAP_TEXT::Execute().

◆ blitCursor()

◆ calcAngleStep()

static double KIGFX::GAL::calcAngleStep ( double aRadius)
inlinestaticprotectedinherited

Compute the angle step when drawing arcs/circles approximated with lines.

Bigger arcs need smaller alpha increment to make them look smooth

Definition at line 1469 of file graphics_abstraction_layer.h.

References M_PI, and SEG_PER_CIRCLE_COUNT.

Referenced by KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::OPENGL_GAL::DrawEllipse(), and KIGFX::OPENGL_GAL::DrawEllipseArc().

◆ ChangeGroupColor()

void CAIRO_GAL_BASE::ChangeGroupColor ( int aGroupNumber,
const COLOR4D & aNewColor )
overridevirtualinherited

Change the color used to draw the group.

Parameters
aGroupNumberis the group number.
aNewColoris the new color.

Reimplemented from KIGFX::GAL.

Definition at line 1004 of file cairo_gal.cpp.

References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, CMD_SET_FILLCOLOR, CMD_SET_STROKECOLOR, KIGFX::COLOR4D::g, m_groups, KIGFX::COLOR4D::r, and storePath().

◆ ChangeGroupDepth()

void CAIRO_GAL_BASE::ChangeGroupDepth ( int aGroupNumber,
int aDepth )
overridevirtualinherited

Change the depth (Z-axis position) of the group.

Parameters
aGroupNumberis the group number.
aDepthis the new depth.

Reimplemented from KIGFX::GAL.

Definition at line 1021 of file cairo_gal.cpp.

◆ ChangeGroupUndimmed()

virtual void KIGFX::GAL::ChangeGroupUndimmed ( int aGroupNumber,
bool aUndimmed )
inlinevirtualinherited

Exempt the group from its layer's dim, see SetSceneLayerDim().

Parameters
aGroupNumberis the group number.
aUndimmedis true to keep the group's colour while its layer is dimmed.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 827 of file graphics_abstraction_layer.h.

◆ ClearCache()

void CAIRO_GAL_BASE::ClearCache ( )
overridevirtualinherited

Delete all data created during caching of graphic items.

Reimplemented from KIGFX::GAL.

Definition at line 1046 of file cairo_gal.cpp.

References DeleteGroup(), and m_groups.

Referenced by ~CAIRO_GAL_BASE().

◆ ClearScreen()

void CAIRO_GAL_BASE::ClearScreen ( )
overridevirtualinherited

Clear the screen.

Reimplemented from KIGFX::GAL.

Definition at line 671 of file cairo_gal.cpp.

References KIGFX::GAL::m_clearColor, m_currentContext, and KIGFX::GAL::m_screenSize.

Referenced by resetContext().

◆ ClearTarget()

void CAIRO_GAL::ClearTarget ( RENDER_TARGET aTarget)
overridevirtual

Clear the target for rendering.

Parameters
aTargetis the target to be cleared.

Reimplemented from KIGFX::GAL.

Definition at line 1669 of file cairo_gal.cpp.

References KIGFX::COLOR4D::BLACK, m_compositor, m_mainBuffer, m_overlayBuffer, m_tempBuffer, KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::TARGET_TEMP.

Referenced by StartDiffLayer(), and StartNegativesLayer().

◆ computeMinGridSpacing()

double GAL::computeMinGridSpacing ( ) const
protectedinherited

Compute minimum grid spacing from the grid settings.

Returns
the minimum spacing to use for drawing the grid

Definition at line 266 of file graphics_abstraction_layer.cpp.

References m_gridMinSpacing.

Referenced by GetVisibleGridSize(), and gridLattice().

◆ computeWorldScale()

void KIGFX::GAL::computeWorldScale ( )
inlineprotectedinherited

◆ ComputeWorldScreenMatrix()

◆ deinitSurface()

void CAIRO_GAL::deinitSurface ( )

Destroy Cairo surfaces when are not needed anymore.

Definition at line 1712 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::m_context, m_isInitialized, and KIGFX::CAIRO_GAL_BASE::m_surface.

Referenced by EndDrawing(), EndGroup(), and updatedGalDisplayOptions().

◆ deleteBitmaps()

void CAIRO_GAL::deleteBitmaps ( )

Allocate the bitmaps for drawing.

Definition at line 1742 of file cairo_gal.cpp.

References m_bitmapBuffer, and m_wxOutput.

Referenced by ResizeScreen(), and ~CAIRO_GAL().

◆ DeleteGroup()

void CAIRO_GAL_BASE::DeleteGroup ( int aGroupNumber)
overridevirtualinherited

Delete the group from the memory.

Parameters
aGroupNumberis the group number.

Reimplemented from KIGFX::GAL.

Definition at line 1028 of file cairo_gal.cpp.

References CMD_FILL_PATH, CMD_STROKE_PATH, end, m_groups, and storePath().

Referenced by ClearCache().

◆ DrawArc()

void CAIRO_GAL_BASE::DrawArc ( const VECTOR2D & aCenterPoint,
double aRadius,
const EDA_ANGLE & aStartAngle,
const EDA_ANGLE & aAngle )
overridevirtualinherited

Draw an arc.

Parameters
aCenterPointis the center point of the arc.
aRadiusis the arc radius.
aStartAngleis the start angle of the arc.
aAngleis the angle of the arc.

Reimplemented from KIGFX::GAL.

Definition at line 346 of file cairo_gal.cpp.

References arc_angles_xform_and_normalize(), EDA_ANGLE::AsRadians(), flushPath(), m_currentContext, m_isElementAdded, KIGFX::GAL::m_isFillEnabled, m_lineWidthInPixels, RADIANS_T, RotatePoint(), roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

Referenced by DrawArcSegment(), and drawGridSource().

◆ DrawArcSegment()

void CAIRO_GAL_BASE::DrawArcSegment ( const VECTOR2D & aCenterPoint,
double aRadius,
const EDA_ANGLE & aStartAngle,
const EDA_ANGLE & aAngle,
double aWidth,
double aMaxError )
overridevirtualinherited

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.

This has meaning only for back ends that can't draw a true arc, and use segments to approximate.

TODO: Unify Arc routines

Parameters
aCenterPointis the center point of the arc.
aRadiusis the arc radius.
aStartAngleis the start angle of the arc.
aAngleis the angle of the arc.
aWidthis the thickness of the arc (pen size).
aMaxErroris the max allowed error to create segments to approximate a circle. Note: aMaxError is not used in Cairo, because Cairo can draw true arcs

Reimplemented from KIGFX::GAL.

Definition at line 390 of file cairo_gal.cpp.

References arc_angles_xform_and_normalize(), EDA_ANGLE::AsRadians(), DrawArc(), flushPath(), m_currentContext, m_isElementAdded, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_lineWidth, M_PI, KIGFX::GAL::m_strokeColor, RADIANS_T, RotatePoint(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ drawAxes()

void CAIRO_GAL_BASE::drawAxes ( const VECTOR2D & aStartPoint,
const VECTOR2D & aEndPoint )
protectedinherited

◆ DrawBitmap()

void CAIRO_GAL_BASE::DrawBitmap ( const BITMAP_BASE & aBitmap,
double alphaBlend = 1.0 )
overridevirtualinherited

◆ DrawCircle()

void CAIRO_GAL_BASE::DrawCircle ( const VECTOR2D & aCenterPoint,
double aRadius )
overridevirtualinherited

Draw a circle using world coordinates.

Parameters
aCenterPointis the center point of the circle.
aRadiusis the radius of the circle.

Reimplemented from KIGFX::GAL.

Definition at line 330 of file cairo_gal.cpp.

References flushPath(), m_currentContext, m_isElementAdded, m_lineWidthInPixels, M_PI, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

Referenced by DrawHoleWall().

◆ DrawCursor()

void CAIRO_GAL_BASE::DrawCursor ( const VECTOR2D & aCursorPosition)
overridevirtualinherited

Draw the cursor.

Parameters
aCursorPositionis the cursor position in screen coordinates.

Reimplemented from KIGFX::GAL.

Definition at line 1085 of file cairo_gal.cpp.

References KIGFX::GAL::m_cursorPosition.

◆ DrawCurve()

void CAIRO_GAL_BASE::DrawCurve ( const VECTOR2D & startPoint,
const VECTOR2D & controlPointA,
const VECTOR2D & controlPointB,
const VECTOR2D & endPoint,
double aFilterValue = 0.0 )
overridevirtualinherited

Draw a cubic bezier spline.

Parameters
startPointis the start point of the spline.
controlPointAis the first control point.
controlPointBis the second control point.
endPointis the end point of the spline.
aFilterValueis 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 from KIGFX::GAL.

Definition at line 557 of file cairo_gal.cpp.

References flushPath(), m_currentContext, m_isElementAdded, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ DrawEllipse()

void CAIRO_GAL_BASE::DrawEllipse ( const VECTOR2D & aCenterPoint,
double aMajorRadius,
double aMinorRadius,
const EDA_ANGLE & aRotation )
overridevirtualinherited

Draw a closed ellipse.

Parameters
aCenterPointcenter of the ellipse.
aMajorRadiusmajor semi-axis length.
aMinorRadiusminor semi-axis length.
aRotationrotation of the major axis from world X, CCW.

Reimplemented from KIGFX::GAL.

Definition at line 450 of file cairo_gal.cpp.

References angle_xform(), EDA_ANGLE::AsRadians(), flushPath(), m_currentContext, m_isElementAdded, m_lineWidthInPixels, M_PI, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ DrawEllipseArc()

void CAIRO_GAL_BASE::DrawEllipseArc ( const VECTOR2D & aCenterPoint,
double aMajorRadius,
double aMinorRadius,
const EDA_ANGLE & aRotation,
const EDA_ANGLE & aStartAngle,
const EDA_ANGLE & aEndAngle )
overridevirtualinherited

Draw an elliptical arc in world coordinates.

Parameters
aCenterPointcenter of the parent ellipse.
aMajorRadiusmajor semi-axis length.
aMinorRadiusminor semi-axis length.
aRotationrotation of the major axis from world X, CCW.
aStartAnglesweep start angle in the ellipse local frame, CCW.
aEndAnglesweep end angle in the ellipse local frame, CCW.

Reimplemented from KIGFX::GAL.

Definition at line 480 of file cairo_gal.cpp.

References angle_xform(), arc_angles_xform_and_normalize(), EDA_ANGLE::AsRadians(), flushPath(), m_currentContext, m_isElementAdded, KIGFX::GAL::m_isFillEnabled, m_lineWidthInPixels, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ DrawGlyph()

void CAIRO_GAL_BASE::DrawGlyph ( const KIFONT::GLYPH & aPolySet,
int aNth,
int aTotal )
overridevirtualinherited

◆ DrawGlyphs()

void KIGFX::CAIRO_GAL_BASE::DrawGlyphs ( const std::vector< std::unique_ptr< KIFONT::GLYPH > > & aGlyphs)
inlineoverridevirtualinherited

Draw polygons representing font glyphs.

Reimplemented from KIGFX::GAL.

Definition at line 136 of file cairo_gal.h.

References DrawGlyph().

◆ DrawGrid()

◆ drawGridCoverageShape()

◆ drawGridCross()

void CAIRO_GAL_BASE::drawGridCross ( const VECTOR2D & aPoint,
const COLOR4D & aColor )
protectedinherited

◆ drawGridLine()

void CAIRO_GAL_BASE::drawGridLine ( const VECTOR2D & aStartPoint,
const VECTOR2D & aEndPoint,
const COLOR4D & aColor )
protectedinherited

Draw a grid line (usually a simplified line function).

Parameters
aStartPointis the start point of the line.
aEndPointis the end point of the line.
aColoris the colour to stroke it in.

Definition at line 1146 of file cairo_gal.cpp.

References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, m_currentContext, KIGFX::COLOR4D::r, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

Referenced by drawGridSource().

◆ drawGridPoint()

void CAIRO_GAL_BASE::drawGridPoint ( const VECTOR2D & aPoint,
double aWidth,
double aHeight,
const COLOR4D & aColor )
protectedinherited

◆ drawGridSource()

◆ drawGridSources()

void CAIRO_GAL_BASE::drawGridSources ( )
protectedinherited

Render m_gridSources precedence-ascending; each bounded source paints its coverage out first, so the last drawn wins.

Cairo has no stencil, so paint order stands in.

Definition at line 1887 of file cairo_gal.cpp.

References drawGridSource(), KIGFX::GAL::m_depthRange, KIGFX::GAL::m_gridSources, and SetLayerDepth().

Referenced by DrawGrid().

◆ DrawGroup()

void CAIRO_GAL_BASE::DrawGroup ( int aGroupNumber)
overridevirtualinherited

◆ DrawHoleWall()

void CAIRO_GAL_BASE::DrawHoleWall ( const VECTOR2D & aCenterPoint,
double aHoleRadius,
double aWallWidth )
overridevirtualinherited

Draw a hole wall ring.

Parameters
aCenterPointis the center point of the hole.
aHoleRadiusis the radius of the hole.
aWallWidthis the wall thickness.

Reimplemented from KIGFX::GAL.

Definition at line 324 of file cairo_gal.cpp.

References DrawCircle().

◆ DrawLine()

void CAIRO_GAL_BASE::DrawLine ( const VECTOR2D & aStartPoint,
const VECTOR2D & aEndPoint )
overridevirtualinherited

Draw a line.

Start and end points are defined as 2D-Vectors.

Parameters
aStartPointis the start point of the line.
aEndPointis the end point of the line.

Reimplemented from KIGFX::GAL.

Definition at line 199 of file cairo_gal.cpp.

References flushPath(), m_currentContext, m_isElementAdded, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ DrawPad()

virtual void KIGFX::GAL::DrawPad ( const VECTOR2D & aCenter,
double aHalfWidth,
double aHalfHeight,
double aCornerRadius,
float aShapeType,
double aRotation,
const COLOR4D & aColor )
inlinevirtualinherited

Draw a filled pad as one primitive in aColor.

Only called when SupportsTypedPads().

Parameters
aShapeTypeis 0 circle, 1 rect, 2 roundrect, 3 chamfered, 4 oval or 5 trapezoid.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 300 of file graphics_abstraction_layer.h.

◆ drawPoly() [1/4]

◆ drawPoly() [2/4]

void CAIRO_GAL_BASE::drawPoly ( const std::deque< VECTOR2D > & aPointList)
protectedinherited

Drawing polygons & polylines is the same in Cairo, so here is the common code.

Definition at line 1308 of file cairo_gal.cpp.

References flushPath(), m_currentContext, m_isElementAdded, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

Referenced by DrawGlyph(), DrawPolygon(), DrawPolygon(), DrawPolygon(), DrawPolygon(), DrawPolyline(), DrawPolyline(), DrawPolyline(), and DrawPolylines().

◆ drawPoly() [3/4]

void CAIRO_GAL_BASE::drawPoly ( const std::vector< VECTOR2D > & aPointList)
protectedinherited

◆ drawPoly() [4/4]

void CAIRO_GAL_BASE::drawPoly ( const VECTOR2D aPointList[],
int aListSize )
protectedinherited

◆ DrawPolygon() [1/4]

void CAIRO_GAL_BASE::DrawPolygon ( const SHAPE_LINE_CHAIN & aPolySet)
overridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 551 of file cairo_gal.cpp.

References drawPoly().

◆ DrawPolygon() [2/4]

void CAIRO_GAL_BASE::DrawPolygon ( const SHAPE_POLY_SET & aPolySet,
bool aStrokeTriangulation = false )
overridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 544 of file cairo_gal.cpp.

References SHAPE_POLY_SET::COutline(), drawPoly(), and SHAPE_POLY_SET::OutlineCount().

◆ DrawPolygon() [3/4]

void KIGFX::CAIRO_GAL_BASE::DrawPolygon ( const std::deque< VECTOR2D > & aPointList)
inlineoverridevirtualinherited

Draw a polygon.

Parameters
aPointListis the list of the polygon points.

Reimplemented from KIGFX::GAL.

Definition at line 123 of file cairo_gal.h.

References drawPoly().

◆ DrawPolygon() [4/4]

void KIGFX::CAIRO_GAL_BASE::DrawPolygon ( const VECTOR2D aPointList[],
int aListSize )
inlineoverridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 124 of file cairo_gal.h.

References drawPoly().

◆ DrawPolyline() [1/4]

void KIGFX::CAIRO_GAL_BASE::DrawPolyline ( const SHAPE_LINE_CHAIN & aLineChain)
inlineoverridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 113 of file cairo_gal.h.

References drawPoly().

◆ DrawPolyline() [2/4]

void KIGFX::CAIRO_GAL_BASE::DrawPolyline ( const std::deque< VECTOR2D > & aPointList)
inlineoverridevirtualinherited

Draw a polyline.

Parameters
aPointListis a list of 2D-Vectors containing the polyline points.

Reimplemented from KIGFX::GAL.

Definition at line 107 of file cairo_gal.h.

References drawPoly().

◆ DrawPolyline() [3/4]

void KIGFX::CAIRO_GAL_BASE::DrawPolyline ( const VECTOR2D aPointList[],
int aListSize )
inlineoverridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 108 of file cairo_gal.h.

References drawPoly().

◆ DrawPolyline() [4/4]

virtual void KIGFX::GAL::DrawPolyline ( const std::vector< VECTOR2D > & aPointList)
inlinevirtualinherited

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 319 of file graphics_abstraction_layer.h.

◆ DrawPolylines()

void KIGFX::CAIRO_GAL_BASE::DrawPolylines ( const std::vector< std::vector< VECTOR2D > > & aPointLists)
inlineoverridevirtualinherited

Draw multiple polylines.

Parameters
aPointListsare lists of 2D-Vectors containing the polyline points.

Reimplemented from KIGFX::GAL.

Definition at line 116 of file cairo_gal.h.

References drawPoly().

◆ DrawRectangle() [1/2]

void CAIRO_GAL_BASE::DrawRectangle ( const VECTOR2D & aStartPoint,
const VECTOR2D & aEndPoint )
overridevirtualinherited

Draw a rectangle.

Parameters
aStartPointis the start point of the rectangle.
aEndPointis the end point of the rectangle.

Reimplemented from KIGFX::GAL.

Definition at line 522 of file cairo_gal.cpp.

References flushPath(), m_currentContext, m_isElementAdded, roundp(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ DrawRectangle() [2/2]

void KIGFX::GAL::DrawRectangle ( const BOX2I & aRect)
inlineinherited

◆ DrawSegment()

void CAIRO_GAL_BASE::DrawSegment ( const VECTOR2D & aStartPoint,
const VECTOR2D & aEndPoint,
double aWidth )
overridevirtualinherited

Draw a rounded segment.

Start and end points are defined as 2D-Vectors.

Parameters
aStartPointis the start point of the segment.
aEndPointis the end point of the segment.
aWidthis a width of the segment

Reimplemented from KIGFX::GAL.

Definition at line 256 of file cairo_gal.cpp.

References flushPath(), m_currentContext, KIGFX::GAL::m_fillColor, m_isElementAdded, KIGFX::GAL::m_isFillEnabled, M_PI, KIGFX::GAL::m_strokeColor, radius, roundp(), SetLineWidth(), syncLineWidth(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

Referenced by DrawSegmentChain(), and DrawSegmentChain().

◆ DrawSegmentChain() [1/2]

void CAIRO_GAL_BASE::DrawSegmentChain ( const SHAPE_LINE_CHAIN & aLineChain,
double aWidth )
overridevirtualinherited

◆ DrawSegmentChain() [2/2]

void CAIRO_GAL_BASE::DrawSegmentChain ( const std::vector< VECTOR2D > & aPointList,
double aWidth )
overridevirtualinherited

Draw a chain of rounded segments.

Parameters
aPointListis a list of 2D-Vectors containing the chain points.
aWidthis a width of the segments

Reimplemented from KIGFX::GAL.

Definition at line 237 of file cairo_gal.cpp.

References DrawSegment().

◆ DrawTrack()

void GAL::DrawTrack ( const VECTOR2D & aStart,
const VECTOR2D & aEnd,
double aWidth,
const COLOR4D & aColor )
virtualinherited

Draw a filled track capsule in aColor without touching the fill and stroke state.

Backends may override it to skip that overhead on the track hot path.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 193 of file graphics_abstraction_layer.cpp.

References DrawSegment(), SetFillColor(), SetIsFill(), SetIsStroke(), and SetStrokeColor().

◆ EnableDepthTest()

void CAIRO_GAL_BASE::EnableDepthTest ( bool aEnabled = false)
overridevirtualinherited

Reimplemented from KIGFX::GAL.

Definition at line 1091 of file cairo_gal.cpp.

◆ EndDiffLayer()

void CAIRO_GAL::EndDiffLayer ( )
overridevirtual

Ends rendering of a differential layer.

Objects drawn after the StartDiffLayer() will be drawn and composited with a differential blend mode, then drawing is returned to normal.

Reimplemented from KIGFX::GAL.

Definition at line 1066 of file cairo_gal.cpp.

References m_compositor, m_mainBuffer, and m_tempBuffer.

◆ EndDrawing()

void CAIRO_GAL::EndDrawing ( )
overridevirtual

End the drawing, needs to be called for every new frame.

Use GAL_DRAWING_CONTEXT RAII object unless you know what you're doing.

Reimplemented from KIGFX::GAL.

Definition at line 1515 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::blitCursor(), deinitSurface(), KIGFX::CAIRO_GAL_BASE::EndDrawing(), m_bitmapBuffer, m_compositor, m_mainBuffer, m_overlayBuffer, m_overlayExclusions, KIGFX::GAL::m_screenSize, m_stride, m_wxBufferWidth, and m_wxOutput.

◆ EndGroup()

void CAIRO_GAL::EndGroup ( )
overridevirtual

End the group.

Reimplemented from KIGFX::GAL.

Definition at line 1632 of file cairo_gal.cpp.

References deinitSurface(), and KIGFX::CAIRO_GAL_BASE::EndGroup().

◆ EndNegativesLayer()

void CAIRO_GAL::EndNegativesLayer ( )
overridevirtual

Ends rendering of a negatives layer and draws it to the main layer.

No-op in OpenGL.

Reimplemented from KIGFX::GAL.

Definition at line 1079 of file cairo_gal.cpp.

References m_compositor, m_mainBuffer, and m_tempBuffer.

◆ endUpdate()

virtual void KIGFX::GAL::endUpdate ( )
inlineprotectedvirtualinherited

Disable item update mode.

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 1431 of file graphics_abstraction_layer.h.

◆ Flush()

void CAIRO_GAL_BASE::Flush ( )
overridevirtualinherited

Force all remaining objects to be drawn.

Reimplemented from KIGFX::GAL.

Definition at line 665 of file cairo_gal.cpp.

References storePath().

Referenced by EndDrawing().

◆ flushPath()

◆ GetClearColor()

const COLOR4D & KIGFX::GAL::GetClearColor ( ) const
inlineinherited

Definition at line 519 of file graphics_abstraction_layer.h.

References m_clearColor.

Referenced by EDIT_POINTS::ViewDraw().

◆ GetCoarseGrid()

int KIGFX::GAL::GetCoarseGrid ( ) const
inlineinherited

Definition at line 1280 of file graphics_abstraction_layer.h.

References m_gridTick.

◆ GetContextLoss()

virtual GAL_CONTEXT_LOSS KIGFX::GAL::GetContextLoss ( ) const
inlinevirtualinherited

Check whether a GPU reset destroyed this canvas' rendering context.

A lost canvas cannot draw or update cached items until its owner rebuilds it.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1391 of file graphics_abstraction_layer.h.

References KIGFX::NONE.

◆ getCursorColor()

COLOR4D GAL::getCursorColor ( ) const
protectedinherited

◆ GetFillColor()

const COLOR4D & KIGFX::GAL::GetFillColor ( ) const
inlineinherited

Get the fill color.

Returns
the color for filling a outline.

Definition at line 588 of file graphics_abstraction_layer.h.

References m_fillColor.

Referenced by DrawGlyphs().

◆ GetGlyphSize()

◆ GetGridColor()

const COLOR4D & KIGFX::GAL::GetGridColor ( ) const
inlineinherited

Definition at line 1281 of file graphics_abstraction_layer.h.

References m_gridColor.

◆ GetGridLineWidth()

float KIGFX::GAL::GetGridLineWidth ( ) const
inlineinherited

Get the grid line width.

Returns
the grid line width

Definition at line 1263 of file graphics_abstraction_layer.h.

References m_gridLineWidth.

◆ GetGridOrigin()

const VECTOR2D & KIGFX::GAL::GetGridOrigin ( ) const
inlineinherited

Definition at line 1161 of file graphics_abstraction_layer.h.

References m_gridOrigin.

◆ GetGridPoint()

VECTOR2D GAL::GetGridPoint ( const VECTOR2D & aPoint) const
inherited

For a given point it returns the nearest point belonging to the grid in world coordinates.

Parameters
aPointis the point for which the grid point is searched.
Returns
The nearest grid point in world coordinates.

Definition at line 405 of file graphics_abstraction_layer.cpp.

References KiROUND(), m_gridOffset, m_gridSize, m_gridSources, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition().

◆ GetGridSize()

const VECTOR2D & KIGFX::GAL::GetGridSize ( ) const
inlineinherited

◆ GetGridSnapping()

◆ GetGridSources()

const std::vector< GRID_SOURCE > & KIGFX::GAL::GetGridSources ( ) const
inlineinherited

Definition at line 1277 of file graphics_abstraction_layer.h.

References m_gridSources.

◆ GetGridStyle()

GRID_STYLE KIGFX::GAL::GetGridStyle ( ) const
inlineinherited

Definition at line 1279 of file graphics_abstraction_layer.h.

References m_gridStyle.

◆ GetGridVisibility()

bool KIGFX::GAL::GetGridVisibility ( ) const
inlineinherited

Definition at line 1133 of file graphics_abstraction_layer.h.

References m_gridVisibility.

◆ GetHorizontalJustify()

GR_TEXT_H_ALIGN_T KIGFX::GAL::GetHorizontalJustify ( ) const
inlineinherited

◆ GetIsFill()

bool KIGFX::GAL::GetIsFill ( ) const
inlineinherited

Get the fill status.

Returns
true if fill is enabled, false otherwise.

Definition at line 548 of file graphics_abstraction_layer.h.

References m_isFillEnabled.

◆ GetIsStroke()

bool KIGFX::GAL::GetIsStroke ( ) const
inlineinherited

Get the stroke status.

Returns
true if stroke is enabled, false otherwise.

Definition at line 568 of file graphics_abstraction_layer.h.

References m_isStrokeEnabled.

◆ getLayerDepth()

double KIGFX::GAL::getLayerDepth ( ) const
inlineprivateinherited

Definition at line 1613 of file graphics_abstraction_layer.h.

References m_layerDepth.

◆ GetLayoutPixelSize()

virtual VECTOR2I KIGFX::GAL::GetLayoutPixelSize ( ) const
inlinevirtualinherited

Return the size the view is centred in and panned by.

It is the canvas size unless the canvas lays its view out like one of another size.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 503 of file graphics_abstraction_layer.h.

References m_screenSize.

Referenced by ComputeWorldScreenMatrix().

◆ GetLineWidth()

float KIGFX::GAL::GetLineWidth ( ) const
inlineinherited

Get the line width.

Returns
the actual line width.

Definition at line 643 of file graphics_abstraction_layer.h.

References m_lineWidth.

Referenced by BitmapText(), CALLBACK_GAL::DrawGlyph(), ROUTER_PREVIEW_ITEM::drawLineChain(), and RATSNEST_VIEW_ITEM::ViewDraw().

◆ GetLookAtPoint()

const VECTOR2D & KIGFX::GAL::GetLookAtPoint ( ) const
inlineinherited

Definition at line 917 of file graphics_abstraction_layer.h.

References m_lookAtPoint.

Referenced by GetVisibleWorldExtents().

◆ GetMaxDepth()

double KIGFX::GAL::GetMaxDepth ( ) const
inlineinherited

Definition at line 938 of file graphics_abstraction_layer.h.

References m_depthRange.

◆ GetMinDepth()

double KIGFX::GAL::GetMinDepth ( ) const
inlineinherited

◆ GetMinLineWidth()

float KIGFX::GAL::GetMinLineWidth ( ) const
inlineinherited

Get the minimum line width in pixels.

Returns
the minimum line width.

Definition at line 653 of file graphics_abstraction_layer.h.

References m_minLineWidth.

Referenced by KIGFX::OPENGL_GAL::BeginDrawing().

◆ getNewGroupNumber()

unsigned int CAIRO_GAL_BASE::getNewGroupNumber ( )
protectedinherited

Return a valid key that can be used as a new group number.

Returns
An unique group number that is not used by any other group.

Definition at line 1413 of file cairo_gal.cpp.

References m_groupCounter, and m_groups.

Referenced by BeginGroup().

◆ GetRotation()

double KIGFX::GAL::GetRotation ( ) const
inlineinherited

Definition at line 926 of file graphics_abstraction_layer.h.

References m_rotation.

◆ GetScreenDPI()

double KIGFX::GAL::GetScreenDPI ( ) const
inlineinherited

Definition at line 909 of file graphics_abstraction_layer.h.

References m_screenDPI.

◆ GetScreenPixelSize()

const VECTOR2I & KIGFX::GAL::GetScreenPixelSize ( ) const
inlineinherited

◆ GetScreenWorldMatrix()

const MATRIX3x3D & KIGFX::GAL::GetScreenWorldMatrix ( ) const
inlineinherited

Get the screen <-> world transformation matrix.

The matrix carries the world scale, so this counts as a read of it, see TakeWorldScaleRead().

Returns
the transformation matrix.

Definition at line 868 of file graphics_abstraction_layer.h.

References m_screenWorldMatrix, and m_worldScaleRead.

Referenced by GetVisibleWorldExtents(), KIGFX::OPENGL_GAL::getWorldPixelSize(), screenSpaceCircle(), screenSpaceLine(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().

◆ GetStrokeColor()

const COLOR4D & KIGFX::GAL::GetStrokeColor ( ) const
inlineinherited

Get the stroke color.

Returns
the color for stroking the outline.

Definition at line 613 of file graphics_abstraction_layer.h.

References m_strokeColor.

Referenced by DrawGlyphs(), KIGFX::PREVIEW::DrawTextNextToCursor(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ GetSwapInterval()

virtual int KIGFX::GAL::GetSwapInterval ( ) const
inlinevirtualinherited

Return the swap interval. -1 for adaptive, 0 for disabled/unknown.

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 506 of file graphics_abstraction_layer.h.

◆ GetTarget()

RENDER_TARGET CAIRO_GAL::GetTarget ( ) const
overridevirtual

Get the currently used target for rendering.

Returns
The current rendering target.

Reimplemented from KIGFX::GAL.

Definition at line 1663 of file cairo_gal.cpp.

References m_currentTarget.

◆ GetVerticalJustify()

GR_TEXT_V_ALIGN_T KIGFX::GAL::GetVerticalJustify ( ) const
inlineinherited

◆ GetVisibleGridSize()

VECTOR2D KIGFX::GAL::GetVisibleGridSize ( ) const
inlineinherited

Return the visible grid size in x and y directions.

Returns
A vector containing the spacing of visible grid marks

Definition at line 1198 of file graphics_abstraction_layer.h.

References KIGFX::AutoSparsePitch(), computeMinGridSpacing(), m_gridSize, m_gridStyle, m_gridTick, m_worldScale, minSize, KIGFX::SMALL_CROSS, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and ViaSnapRange().

◆ GetVisibleWorldExtents()

BOX2D GAL::GetVisibleWorldExtents ( ) const
inherited
Returns
the bounding box of the world that is displayed on screen at the moment

Definition at line 251 of file graphics_abstraction_layer.cpp.

References GetLookAtPoint(), MATRIX3x3< T >::GetScale(), GetScreenWorldMatrix(), m_screenSize, BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by ROUTER_TOOL::handleCommonEvents(), and ROUTER_TOOL::InlineDrag().

◆ GetWorldScale()

◆ GetWorldScaleForScreenSpace()

double KIGFX::GAL::GetWorldScaleForScreenSpace ( ) const
inlineinherited

Get the world scale to size something drawn in screen space mode.

Such things keep their pixel size at any scale, so unlike GetWorldScale() this is not a read, see TakeWorldScaleRead().

Definition at line 955 of file graphics_abstraction_layer.h.

References m_worldScale.

◆ GetWorldScreenMatrix()

const MATRIX3x3D & KIGFX::GAL::GetWorldScreenMatrix ( ) const
inlineinherited

Get the world <-> screen transformation matrix.

The matrix carries the world scale, so this counts as a read of it, see TakeWorldScaleRead().

Returns
the transformation matrix.

Definition at line 855 of file graphics_abstraction_layer.h.

References m_worldScaleRead, and m_worldScreenMatrix.

◆ GetWorldUnitLength()

double KIGFX::GAL::GetWorldUnitLength ( ) const
inlineinherited

Definition at line 898 of file graphics_abstraction_layer.h.

References m_worldUnitLength.

Referenced by CONSTRAINT_BADGE_ITEM::ViewDraw().

◆ GetZoomFactor()

double KIGFX::GAL::GetZoomFactor ( ) const
inlineinherited

◆ gridLattice()

◆ gridMinorLineWidth()

float KIGFX::GAL::gridMinorLineWidth ( double aWorldPixelSize,
double aScaleFactor ) const
inlineprotectedinherited

Compute the world width of a minor grid line.

A major line is twice as wide. Shaders round this to whole pixels, so every canvas must evaluate it in the same order to round the same way.

Parameters
aWorldPixelSizeis the world length of a screen pixel.
aScaleFactoris the canvas DPI scale factor.

Definition at line 1460 of file graphics_abstraction_layer.h.

References m_gridLineWidth.

Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and KIGFX::GAL_MODERN::PopulateCameraUBOs().

◆ gridScreenBBox()

BOX2D GAL::gridScreenBBox ( const GRID_SOURCE & aSrc) const
protectedinherited
Returns
the visible screen area expressed in aSrc's frame (relative to its origin and counter-rotated by its orientation).

Definition at line 286 of file graphics_abstraction_layer.cpp.

References m_screenSize, m_screenWorldMatrix, BOX2< Vec >::Merge(), GRID_GEOMETRY::orientation, GRID_GEOMETRY::origin, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and gridLattice().

◆ gridSourceColor()

COLOR4D GAL::gridSourceColor ( const GRID_SOURCE & aSrc) const
protectedinherited

◆ GroupContentFingerprint()

virtual std::array< uint64_t, 2 > KIGFX::GAL::GroupContentFingerprint ( int aGroupNumber) const
inlinevirtualinherited

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 796 of file graphics_abstraction_layer.h.

Referenced by KIGFX::sortRetainedOrder().

◆ HasRetainedScene()

virtual bool KIGFX::GAL::HasRetainedScene ( ) const
inlinevirtualinherited

Return true if the backend keeps cached groups in a persistent scene that it patches in place, so one changed item does not make VIEW emit every cached layer again.

VIEW places each group with SetGroupPlacement() and emits the cached layers through BeginSceneLayer() only while HasStaticRebuildPending(). The scene holds every item, not just the viewport.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 187 of file graphics_abstraction_layer.h.

Referenced by PCB_EDIT_FRAME::redrawNetnames(), APPEARANCE_CONTROLS::setVisibleLayers(), and DS_PROXY_VIEW_ITEM::ViewDraw().

◆ HasStaticRebuildPending()

virtual bool KIGFX::GAL::HasStaticRebuildPending ( ) const
inlinevirtualinherited

Return true if the backend dropped its cached geometry and VIEW must draw the cached layers again, even when its own TARGET_CACHED is clean.

Otherwise the pool would rebuild empty and blank the scene.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 179 of file graphics_abstraction_layer.h.

◆ HasTarget()

virtual bool KIGFX::GAL::HasTarget ( RENDER_TARGET aTarget)
inlinevirtualinherited

Return true if the target exists.

Parameters
aTargetis the target to be checked.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1039 of file graphics_abstraction_layer.h.

◆ initSurface()

◆ IsCairoEngine()

bool KIGFX::CAIRO_GAL_BASE::IsCairoEngine ( )
inlineoverridevirtualinherited

Return true if the GAL engine is a Cairo based type.

Reimplemented from KIGFX::GAL.

Definition at line 61 of file cairo_gal.h.

◆ IsContextLocked()

virtual bool KIGFX::GAL::IsContextLocked ( )
inlinevirtualinherited

Checks the state of the context lock.

Returns
True if the context is currently locked

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1368 of file graphics_abstraction_layer.h.

◆ IsContextValid()

virtual bool KIGFX::GAL::IsContextValid ( ) const
inlinevirtualinherited

Check whether the locked context is actually the current one.

A canvas whose native window is already gone cannot be made current. GL commands issued while this is false land in whichever sibling context is still bound.

Returns
True if GL commands may be issued.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1381 of file graphics_abstraction_layer.h.

◆ IsCursorEnabled()

bool KIGFX::GAL::IsCursorEnabled ( ) const
inlineinherited

Return information about cursor visibility.

Returns
True if cursor is visible.

Definition at line 1340 of file graphics_abstraction_layer.h.

References m_forceDisplayCursor, and m_isCursorEnabled.

Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), and KIGFX::GAL_MODERN::PopulateCursorUBO().

◆ IsDrawingMode()

virtual bool KIGFX::GAL::IsDrawingMode ( ) const
inlinevirtualinherited

Return true if the GAL is inside a BeginDrawing/EndDrawing pair.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 248 of file graphics_abstraction_layer.h.

◆ IsFlippedX()

◆ IsFlippedY()

bool KIGFX::GAL::IsFlippedY ( ) const
inlineinherited

Definition at line 1007 of file graphics_abstraction_layer.h.

References m_globalFlipY.

◆ IsFontBold()

bool KIGFX::GAL::IsFontBold ( ) const
inlineinherited

Definition at line 715 of file graphics_abstraction_layer.h.

References m_attributes.

◆ IsFontItalic()

bool KIGFX::GAL::IsFontItalic ( ) const
inlineinherited

Definition at line 718 of file graphics_abstraction_layer.h.

References m_attributes.

◆ IsFontUnderlined()

bool KIGFX::GAL::IsFontUnderlined ( ) const
inlineinherited

Definition at line 721 of file graphics_abstraction_layer.h.

References m_attributes.

◆ IsInitialized()

virtual bool KIGFX::GAL::IsInitialized ( ) const
inlinevirtualinherited

Return the initialization status for the canvas.

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 158 of file graphics_abstraction_layer.h.

◆ IsOpenGlEngine()

virtual bool KIGFX::GAL::IsOpenGlEngine ( )
inlinevirtualinherited

Return true if the GAL engine is a OpenGL based type.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 167 of file graphics_abstraction_layer.h.

◆ IsResetSettled()

virtual bool KIGFX::GAL::IsResetSettled ( )
inlinevirtualinherited

Check whether the driver has finished the reset that destroyed this canvas' context.

Rebuilding before then can fail or hang in the driver.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1401 of file graphics_abstraction_layer.h.

◆ IsTextMirrored()

bool KIGFX::GAL::IsTextMirrored ( ) const
inlineinherited

◆ IsVisible()

bool KIGFX::CAIRO_GAL::IsVisible ( ) const
inlineoverridevirtual

Return true if the GAL canvas is visible on the screen.

Reimplemented from KIGFX::GAL.

Definition at line 420 of file cairo_gal.h.

◆ LockContext()

virtual void KIGFX::GAL::LockContext ( int aClientCookie)
inlinevirtualinherited

Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1408 of file graphics_abstraction_layer.h.

◆ MarkStaticDirty()

virtual void KIGFX::GAL::MarkStaticDirty ( )
inlinevirtualinherited

Make a backend that keeps a static geometry pool rebuild it on the next frame.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 512 of file graphics_abstraction_layer.h.

◆ normalize()

template<typename T>
void KIGFX::GAL::normalize ( T & a,
T & b )
inlineprotectedinherited

◆ OnGalDisplayOptionsChanged()

void GAL::OnGalDisplayOptionsChanged ( const GAL_DISPLAY_OPTIONS & aOptions)
overrideprotectedvirtualinherited

Handler for observer settings changes.

Implements KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER.

Definition at line 105 of file graphics_abstraction_layer.cpp.

References updatedGalDisplayOptions().

◆ onPaint()

void CAIRO_GAL::onPaint ( wxPaintEvent & aEvent)

Paint event handler.

Parameters
aEventis the paint event.

Definition at line 1768 of file cairo_gal.cpp.

References PostPaint().

Referenced by CAIRO_GAL().

◆ onSetNativeCursor()

void CAIRO_GAL::onSetNativeCursor ( wxSetCursorEvent & aEvent)

Give the correct cursor image when the native widget asks for it.

Parameters
aEventis the cursor event to plac the cursor into.

Definition at line 1836 of file cairo_gal.cpp.

References m_currentwxCursor.

Referenced by CAIRO_GAL().

◆ PostPaint()

void CAIRO_GAL::PostPaint ( wxPaintEvent & aEvent)

Post an event to m_paint_listener.

A post is used so that the actual drawing function can use a device context type that is not specific to the wxEVT_PAINT event, just by changing the PostPaint code.

Definition at line 1589 of file cairo_gal.cpp.

References m_paintListener.

Referenced by onPaint().

◆ RefillsNonCachedTargets()

virtual bool KIGFX::GAL::RefillsNonCachedTargets ( ) const
inlinevirtualinherited

Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 173 of file graphics_abstraction_layer.h.

◆ resetContext()

◆ ResetTextAttributes()

void GAL::ResetTextAttributes ( )
inherited

Reset text attributes to default styling.

FONT TODO: do we need any of this in GAL anymore?

Normally, custom attributes will be set individually after this, otherwise you can use SetTextAttributes()

Definition at line 204 of file graphics_abstraction_layer.cpp.

References GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().

Referenced by GAL(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().

◆ ResizeScreen()

void CAIRO_GAL::ResizeScreen ( int aWidth,
int aHeight )
overridevirtual

Resize the canvas.

Reimplemented from KIGFX::GAL.

Definition at line 1597 of file cairo_gal.cpp.

References allocateBitmaps(), deleteBitmaps(), m_compositor, m_validCompositor, and KIGFX::CAIRO_GAL_BASE::ResizeScreen().

◆ Restore()

void CAIRO_GAL_BASE::Restore ( )
overridevirtualinherited

◆ Rotate()

void CAIRO_GAL_BASE::Rotate ( double aAngle)
overridevirtualinherited

◆ roundp()

◆ Save()

void CAIRO_GAL_BASE::Save ( )
overridevirtualinherited

◆ Scale()

void CAIRO_GAL_BASE::Scale ( const VECTOR2D & aScale)
overridevirtualinherited

◆ SetAxesColor()

void KIGFX::GAL::SetAxesColor ( const COLOR4D & aAxesColor)
inlineinherited

◆ SetAxesEnabled()

◆ SetClearColor()

void KIGFX::GAL::SetClearColor ( const COLOR4D & aColor)
inlineinherited

Definition at line 514 of file graphics_abstraction_layer.h.

References m_clearColor.

Referenced by BOARD_PRINTOUT::DrawPage(), and SCH_PRINTOUT::PrintPage().

◆ SetCoarseGrid()

void KIGFX::GAL::SetCoarseGrid ( int aInterval)
inlineinherited

Draw every tick line wider.

Parameters
aIntervalincrease the width of every aInterval line, if 0 do not use this feature.

Definition at line 1253 of file graphics_abstraction_layer.h.

References m_gridTick.

Referenced by GAL().

◆ setCompositor()

void CAIRO_GAL::setCompositor ( )

◆ SetCursorColor()

void KIGFX::GAL::SetCursorColor ( const COLOR4D & aCursorColor)
inlineinherited

Set the cursor color.

Parameters
aCursorColoris the color of the cursor.

Definition at line 1350 of file graphics_abstraction_layer.h.

References m_cursorColor.

Referenced by GAL().

◆ SetCursorEnabled()

void KIGFX::GAL::SetCursorEnabled ( bool aCursorEnabled)
inlineinherited

Enable/disable cursor.

Parameters
aCursorEnabledis true if the cursor should be drawn, else false.

Definition at line 1330 of file graphics_abstraction_layer.h.

References m_isCursorEnabled.

Referenced by GAL().

◆ SetDepthRange()

void KIGFX::GAL::SetDepthRange ( const VECTOR2D & aDepthRange)
inlineinherited

Set the range of the layer depth.

Usually required for the OpenGL implementation, any object outside this range is not drawn.

The MinDepth (x) is closest to the clipping plane (top) while the MaxDepth (y) is farthest from the clipping plane (bottom).

Definition at line 936 of file graphics_abstraction_layer.h.

References m_depthRange.

Referenced by GAL().

◆ SetFillColor()

void CAIRO_GAL_BASE::SetFillColor ( const COLOR4D & aColor)
overridevirtualinherited

◆ SetFlip()

void KIGFX::GAL::SetFlip ( bool xAxis,
bool yAxis )
inlineinherited

Sets flipping of the screen.

Parameters
xAxisis the flip flag for the X axis.
yAxisis the flip flag for the Y axis.

Definition at line 1000 of file graphics_abstraction_layer.h.

References m_globalFlipX, and m_globalFlipY.

Referenced by GAL(), and BOARD_PRINTOUT::setupGal().

◆ SetFontBold()

void KIGFX::GAL::SetFontBold ( const bool aBold)
inlineinherited

Definition at line 714 of file graphics_abstraction_layer.h.

References m_attributes.

Referenced by ResetTextAttributes().

◆ SetFontItalic()

void KIGFX::GAL::SetFontItalic ( bool aItalic)
inlineinherited

Definition at line 717 of file graphics_abstraction_layer.h.

References m_attributes.

Referenced by ResetTextAttributes().

◆ SetFontUnderlined()

void KIGFX::GAL::SetFontUnderlined ( bool aUnderlined)
inlineinherited

Definition at line 720 of file graphics_abstraction_layer.h.

References m_attributes.

Referenced by ResetTextAttributes().

◆ SetGlyphSize()

void KIGFX::GAL::SetGlyphSize ( const VECTOR2I aSize)
inlineinherited

◆ SetGridColor()

void KIGFX::GAL::SetGridColor ( const COLOR4D & aGridColor)
inlineinherited

Set the grid color.

Parameters
aGridColoris the grid color, it should have a low alpha value for the best effect.

Definition at line 1225 of file graphics_abstraction_layer.h.

References m_gridColor.

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), KIGFX::OPENGL_GAL::OPENGL_GAL(), GERBVIEW_FRAME::SetGridColor(), and PCB_EDIT_FRAME::SetGridColor().

◆ SetGridOrigin()

void KIGFX::GAL::SetGridOrigin ( const VECTOR2D & aGridOrigin)
inlineinherited

Set the origin point for the grid.

Parameters
aGridOriginis a vector containing the grid origin point, in world coordinates.

Definition at line 1146 of file graphics_abstraction_layer.h.

References m_gridOffset, m_gridOrigin, and m_gridSize.

Referenced by FOOTPRINT_EDIT_FRAME::borrowBoardNonDestructive(), PCB_CONTROL::DoSetGridOrigin(), and PCB_BASE_EDIT_FRAME::SetBoard().

◆ SetGridSize()

void KIGFX::GAL::SetGridSize ( const VECTOR2D & aGridSize)
inlineinherited

Set the grid size.

Parameters
aGridSizeis a vector containing the grid size in x and y direction.

Definition at line 1171 of file graphics_abstraction_layer.h.

References m_gridOffset, m_gridOrigin, and m_gridSize.

Referenced by FOOTPRINT_PREVIEW_PANEL::New(), COMMON_TOOLS::OnGridChanged(), DIALOG_BARCODE_PROPERTIES::prepareCanvas(), and DIALOG_PAD_PROPERTIES::prepareCanvas().

◆ SetGridSources()

void GAL::SetGridSources ( std::vector< GRID_SOURCE > aSources)
inherited

Set the grid-source list rendered alongside the display grid.

The list is sorted by GRID_GEOMETRY::TakesPrecedenceOver, so every consumer can take the first source that applies rather than re-deriving the overlap rules. The sort is stable, leaving exact ties in the caller's original order.

Definition at line 274 of file graphics_abstraction_layer.cpp.

References m_gridSources.

◆ SetGridVisibility()

void KIGFX::GAL::SetGridVisibility ( bool aVisibility)
inlineinherited

◆ SetGroupPlacement()

virtual void KIGFX::GAL::SetGroupPlacement ( int aGroup,
int aLayer,
double aLodScale,
bool aShown,
const RETAINED_GROUP_ORDER & aOrder )
inlinevirtualinherited

Declare where a cached group belongs in the retained scene.

Parameters
aGroupis the group number returned by BeginGroup().
aLayeris the VIEW layer id the group was cached for.
aLodScaleis the view scale above which the group is drawn.
aShownis false to keep the group out of the scene regardless of scale.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 241 of file graphics_abstraction_layer.h.

◆ SetHorizontalJustify()

void KIGFX::GAL::SetHorizontalJustify ( const GR_TEXT_H_ALIGN_T aHorizontalJustify)
inlineinherited

Definition at line 726 of file graphics_abstraction_layer.h.

References m_attributes.

Referenced by KIGFX::bitmapText(), and ResetTextAttributes().

◆ SetHoverColor()

virtual void KIGFX::GAL::SetHoverColor ( const COLOR4D & aColor)
inlinevirtualinherited

Definition at line 603 of file graphics_abstraction_layer.h.

References m_hoverColor.

◆ SetIsFill()

void CAIRO_GAL_BASE::SetIsFill ( bool aIsFillEnabled)
overridevirtualinherited

Enable/disable fill.

Parameters
aIsFillEnabledis true, when the graphics objects should be filled, else false.

Reimplemented from KIGFX::GAL.

Definition at line 682 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::BoolArg, CMD_SET_FILL, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Argument, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Command, m_currentGroup, KIGFX::GAL::m_isFillEnabled, m_isGrouping, and storePath().

Referenced by DrawGlyph(), and drawGridSource().

◆ SetIsStroke()

void CAIRO_GAL_BASE::SetIsStroke ( bool aIsStrokeEnabled)
overridevirtualinherited

Enable/disable stroked outlines.

Parameters
aIsStrokeEnabledis true, if the outline of an object should be stroked.

Reimplemented from KIGFX::GAL.

Definition at line 697 of file cairo_gal.cpp.

References KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::BoolArg, CMD_SET_STROKE, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Argument, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Command, m_currentGroup, m_isGrouping, KIGFX::GAL::m_isStrokeEnabled, and storePath().

Referenced by DrawGlyph(), and drawGridSource().

◆ SetLayerDepth()

void CAIRO_GAL_BASE::SetLayerDepth ( double aLayerDepth)
overridevirtualinherited

Set the depth of the layer (position on the z-axis)

If you do this, you should consider using a GAL_SCOPED_ATTR to ensure the depth is reset to the original value.

Parameters
aLayerDepththe layer depth for the objects. Smaller is closer to the viewer.

Reimplemented from KIGFX::GAL.

Definition at line 767 of file cairo_gal.cpp.

References KIGFX::GAL::SetLayerDepth(), and storePath().

Referenced by drawGridSources().

◆ SetLineWidth()

void CAIRO_GAL_BASE::SetLineWidth ( float aLineWidth)
overridevirtualinherited

◆ SetLookAtPoint()

void KIGFX::GAL::SetLookAtPoint ( const VECTOR2D & aPoint)
inlineinherited

Get/set the Point in world space to look at.

This point corresponds with the center of the actual drawing area.

Definition at line 916 of file graphics_abstraction_layer.h.

References m_lookAtPoint.

Referenced by BOARD_PRINTOUT::DrawPage(), GAL(), and SCH_PRINTOUT::PrintPage().

◆ SetMinLineWidth()

virtual void KIGFX::GAL::SetMinLineWidth ( float aLineWidth)
inlinevirtualinherited

Set the minimum line width in pixels.

Parameters
aLineWidthis the minimum line width.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 633 of file graphics_abstraction_layer.h.

References m_minLineWidth.

Referenced by GAL(), and KIGFX::OPENGL_GAL::SetMinLineWidth().

◆ SetMouseListener()

void KIGFX::CAIRO_GAL::SetMouseListener ( wxEvtHandler * aMouseListener)
inline

Definition at line 469 of file cairo_gal.h.

References m_mouseListener.

◆ SetNativeCursorStyle()

bool CAIRO_GAL::SetNativeCursorStyle ( KICURSOR aCursor,
bool aHiDPI )
overridevirtual

Set the cursor in the native panel.

Parameters
aCursoris the cursor to use in the native panell
aHiDPIis used to determine if high DPI cursors should be used.
Returns
true if the cursor was updated, false if the cursor given was already set.

Reimplemented from KIGFX::GAL.

Definition at line 1818 of file cairo_gal.cpp.

References CURSOR_STORE::GetCursor(), KIGFX::GAL::m_currentNativeCursor, m_currentwxCursor, and KIGFX::GAL::SetNativeCursorStyle().

◆ SetNegativeDrawMode()

void CAIRO_GAL_BASE::SetNegativeDrawMode ( bool aSetting)
overridevirtualinherited

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.

Parameters
aSettingis true if negative mode should be enabled

Reimplemented from KIGFX::GAL.

Definition at line 1053 of file cairo_gal.cpp.

References m_currentContext.

◆ SetOverlayExclusions()

void KIGFX::CAIRO_GAL::SetOverlayExclusions ( const std::vector< wxRect > & aRects)
inline

Set areas, in canvas coordinates, that the frame blit must leave alone.

The blit happens outside the paint cycle, so it would otherwise erase any window stacked over the canvas.

Parameters
aRectsare the areas to preserve

Definition at line 435 of file cairo_gal.h.

References m_overlayExclusions.

◆ SetPaintListener()

void KIGFX::CAIRO_GAL::SetPaintListener ( wxEvtHandler * aPaintListener)
inline

Definition at line 474 of file cairo_gal.h.

References m_paintListener.

◆ SetRotation()

void KIGFX::GAL::SetRotation ( double aRotation)
inlineinherited

Get/set the rotation angle (in radians).

Definition at line 925 of file graphics_abstraction_layer.h.

References m_rotation.

Referenced by GAL().

◆ SetSceneDrawOrdered()

virtual void KIGFX::GAL::SetSceneDrawOrdered ( bool aOrdered)
inlinevirtualinherited

Tell the retained scene whether cached groups are placed in an order that matters.

When they are, a knockout erases only what was placed before it on its layer, as on a Gerber layer. Otherwise a layer's knockouts apply to all of it.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 231 of file graphics_abstraction_layer.h.

◆ SetSceneLayerDim()

virtual void KIGFX::GAL::SetSceneLayerDim ( int aLayer,
const COLOR4D & aToward,
double aKeep )
inlinevirtualinherited

Fade a cached layer towards a colour in the shader, so dimming it recolours none of its groups.

Groups marked with ChangeGroupUndimmed() keep their colour.

Parameters
aLayeris the VIEW layer id.
aTowardis the colour the layer fades towards, usually the background.
aKeepis the share of each colour that is kept, 1 to leave the layer as it is.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 216 of file graphics_abstraction_layer.h.

◆ SetSceneLayerOverlayAlpha()

virtual void KIGFX::GAL::SetSceneLayerOverlayAlpha ( int aLayer)
inlinevirtualinherited

Blend a cached layer the way the other canvases blend the overlay they draw it in.

Colour c with alpha a over d then shows c*a + d*(1 - a*a) rather than c*a + d*(1 - a).

Parameters
aLayeris the VIEW layer id.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 224 of file graphics_abstraction_layer.h.

◆ SetSceneLayerState()

virtual void KIGFX::GAL::SetSceneLayerState ( int aLayer,
int aOrder,
bool aVisible,
bool aHasNegatives )
inlinevirtualinherited

Describe a cached layer to the retained scene.

Layers draw in decreasing order value and a hidden layer keeps its groups, so showing, hiding or reordering layers emits nothing again.

Parameters
aLayeris the VIEW layer id.
aOrderis the layer's rendering order.
aVisibleis false to leave the layer out of the frame.
aHasNegativesis true if the layer has to contain its own knockouts.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 206 of file graphics_abstraction_layer.h.

◆ SetSceneScale()

virtual void KIGFX::GAL::SetSceneScale ( double aScale)
inlinevirtualinherited

Set the view scale that group placements are tested against.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 245 of file graphics_abstraction_layer.h.

◆ SetScreenDPI()

void KIGFX::GAL::SetScreenDPI ( double aScreenDPI)
inlineinherited

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.

Definition at line 908 of file graphics_abstraction_layer.h.

References m_screenDPI.

Referenced by KIGFX::CAIRO_PRINT_GAL::CAIRO_PRINT_GAL(), and GAL().

◆ SetScreenSize()

void KIGFX::GAL::SetScreenSize ( const VECTOR2I & aSize)
inlineinherited

◆ SetScreenSpaceMode()

virtual void KIGFX::GAL::SetScreenSpaceMode ( bool aEnabled)
inlinevirtualinherited

Store sizes of what is drawn next in pixels rather than world units, so it keeps its pixel size through a zoom without being drawn again.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1061 of file graphics_abstraction_layer.h.

◆ SetStrokeColor()

void CAIRO_GAL_BASE::SetStrokeColor ( const COLOR4D & aColor)
overridevirtualinherited

Set the stroke color.

Parameters
aColoris the color for stroking the outline.

Reimplemented from KIGFX::GAL.

Definition at line 712 of file cairo_gal.cpp.

References CMD_SET_STROKECOLOR, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::DblArg, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Argument, KIGFX::CAIRO_GAL_BASE::GROUP_ELEMENT::m_Command, m_currentGroup, m_isGrouping, KIGFX::GAL::m_strokeColor, and storePath().

Referenced by drawGridSource().

◆ SetStrokeLengthPad()

virtual void KIGFX::GAL::SetStrokeLengthPad ( double aPixels)
inlinevirtualinherited

Extend every stroke drawn from now on by aPixels at each end.

Pixels are resolved per frame so the look survives a zoom without drawing again. Zero turns it off.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1073 of file graphics_abstraction_layer.h.

◆ SetStrokeLevelOfDetail()

virtual void KIGFX::GAL::SetStrokeLevelOfDetail ( double aLod)
inlinevirtualinherited

Show every stroke drawn from now on only while the view scale is above aLod, as VIEW::IsShownAtScale() decides.

It is decided per frame so a zoom needs no redraw. Zero turns it off.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1088 of file graphics_abstraction_layer.h.

Referenced by KIGFX::VIEW_GROUP::ViewDraw().

◆ SetStrokePixelPad()

virtual void KIGFX::GAL::SetStrokePixelPad ( double aPixels)
inlinevirtualinherited

Widen every stroke, circle and pad drawn from now on by aPixels.

Pixels are resolved per frame so the look survives a zoom without drawing again. Zero turns it off.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1079 of file graphics_abstraction_layer.h.

Referenced by RATSNEST_VIEW_ITEM::ViewDraw().

◆ SetTarget()

void CAIRO_GAL::SetTarget ( RENDER_TARGET aTarget)
overridevirtual

Set the target for rendering.

Parameters
aTargetis the new target for rendering.

Reimplemented from KIGFX::GAL.

Definition at line 1639 of file cairo_gal.cpp.

References m_compositor, m_currentTarget, m_isInitialized, m_mainBuffer, m_overlayBuffer, m_tempBuffer, m_validCompositor, KIGFX::CAIRO_GAL_BASE::storePath(), KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::TARGET_TEMP.

Referenced by CAIRO_GAL(), StartDiffLayer(), and StartNegativesLayer().

◆ SetTextMirrored()

void KIGFX::GAL::SetTextMirrored ( const bool aMirrored)
inlineinherited

◆ SetVerticalJustify()

void KIGFX::GAL::SetVerticalJustify ( const GR_TEXT_V_ALIGN_T aVerticalJustify)
inlineinherited

Definition at line 733 of file graphics_abstraction_layer.h.

References m_attributes.

Referenced by KIGFX::bitmapText(), and ResetTextAttributes().

◆ SetWorldScreenMatrix()

void KIGFX::GAL::SetWorldScreenMatrix ( const MATRIX3x3D & aMatrix)
inlineinherited

Set the world <-> screen transformation matrix.

Parameters
aMatrixis the 3x3 world <-> screen transformation matrix.

Definition at line 879 of file graphics_abstraction_layer.h.

References m_worldScreenMatrix.

◆ SetWorldUnitLength()

void KIGFX::GAL::SetWorldUnitLength ( double aWorldUnitLength)
inlineinherited

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.

Definition at line 896 of file graphics_abstraction_layer.h.

References m_worldUnitLength.

Referenced by GAL(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_PRINTOUT::PrintPage(), GERBVIEW_PRINTOUT::setupGal(), PCBNEW_PRINTOUT::setupGal(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), and PL_DRAW_PANEL_GAL::SwitchBackend().

◆ SetZoomFactor()

void KIGFX::GAL::SetZoomFactor ( double aZoomFactor)
inlineinherited

Definition at line 919 of file graphics_abstraction_layer.h.

References m_zoomFactor.

Referenced by BOARD_PRINTOUT::DrawPage(), GAL(), and SCH_PRINTOUT::PrintPage().

◆ Show()

bool CAIRO_GAL::Show ( bool aShow)
overridevirtual

Show/hide the GAL canvas.

Reimplemented from KIGFX::GAL.

Definition at line 1614 of file cairo_gal.cpp.

◆ skipGestureEvent()

void CAIRO_GAL::skipGestureEvent ( wxGestureEvent & aEvent)

Skip the gesture event to the parent.

Parameters
aEventis the gesture event.

Definition at line 1786 of file cairo_gal.cpp.

References m_mouseListener.

Referenced by CAIRO_GAL().

◆ skipMouseEvent()

void CAIRO_GAL::skipMouseEvent ( wxMouseEvent & aEvent)

Mouse event handler, forwards the event to the child.

Parameters
aEventis the mouse event to be forwarded.

Definition at line 1778 of file cairo_gal.cpp.

References m_mouseListener.

Referenced by CAIRO_GAL().

◆ StartDiffLayer()

void CAIRO_GAL::StartDiffLayer ( )
overridevirtual

Begins rendering of a differential layer.

Used by gerbview's differential mode.

Differential layers have their drawn objects blended onto the lower layers differently so we need to end drawing of current objects and start a new set to be completed with a different blend mode.

Reimplemented from KIGFX::GAL.

Definition at line 1059 of file cairo_gal.cpp.

References ClearTarget(), SetTarget(), and KIGFX::TARGET_TEMP.

◆ StartNegativesLayer()

void CAIRO_GAL::StartNegativesLayer ( )
overridevirtual

Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer().

For Cairo, layers with negative items need a new layer so when negative layers _CLEAR sections it doesn't delete drawings on layers below them. No-op in OpenGL

Reimplemented from KIGFX::GAL.

Definition at line 1072 of file cairo_gal.cpp.

References ClearTarget(), SetTarget(), and KIGFX::TARGET_TEMP.

◆ storePath()

◆ SupportsStrokeLengthPad()

virtual bool KIGFX::GAL::SupportsStrokeLengthPad ( ) const
inlinevirtualinherited

Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad().

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1067 of file graphics_abstraction_layer.h.

◆ SupportsStrokeLevelOfDetail()

virtual bool KIGFX::GAL::SupportsStrokeLevelOfDetail ( ) const
inlinevirtualinherited

Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail().

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1082 of file graphics_abstraction_layer.h.

Referenced by KIGFX::VIEW_GROUP::ViewDraw().

◆ SupportsStrokePixelPad()

virtual bool KIGFX::GAL::SupportsStrokePixelPad ( ) const
inlinevirtualinherited

Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad().

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 1064 of file graphics_abstraction_layer.h.

Referenced by SCH_BASE_FRAME::RefreshZoomDependentItems(), and RATSNEST_VIEW_ITEM::ViewDraw().

◆ SupportsTypedPads()

virtual bool KIGFX::GAL::SupportsTypedPads ( ) const
inlinevirtualinherited

Return true if DrawPad() renders every standard pad shape.

Painters must not use it otherwise, since the base implementation draws every non-circular pad as a rectangle.

Reimplemented in KIGFX::GAL_MODERN.

Definition at line 254 of file graphics_abstraction_layer.h.

◆ syncLineWidth()

void CAIRO_GAL_BASE::syncLineWidth ( bool aForceWidth = false,
double aWidth = 0.0 )
protectedinherited

◆ TakeWorldScaleLimits()

void KIGFX::GAL::TakeWorldScaleLimits ( double & aBelow,
double & aAbove ) const
inlineinherited

Give and forget the nearest limits on either side of the scale passed to WorldScaleBelow().

Definition at line 974 of file graphics_abstraction_layer.h.

References m_scaleLimitAbove, and m_scaleLimitBelow.

◆ TakeWorldScaleRead()

bool KIGFX::GAL::TakeWorldScaleRead ( ) const
inlineinherited

Tell whether GetWorldScale() or a transformation matrix was read since the last call.

A backend that keeps geometry across frames needs this because whatever was sized from the scale goes stale on zoom.

Definition at line 986 of file graphics_abstraction_layer.h.

References m_worldScaleRead.

◆ ToScreen()

VECTOR2D KIGFX::GAL::ToScreen ( const VECTOR2D & aPoint) const
inlineinherited

Compute the point position in screen coordinates from given world coordinates.

Parameters
aPointthe point position in world coordinates.
Returns
the point position in screen coordinates.

Definition at line 1311 of file graphics_abstraction_layer.h.

References m_worldScreenMatrix.

Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ ToWorld()

VECTOR2D KIGFX::GAL::ToWorld ( const VECTOR2D & aPoint) const
inlineinherited

Compute the point position in world coordinates from given screen coordinates.

Parameters
aPointthe point position in screen coordinates.
Returns
the point position in world coordinates.

Definition at line 1300 of file graphics_abstraction_layer.h.

References m_screenWorldMatrix.

◆ Transform()

void CAIRO_GAL_BASE::Transform ( const MATRIX3x3D & aTransformation)
overridevirtualinherited

Transform the context.

Parameters
aTransformationis the transformation matrix.

Reimplemented from KIGFX::GAL.

Definition at line 774 of file cairo_gal.cpp.

References m_currentXform, MATRIX3x3< T >::m_data, and updateWorldScreenMatrix().

◆ Translate()

void CAIRO_GAL_BASE::Translate ( const VECTOR2D & aTranslation)
overridevirtualinherited

◆ UnlockContext()

virtual void KIGFX::GAL::UnlockContext ( int aClientCookie)
inlinevirtualinherited

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1410 of file graphics_abstraction_layer.h.

◆ updatedGalDisplayOptions()

bool CAIRO_GAL::updatedGalDisplayOptions ( const GAL_DISPLAY_OPTIONS & aOptions)
overridevirtual

◆ updateWorldScreenMatrix()

void CAIRO_GAL_BASE::updateWorldScreenMatrix ( )
protectedinherited

◆ UsesPolygonTriangulationCache()

virtual bool KIGFX::GAL::UsesPolygonTriangulationCache ( ) const
inlinevirtualinherited

Return true if filled polygons are drawn from the SHAPE_POLY_SET triangulation cache, which painters should then fill before calling DrawPolygon.

Reimplemented in KIGFX::GAL_MODERN, and KIGFX::OPENGL_GAL.

Definition at line 260 of file graphics_abstraction_layer.h.

◆ WorldScaleBelow()

bool KIGFX::GAL::WorldScaleBelow ( double aLimit) const
inlineinherited

Tell whether the world scale is below a limit.

This is not a read of the scale, so what depends only on the answer stays valid through a zoom that does not cross the limit, see TakeWorldScaleLimits().

Definition at line 961 of file graphics_abstraction_layer.h.

References m_scaleLimitAbove, m_scaleLimitBelow, and m_worldScale.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ xform() [1/3]

const VECTOR2D CAIRO_GAL_BASE::xform ( const VECTOR2D & aP)
protectedinherited

Definition at line 122 of file cairo_gal.cpp.

References VECTOR2< T >::x, xform(), and VECTOR2< T >::y.

◆ xform() [2/3]

◆ xform() [3/3]

const VECTOR2D CAIRO_GAL_BASE::xform ( double x,
double y )
protectedinherited

Definition at line 112 of file cairo_gal.cpp.

References m_currentWorld2Screen, VECTOR2< T >::x, and VECTOR2< T >::y.

Member Data Documentation

◆ GAL_FORMAT

cairo_format_t KIGFX::CAIRO_GAL_BASE::GAL_FORMAT = CAIRO_FORMAT_ARGB32
staticconstexprprotectedinherited

Format used to store pixels.

Definition at line 395 of file cairo_gal.h.

Referenced by KIGFX::CAIRO_GAL::allocateBitmaps(), and KIGFX::CAIRO_GAL::initSurface().

◆ GRID_DEPTH

const int GAL::GRID_DEPTH = MAX_DEPTH - 1
staticprotectedinherited

Depth level on which the grid is drawn.

Definition at line 1511 of file graphics_abstraction_layer.h.

◆ m_attributes

◆ m_axesColor

COLOR4D KIGFX::GAL::m_axesColor
protectedinherited

◆ m_axesEnabled

bool KIGFX::GAL::m_axesEnabled
protectedinherited

◆ m_backgroundColor

COLOR4D KIGFX::CAIRO_GAL::m_backgroundColor
protected

Background color.

Definition at line 557 of file cairo_gal.h.

◆ m_bitmapBuffer

unsigned char* KIGFX::CAIRO_GAL::m_bitmapBuffer
protected

Storage of the Cairo image.

Definition at line 553 of file cairo_gal.h.

Referenced by allocateBitmaps(), CAIRO_GAL(), deleteBitmaps(), EndDrawing(), and initSurface().

◆ m_bufferSize

unsigned int KIGFX::CAIRO_GAL::m_bufferSize
protected

Size of buffers cairoOutput, bitmapBuffers.

Definition at line 549 of file cairo_gal.h.

Referenced by allocateBitmaps().

◆ m_cairoWorldScreenMatrix

cairo_matrix_t KIGFX::CAIRO_GAL_BASE::m_cairoWorldScreenMatrix
protectedinherited

Cairo world to screen transform matrix.

Definition at line 383 of file cairo_gal.h.

Referenced by CAIRO_GAL_BASE(), resetContext(), and updateWorldScreenMatrix().

◆ m_clearColor

◆ m_compositor

std::shared_ptr<CAIRO_COMPOSITOR> KIGFX::CAIRO_GAL::m_compositor
protected

◆ m_context

cairo_t* KIGFX::CAIRO_GAL_BASE::m_context
protectedinherited

◆ m_crossHairMode

KIGFX::CROSS_HAIR_MODE KIGFX::GAL::m_crossHairMode
protectedinherited

◆ m_currentContext

◆ m_currentGroup

GROUP* KIGFX::CAIRO_GAL_BASE::m_currentGroup
protectedinherited

◆ m_currentNativeCursor

KICURSOR KIGFX::GAL::m_currentNativeCursor
protectedinherited

◆ m_currentTarget

RENDER_TARGET KIGFX::CAIRO_GAL::m_currentTarget
protected

Current rendering target.

Definition at line 542 of file cairo_gal.h.

Referenced by CAIRO_GAL(), GetTarget(), and SetTarget().

◆ m_currentWorld2Screen

cairo_matrix_t KIGFX::CAIRO_GAL_BASE::m_currentWorld2Screen
protectedinherited

◆ m_currentwxCursor

WX_CURSOR_TYPE KIGFX::CAIRO_GAL::m_currentwxCursor
protected

wx cursor showing the current native cursor

Definition at line 559 of file cairo_gal.h.

Referenced by onSetNativeCursor(), and SetNativeCursorStyle().

◆ m_currentXform

cairo_matrix_t KIGFX::CAIRO_GAL_BASE::m_currentXform
protectedinherited

◆ m_cursorColor

COLOR4D KIGFX::GAL::m_cursorColor
protectedinherited

Cursor color.

Definition at line 1605 of file graphics_abstraction_layer.h.

Referenced by getCursorColor(), and SetCursorColor().

◆ m_cursorPosition

◆ m_depthRange

VECTOR2D KIGFX::GAL::m_depthRange
protectedinherited

◆ m_depthStack

std::stack<double> KIGFX::GAL::m_depthStack
protectedinherited

Stored depth values.

Definition at line 1553 of file graphics_abstraction_layer.h.

◆ m_fillColor

◆ m_forceDisplayCursor

bool KIGFX::GAL::m_forceDisplayCursor
protectedinherited

Always show cursor.

Definition at line 1604 of file graphics_abstraction_layer.h.

Referenced by GAL(), IsCursorEnabled(), and updatedGalDisplayOptions().

◆ m_globalFlipX

◆ m_globalFlipY

bool KIGFX::GAL::m_globalFlipY
protectedinherited

◆ m_gridColor

COLOR4D KIGFX::GAL::m_gridColor
protectedinherited

◆ m_gridLineWidth

◆ m_gridMinSpacing

int KIGFX::GAL::m_gridMinSpacing
protectedinherited

Minimum screen size of the grid (pixels) below which the grid is not drawn.

Definition at line 1597 of file graphics_abstraction_layer.h.

Referenced by computeMinGridSpacing(), GAL(), and updatedGalDisplayOptions().

◆ m_gridOffset

VECTOR2D KIGFX::GAL::m_gridOffset
protectedinherited

The grid offset to compensate cursor position.

Definition at line 1591 of file graphics_abstraction_layer.h.

Referenced by GetGridPoint(), SetGridOrigin(), and SetGridSize().

◆ m_gridOrigin

VECTOR2D KIGFX::GAL::m_gridOrigin
protectedinherited

◆ m_gridSize

◆ m_gridSources

◆ m_gridStyle

◆ m_gridTick

int KIGFX::GAL::m_gridTick
protectedinherited

◆ m_gridVisibility

bool KIGFX::GAL::m_gridVisibility
protectedinherited

◆ m_groupCounter

unsigned int KIGFX::CAIRO_GAL_BASE::m_groupCounter
protectedinherited

Counter used for generating group keys.

Definition at line 377 of file cairo_gal.h.

Referenced by CAIRO_GAL_BASE(), and getNewGroupNumber().

◆ m_groups

std::map<int, GROUP> KIGFX::CAIRO_GAL_BASE::m_groups
protectedinherited

List of graphic groups.

Definition at line 376 of file cairo_gal.h.

Referenced by BeginGroup(), ChangeGroupColor(), ClearCache(), DeleteGroup(), DrawGroup(), and getNewGroupNumber().

◆ m_hoverColor

COLOR4D KIGFX::GAL::m_hoverColor
protectedinherited

Color for hovered (active) links.

Definition at line 1581 of file graphics_abstraction_layer.h.

Referenced by DrawGlyphs(), and SetHoverColor().

◆ m_imageSurfaces

std::vector<cairo_surface_t*> KIGFX::CAIRO_GAL_BASE::m_imageSurfaces
protectedinherited

List of surfaces that were created by painting images, to be cleaned up later.

Definition at line 391 of file cairo_gal.h.

Referenced by DrawBitmap(), resetContext(), and ~CAIRO_GAL_BASE().

◆ m_isCursorEnabled

bool KIGFX::GAL::m_isCursorEnabled
protectedinherited

Is the cursor enabled?

Definition at line 1603 of file graphics_abstraction_layer.h.

Referenced by getCursorColor(), IsCursorEnabled(), and SetCursorEnabled().

◆ m_isElementAdded

bool KIGFX::CAIRO_GAL_BASE::m_isElementAdded
protectedinherited

◆ m_isFillEnabled

◆ m_isGrouping

bool KIGFX::CAIRO_GAL_BASE::m_isGrouping
protectedinherited

◆ m_isInitialized

bool KIGFX::CAIRO_GAL::m_isInitialized
protected

Are Cairo image & surface ready to use.

Definition at line 556 of file cairo_gal.h.

Referenced by CAIRO_GAL(), deinitSurface(), initSurface(), and SetTarget().

◆ m_isStrokeEnabled

◆ m_layerDepth

◆ m_lineWidth

◆ m_lineWidthInPixels

double KIGFX::CAIRO_GAL_BASE::m_lineWidthInPixels
protectedinherited

◆ m_lineWidthIsOdd

bool KIGFX::CAIRO_GAL_BASE::m_lineWidthIsOdd
protectedinherited

Definition at line 381 of file cairo_gal.h.

Referenced by CAIRO_GAL_BASE(), drawGridSource(), roundp(), and syncLineWidth().

◆ m_lookAtPoint

VECTOR2D KIGFX::GAL::m_lookAtPoint
protectedinherited

◆ m_mainBuffer

unsigned int KIGFX::CAIRO_GAL::m_mainBuffer
protected

Handle to the main buffer.

Definition at line 538 of file cairo_gal.h.

Referenced by BeginDrawing(), CAIRO_GAL(), ClearTarget(), EndDiffLayer(), EndDrawing(), EndNegativesLayer(), setCompositor(), and SetTarget().

◆ m_minLineWidth

float KIGFX::GAL::m_minLineWidth
protectedinherited

Minimum line width in pixels.

Definition at line 1573 of file graphics_abstraction_layer.h.

Referenced by GetMinLineWidth(), and SetMinLineWidth().

◆ m_mouseListener

wxEvtHandler* KIGFX::CAIRO_GAL::m_mouseListener
protected

Mouse listener.

Definition at line 547 of file cairo_gal.h.

Referenced by CAIRO_GAL(), SetMouseListener(), skipGestureEvent(), and skipMouseEvent().

◆ m_observerLink

UTIL::LINK KIGFX::GAL::m_observerLink
protectedinherited

Definition at line 1551 of file graphics_abstraction_layer.h.

Referenced by GAL().

◆ m_options

◆ m_overlayBuffer

unsigned int KIGFX::CAIRO_GAL::m_overlayBuffer
protected

Handle to the overlay buffer.

Definition at line 539 of file cairo_gal.h.

Referenced by CAIRO_GAL(), ClearTarget(), EndDrawing(), setCompositor(), and SetTarget().

◆ m_overlayExclusions

std::vector<wxRect> KIGFX::CAIRO_GAL::m_overlayExclusions
protected

Areas the frame blit must leave alone.

Definition at line 561 of file cairo_gal.h.

Referenced by EndDrawing(), and SetOverlayExclusions().

◆ m_paintListener

wxEvtHandler* KIGFX::CAIRO_GAL::m_paintListener
protected

Paint listener.

Definition at line 548 of file cairo_gal.h.

Referenced by CAIRO_GAL(), PostPaint(), and SetPaintListener().

◆ m_parentWindow

wxWindow* KIGFX::CAIRO_GAL::m_parentWindow
protected

Parent window.

Definition at line 546 of file cairo_gal.h.

Referenced by CAIRO_GAL().

◆ m_rotation

double KIGFX::GAL::m_rotation
protectedinherited

Rotation transformation (radians)

Definition at line 1561 of file graphics_abstraction_layer.h.

Referenced by ComputeWorldScreenMatrix(), GetRotation(), and SetRotation().

◆ m_savedBuffer

unsigned int KIGFX::CAIRO_GAL::m_savedBuffer
protected

Handle to buffer to restore after rendering to temp buffer.

Definition at line 541 of file cairo_gal.h.

Referenced by CAIRO_GAL().

◆ m_scaleLimitAbove

double KIGFX::GAL::m_scaleLimitAbove = std::numeric_limits<double>::max()
mutableprotectedinherited

Definition at line 1567 of file graphics_abstraction_layer.h.

Referenced by TakeWorldScaleLimits(), and WorldScaleBelow().

◆ m_scaleLimitBelow

double KIGFX::GAL::m_scaleLimitBelow = 0.0
mutableprotectedinherited

◆ m_screenDPI

double KIGFX::GAL::m_screenDPI
protectedinherited

◆ m_screenSize

◆ m_screenWorldMatrix

◆ m_stride

int KIGFX::CAIRO_GAL::m_stride
protected

Stride value for Cairo.

Definition at line 554 of file cairo_gal.h.

Referenced by allocateBitmaps(), EndDrawing(), and initSurface().

◆ m_strokeColor

◆ m_surface

cairo_surface_t* KIGFX::CAIRO_GAL_BASE::m_surface
protectedinherited

◆ m_tempBuffer

unsigned int KIGFX::CAIRO_GAL::m_tempBuffer
protected

Handle to the temp buffer.

Definition at line 540 of file cairo_gal.h.

Referenced by CAIRO_GAL(), ClearTarget(), EndDiffLayer(), EndNegativesLayer(), setCompositor(), and SetTarget().

◆ m_validCompositor

bool KIGFX::CAIRO_GAL::m_validCompositor
protected

Compositor initialization flag.

Definition at line 543 of file cairo_gal.h.

Referenced by BeginDrawing(), CAIRO_GAL(), ResizeScreen(), setCompositor(), SetTarget(), and updatedGalDisplayOptions().

◆ m_worldScale

◆ m_worldScaleRead

bool KIGFX::GAL::m_worldScaleRead = false
mutableprotectedinherited

◆ m_worldScreenMatrix

◆ m_worldUnitLength

double KIGFX::GAL::m_worldUnitLength
protectedinherited

◆ m_wxBufferWidth

int KIGFX::CAIRO_GAL::m_wxBufferWidth
protected

Definition at line 555 of file cairo_gal.h.

Referenced by allocateBitmaps(), EndDrawing(), and initSurface().

◆ m_wxOutput

unsigned char* KIGFX::CAIRO_GAL::m_wxOutput
protected

wxImage compatible buffer

Definition at line 550 of file cairo_gal.h.

Referenced by allocateBitmaps(), CAIRO_GAL(), deleteBitmaps(), and EndDrawing().

◆ m_xformStack

std::vector<cairo_matrix_t> KIGFX::CAIRO_GAL_BASE::m_xformStack
protectedinherited

Definition at line 393 of file cairo_gal.h.

Referenced by Restore(), and Save().

◆ m_zoomFactor

double KIGFX::GAL::m_zoomFactor
protectedinherited

◆ MAX_CAIRO_ARGUMENTS

const int KIGFX::CAIRO_GAL_BASE::MAX_CAIRO_ARGUMENTS = 4
staticprotectedinherited

Maximum number of arguments for one command.

Definition at line 338 of file cairo_gal.h.

◆ MAX_DEPTH

const int GAL::MAX_DEPTH = 2*MAX_LAYERS_FOR_VIEW - 1
staticprotectedinherited

Definition at line 1508 of file graphics_abstraction_layer.h.

Referenced by GAL(), and KIGFX::GAL_MODERN::PopulateCameraUBOs().

◆ MIN_DEPTH

const int GAL::MIN_DEPTH = -2*MAX_LAYERS_FOR_VIEW
staticprotectedinherited

Possible depth range.

Definition at line 1507 of file graphics_abstraction_layer.h.

Referenced by GAL().

◆ SEG_PER_CIRCLE_COUNT

int KIGFX::GAL::SEG_PER_CIRCLE_COUNT = 64
staticconstexprprotectedinherited

The default number of segments approximating a full circle.

Definition at line 1466 of file graphics_abstraction_layer.h.

Referenced by calcAngleStep(), and KIGFX::OPENGL_GAL::DrawArcSegment().


The documentation for this class was generated from the following files: