KiCad PCB EDA Suite
KIGFX::GAL Class Reference

Abstract interface for drawing on a 2D-surface. More...

#include <graphics_abstraction_layer.h>

Inheritance diagram for KIGFX::GAL:
KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER BASIC_GAL KIGFX::CAIRO_GAL_BASE KIGFX::OPENGL_GAL KIGFX::CAIRO_GAL KIGFX::CAIRO_PRINT_GAL

Classes

struct  TEXT_PROPERTIES
 

Public Member Functions

 GAL (GAL_DISPLAY_OPTIONS &aOptions)
 
virtual ~GAL ()
 
virtual bool IsInitialized () const
 Return the initialization status for the canvas. More...
 
virtual bool IsVisible () const
 Return true if the GAL canvas is visible on the screen. More...
 
virtual bool IsCairoEngine ()
 Return true if the GAL engine is a Cairo based type. More...
 
virtual bool IsOpenGlEngine ()
 Return true if the GAL engine is a OpenGL based type. More...
 
virtual void DrawLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 Draw a line. More...
 
virtual void DrawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
 Draw a rounded segment. More...
 
virtual void DrawPolyline (const std::deque< VECTOR2D > &aPointList)
 Draw a polyline. More...
 
virtual void DrawPolyline (const VECTOR2D aPointList[], int aListSize)
 
virtual void DrawPolyline (const SHAPE_LINE_CHAIN &aLineChain)
 
virtual void DrawCircle (const VECTOR2D &aCenterPoint, double aRadius)
 Draw a circle using world coordinates. More...
 
virtual void DrawArc (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
 Draw an arc. More...
 
virtual void DrawArcSegment (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth, double aMaxError)
 Draw an arc segment. More...
 
virtual void DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 Draw a rectangle. More...
 
virtual void DrawPolygon (const std::deque< VECTOR2D > &aPointList)
 Draw a polygon. More...
 
virtual void DrawPolygon (const VECTOR2D aPointList[], int aListSize)
 
virtual void DrawPolygon (const SHAPE_POLY_SET &aPolySet, bool aStrokeTriangulation=false)
 
virtual void DrawPolygon (const SHAPE_LINE_CHAIN &aPolySet)
 
virtual void DrawCurve (const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0)
 Draw a cubic bezier spline. More...
 
virtual void DrawBitmap (const BITMAP_BASE &aBitmap)
 Draw a bitmap image. More...
 
virtual void ResizeScreen (int aWidth, int aHeight)
 Resize the canvas. More...
 
virtual bool Show (bool aShow)
 Show/hide the GAL canvas. More...
 
const VECTOR2IGetScreenPixelSize () const
 Return GAL canvas size in pixels. More...
 
virtual void Flush ()
 Force all remaining objects to be drawn. More...
 
void SetClearColor (const COLOR4D &aColor)
 
const COLOR4DGetClearColor () const
 
virtual void ClearScreen ()
 Clear the screen. More...
 
virtual void SetIsFill (bool aIsFillEnabled)
 Enable/disable fill. More...
 
virtual void SetIsStroke (bool aIsStrokeEnabled)
 Enable/disable stroked outlines. More...
 
virtual void SetFillColor (const COLOR4D &aColor)
 Set the fill color. More...
 
const COLOR4DGetFillColor () const
 Get the fill color. More...
 
virtual void SetStrokeColor (const COLOR4D &aColor)
 Set the stroke color. More...
 
const COLOR4DGetStrokeColor () const
 Get the stroke color. More...
 
virtual void SetLineWidth (float aLineWidth)
 Set the line width. More...
 
float GetLineWidth () const
 Get the line width. More...
 
virtual void SetLayerDepth (double aLayerDepth)
 Set the depth of the layer (position on the z-axis) More...
 
const STROKE_FONTGetStrokeFont () const
 
virtual void StrokeText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
 Draw a vector type text using preloaded Newstroke font. More...
 
virtual void BitmapText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
 Draw a text using a bitmap font. More...
 
VECTOR2D GetTextLineSize (const UTF8 &aText) const
 Compute the X and Y size of a given text. More...
 
virtual void SetTextAttributes (const EDA_TEXT *aText)
 Loads attributes of the given text (bold/italic/underline/mirrored and so on). More...
 
void ResetTextAttributes ()
 Reset text attributes to default styling. More...
 
void SetGlyphSize (const VECTOR2D &aSize)
 Set the font glyph size. More...
 
const VECTOR2DGetGlyphSize () const
 
void SetFontBold (bool aBold)
 Set bold property of current font. More...
 
bool IsFontBold () const
 
void SetFontItalic (bool aItalic)
 Set italic property of current font. More...
 
bool IsFontItalic () const
 
void SetFontUnderlined (bool aUnderlined)
 
bool IsFontUnderlined () const
 
void SetTextMirrored (bool aMirrored)
 Set a mirrored property of text. More...
 
bool IsTextMirrored () const
 
void SetHorizontalJustify (const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
 Set the horizontal justify for text drawing. More...
 
EDA_TEXT_HJUSTIFY_T GetHorizontalJustify () const
 Return current text horizontal justification setting. More...
 
void SetVerticalJustify (const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
 Set the vertical justify for text drawing. More...
 
EDA_TEXT_VJUSTIFY_T GetVerticalJustify () const
 Returns current text vertical justification setting. More...
 
virtual void Transform (const MATRIX3x3D &aTransformation)
 Transform the context. More...
 
virtual void Rotate (double aAngle)
 Rotate the context. More...
 
virtual void Translate (const VECTOR2D &aTranslation)
 Translate the context. More...
 
virtual void Scale (const VECTOR2D &aScale)
 Scale the context. More...
 
virtual void Save ()
 Save the context. More...
 
virtual void Restore ()
 Restore the context. More...
 
virtual int BeginGroup ()
 Begin a group. More...
 
virtual void EndGroup ()
 End the group. More...
 
virtual void DrawGroup (int aGroupNumber)
 Draw the stored group. More...
 
virtual void ChangeGroupColor (int aGroupNumber, const COLOR4D &aNewColor)
 Change the color used to draw the group. More...
 
virtual void ChangeGroupDepth (int aGroupNumber, int aDepth)
 Change the depth (Z-axis position) of the group. More...
 
virtual void DeleteGroup (int aGroupNumber)
 Delete the group from the memory. More...
 
virtual void ClearCache ()
 Delete all data created during caching of graphic items. More...
 
virtual void ComputeWorldScreenMatrix ()
 Compute the world <-> screen transformation matrix. More...
 
const MATRIX3x3DGetWorldScreenMatrix () const
 Get the world <-> screen transformation matrix. More...
 
const MATRIX3x3DGetScreenWorldMatrix () const
 Get the screen <-> world transformation matrix. More...
 
void SetWorldScreenMatrix (const MATRIX3x3D &aMatrix)
 Set the world <-> screen transformation matrix. More...
 
BOX2D GetVisibleWorldExtents () const
 
void SetWorldUnitLength (double aWorldUnitLength)
 Set the unit length. More...
 
void SetScreenSize (const VECTOR2I &aSize)
 
void SetScreenDPI (double aScreenDPI)
 Set the dots per inch of the screen. More...
 
void SetLookAtPoint (const VECTOR2D &aPoint)
 Set the Point in world space to look at. More...
 
const VECTOR2DGetLookAtPoint () const
 Get the look at point. More...
 
void SetZoomFactor (double aZoomFactor)
 Set the zoom factor of the scene. More...
 
double GetZoomFactor () const
 Get the zoom factor. More...
 
void SetRotation (double aRotation)
 Set the rotation angle. More...
 
double GetRotation () const
 Get the rotation angle. More...
 
void SetDepthRange (const VECTOR2D &aDepthRange)
 Set the range of the layer depth. More...
 
double GetMinDepth () const
 Return the minimum depth in the currently used range (the top). More...
 
double GetMaxDepth () const
 Return the maximum depth in the currently used range (the bottom). More...
 
double GetWorldScale () const
 Get the world scale. More...
 
void SetFlip (bool xAxis, bool yAxis)
 Sets flipping of the screen. More...
 
bool IsFlippedX () const
 Return true if flip flag for the X axis is set. More...
 
bool IsFlippedY () const
 Return true if flip flag for the Y axis is set. More...
 
virtual void SetTarget (RENDER_TARGET aTarget)
 Set the target for rendering. More...
 
virtual RENDER_TARGET GetTarget () const
 Get the currently used target for rendering. More...
 
virtual void ClearTarget (RENDER_TARGET aTarget)
 Clear the target for rendering. More...
 
virtual bool HasTarget (RENDER_TARGET aTarget)
 Return true if the target exists. More...
 
virtual void SetNegativeDrawMode (bool aSetting)
 Set negative draw mode in the renderer. More...
 
virtual void StartDiffLayer ()
 Begins rendering of a differential layer. More...
 
virtual void EndDiffLayer ()
 Ends rendering of a differential layer. More...
 
virtual void StartNegativesLayer ()
 Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer(). More...
 
virtual void EndNegativesLayer ()
 Ends rendering of a negatives layer and draws it to the main layer. More...
 
void SetGridVisibility (bool aVisibility)
 Set the visibility setting of the grid. More...
 
bool GetGridVisibility () const
 
bool GetGridSnapping () const
 
void SetGridOrigin (const VECTOR2D &aGridOrigin)
 Set the origin point for the grid. More...
 
const VECTOR2DGetGridOrigin () const
 
void SetGridSize (const VECTOR2D &aGridSize)
 Set the grid size. More...
 
const VECTOR2DGetGridSize () const
 Return the grid size. More...
 
void SetGridColor (const COLOR4D &aGridColor)
 Set the grid color. More...
 
void SetAxesColor (const COLOR4D &aAxesColor)
 Set the axes color. More...
 
void SetAxesEnabled (bool aAxesEnabled)
 Enable drawing the axes. More...
 
void SetCoarseGrid (int aInterval)
 Draw every tick line wider. More...
 
float GetGridLineWidth () const
 Get the grid line width. More...
 
virtual void DrawGrid ()
 
VECTOR2D GetGridPoint (const VECTOR2D &aPoint) const
 For a given point it returns the nearest point belonging to the grid in world coordinates. More...
 
VECTOR2D ToWorld (const VECTOR2D &aPoint) const
 Compute the point position in world coordinates from given screen coordinates. More...
 
VECTOR2D ToScreen (const VECTOR2D &aPoint) const
 Compute the point position in screen coordinates from given world coordinates. More...
 
virtual bool SetNativeCursorStyle (KICURSOR aCursor)
 Set the cursor in the native panel. More...
 
void SetCursorEnabled (bool aCursorEnabled)
 Enable/disable cursor. More...
 
bool IsCursorEnabled () const
 Return information about cursor visibility. More...
 
void SetCursorColor (const COLOR4D &aCursorColor)
 Set the cursor color. More...
 
virtual void DrawCursor (const VECTOR2D &aCursorPosition)
 Draw the cursor. More...
 
void AdvanceDepth ()
 Change the current depth to deeper, so it is possible to draw objects right beneath other. More...
 
void PushDepth ()
 Store current drawing depth on the depth stack. More...
 
void PopDepth ()
 Restore previously stored drawing depth for the depth stack. More...
 
virtual void EnableDepthTest (bool aEnabled=false)
 
virtual bool IsContextLocked ()
 Checks the state of the context lock. More...
 

Protected Member Functions

virtual void lockContext (int aClientCookie)
 Use GAL_CONTEXT_LOCKER RAII object. More...
 
virtual void unlockContext (int aClientCookie)
 
virtual void beginUpdate ()
 Enable item update mode. More...
 
virtual void endUpdate ()
 Disable item update mode. More...
 
virtual void beginDrawing ()
 Begin the drawing, needs to be called for every new frame. More...
 
virtual void endDrawing ()
 End the drawing, needs to be called for every new frame. More...
 
void computeWorldScale ()
 Compute the scaling factor for the world->screen matrix. More...
 
double computeMinGridSpacing () const
 compute minimum grid spacing from the grid settings More...
 
COLOR4D getCursorColor () const
 Get the actual cursor color to draw. More...
 
void OnGalDisplayOptionsChanged (const GAL_DISPLAY_OPTIONS &aOptions) override
 Handler for observer settings changes. More...
 
virtual bool updatedGalDisplayOptions (const GAL_DISPLAY_OPTIONS &aOptions)
 Handle updating display options. More...
 

Protected Attributes

GAL_DISPLAY_OPTIONSm_options
 
UTIL::LINK m_observerLink
 
std::stack< double > m_depthStack
 Stored depth values. More...
 
VECTOR2I m_screenSize
 Screen size in screen coordinates. More...
 
double m_worldUnitLength
 The unit length of the world coordinates [inch]. More...
 
double m_screenDPI
 The dots per inch of the screen. More...
 
VECTOR2D m_lookAtPoint
 Point to be looked at in world space. More...
 
double m_zoomFactor
 The zoom factor. More...
 
double m_rotation
 Rotation transformation (radians) More...
 
MATRIX3x3D m_worldScreenMatrix
 World transformation. More...
 
MATRIX3x3D m_screenWorldMatrix
 Screen transformation. More...
 
double m_worldScale
 The scale factor world->screen. More...
 
bool m_globalFlipX
 Flag for X axis flipping. More...
 
bool m_globalFlipY
 Flag for Y axis flipping. More...
 
float m_lineWidth
 The line width. More...
 
bool m_isFillEnabled
 Is filling of graphic objects enabled ? More...
 
bool m_isStrokeEnabled
 Are the outlines stroked ? More...
 
COLOR4D m_fillColor
 The fill color. More...
 
COLOR4D m_strokeColor
 The color of the outlines. More...
 
COLOR4D m_clearColor
 
double m_layerDepth
 The actual layer depth. More...
 
VECTOR2D m_depthRange
 Range of the depth. More...
 
bool m_gridVisibility
 Should the grid be shown. More...
 
GRID_STYLE m_gridStyle
 Grid display style. More...
 
VECTOR2D m_gridSize
 The grid size. More...
 
VECTOR2D m_gridOrigin
 The grid origin. More...
 
VECTOR2D m_gridOffset
 The grid offset to compensate cursor position. More...
 
COLOR4D m_gridColor
 Color of the grid. More...
 
COLOR4D m_axesColor
 Color of the axes. More...
 
bool m_axesEnabled
 Should the axes be drawn. More...
 
int m_gridTick
 Every tick line gets the double width. More...
 
float m_gridLineWidth
 Line width of the grid. More...
 
int m_gridMinSpacing
 Minimum screen size of the grid (pixels) below which the grid is not drawn. More...
 
bool m_isCursorEnabled
 Is the cursor enabled? More...
 
bool m_forceDisplayCursor
 Always show cursor. More...
 
COLOR4D m_cursorColor
 Cursor color. More...
 
bool m_fullscreenCursor
 Shape of the cursor (fullscreen or small cross) More...
 
VECTOR2D m_cursorPosition
 Current cursor position (world coordinates) More...
 
STROKE_FONT m_strokeFont
 Instance of object that stores information about how to draw texts. More...
 
KICURSOR m_currentNativeCursor
 Current cursor. More...
 

Static Protected Attributes

static const int MIN_DEPTH = -1024
 Possible depth range. More...
 
static const int MAX_DEPTH = 1023
 
static const int GRID_DEPTH = MAX_DEPTH - 1
 Depth level on which the grid is drawn. More...
 

Private Attributes

struct KIGFX::GAL::TEXT_PROPERTIES textProperties
 

Friends

class GAL_CONTEXT_LOCKER
 
class GAL_UPDATE_CONTEXT
 
class GAL_DRAWING_CONTEXT
 

Detailed Description

Abstract interface for drawing on a 2D-surface.

The functions are optimized for drawing shapes of an EDA-program such as KiCad. Most methods are abstract and need to be implemented by a lower layer, for example by a Cairo or OpenGL implementation. Almost all methods use world coordinates as arguments. The board design is defined in world space units for drawing purposes these are transformed to screen units with this layer. So zooming is handled here as well.

Definition at line 60 of file graphics_abstraction_layer.h.

Constructor & Destructor Documentation

◆ GAL()

GAL::GAL ( GAL_DISPLAY_OPTIONS aOptions)

Definition at line 39 of file graphics_abstraction_layer.cpp.

39  :
40  m_options( aDisplayOptions ),
41  m_strokeFont( this ),
42  // m_currentNativeCursor is initialized with KICURSOR::DEFAULT value to avoid
43  // if comparison with uninitialized value on SetNativeCursorStyle method.
44  // Some classes inheriting from GAL has different SetNativeCursorStyle method
45  // implementation and therefore it's called also on constructor
46  // to change the value from DEFAULT to KICURSOR::ARROW
48 {
49  // Set the default values for the internal variables
50  SetIsFill( false );
51  SetIsStroke( true );
52  SetFillColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
53  SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
54  SetLookAtPoint( VECTOR2D( 0, 0 ) );
55  SetZoomFactor( 1.0 );
56  SetRotation( 0.0 );
57  // this value for SetWorldUnitLength is only suitable for Pcbnew.
58  // Other editors/viewer must call SetWorldUnitLength with their internal units
59  SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
60  // wxDC::GetPPI() reports 96 DPI, but somehow this value
61  // is the closest match to the legacy renderer
62  SetScreenDPI( 91 );
64  SetLayerDepth( 0.0 );
65  SetFlip( false, false );
66  SetLineWidth( 1.0f );
68  SetAxesEnabled( false );
69 
70  // Set grid defaults
71  SetGridVisibility( true );
72  SetCoarseGrid( 10 );
73  m_gridLineWidth = 0.5f;
75  m_gridMinSpacing = 10;
76 
77  // Initialize the cursor shape
78  SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
79  m_fullscreenCursor = false;
80  m_forceDisplayCursor = false;
81  SetCursorEnabled( false );
82 
83  // Initialize the native widget to an arrow cursor
85 
86  // Initialize text properties
88 
90 
91  // subscribe for settings updates
93 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
Use lines for the grid.
STROKE_FONT m_strokeFont
Instance of object that stores information about how to draw texts.
void SetCursorEnabled(bool aCursorEnabled)
Enable/disable cursor.
LINK Subscribe(ObserverInterface *aObserver)
Add a subscription returning an RAII link.
Definition: observable.h:157
void SetFlip(bool xAxis, bool yAxis)
Sets flipping of the screen.
bool LoadNewStrokeFont(const char *const aNewStrokeFont[], int aNewStrokeFontSize)
Load the new stroke font.
Definition: stroke_font.cpp:58
void SetScreenDPI(double aScreenDPI)
Set the dots per inch of the screen.
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
float m_gridLineWidth
Line width of the grid.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
static const int MIN_DEPTH
Possible depth range.
GAL_DISPLAY_OPTIONS & m_options
const char *const newstroke_font[]
Array containing strokes for unicode glyphs.
void ResetTextAttributes()
Reset text attributes to default styling.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
int m_gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
virtual bool SetNativeCursorStyle(KICURSOR aCursor)
Set the cursor in the native panel.
const int newstroke_font_bufsize
void computeWorldScale()
Compute the scaling factor for the world->screen matrix.
GRID_STYLE m_gridStyle
Grid display style.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void SetCoarseGrid(int aInterval)
Draw every tick line wider.
bool m_forceDisplayCursor
Always show cursor.
void SetRotation(double aRotation)
Set the rotation angle.
void SetZoomFactor(double aZoomFactor)
Set the zoom factor of the scene.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
bool m_fullscreenCursor
Shape of the cursor (fullscreen or small cross)
void SetLookAtPoint(const VECTOR2D &aPoint)
Set the Point in world space to look at.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
void SetDepthRange(const VECTOR2D &aDepthRange)
Set the range of the layer depth.
KICURSOR m_currentNativeCursor
Current cursor.
static const int MAX_DEPTH
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References ARROW, computeWorldScale(), KIGFX::LINES, KIGFX::STROKE_FONT::LoadNewStrokeFont(), m_forceDisplayCursor, m_fullscreenCursor, m_gridLineWidth, m_gridMinSpacing, m_gridStyle, m_observerLink, m_options, m_strokeFont, MAX_DEPTH, MIN_DEPTH, newstroke_font, newstroke_font_bufsize, ResetTextAttributes(), SetAxesEnabled(), SetCoarseGrid(), SetCursorColor(), SetCursorEnabled(), SetDepthRange(), SetFillColor(), SetFlip(), SetGridVisibility(), SetIsFill(), SetIsStroke(), SetLayerDepth(), SetLineWidth(), SetLookAtPoint(), SetNativeCursorStyle(), SetRotation(), SetScreenDPI(), SetStrokeColor(), SetWorldUnitLength(), SetZoomFactor(), and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().

◆ ~GAL()

GAL::~GAL ( )
virtual

Definition at line 96 of file graphics_abstraction_layer.cpp.

97 {
98 }

Member Function Documentation

◆ AdvanceDepth()

void KIGFX::GAL::AdvanceDepth ( )
inline

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

Definition at line 1056 of file graphics_abstraction_layer.h.

1057  {
1058  m_layerDepth -= 0.05;
1059  }
double m_layerDepth
The actual layer depth.

References m_layerDepth.

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

◆ beginDrawing()

virtual void KIGFX::GAL::beginDrawing ( )
inlineprotectedvirtual

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

Private: use GAL_DRAWING_CONTEXT RAII object

Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 1104 of file graphics_abstraction_layer.h.

1104 {};

Referenced by KIGFX::GAL_DRAWING_CONTEXT::GAL_DRAWING_CONTEXT().

◆ BeginGroup()

virtual int KIGFX::GAL::BeginGroup ( )
inlinevirtual

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 in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 532 of file graphics_abstraction_layer.h.

532 { return 0; };

Referenced by KIGFX::VIEW::updateItemGeometry().

◆ beginUpdate()

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

Enable item update mode.

Private: use GAL_UPDATE_CONTEXT RAII object

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1097 of file graphics_abstraction_layer.h.

1097 {}

Referenced by KIGFX::GAL_UPDATE_CONTEXT::GAL_UPDATE_CONTEXT().

◆ BitmapText()

virtual void KIGFX::GAL::BitmapText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)
inlinevirtual

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.
aRotationAngleis the text rotation angle.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 361 of file graphics_abstraction_layer.h.

363  {
364  // Fallback: use stroke font
365 
366  // Handle flipped view
367  if( m_globalFlipX )
369 
370  // Bitmap font is slightly smaller and slightly heavier than the stroke font so we
371  // compensate a bit before stroking
372  float saveLineWidth = m_lineWidth;
373  VECTOR2D saveGlyphSize = textProperties.m_glyphSize;
374  {
375  m_lineWidth *= 1.2f;
377 
378  StrokeText( aText, aPosition, aRotationAngle );
379  }
380  m_lineWidth = saveLineWidth;
381  textProperties.m_glyphSize = saveGlyphSize;
382 
383  if( m_globalFlipX )
385  }
bool m_globalFlipX
Flag for X axis flipping.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
VECTOR2D m_glyphSize
Size of the glyphs.
float m_lineWidth
The line width.

References m_globalFlipX, KIGFX::GAL::TEXT_PROPERTIES::m_glyphSize, m_lineWidth, KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, StrokeText(), and textProperties.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), and KIGFX::VIEW_OVERLAY::COMMAND_BITMAP_TEXT::Execute().

◆ ChangeGroupColor()

virtual void KIGFX::GAL::ChangeGroupColor ( int  aGroupNumber,
const COLOR4D aNewColor 
)
inlinevirtual

Change the color used to draw the group.

Parameters
aGroupNumberis the group number.
aNewColoris the new color.

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

Definition at line 550 of file graphics_abstraction_layer.h.

550 {};

Referenced by KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator()(), KIGFX::VIEW::UpdateAllLayersColor(), and KIGFX::VIEW::updateItemColor().

◆ ChangeGroupDepth()

virtual void KIGFX::GAL::ChangeGroupDepth ( int  aGroupNumber,
int  aDepth 
)
inlinevirtual

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

Parameters
aGroupNumberis the group number.
aDepthis the new depth.

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

Definition at line 558 of file graphics_abstraction_layer.h.

558 {};

Referenced by KIGFX::VIEW::UPDATE_DEPTH_VISITOR::operator()(), and KIGFX::VIEW::UpdateAllLayersOrder().

◆ ClearCache()

virtual void KIGFX::GAL::ClearCache ( )
inlinevirtual

Delete all data created during caching of graphic items.

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

Definition at line 570 of file graphics_abstraction_layer.h.

570 {};

Referenced by KIGFX::VIEW::Clear().

◆ ClearScreen()

virtual void KIGFX::GAL::ClearScreen ( )
inlinevirtual

Clear the screen.

Parameters
aColoris the color used for clearing.

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

Definition at line 232 of file graphics_abstraction_layer.h.

232 {};

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().

◆ ClearTarget()

virtual void KIGFX::GAL::ClearTarget ( RENDER_TARGET  aTarget)
inlinevirtual

Clear the target for rendering.

Parameters
aTargetis the target to be cleared.

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

Definition at line 798 of file graphics_abstraction_layer.h.

798 {};

Referenced by KIGFX::VIEW::ClearTargets().

◆ computeMinGridSpacing()

double GAL::computeMinGridSpacing ( ) const
protected

compute minimum grid spacing from the grid settings

Returns
the minimum spacing to use for drawing the grid

Definition at line 237 of file graphics_abstraction_layer.cpp.

238 {
239  // just return the current value. This could be cleverer and take
240  // into account other settings in future
241  return m_gridMinSpacing;
242 }
int m_gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.

References m_gridMinSpacing.

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

◆ computeWorldScale()

void KIGFX::GAL::computeWorldScale ( )
inlineprotected

Compute the scaling factor for the world->screen matrix.

Definition at line 1111 of file graphics_abstraction_layer.h.

1112  {
1114  }
double m_zoomFactor
The zoom factor.
double m_worldScale
The scale factor world->screen.
double m_screenDPI
The dots per inch of the screen.
double m_worldUnitLength
The unit length of the world coordinates [inch].

References m_screenDPI, m_worldScale, m_worldUnitLength, and m_zoomFactor.

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

◆ ComputeWorldScreenMatrix()

void GAL::ComputeWorldScreenMatrix ( )
virtual

Compute the world <-> screen transformation matrix.

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

Definition at line 192 of file graphics_abstraction_layer.cpp.

193 {
195 
196  MATRIX3x3D translation;
197  translation.SetIdentity();
198  // We're deliberately dividing integers to avoid fractional pixel offsets.
199  translation.SetTranslation( VECTOR2D( m_screenSize.x/2, m_screenSize.y/2 ) );
200 
201  MATRIX3x3D rotate;
202  rotate.SetIdentity();
203  rotate.SetRotation( m_rotation );
204 
206  scale.SetIdentity();
207  scale.SetScale( VECTOR2D( m_worldScale, m_worldScale ) );
208 
209  MATRIX3x3D flip;
210  flip.SetIdentity();
211  flip.SetScale( VECTOR2D( m_globalFlipX ? -1.0 : 1.0, m_globalFlipY ? -1.0 : 1.0 ) );
212 
213  MATRIX3x3D lookat;
214  lookat.SetIdentity();
215  lookat.SetTranslation( -m_lookAtPoint );
216 
217  m_worldScreenMatrix = translation * rotate * flip * scale * lookat;
219 }
void SetRotation(T aAngle)
Set the rotation components of the matrix.
Definition: matrix3x3.h:245
MATRIX3x3D m_screenWorldMatrix
Screen transformation.
MATRIX3x3 Inverse() const
Determine the inverse of the matrix.
Definition: matrix3x3.h:339
VECTOR2D m_lookAtPoint
Point to be looked at in world space.
void SetIdentity()
Set the matrix to the identity matrix.
Definition: matrix3x3.h:210
MATRIX3x3D m_worldScreenMatrix
World transformation.
double m_worldScale
The scale factor world->screen.
bool m_globalFlipX
Flag for X axis flipping.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
void computeWorldScale()
Compute the scaling factor for the world->screen matrix.
double m_rotation
Rotation transformation (radians)
const int scale
void SetScale(VECTOR2< T > aScale)
Set the scale components of the matrix.
Definition: matrix3x3.h:257
bool m_globalFlipY
Flag for Y axis flipping.
void SetTranslation(VECTOR2< T > aTranslation)
Set the translation components of the matrix.
Definition: matrix3x3.h:226
VECTOR2I m_screenSize
Screen size in screen coordinates.

References computeWorldScale(), MATRIX3x3< T >::Inverse(), m_globalFlipX, m_globalFlipY, m_lookAtPoint, m_rotation, m_screenSize, m_screenWorldMatrix, m_worldScale, m_worldScreenMatrix, scale, MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetRotation(), MATRIX3x3< T >::SetScale(), MATRIX3x3< T >::SetTranslation(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::resetContext(), KIGFX::VIEW::SetCenter(), and KIGFX::VIEW::SetScale().

◆ DeleteGroup()

virtual void KIGFX::GAL::DeleteGroup ( int  aGroupNumber)
inlinevirtual

Delete the group from the memory.

Parameters
aGroupNumberis the group number.

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

Definition at line 565 of file graphics_abstraction_layer.h.

565 {};

Referenced by KIGFX::VIEW::RECACHE_ITEM_VISITOR::operator()(), KIGFX::VIEW::Remove(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW::updateLayers().

◆ DrawArc()

virtual void KIGFX::GAL::DrawArc ( const VECTOR2D aCenterPoint,
double  aRadius,
double  aStartAngle,
double  aEndAngle 
)
inlinevirtual

Draw an arc.

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

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

Definition at line 136 of file graphics_abstraction_layer.h.

137  {};

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), and KIGFX::VIEW_OVERLAY::COMMAND_ARC::Execute().

◆ DrawArcSegment()

virtual void KIGFX::GAL::DrawArcSegment ( const VECTOR2D aCenterPoint,
double  aRadius,
double  aStartAngle,
double  aEndAngle,
double  aWidth,
double  aMaxError 
)
inlinevirtual

Draw an arc segment.

This method differs from DrawArc() in what happens when fill/stroke are on or off. DrawArc() draws a "pie piece" when fill is turned on, and a thick stroke when fill is off. DrawArcSegment() with fill on behaves like DrawArc() with fill off. DrawArcSegment() with fill off draws the outline of what it would have drawn with fill on.

TODO: Unify Arc routines

Parameters
aCenterPointis the center point of the arc.
aRadiusis the arc radius.
aStartAngleis the start angle of the arc.
aEndAngleis the end angle of the arc.
aWidthis the thickness of the arc (pen size).
aMaxErroris the max allowed error to create segments to approximate a circle. It has meaning only for back ends that can't draw a true arc, and use segments to approximate.

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

Definition at line 157 of file graphics_abstraction_layer.h.

158  {};

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_PAINTER::draw().

◆ DrawBitmap()

virtual void KIGFX::GAL::DrawBitmap ( const BITMAP_BASE aBitmap)
inlinevirtual

Draw a bitmap image.

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

Definition at line 196 of file graphics_abstraction_layer.h.

196 {};

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

◆ DrawCircle()

virtual void KIGFX::GAL::DrawCircle ( const VECTOR2D aCenterPoint,
double  aRadius 
)
inlinevirtual

◆ DrawCursor()

virtual void KIGFX::GAL::DrawCursor ( const VECTOR2D aCursorPosition)
inlinevirtual

Draw the cursor.

Parameters
aCursorPositionis the cursor position in screen coordinates.

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

Definition at line 1050 of file graphics_abstraction_layer.h.

1050 {};

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().

◆ DrawCurve()

virtual void KIGFX::GAL::DrawCurve ( const VECTOR2D startPoint,
const VECTOR2D controlPointA,
const VECTOR2D controlPointB,
const VECTOR2D endPoint,
double  aFilterValue = 0.0 
)
inlinevirtual

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 in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 189 of file graphics_abstraction_layer.h.

191  {};

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

◆ DrawGrid()

virtual void KIGFX::GAL::DrawGrid ( )
inlinevirtual

◆ DrawGroup()

virtual void KIGFX::GAL::DrawGroup ( int  aGroupNumber)
inlinevirtual

Draw the stored group.

Parameters
aGroupNumberis the group number.

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

Definition at line 542 of file graphics_abstraction_layer.h.

542 {};

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

◆ DrawLine()

◆ DrawPolygon() [1/4]

◆ DrawPolygon() [2/4]

virtual void KIGFX::GAL::DrawPolygon ( const VECTOR2D  aPointList[],
int  aListSize 
)
inlinevirtual

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

Definition at line 174 of file graphics_abstraction_layer.h.

174 {};

◆ DrawPolygon() [3/4]

virtual void KIGFX::GAL::DrawPolygon ( const SHAPE_POLY_SET aPolySet,
bool  aStrokeTriangulation = false 
)
inlinevirtual

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

Definition at line 175 of file graphics_abstraction_layer.h.

175 {};

◆ DrawPolygon() [4/4]

virtual void KIGFX::GAL::DrawPolygon ( const SHAPE_LINE_CHAIN aPolySet)
inlinevirtual

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

Definition at line 176 of file graphics_abstraction_layer.h.

176 {};

◆ DrawPolyline() [1/3]

virtual void KIGFX::GAL::DrawPolyline ( const std::deque< VECTOR2D > &  aPointList)
inlinevirtual

◆ DrawPolyline() [2/3]

virtual void KIGFX::GAL::DrawPolyline ( const VECTOR2D  aPointList[],
int  aListSize 
)
inlinevirtual

Reimplemented in KIGFX::OPENGL_GAL, BASIC_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 117 of file graphics_abstraction_layer.h.

117 {};

◆ DrawPolyline() [3/3]

virtual void KIGFX::GAL::DrawPolyline ( const SHAPE_LINE_CHAIN aLineChain)
inlinevirtual

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

Definition at line 118 of file graphics_abstraction_layer.h.

118 {};

◆ DrawRectangle()

virtual void KIGFX::GAL::DrawRectangle ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inlinevirtual

◆ DrawSegment()

virtual void KIGFX::GAL::DrawSegment ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint,
double  aWidth 
)
inlinevirtual

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 in KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 108 of file graphics_abstraction_layer.h.

109  {};

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), and ROUTER_PREVIEW_ITEM::drawShape().

◆ EnableDepthTest()

virtual void KIGFX::GAL::EnableDepthTest ( bool  aEnabled = false)
inlinevirtual

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

Definition at line 1078 of file graphics_abstraction_layer.h.

1078 {};

◆ EndDiffLayer()

virtual void KIGFX::GAL::EndDiffLayer ( )
inlinevirtual

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 in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.

Definition at line 837 of file graphics_abstraction_layer.h.

837 {};

Referenced by KIGFX::VIEW::redrawRect().

◆ endDrawing()

virtual void KIGFX::GAL::endDrawing ( )
inlineprotectedvirtual

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

Private: use GAL_DRAWING_CONTEXT RAII object

Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 1108 of file graphics_abstraction_layer.h.

1108 {};

Referenced by KIGFX::GAL_DRAWING_CONTEXT::~GAL_DRAWING_CONTEXT().

◆ EndGroup()

virtual void KIGFX::GAL::EndGroup ( )
inlinevirtual

End the group.

Reimplemented in KIGFX::CAIRO_GAL, KIGFX::OPENGL_GAL, and KIGFX::CAIRO_GAL_BASE.

Definition at line 535 of file graphics_abstraction_layer.h.

535 {};

Referenced by KIGFX::VIEW::updateItemGeometry().

◆ EndNegativesLayer()

virtual void KIGFX::GAL::EndNegativesLayer ( )
inlinevirtual

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

No-op in OpenGL.

Reimplemented in KIGFX::CAIRO_GAL.

Definition at line 853 of file graphics_abstraction_layer.h.

853 {};

Referenced by KIGFX::VIEW::redrawRect().

◆ endUpdate()

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

Disable item update mode.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1100 of file graphics_abstraction_layer.h.

1100 {}

Referenced by KIGFX::GAL_UPDATE_CONTEXT::~GAL_UPDATE_CONTEXT().

◆ Flush()

virtual void KIGFX::GAL::Flush ( )
inlinevirtual

Force all remaining objects to be drawn.

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

Definition at line 215 of file graphics_abstraction_layer.h.

215 {};

◆ GetClearColor()

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

Definition at line 222 of file graphics_abstraction_layer.h.

223  {
224  return m_clearColor;
225  }

References m_clearColor.

Referenced by EDIT_POINTS::ViewDraw().

◆ getCursorColor()

COLOR4D GAL::getCursorColor ( ) const
protected

Get the actual cursor color to draw.

Definition at line 267 of file graphics_abstraction_layer.cpp.

268 {
270 
271  // dim the cursor if it's only on because it was forced
272  // (this helps to provide a hint for active tools)
273  if( !m_isCursorEnabled )
274  color.a = color.a * 0.5;
275 
276  return color;
277 }
int color
Definition: DXF_plotter.cpp:57
bool m_isCursorEnabled
Is the cursor enabled?
COLOR4D m_cursorColor
Cursor color.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References color, m_cursorColor, and m_isCursorEnabled.

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

◆ GetFillColor()

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

Get the fill color.

Returns
the color for filling a outline.

Definition at line 273 of file graphics_abstraction_layer.h.

274  {
275  return m_fillColor;
276  }
COLOR4D m_fillColor
The fill color.

References m_fillColor.

◆ GetGlyphSize()

◆ GetGridLineWidth()

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

Get the grid line width.

Returns
the grid line widthDraw the grid

Definition at line 969 of file graphics_abstraction_layer.h.

References m_gridLineWidth.

◆ GetGridOrigin()

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

Definition at line 894 of file graphics_abstraction_layer.h.

895  {
896  return m_gridOrigin;
897  }
VECTOR2D m_gridOrigin
The grid origin.

References m_gridOrigin.

Referenced by GRID_HELPER::GetOrigin().

◆ GetGridPoint()

VECTOR2D GAL::GetGridPoint ( const VECTOR2D aPoint) const

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 245 of file graphics_abstraction_layer.cpp.

246 {
247 #if 0
248  // This old code expects a non zero grid size, which can be wrong here.
249  return VECTOR2D( KiROUND( ( aPoint.x - m_gridOffset.x ) / m_gridSize.x ) * m_gridSize.x + m_gridOffset.x,
250  KiROUND( ( aPoint.y - m_gridOffset.y ) / m_gridSize.y ) * m_gridSize.y + m_gridOffset.y );
251 #else
252  // if grid size == 0.0 there is no grid, so use aPoint as grid reference position
253  double cx = m_gridSize.x > 0.0 ? KiROUND( ( aPoint.x - m_gridOffset.x ) / m_gridSize.x ) * m_gridSize.x + m_gridOffset.x
254  : aPoint.x;
255  double cy = m_gridSize.y > 0.0 ? KiROUND( ( aPoint.y - m_gridOffset.y ) / m_gridSize.y ) * m_gridSize.y + m_gridOffset.y
256  : aPoint.y;
257 
258  return VECTOR2D( cx, cy );
259 #endif
260 }
VECTOR2D m_gridSize
The grid size.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
VECTOR2D m_gridOffset
The grid offset to compensate cursor position.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73

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

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

◆ GetGridSize()

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

Return the grid size.

Returns
A vector containing the grid size in x and y direction.

Definition at line 921 of file graphics_abstraction_layer.h.

922  {
923  return m_gridSize;
924  }
VECTOR2D m_gridSize
The grid size.

References m_gridSize.

Referenced by COMMON_TOOLS::CursorControl(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), GRID_HELPER::GetGrid(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_DRAW_FRAME::GetNearestHalfGridPosition(), COMMON_TOOLS::PanControl(), and EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ GetGridSnapping()

◆ GetGridVisibility()

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

Definition at line 866 of file graphics_abstraction_layer.h.

866 { return m_gridVisibility; }
bool m_gridVisibility
Should the grid be shown.

References m_gridVisibility.

Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ GetHorizontalJustify()

EDA_TEXT_HJUSTIFY_T KIGFX::GAL::GetHorizontalJustify ( ) const
inline

Return current text horizontal justification setting.

Definition at line 458 of file graphics_abstraction_layer.h.

459  {
461  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
EDA_TEXT_HJUSTIFY_T m_horizontalJustify
Horizontal justification.

References KIGFX::GAL::TEXT_PROPERTIES::m_horizontalJustify, and textProperties.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::SCH_PAINTER::boxText(), and KIGFX::STROKE_FONT::drawSingleLineText().

◆ GetLineWidth()

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

◆ GetLookAtPoint()

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

Get the look at point.

Returns
the look at point.

Definition at line 663 of file graphics_abstraction_layer.h.

664  {
665  return m_lookAtPoint;
666  }
VECTOR2D m_lookAtPoint
Point to be looked at in world space.

References m_lookAtPoint.

Referenced by GetVisibleWorldExtents().

◆ GetMaxDepth()

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

Return the maximum depth in the currently used range (the bottom).

Definition at line 732 of file graphics_abstraction_layer.h.

733  {
734  return m_depthRange.y;
735  }
VECTOR2D m_depthRange
Range of the depth.

References m_depthRange, and VECTOR2< T >::y.

◆ GetMinDepth()

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

Return the minimum depth in the currently used range (the top).

Definition at line 724 of file graphics_abstraction_layer.h.

725  {
726  return m_depthRange.x;
727  }
VECTOR2D m_depthRange
Range of the depth.

References m_depthRange, and VECTOR2< T >::x.

Referenced by KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ GetRotation()

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

Get the rotation angle.

Returns
The rotation angle (radians).

Definition at line 703 of file graphics_abstraction_layer.h.

704  {
705  return m_rotation;
706  }
double m_rotation
Rotation transformation (radians)

References m_rotation.

◆ GetScreenPixelSize()

◆ GetScreenWorldMatrix()

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

Get the screen <-> world transformation matrix.

Returns
the transformation matrix.

Definition at line 594 of file graphics_abstraction_layer.h.

595  {
596  return m_screenWorldMatrix;
597  }
MATRIX3x3D m_screenWorldMatrix
Screen transformation.

References m_screenWorldMatrix.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::getShadowWidth(), GetVisibleWorldExtents(), KIGFX::OPENGL_GAL::getWorldPixelSize(), screenSpaceCircle(), screenSpaceLine(), and KIGFX::VIEW::ToWorld().

◆ GetStrokeColor()

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

Get the stroke color.

Returns
the color for stroking the outline.

Definition at line 293 of file graphics_abstraction_layer.h.

294  {
295  return m_strokeColor;
296  }
COLOR4D m_strokeColor
The color of the outlines.

References m_strokeColor.

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

◆ GetStrokeFont()

const STROKE_FONT& KIGFX::GAL::GetStrokeFont ( ) const
inline

Definition at line 335 of file graphics_abstraction_layer.h.

336  {
337  return m_strokeFont;
338  }
STROKE_FONT m_strokeFont
Instance of object that stores information about how to draw texts.

References m_strokeFont.

Referenced by KIGFX::SCH_PAINTER::boxText(), and EDA_TEXT::GetTextBox().

◆ GetTarget()

virtual RENDER_TARGET KIGFX::GAL::GetTarget ( ) const
inlinevirtual

Get the currently used target for rendering.

Returns
The current rendering target.

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

Definition at line 791 of file graphics_abstraction_layer.h.

791 { return TARGET_CACHED; };
Main rendering target (cached)
Definition: definitions.h:48

References KIGFX::TARGET_CACHED.

◆ GetTextLineSize()

VECTOR2D GAL::GetTextLineSize ( const UTF8 aText) const

Compute the X and Y size of a given text.

The text is expected to be a only one line text.

Parameters
aTextis the text string (one line).
Returns
is the text size.

Definition at line 183 of file graphics_abstraction_layer.cpp.

184 {
185  // Compute the X and Y size of a given text.
186  // Because computeTextLineSize expects a one line text,
187  // aText is expected to be only one line text.
188  return m_strokeFont.computeTextLineSize( aText );
189 }
STROKE_FONT m_strokeFont
Instance of object that stores information about how to draw texts.
VECTOR2D computeTextLineSize(const UTF8 &aText) const
Compute the X and Y size of a given text.

References KIGFX::STROKE_FONT::computeTextLineSize(), and m_strokeFont.

Referenced by LABEL_MANAGER::Add(), GraphicTextWidth(), and EDA_TEXT::LenSize().

◆ GetVerticalJustify()

EDA_TEXT_VJUSTIFY_T KIGFX::GAL::GetVerticalJustify ( ) const
inline

Returns current text vertical justification setting.

Definition at line 476 of file graphics_abstraction_layer.h.

477  {
479  }
EDA_TEXT_VJUSTIFY_T m_verticalJustify
Vertical justification.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_verticalJustify, and textProperties.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::SCH_PAINTER::boxText(), and KIGFX::STROKE_FONT::Draw().

◆ GetVisibleWorldExtents()

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

Definition at line 222 of file graphics_abstraction_layer.cpp.

223 {
224  const MATRIX3x3D& matrix = GetScreenWorldMatrix();
225 
226  VECTOR2D halfSize = VECTOR2D( matrix.GetScale().x * m_screenSize.x * 0.5,
227  matrix.GetScale().y * m_screenSize.y * 0.5 );
228 
229  BOX2D extents;
230  extents.SetOrigin( GetLookAtPoint() - halfSize );
231  extents.SetSize( halfSize * 2 );
232 
233  return extents;
234 }
const MATRIX3x3D & GetScreenWorldMatrix() const
Get the screen <-> world transformation matrix.
Define a general 2D-vector/point.
Definition: vector2d.h:61
VECTOR2< T > GetScale() const
Get the scale components of the matrix.
Definition: matrix3x3.h:265
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
const VECTOR2D & GetLookAtPoint() const
Get the look at point.
void SetOrigin(const Vec &pos)
Definition: box2.h:193
VECTOR2I m_screenSize
Screen size in screen coordinates.

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

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

◆ GetWorldScale()

double KIGFX::GAL::GetWorldScale ( ) const
inline

◆ GetWorldScreenMatrix()

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

Get the world <-> screen transformation matrix.

Returns
the transformation matrix.

Definition at line 584 of file graphics_abstraction_layer.h.

585  {
586  return m_worldScreenMatrix;
587  }
MATRIX3x3D m_worldScreenMatrix
World transformation.

References m_worldScreenMatrix.

Referenced by KIGFX::VIEW::ToScreen().

◆ GetZoomFactor()

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

Get the zoom factor.

Returns
the zoom factor.

Definition at line 683 of file graphics_abstraction_layer.h.

684  {
685  return m_zoomFactor;
686  }
double m_zoomFactor
The zoom factor.

References m_zoomFactor.

Referenced by COMMON_TOOLS::doZoomInOut(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), EDA_DRAW_FRAME::OnUpdateSelectZoom(), ZOOM_MENU::update(), and EDA_DRAW_FRAME::UpdateZoomSelectBox().

◆ HasTarget()

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

Return true if the target exists.

Parameters
aTargetis the target to be checked.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 805 of file graphics_abstraction_layer.h.

806  {
807  return true;
808  };

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint().

◆ IsCairoEngine()

virtual bool KIGFX::GAL::IsCairoEngine ( )
inlinevirtual

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

Reimplemented in KIGFX::CAIRO_GAL_BASE.

Definition at line 80 of file graphics_abstraction_layer.h.

80 { return false; }

Referenced by getShadowLayer().

◆ IsContextLocked()

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

Checks the state of the context lock.

Returns
True if the context is currently locked

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1084 of file graphics_abstraction_layer.h.

1085  {
1086  return false;
1087  }

Referenced by EDA_DRAW_PANEL_GAL::onSize().

◆ IsCursorEnabled()

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

Return information about cursor visibility.

Returns
True if cursor is visible.

Definition at line 1030 of file graphics_abstraction_layer.h.

1031  {
1033  }
bool m_isCursorEnabled
Is the cursor enabled?
bool m_forceDisplayCursor
Always show cursor.

References m_forceDisplayCursor, and m_isCursorEnabled.

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

◆ IsFlippedX()

bool KIGFX::GAL::IsFlippedX ( ) const
inline

Return true if flip flag for the X axis is set.

Definition at line 762 of file graphics_abstraction_layer.h.

763  {
764  return m_globalFlipX;
765  }
bool m_globalFlipX
Flag for X axis flipping.

References m_globalFlipX.

Referenced by KIGFX::CAIRO_GAL_BASE::angle_xform(), KIGFX::CAIRO_GAL_BASE::arc_angles_xform_and_normalize(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), and DS_PROXY_VIEW_ITEM::ViewDraw().

◆ IsFlippedY()

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

Return true if flip flag for the Y axis is set.

Definition at line 770 of file graphics_abstraction_layer.h.

771  {
772  return m_globalFlipY;
773  }
bool m_globalFlipY
Flag for Y axis flipping.

References m_globalFlipY.

◆ IsFontBold()

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

Definition at line 424 of file graphics_abstraction_layer.h.

424 { return textProperties.m_bold; }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_bold, and textProperties.

Referenced by KIGFX::STROKE_FONT::Draw().

◆ IsFontItalic()

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

◆ IsFontUnderlined()

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

◆ IsInitialized()

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

Return the initialization status for the canvas.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 74 of file graphics_abstraction_layer.h.

74 { return true; }

Referenced by SCH_DRAW_PANEL::onPaint(), and EDA_DRAW_PANEL_GAL::onRefreshTimer().

◆ IsOpenGlEngine()

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

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

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 83 of file graphics_abstraction_layer.h.

83 { return false; }

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_PAINTER::draw().

◆ IsTextMirrored()

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

◆ IsVisible()

virtual bool KIGFX::GAL::IsVisible ( ) const
inlinevirtual

◆ lockContext()

virtual void KIGFX::GAL::lockContext ( int  aClientCookie)
inlineprotectedvirtual

Use GAL_CONTEXT_LOCKER RAII object.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1091 of file graphics_abstraction_layer.h.

1091 {}

Referenced by KIGFX::GAL_CONTEXT_LOCKER::GAL_CONTEXT_LOCKER().

◆ OnGalDisplayOptionsChanged()

void GAL::OnGalDisplayOptionsChanged ( const GAL_DISPLAY_OPTIONS aOptions)
overrideprotectedvirtual

Handler for observer settings changes.

Implements KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER.

Definition at line 101 of file graphics_abstraction_layer.cpp.

102 {
103  // defer to the child class first
104  updatedGalDisplayOptions( aOptions );
105 
106  // there is no refresh to do at this level
107 }
virtual bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions)
Handle updating display options.

References updatedGalDisplayOptions().

◆ PopDepth()

void KIGFX::GAL::PopDepth ( )
inline

Restore previously stored drawing depth for the depth stack.

Definition at line 1072 of file graphics_abstraction_layer.h.

1073  {
1074  m_layerDepth = m_depthStack.top();
1075  m_depthStack.pop();
1076  }
double m_layerDepth
The actual layer depth.
std::stack< double > m_depthStack
Stored depth values.

References m_depthStack, and m_layerDepth.

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

◆ PushDepth()

void KIGFX::GAL::PushDepth ( )
inline

Store current drawing depth on the depth stack.

Definition at line 1064 of file graphics_abstraction_layer.h.

1065  {
1066  m_depthStack.push( m_layerDepth );
1067  }
double m_layerDepth
The actual layer depth.
std::stack< double > m_depthStack
Stored depth values.

References m_depthStack, and m_layerDepth.

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

◆ ResetTextAttributes()

void GAL::ResetTextAttributes ( )

Reset text attributes to default styling.

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

Definition at line 167 of file graphics_abstraction_layer.cpp.

168 {
169  // Tiny but non-zero - this will always need setting
170  // there is no built-in default
171  SetGlyphSize( { 1.0, 1.0 } );
172 
175 
176  SetFontBold( false );
177  SetFontItalic( false );
178  SetFontUnderlined( false );
179  SetTextMirrored( false );
180 }
void SetFontBold(bool aBold)
Set bold property of current font.
void SetVerticalJustify(const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
Set the vertical justify for text drawing.
void SetFontItalic(bool aItalic)
Set italic property of current font.
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
void SetFontUnderlined(bool aUnderlined)
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.

References GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().

Referenced by KIGFX::PCB_PAINTER::draw(), GAL(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), and KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().

◆ ResizeScreen()

virtual void KIGFX::GAL::ResizeScreen ( int  aWidth,
int  aHeight 
)
inlinevirtual

◆ Restore()

virtual void KIGFX::GAL::Restore ( )
inlinevirtual

◆ Rotate()

virtual void KIGFX::GAL::Rotate ( double  aAngle)
inlinevirtual

Rotate the context.

Parameters
aAngleis the rotation angle in radians.

Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.

Definition at line 498 of file graphics_abstraction_layer.h.

498 {};

Referenced by KIGFX::STROKE_FONT::Draw(), and KIGFX::PCB_PAINTER::draw().

◆ Save()

virtual void KIGFX::GAL::Save ( )
inlinevirtual

◆ Scale()

virtual void KIGFX::GAL::Scale ( const VECTOR2D aScale)
inlinevirtual

Scale the context.

Parameters
aScaleis the scale factor for the x- and y-axis.

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

Definition at line 512 of file graphics_abstraction_layer.h.

512 {};

Referenced by KIGFX::SCH_PAINTER::draw(), and DS_PROXY_VIEW_ITEM::ViewDraw().

◆ SetAxesColor()

void KIGFX::GAL::SetAxesColor ( const COLOR4D aAxesColor)
inline

◆ SetAxesEnabled()

◆ SetClearColor()

◆ SetCoarseGrid()

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

Draw every tick line wider.

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

Definition at line 959 of file graphics_abstraction_layer.h.

960  {
961  m_gridTick = aInterval;
962  }
int m_gridTick
Every tick line gets the double width.

References m_gridTick.

Referenced by GAL().

◆ SetCursorColor()

void KIGFX::GAL::SetCursorColor ( const COLOR4D aCursorColor)
inline

Set the cursor color.

Parameters
aCursorColoris the color of the cursor.

Definition at line 1040 of file graphics_abstraction_layer.h.

1041  {
1042  m_cursorColor = aCursorColor;
1043  }
COLOR4D m_cursorColor
Cursor color.

References m_cursorColor.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), GAL(), and PCB_DRAW_PANEL_GAL::UpdateColors().

◆ SetCursorEnabled()

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

Enable/disable cursor.

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

Definition at line 1020 of file graphics_abstraction_layer.h.

1021  {
1022  m_isCursorEnabled = aCursorEnabled;
1023  }
bool m_isCursorEnabled
Is the cursor enabled?

References m_isCursorEnabled.

Referenced by GAL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and KIGFX::VIEW_CONTROLS::ShowCursor().

◆ SetDepthRange()

void KIGFX::GAL::SetDepthRange ( const VECTOR2D aDepthRange)
inline

Set the range of the layer depth.

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

Parameters
aDepthRangeis the depth range where component x is the near clipping plane and y is the far clipping plane.

Definition at line 716 of file graphics_abstraction_layer.h.

717  {
718  m_depthRange = aDepthRange;
719  }
VECTOR2D m_depthRange
Range of the depth.

References m_depthRange.

Referenced by GAL().

◆ SetFillColor()

◆ SetFlip()

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

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 753 of file graphics_abstraction_layer.h.

754  {
755  m_globalFlipX = xAxis;
756  m_globalFlipY = yAxis;
757  }
bool m_globalFlipX
Flag for X axis flipping.
bool m_globalFlipY
Flag for Y axis flipping.

References m_globalFlipX, and m_globalFlipY.

Referenced by GAL(), KIGFX::VIEW::SetMirror(), and BOARD_PRINTOUT::setupGal().

◆ SetFontBold()

void KIGFX::GAL::SetFontBold ( bool  aBold)
inline

Set bold property of current font.

Parameters
aBoldtells if the font should be bold or not.

Definition at line 423 of file graphics_abstraction_layer.h.

423 { textProperties.m_bold = aBold; }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_bold, and textProperties.

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), GraphicTextWidth(), EDA_TEXT::LenSize(), ResetTextAttributes(), and SetTextAttributes().

◆ SetFontItalic()

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

Set italic property of current font.

Parameters
aItalictells if the font should be italic or not.

Definition at line 431 of file graphics_abstraction_layer.h.

431 { textProperties.m_italic = aItalic; }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_italic, and textProperties.

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), GraphicTextWidth(), EDA_TEXT::LenSize(), ResetTextAttributes(), and SetTextAttributes().

◆ SetFontUnderlined()

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

◆ SetGlyphSize()

void KIGFX::GAL::SetGlyphSize ( const VECTOR2D aSize)
inline

◆ SetGridColor()

void KIGFX::GAL::SetGridColor ( const COLOR4D aGridColor)
inline

Set the grid color.

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

Definition at line 931 of file graphics_abstraction_layer.h.

932  {
933  m_gridColor = aGridColor;
934  }
COLOR4D m_gridColor
Color of the grid.

References m_gridColor.

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::OPENGL_GAL::OPENGL_GAL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), GERBVIEW_FRAME::SetGridColor(), and PCB_DRAW_PANEL_GAL::UpdateColors().

◆ SetGridOrigin()

void KIGFX::GAL::SetGridOrigin ( const VECTOR2D aGridOrigin)
inline

Set the origin point for the grid.

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

Definition at line 879 of file graphics_abstraction_layer.h.

880  {
881  m_gridOrigin = aGridOrigin;
882 
883  if( m_gridSize.x == 0.0 || m_gridSize.y == 0.0 )
884  {
885  m_gridOffset = VECTOR2D( 0.0, 0.0);
886  }
887  else
888  {
889  m_gridOffset = VECTOR2D( (long) m_gridOrigin.x % (long) m_gridSize.x,
890  (long) m_gridOrigin.y % (long) m_gridSize.y );
891  }
892  }
VECTOR2D m_gridSize
The grid size.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
VECTOR2D m_gridOffset
The grid offset to compensate cursor position.
VECTOR2D m_gridOrigin
The grid origin.

References m_gridOffset, m_gridOrigin, m_gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ SetGridSize()

void KIGFX::GAL::SetGridSize ( const VECTOR2D aGridSize)
inline

Set the grid size.

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

Definition at line 904 of file graphics_abstraction_layer.h.

905  {
906  m_gridSize = aGridSize;
907 
908  // Avoid stupid grid size values: a grid size should be >= 1 in internal units
909  m_gridSize.x = std::max( 1.0, m_gridSize.x );
910  m_gridSize.y = std::max( 1.0, m_gridSize.y );
911 
912  m_gridOffset = VECTOR2D( (long) m_gridOrigin.x % (long) m_gridSize.x,
913  (long) m_gridOrigin.y % (long) m_gridSize.y );
914  }
VECTOR2D m_gridSize
The grid size.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
VECTOR2D m_gridOffset
The grid offset to compensate cursor position.
VECTOR2D m_gridOrigin
The grid origin.

References m_gridOffset, m_gridOrigin, m_gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by COMMON_TOOLS::OnGridChanged(), DIALOG_PAD_PROPERTIES::prepareCanvas(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ SetGridVisibility()

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

Set the visibility setting of the grid.

Parameters
aVisibilityis the new visibility setting of the grid.

Definition at line 864 of file graphics_abstraction_layer.h.

864 { m_gridVisibility = aVisibility; }
bool m_gridVisibility
Should the grid be shown.

References m_gridVisibility.

Referenced by GAL(), COMMON_TOOLS::OnGridChanged(), GERBER_LAYER_WIDGET::OnRenderEnable(), DIALOG_PAD_PROPERTIES::prepareCanvas(), EDA_DRAW_FRAME::SetGridVisibility(), EDA_DRAW_PANEL_GAL::SwitchBackend(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().

◆ SetHorizontalJustify()

void KIGFX::GAL::SetHorizontalJustify ( const EDA_TEXT_HJUSTIFY_T  aHorizontalJustify)
inline

Set the horizontal justify for text drawing.

Parameters
aHorizontalJustifyis the horizontal justify value.

Definition at line 450 of file graphics_abstraction_layer.h.

451  {
452  textProperties.m_horizontalJustify = aHorizontalJustify;
453  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
EDA_TEXT_HJUSTIFY_T m_horizontalJustify
Horizontal justification.

References KIGFX::GAL::TEXT_PROPERTIES::m_horizontalJustify, and textProperties.

Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), ResetTextAttributes(), and SetTextAttributes().

◆ SetIsFill()

◆ SetIsStroke()

◆ SetLayerDepth()

virtual void KIGFX::GAL::SetLayerDepth ( double  aLayerDepth)
inlinevirtual

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

Parameters
aLayerDepththe layer depth for the objects.

Reimplemented in KIGFX::CAIRO_GAL_BASE.

Definition at line 323 of file graphics_abstraction_layer.h.

324  {
325  assert( aLayerDepth <= m_depthRange.y );
326  assert( aLayerDepth >= m_depthRange.x );
327 
328  m_layerDepth = aLayerDepth;
329  }
double m_layerDepth
The actual layer depth.
VECTOR2D m_depthRange
Range of the depth.

References m_depthRange, m_layerDepth, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::VIEW::draw(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), GAL(), KIGFX::VIEW::redrawRect(), KIGFX::CAIRO_GAL_BASE::SetLayerDepth(), KIGFX::VIEW::updateItemGeometry(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().

◆ SetLineWidth()

virtual void KIGFX::GAL::SetLineWidth ( float  aLineWidth)
inlinevirtual

◆ SetLookAtPoint()

void KIGFX::GAL::SetLookAtPoint ( const VECTOR2D aPoint)
inline

Set the Point in world space to look at.

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

Parameters
aPointis the look at point (center of the actual drawing area).

Definition at line 653 of file graphics_abstraction_layer.h.

654  {
655  m_lookAtPoint = aPoint;
656  }
VECTOR2D m_lookAtPoint
Point to be looked at in world space.

References m_lookAtPoint.

Referenced by GAL(), and KIGFX::VIEW::SetCenter().

◆ SetNativeCursorStyle()

bool GAL::SetNativeCursorStyle ( KICURSOR  aCursor)
virtual

Set the cursor in the native panel.

Parameters
aCursoris the cursor to use in the native panel
Returns
true if the cursor was updated, false if the cursor given was already set

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

Definition at line 280 of file graphics_abstraction_layer.cpp.

281 {
282  if( m_currentNativeCursor == aCursor )
283  return false;
284 
285  m_currentNativeCursor = aCursor;
286 
287  return true;
288 }
KICURSOR m_currentNativeCursor
Current cursor.

References m_currentNativeCursor.

Referenced by GAL(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::OPENGL_GAL::SetNativeCursorStyle(), and KIGFX::CAIRO_GAL::SetNativeCursorStyle().

◆ SetNegativeDrawMode()

virtual void KIGFX::GAL::SetNegativeDrawMode ( bool  aSetting)
inlinevirtual

Set negative draw mode in the renderer.

When negative mode is enabled, drawn items will subtract from previously drawn items. This is mainly needed for Gerber negative item support in Cairo, since unlike in OpenGL, objects drawn with zero opacity on top of other objects would not normally mask objects in Cairo. This method is a no-op in OpenGL.

Parameters
aSettingis true if negative mode should be enabled

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

Definition at line 821 of file graphics_abstraction_layer.h.

821 {};

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

◆ SetRotation()

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

Set the rotation angle.

Parameters
aRotationis the new rotation angle (radians).

Definition at line 693 of file graphics_abstraction_layer.h.

694  {
695  m_rotation = aRotation;
696  }
double m_rotation
Rotation transformation (radians)

References m_rotation.

Referenced by GAL().

◆ SetScreenDPI()

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

Set the dots per inch of the screen.

This value depends on the user screen, it should be configurable by the application. For instance a typical notebook with HD+ resolution (1600x900) has 106 DPI.

Parameters
aScreenDPIare the screen DPI.

Definition at line 641 of file graphics_abstraction_layer.h.

642  {
643  m_screenDPI = aScreenDPI;
644  }
double m_screenDPI
The dots per inch of the screen.

References m_screenDPI.

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

◆ SetScreenSize()

void KIGFX::GAL::SetScreenSize ( const VECTOR2I aSize)
inline

Definition at line 628 of file graphics_abstraction_layer.h.

629  {
630  m_screenSize = aSize;
631  }
VECTOR2I m_screenSize
Screen size in screen coordinates.

References m_screenSize.

Referenced by KIGFX::CAIRO_PRINT_GAL::SetSheetSize().

◆ SetStrokeColor()

◆ SetTarget()

virtual void KIGFX::GAL::SetTarget ( RENDER_TARGET  aTarget)
inlinevirtual

Set the target for rendering.

Parameters
aTargetis the new target for rendering.

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

Definition at line 784 of file graphics_abstraction_layer.h.

784 {};

Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::VIEW::redrawRect(), KIGFX::VIEW::updateItemGeometry(), and MY_DRAWING::ViewDraw().

◆ SetTextAttributes()

void GAL::SetTextAttributes ( const EDA_TEXT aText)
virtual

Loads attributes of the given text (bold/italic/underline/mirrored and so on).

Parameters
aTextis the text item.

Definition at line 155 of file graphics_abstraction_layer.cpp.

156 {
157  SetGlyphSize( VECTOR2D( aText->GetTextSize() ) );
160  SetFontBold( aText->IsBold() );
161  SetFontItalic( aText->IsItalic() );
162  SetFontUnderlined( false );
163  SetTextMirrored( aText->IsMirrored() );
164 }
bool IsBold() const
Definition: eda_text.h:183
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:199
bool IsMirrored() const
Definition: eda_text.h:189
void SetFontBold(bool aBold)
Set bold property of current font.
bool IsItalic() const
Definition: eda_text.h:180
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:198
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
const wxSize & GetTextSize() const
Definition: eda_text.h:238
void SetVerticalJustify(const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
Set the vertical justify for text drawing.
void SetFontItalic(bool aItalic)
Set italic property of current font.
void SetGlyphSize(const VECTOR2D &aSize)
Set the font glyph size.
void SetTextMirrored(bool aMirrored)
Set a mirrored property of text.
void SetFontUnderlined(bool aUnderlined)
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.

References EDA_TEXT::GetHorizJustify(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), EDA_TEXT::IsBold(), EDA_TEXT::IsItalic(), EDA_TEXT::IsMirrored(), SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), and GRText().

◆ SetTextMirrored()

void KIGFX::GAL::SetTextMirrored ( bool  aMirrored)
inline

Set a mirrored property of text.

Parameters
aMirroredtells if the text should be mirrored or not.

Definition at line 442 of file graphics_abstraction_layer.h.

442 { textProperties.m_mirrored = aMirrored; }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, and textProperties.

Referenced by KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), ResetTextAttributes(), SetTextAttributes(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ SetVerticalJustify()

void KIGFX::GAL::SetVerticalJustify ( const EDA_TEXT_VJUSTIFY_T  aVerticalJustify)
inline

Set the vertical justify for text drawing.

Parameters
aVerticalJustifyis the vertical justify value.

Definition at line 468 of file graphics_abstraction_layer.h.

469  {
470  textProperties.m_verticalJustify = aVerticalJustify;
471  }
EDA_TEXT_VJUSTIFY_T m_verticalJustify
Vertical justification.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties

References KIGFX::GAL::TEXT_PROPERTIES::m_verticalJustify, and textProperties.

Referenced by KIGFX::SCH_PAINTER::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), ResetTextAttributes(), and SetTextAttributes().

◆ SetWorldScreenMatrix()

void KIGFX::GAL::SetWorldScreenMatrix ( const MATRIX3x3D aMatrix)
inline

Set the world <-> screen transformation matrix.

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

Definition at line 604 of file graphics_abstraction_layer.h.

605  {
606  m_worldScreenMatrix = aMatrix;
607  }
MATRIX3x3D m_worldScreenMatrix
World transformation.

References m_worldScreenMatrix.

◆ SetWorldUnitLength()

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

Set the unit length.

This defines the length [inch] per one integer. For instance a value 0.001 means that the coordinate [1000, 1000] corresponds with a point at (1 inch, 1 inch) or 1 mil resolution per integer.

Parameters
aWorldUnitLengthis the world Unit length.

Definition at line 623 of file graphics_abstraction_layer.h.

624  {
625  m_worldUnitLength = aWorldUnitLength;
626  }
double m_worldUnitLength
The unit length of the world coordinates [inch].

References m_worldUnitLength.

Referenced by GAL(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), GERBVIEW_PRINTOUT::setupGal(), PCBNEW_PRINTOUT::setupGal(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), PL_DRAW_PANEL_GAL::SwitchBackend(), SCH_DRAW_PANEL::SwitchBackend(), and PCB_DRAW_PANEL_GAL::SwitchBackend().

◆ SetZoomFactor()

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

Set the zoom factor of the scene.

Parameters
aZoomFactoris the zoom factor.

Definition at line 673 of file graphics_abstraction_layer.h.

674  {
675  m_zoomFactor = aZoomFactor;
676  }
double m_zoomFactor
The zoom factor.

References m_zoomFactor.

Referenced by GAL(), and KIGFX::VIEW::SetScale().

◆ Show()

virtual bool KIGFX::GAL::Show ( bool  aShow)
inlinevirtual

Show/hide the GAL canvas.

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

Definition at line 206 of file graphics_abstraction_layer.h.

206 { return true; };

◆ StartDiffLayer()

virtual void KIGFX::GAL::StartDiffLayer ( )
inlinevirtual

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 in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.

Definition at line 830 of file graphics_abstraction_layer.h.

830 {};

Referenced by KIGFX::VIEW::redrawRect().

◆ StartNegativesLayer()

virtual void KIGFX::GAL::StartNegativesLayer ( )
inlinevirtual

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 in KIGFX::CAIRO_GAL.

Definition at line 847 of file graphics_abstraction_layer.h.

847 {};

Referenced by KIGFX::VIEW::redrawRect().

◆ StrokeText()

virtual void KIGFX::GAL::StrokeText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)
inlinevirtual

Draw a vector type text using preloaded Newstroke font.

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

Definition at line 347 of file graphics_abstraction_layer.h.

349  {
350  m_strokeFont.Draw( aText, aPosition, aRotationAngle );
351  }
STROKE_FONT m_strokeFont
Instance of object that stores information about how to draw texts.
void Draw(const UTF8 &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a string.

References KIGFX::STROKE_FONT::Draw(), and m_strokeFont.

Referenced by BitmapText(), KIGFX::SCH_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), GRText(), and KIGFX::SCH_PAINTER::strokeText().

◆ ToScreen()

VECTOR2D KIGFX::GAL::ToScreen ( const VECTOR2D aPoint) const
inline

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 1002 of file graphics_abstraction_layer.h.

1003  {
1004  return VECTOR2D( m_worldScreenMatrix * aPoint );
1005  }
MATRIX3x3D m_worldScreenMatrix
World transformation.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

References m_worldScreenMatrix.

Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor().

◆ ToWorld()

VECTOR2D KIGFX::GAL::ToWorld ( const VECTOR2D aPoint) const
inline

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 991 of file graphics_abstraction_layer.h.

992  {
993  return VECTOR2D( m_screenWorldMatrix * aPoint );
994  }
MATRIX3x3D m_screenWorldMatrix
Screen transformation.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622

References m_screenWorldMatrix.

◆ Transform()

virtual void KIGFX::GAL::Transform ( const MATRIX3x3D aTransformation)
inlinevirtual

Transform the context.

Parameters
aTransformationis the transformation matrix.

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

Definition at line 491 of file graphics_abstraction_layer.h.

491 {};

◆ Translate()

virtual void KIGFX::GAL::Translate ( const VECTOR2D aTranslation)
inlinevirtual

Translate the context.

Parameters
aTranslationis the translation vector.

Reimplemented in KIGFX::OPENGL_GAL, KIGFX::CAIRO_GAL_BASE, and BASIC_GAL.

Definition at line 505 of file graphics_abstraction_layer.h.

505 {};

Referenced by KIGFX::STROKE_FONT::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::STROKE_FONT::drawSingleLineText(), and DS_PROXY_VIEW_ITEM::ViewDraw().

◆ unlockContext()

virtual void KIGFX::GAL::unlockContext ( int  aClientCookie)
inlineprotectedvirtual

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 1093 of file graphics_abstraction_layer.h.

1093 {}

Referenced by KIGFX::GAL_CONTEXT_LOCKER::~GAL_CONTEXT_LOCKER().

◆ updatedGalDisplayOptions()

bool GAL::updatedGalDisplayOptions ( const GAL_DISPLAY_OPTIONS aOptions)
protectedvirtual

Handle updating display options.

Derived classes should call up to this to set base-class methods.

Returns
true if the new settings changed something. Derived classes can use this information to refresh themselves

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

Definition at line 110 of file graphics_abstraction_layer.cpp.

111 {
112  bool refresh = false;
113 
115  {
117  refresh = true;
118  }
119 
121  {
122  m_gridLineWidth = std::floor( m_options.m_gridLineWidth + 0.5 );
123  refresh = true;
124  }
125 
127  {
129  refresh = true;
130  }
131 
133  {
135  refresh = true;
136  }
137 
139  {
141  refresh = true;
142  }
143 
145  {
147  refresh = true;
148  }
149 
150  // tell the derived class if the base class needs an update or not
151  return refresh;
152 }
bool m_axesEnabled
Should the axes be drawn.
KIGFX::GRID_STYLE m_gridStyle
Snapping options for the grid.
bool m_forceDisplayCursor
The pixel scale factor (>1 for hi-DPI scaled displays)
double m_gridMinSpacing
Whether or not to draw the coordinate system axes.
float m_gridLineWidth
Line width of the grid.
bool m_axesEnabled
Fullscreen crosshair or small cross.
GAL_DISPLAY_OPTIONS & m_options
int m_gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.
GRID_STYLE m_gridStyle
Grid display style.
bool m_forceDisplayCursor
Always show cursor.
double m_gridLineWidth
Minimum pixel distance between displayed grid lines.
bool m_fullscreenCursor
Shape of the cursor (fullscreen or small cross)
bool m_fullscreenCursor
Force cursor display.

References KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, m_fullscreenCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth, m_gridLineWidth, KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing, m_gridMinSpacing, KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle, m_gridStyle, m_options, and refresh.

Referenced by OnGalDisplayOptionsChanged(), KIGFX::OPENGL_GAL::updatedGalDisplayOptions(), and KIGFX::CAIRO_GAL::updatedGalDisplayOptions().

Friends And Related Function Documentation

◆ GAL_CONTEXT_LOCKER

friend class GAL_CONTEXT_LOCKER
friend

Definition at line 64 of file graphics_abstraction_layer.h.

◆ GAL_DRAWING_CONTEXT

friend class GAL_DRAWING_CONTEXT
friend

Definition at line 66 of file graphics_abstraction_layer.h.

◆ GAL_UPDATE_CONTEXT

friend class GAL_UPDATE_CONTEXT
friend

Definition at line 65 of file graphics_abstraction_layer.h.

Member Data Documentation

◆ GRID_DEPTH

const int GAL::GRID_DEPTH = MAX_DEPTH - 1
staticprotected

Depth level on which the grid is drawn.

Definition at line 1128 of file graphics_abstraction_layer.h.

◆ m_axesColor

COLOR4D KIGFX::GAL::m_axesColor
protected

Color of the axes.

Definition at line 1191 of file graphics_abstraction_layer.h.

Referenced by KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::DrawGrid(), and SetAxesColor().

◆ m_axesEnabled

bool KIGFX::GAL::m_axesEnabled
protected

◆ m_clearColor

◆ m_currentNativeCursor

KICURSOR KIGFX::GAL::m_currentNativeCursor
protected

◆ m_cursorColor

COLOR4D KIGFX::GAL::m_cursorColor
protected

Cursor color.

Definition at line 1201 of file graphics_abstraction_layer.h.

Referenced by getCursorColor(), and SetCursorColor().

◆ m_cursorPosition

VECTOR2D KIGFX::GAL::m_cursorPosition
protected

◆ m_depthRange

VECTOR2D KIGFX::GAL::m_depthRange
protected

◆ m_depthStack

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

Stored depth values.

Definition at line 1156 of file graphics_abstraction_layer.h.

Referenced by PopDepth(), and PushDepth().

◆ m_fillColor

◆ m_forceDisplayCursor

bool KIGFX::GAL::m_forceDisplayCursor
protected

Always show cursor.

Definition at line 1200 of file graphics_abstraction_layer.h.

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

◆ m_fullscreenCursor

bool KIGFX::GAL::m_fullscreenCursor
protected

Shape of the cursor (fullscreen or small cross)

Definition at line 1202 of file graphics_abstraction_layer.h.

Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), GAL(), and updatedGalDisplayOptions().

◆ m_globalFlipX

bool KIGFX::GAL::m_globalFlipX
protected

◆ m_globalFlipY

bool KIGFX::GAL::m_globalFlipY
protected

◆ m_gridColor

◆ m_gridLineWidth

float KIGFX::GAL::m_gridLineWidth
protected

◆ m_gridMinSpacing

int KIGFX::GAL::m_gridMinSpacing
protected

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

Definition at line 1195 of file graphics_abstraction_layer.h.

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

◆ m_gridOffset

VECTOR2D KIGFX::GAL::m_gridOffset
protected

The grid offset to compensate cursor position.

Definition at line 1189 of file graphics_abstraction_layer.h.

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

◆ m_gridOrigin

VECTOR2D KIGFX::GAL::m_gridOrigin
protected

◆ m_gridSize

VECTOR2D KIGFX::GAL::m_gridSize
protected

◆ m_gridStyle

GRID_STYLE KIGFX::GAL::m_gridStyle
protected

◆ m_gridTick

int KIGFX::GAL::m_gridTick
protected

Every tick line gets the double width.

Definition at line 1193 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), and SetCoarseGrid().

◆ m_gridVisibility

bool KIGFX::GAL::m_gridVisibility
protected

◆ m_isCursorEnabled

bool KIGFX::GAL::m_isCursorEnabled
protected

Is the cursor enabled?

Definition at line 1199 of file graphics_abstraction_layer.h.

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

◆ m_isFillEnabled

◆ m_isStrokeEnabled

◆ m_layerDepth

◆ m_lineWidth

◆ m_lookAtPoint

VECTOR2D KIGFX::GAL::m_lookAtPoint
protected

◆ m_observerLink

UTIL::LINK KIGFX::GAL::m_observerLink
protected

Definition at line 1154 of file graphics_abstraction_layer.h.

Referenced by GAL().

◆ m_options

◆ m_rotation

double KIGFX::GAL::m_rotation
protected

Rotation transformation (radians)

Definition at line 1164 of file graphics_abstraction_layer.h.

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

◆ m_screenDPI

double KIGFX::GAL::m_screenDPI
protected

◆ m_screenSize

◆ m_screenWorldMatrix

◆ m_strokeColor

◆ m_strokeFont

STROKE_FONT KIGFX::GAL::m_strokeFont
protected

Instance of object that stores information about how to draw texts.

Definition at line 1205 of file graphics_abstraction_layer.h.

Referenced by GAL(), GetStrokeFont(), GetTextLineSize(), and StrokeText().

◆ m_worldScale

◆ m_worldScreenMatrix

◆ m_worldUnitLength

double KIGFX::GAL::m_worldUnitLength
protected

◆ m_zoomFactor

double KIGFX::GAL::m_zoomFactor
protected

◆ MAX_DEPTH

const int GAL::MAX_DEPTH = 1023
staticprotected

Definition at line 1125 of file graphics_abstraction_layer.h.

Referenced by GAL().

◆ MIN_DEPTH

const int GAL::MIN_DEPTH = -1024
staticprotected

Possible depth range.

Definition at line 1124 of file graphics_abstraction_layer.h.

Referenced by GAL().

◆ textProperties


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