KiCad PCB EDA Suite
KIGFX::GAL Class Reference

Class GAL is the 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 KIGFX::OPENGL_GAL

Classes

struct  TEXT_PROPERTIES
 

Public Member Functions

 GAL (GAL_DISPLAY_OPTIONS &aOptions)
 
virtual ~GAL ()
 
virtual bool IsInitialized () const
 Returns the initalization status for the canvas. More...
 
virtual bool IsVisible () const
 Returns true if the GAL canvas is visible on the screen. 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...
 
virtual void BeginUpdate ()
 Enables item update mode. More...
 
virtual void EndUpdate ()
 Disables item update mode. More...
 
virtual void DrawLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 Draw a line. More...
 
virtual void DrawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
 Draw a rounded segment. More...
 
virtual void DrawPolyline (const std::deque< VECTOR2D > &aPointList)
 Draw a polyline. More...
 
virtual void DrawPolyline (const VECTOR2D aPointList[], int aListSize)
 
virtual void DrawPolyline (const SHAPE_LINE_CHAIN &aLineChain)
 
virtual void DrawCircle (const VECTOR2D &aCenterPoint, double aRadius)
 Draw a circle using world coordinates. More...
 
virtual void DrawArc (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
 Draw an arc. More...
 
virtual void DrawArcSegment (const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth)
 Draw an arc segment. More...
 
virtual void DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 Draw a rectangle. More...
 
virtual void DrawPolygon (const std::deque< VECTOR2D > &aPointList)
 Draw a polygon. More...
 
virtual void DrawPolygon (const VECTOR2D aPointList[], int aListSize)
 
virtual void DrawPolygon (const SHAPE_POLY_SET &aPolySet)
 
virtual void DrawCurve (const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint)
 Draw a cubic bezier spline. More...
 
virtual void ResizeScreen (int aWidth, int aHeight)
 Resizes the canvas. More...
 
virtual bool Show (bool aShow)
 Shows/hides the GAL canvas. More...
 
const VECTOR2IGetScreenPixelSize () const
 Returns 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...
 
virtual void SetStrokeColor (const COLOR4D &aColor)
 Set the stroke color. More...
 
const COLOR4DGetStrokeColor () const
 Get the stroke color. More...
 
virtual void SetLineWidth (double aLineWidth)
 Set the line width. More...
 
double 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)
 Draws a vector type text using preloaded Newstroke font. More...
 
virtual void BitmapText (const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
 Draws a text using a bitmap font. More...
 
VECTOR2D GetTextLineSize (const UTF8 &aText) const
 Compute the X and Y size of a given text. More...
 
double GetOverbarVerticalPosition () const
 Compute the vertical position of an overbar, sometimes used in texts. 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 aGlyphSize)
 Set the font glyph size. More...
 
const VECTOR2DGetGlyphSize () const
 
void SetFontBold (const bool aBold)
 Set bold property of current font. More...
 
bool IsFontBold () const
 Returns true if current font has 'bold' attribute enabled. More...
 
void SetFontItalic (const bool aItalic)
 Set italic property of current font. More...
 
bool IsFontItalic () const
 Returns true if current font has 'italic' attribute enabled. More...
 
void SetTextMirrored (const bool aMirrored)
 Set a mirrored property of text. More...
 
bool IsTextMirrored () const
 Returns true if text should displayed mirrored. More...
 
void SetHorizontalJustify (const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
 Set the horizontal justify for text drawing. More...
 
EDA_TEXT_HJUSTIFY_T GetHorizontalJustify () const
 Returns 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)
 Changes the color used to draw the group. More...
 
virtual void ChangeGroupDepth (int aGroupNumber, int aDepth)
 Changes 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...
 
void SetWorldUnitLength (double aWorldUnitLength)
 Set the unit length. More...
 
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 SetDepthRange (const VECTOR2D &aDepthRange)
 Set the range of the layer depth. More...
 
double GetMinDepth () const
 Returns the minimum depth in the currently used range (the top). More...
 
double GetMaxDepth () const
 Returns 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...
 
virtual void SaveScreen ()
 Save the screen contents. More...
 
virtual void RestoreScreen ()
 Restore the screen contents. More...
 
virtual void SetTarget (RENDER_TARGET aTarget)
 Sets the target for rendering. More...
 
virtual RENDER_TARGET GetTarget () const
 Gets the currently used target for rendering. More...
 
virtual void ClearTarget (RENDER_TARGET aTarget)
 Clears the target for rendering. More...
 
virtual void SetNegativeDrawMode (bool aSetting)
 Sets negative draw mode in the renderer. More...
 
void SetGridVisibility (bool aVisibility)
 Sets the visibility setting of the grid. More...
 
void SetGridOrigin (const VECTOR2D &aGridOrigin)
 Set the origin point for the grid. More...
 
void SetGridSize (const VECTOR2D &aGridSize)
 Set the grid size. More...
 
const VECTOR2DGetGridSize () const
 Returns 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)
 Enables drawing the axes. More...
 
void SetCoarseGrid (int aInterval)
 Draw every tick line wider. More...
 
double GetGridLineWidth () const
 Get the grid line width. More...
 
virtual void DrawGrid ()
 > More...
 
VECTOR2D GetGridPoint (const VECTOR2D &aPoint) const
 Function GetGridPoint() For a given point it returns the nearest point belonging to the grid in world coordinates. More...
 
VECTOR2D ToWorld (const VECTOR2D &aPoint) const
 Compute the point position in world coordinates from given screen coordinates. More...
 
VECTOR2D ToScreen (const VECTOR2D &aPoint) const
 Compute the point position in screen coordinates from given world coordinates. More...
 
void SetCursorEnabled (bool aCursorEnabled)
 Enable/disable cursor. More...
 
bool IsCursorEnabled () const
 Returns 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 ()
 Changes the current depth to deeper, so it is possible to draw objects right beneath other. More...
 
void PushDepth ()
 Stores current drawing depth on the depth stack. More...
 
void PopDepth ()
 Restores previously stored drawing depth for the depth stack. More...
 

Static Public Attributes

static const double METRIC_UNIT_LENGTH = 1e9
 

Protected Member Functions

void computeWorldScale ()
 Compute the scaling factor for the world->screen matrix. More...
 
double computeMinGridSpacing () const
 compute minimum grid spacing from the grid settings More...
 
virtual void drawGridLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
 Draw a grid line (usually a simplified line function). More...
 
COLOR4D getCursorColor () const
 Gets 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)
 Function updatedGalDisplayOptions. More...
 

Protected Attributes

GAL_DISPLAY_OPTIONSoptions
 
UTIL::LINK observerLink
 
std::stack< double > depthStack
 Stored depth values. More...
 
VECTOR2I screenSize
 Screen size in screen coordinates. More...
 
double worldUnitLength
 The unit length of the world coordinates [inch]. More...
 
double screenDPI
 The dots per inch of the screen. More...
 
VECTOR2D lookAtPoint
 Point to be looked at in world space. More...
 
double zoomFactor
 The zoom factor. More...
 
MATRIX3x3D worldScreenMatrix
 World transformation. More...
 
MATRIX3x3D screenWorldMatrix
 Screen transformation. More...
 
double worldScale
 The scale factor world->screen. More...
 
bool globalFlipX
 Flag for X axis flipping. More...
 
bool globalFlipY
 Flag for Y axis flipping. More...
 
double lineWidth
 The line width. More...
 
bool isFillEnabled
 Is filling of graphic objects enabled ? More...
 
bool isStrokeEnabled
 Are the outlines stroked ? More...
 
COLOR4D fillColor
 The fill color. More...
 
COLOR4D strokeColor
 The color of the outlines. More...
 
COLOR4D m_clearColor
 
double layerDepth
 The actual layer depth. More...
 
VECTOR2D depthRange
 Range of the depth. More...
 
bool gridVisibility
 Should the grid be shown. More...
 
GRID_STYLE gridStyle
 Grid display style. More...
 
VECTOR2D gridSize
 The grid size. More...
 
VECTOR2D gridOrigin
 The grid origin. More...
 
VECTOR2D gridOffset
 The grid offset to compensate cursor position. More...
 
COLOR4D gridColor
 Color of the grid. More...
 
COLOR4D axesColor
 Color of the axes. More...
 
bool axesEnabled
 Should the axes be drawn. More...
 
int gridTick
 Every tick line gets the double width. More...
 
double gridLineWidth
 Line width of the grid. More...
 
int gridMinSpacing
 Minimum screen size of the grid (pixels) below which the grid is not drawn. More...
 
bool isCursorEnabled
 Is the cursor enabled? More...
 
bool forceDisplayCursor
 Always show cursor. More...
 
COLOR4D cursorColor
 Cursor color. More...
 
bool fullscreenCursor
 Shape of the cursor (fullscreen or small cross) More...
 
VECTOR2D cursorPosition
 Current cursor position (world coordinates) More...
 
STROKE_FONT strokeFont
 Instance of object that stores information about how to draw texts. More...
 

Static Protected Attributes

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

Private Attributes

struct KIGFX::GAL::TEXT_PROPERTIES textProperties
 

Detailed Description

Class GAL is the 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 58 of file graphics_abstraction_layer.h.

Constructor & Destructor Documentation

GAL::GAL ( GAL_DISPLAY_OPTIONS aOptions)

Definition at line 40 of file graphics_abstraction_layer.cpp.

References computeWorldScale(), forceDisplayCursor, fullscreenCursor, gridLineWidth, gridMinSpacing, gridStyle, KIGFX::LINES, KIGFX::STROKE_FONT::LoadNewStrokeFont(), MAX_DEPTH, METRIC_UNIT_LENGTH, MIN_DEPTH, newstroke_font, newstroke_font_bufsize, observerLink, options, ResetTextAttributes(), SetAxesEnabled(), SetCoarseGrid(), SetCursorColor(), SetCursorEnabled(), SetDepthRange(), SetFillColor(), SetFlip(), SetGridVisibility(), SetIsFill(), SetIsStroke(), SetLayerDepth(), SetLineWidth(), SetLookAtPoint(), SetScreenDPI(), SetStrokeColor(), SetWorldUnitLength(), SetZoomFactor(), strokeFont, and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().

40  :
41  options( aDisplayOptions ),
42  strokeFont( this )
43 {
44  // Set the default values for the internal variables
45  SetIsFill( false );
46  SetIsStroke( true );
47  SetFillColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
48  SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
49  SetLookAtPoint( VECTOR2D( 0, 0 ) );
50  SetZoomFactor( 1.0 );
51  SetWorldUnitLength( 1.0 / METRIC_UNIT_LENGTH * 2.54 ); // 1 inch in nanometers
52  SetScreenDPI( 106 ); // Display resolution setting
54  SetLayerDepth( 0.0 );
55  SetFlip( false, false );
56  SetLineWidth( 1.0 );
58  SetAxesEnabled( false );
59 
60  // Set grid defaults
61  SetGridVisibility( true );
62  SetCoarseGrid( 10 );
63  gridLineWidth = 0.5;
65  gridMinSpacing = 10;
66 
67  // Initialize the cursor shape
68  SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
69  fullscreenCursor = false;
70  forceDisplayCursor = false;
71  SetCursorEnabled( false );
72 
73  // Initialize text properties
75 
77 
78  // subscribe for settings updates
79  observerLink = options.Subscribe( this );
80 }
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
STROKE_FONT strokeFont
Instance of object that stores information about how to draw texts.
Use lines for the grid.
void SetCursorEnabled(bool aCursorEnabled)
Enable/disable cursor.
int gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.
GRID_STYLE gridStyle
Grid display style.
LINK Subscribe(ObserverInterface *aObserver)
Function Subscribe adds a subscription returning an RAII link.
Definition: observable.h:161
GAL_DISPLAY_OPTIONS & options
const int newstroke_font_bufsize
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:49
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)
static const int MIN_DEPTH
Possible depth range.
virtual void SetLineWidth(double aLineWidth)
Set the line width.
bool fullscreenCursor
Shape of the cursor (fullscreen or small cross)
void ResetTextAttributes()
Reset text attributes to default styling.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
static const double METRIC_UNIT_LENGTH
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SetAxesEnabled(bool aAxesEnabled)
Enables drawing the axes.
const char *const newstroke_font[]
Array containing strokes for unicode glyphs.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
void computeWorldScale()
Compute the scaling factor for the world->screen matrix.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void SetCoarseGrid(int aInterval)
Draw every tick line wider.
void SetZoomFactor(double aZoomFactor)
Set the zoom factor of the scene.
void SetGridVisibility(bool aVisibility)
Sets the visibility setting of the grid.
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.
bool forceDisplayCursor
Always show cursor.
static const int MAX_DEPTH
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
double gridLineWidth
Line width of the grid.
GAL::~GAL ( )
virtual

Definition at line 83 of file graphics_abstraction_layer.cpp.

84 {
85 }

Member Function Documentation

void KIGFX::GAL::AdvanceDepth ( )
inline

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

Definition at line 963 of file graphics_abstraction_layer.h.

References layerDepth.

964  {
965  layerDepth -= 0.05;
966  }
double layerDepth
The actual layer depth.
virtual void KIGFX::GAL::BeginDrawing ( )
inlinevirtual

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

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

Definition at line 76 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

76 {};
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, and KIGFX::OPENGL_GAL.

Definition at line 542 of file graphics_abstraction_layer.h.

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

542 { return 0; };
virtual void KIGFX::GAL::BeginUpdate ( )
inlinevirtual
virtual void KIGFX::GAL::BitmapText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)
inlinevirtual

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

References globalFlipX, KIGFX::GAL::TEXT_PROPERTIES::m_mirrored, StrokeText(), and textProperties.

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

336  {
337  // Fallback: use stroke font
338 
339  // Handle flipped view
340  if( globalFlipX )
342 
343  StrokeText( aText, aPosition, aRotationAngle );
344 
345  if( globalFlipX )
347  }
bool globalFlipX
Flag for X axis flipping.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draws a vector type text using preloaded Newstroke font.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
virtual void KIGFX::GAL::ChangeGroupColor ( int  aGroupNumber,
const COLOR4D aNewColor 
)
inlinevirtual

Changes the color used to draw the group.

Parameters
aGroupNumberis the group number.
aNewColoris the new color.

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

Definition at line 560 of file graphics_abstraction_layer.h.

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

560 {};
virtual void KIGFX::GAL::ChangeGroupDepth ( int  aGroupNumber,
int  aDepth 
)
inlinevirtual

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

Parameters
aGroupNumberis the group number.
aDepthis the new depth.

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

Definition at line 568 of file graphics_abstraction_layer.h.

Referenced by KIGFX::VIEW::changeItemsDepth::operator()().

568 {};
virtual void KIGFX::GAL::ClearCache ( )
inlinevirtual

Delete all data created during caching of graphic items.

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

Definition at line 580 of file graphics_abstraction_layer.h.

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

580 {};
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.

Definition at line 215 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

215 {};
virtual void KIGFX::GAL::ClearTarget ( RENDER_TARGET  aTarget)
inlinevirtual

Clears the target for rendering.

Parameters
aTargetis the target to be cleared.

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

Definition at line 773 of file graphics_abstraction_layer.h.

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

773 {};
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 205 of file graphics_abstraction_layer.cpp.

References gridMinSpacing.

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

206 {
207  // just return the current value. This could be cleverer and take
208  // into account other settings in future
209  return gridMinSpacing;
210 }
int gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.
void KIGFX::GAL::computeWorldScale ( )
inlineprotected

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

Definition at line 1044 of file graphics_abstraction_layer.h.

References zoomFactor.

Referenced by ComputeWorldScreenMatrix(), and GAL().

1045  {
1047  }
double zoomFactor
The zoom factor.
double worldUnitLength
The unit length of the world coordinates [inch].
double worldScale
The scale factor world->screen.
double screenDPI
The dots per inch of the screen.
void GAL::ComputeWorldScreenMatrix ( )
virtual

Compute the world <-> screen transformation matrix.

Definition at line 177 of file graphics_abstraction_layer.cpp.

References computeWorldScale(), globalFlipX, globalFlipY, MATRIX3x3< T >::Inverse(), lookAtPoint, scale, screenSize, screenWorldMatrix, MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetScale(), MATRIX3x3< T >::SetTranslation(), worldScale, and worldScreenMatrix.

Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::CAIRO_GAL::initSurface(), KIGFX::VIEW::SetCenter(), and KIGFX::VIEW::SetScale().

178 {
180 
182 
183  MATRIX3x3D translation;
184  translation.SetIdentity();
185  translation.SetTranslation( 0.5 * VECTOR2D( screenSize ) );
186 
188  scale.SetIdentity();
189  scale.SetScale( VECTOR2D( worldScale, worldScale ) );
190 
191  MATRIX3x3D flip;
192 
193  flip.SetIdentity();
194  flip.SetScale( VECTOR2D( globalFlipX ? -1.0 : 1.0, globalFlipY ? -1.0 : 1.0 ) );
195 
196  MATRIX3x3D lookat;
197  lookat.SetIdentity();
198  lookat.SetTranslation( -lookAtPoint );
199 
200  worldScreenMatrix = translation * flip * scale * lookat * worldScreenMatrix;
201  screenWorldMatrix = worldScreenMatrix.Inverse();
202 }
MATRIX3x3 Inverse() const
Determine the inverse of the matrix.
Definition: matrix3x3.h:343
MATRIX3x3D screenWorldMatrix
Screen transformation.
bool globalFlipX
Flag for X axis flipping.
void SetIdentity()
Set the matrix to the identity matrix.
Definition: matrix3x3.h:214
VECTOR2D lookAtPoint
Point to be looked at in world space.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
MATRIX3x3D worldScreenMatrix
World transformation.
void computeWorldScale()
Compute the scaling factor for the world->screen matrix.
const int scale
void SetScale(VECTOR2< T > aScale)
Set the scale components of the matrix.
Definition: matrix3x3.h:261
bool globalFlipY
Flag for Y axis flipping.
double worldScale
The scale factor world->screen.
VECTOR2I screenSize
Screen size in screen coordinates.
void SetTranslation(VECTOR2< T > aTranslation)
Set the translation components of the matrix.
Definition: matrix3x3.h:230
virtual void KIGFX::GAL::DeleteGroup ( int  aGroupNumber)
inlinevirtual

Delete the group from the memory.

Parameters
aGroupNumberis the group number.

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

Definition at line 575 of file graphics_abstraction_layer.h.

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

575 {};
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.

Definition at line 134 of file graphics_abstraction_layer.h.

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

134 {};
virtual void KIGFX::GAL::DrawArcSegment ( const VECTOR2D aCenterPoint,
double  aRadius,
double  aStartAngle,
double  aEndAngle,
double  aWidth 
)
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.

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).

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

Definition at line 151 of file graphics_abstraction_layer.h.

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

152  {};
virtual void KIGFX::GAL::DrawCircle ( const VECTOR2D aCenterPoint,
double  aRadius 
)
inlinevirtual

Draw a circle using world coordinates.

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

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

Definition at line 123 of file graphics_abstraction_layer.h.

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

123 {};
virtual void KIGFX::GAL::DrawCursor ( const VECTOR2D aCursorPosition)
inlinevirtual

Draw the cursor.

Parameters
aCursorPositionis the cursor position in screen coordinates.

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

Definition at line 957 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

957 {};
virtual void KIGFX::GAL::DrawCurve ( const VECTOR2D startPoint,
const VECTOR2D controlPointA,
const VECTOR2D controlPointB,
const VECTOR2D endPoint 
)
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.

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

Definition at line 179 of file graphics_abstraction_layer.h.

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

180  {};
void GAL::DrawGrid ( )
virtual

>

Draw the grid

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 213 of file graphics_abstraction_layer.cpp.

References axesColor, axesEnabled, computeMinGridSpacing(), depthRange, drawGridLine(), DrawRectangle(), GetLineWidth(), gridColor, gridLineWidth, gridOrigin, gridSize, gridStyle, gridTick, gridVisibility, KiROUND(), KIGFX::LINES, max, screenSize, screenWorldMatrix, SetFillColor(), SetIsFill(), SetIsStroke(), SetLayerDepth(), SetLineWidth(), SetStrokeColor(), SetTarget(), KIGFX::SMALL_CROSS, KIGFX::TARGET_NONCACHED, worldScale, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

214 {
216 
217  // Draw the grid
218  // For the drawing the start points, end points and increments have
219  // to be calculated in world coordinates
220  VECTOR2D worldStartPoint = screenWorldMatrix * VECTOR2D( 0.0, 0.0 );
221  VECTOR2D worldEndPoint = screenWorldMatrix * VECTOR2D( screenSize );
222 
223  const double gridThreshold = computeMinGridSpacing();
224 
225  int gridScreenSizeDense = KiROUND( gridSize.x * worldScale );
226  int gridScreenSizeCoarse = KiROUND( gridSize.x * static_cast<double>( gridTick ) * worldScale );
227 
228  // Compute the line marker or point radius of the grid
229  // Note: generic grids can't handle sub-pixel lines without
230  // either losing fine/course distinction or having some dots
231  // fail to render
232  double marker = std::max( 1.0, gridLineWidth ) / worldScale;
233  double doubleMarker = 2.0 * marker;
234 
235  // Draw axes if desired
236  if( axesEnabled )
237  {
238  SetIsFill( false );
239  SetIsStroke( true );
241  SetLineWidth( marker );
242 
243  drawGridLine( VECTOR2D( worldStartPoint.x, 0 ),
244  VECTOR2D( worldEndPoint.x, 0 ) );
245 
246  drawGridLine( VECTOR2D( 0, worldStartPoint.y ),
247  VECTOR2D( 0, worldEndPoint.y ) );
248  }
249 
250  if( !gridVisibility )
251  return;
252 
253  // Check if the grid would not be too dense
254  if( std::max( gridScreenSizeDense, gridScreenSizeCoarse ) <= gridThreshold )
255  return;
256 
257  // Compute grid staring and ending indexes to draw grid points on the
258  // visible screen area
259  // Note: later any point coordinate will be offsetted by gridOrigin
260  int gridStartX = KiROUND( (worldStartPoint.x-gridOrigin.x) / gridSize.x );
261  int gridEndX = KiROUND( (worldEndPoint.x-gridOrigin.x) / gridSize.x );
262  int gridStartY = KiROUND( (worldStartPoint.y-gridOrigin.y) / gridSize.y );
263  int gridEndY = KiROUND( (worldEndPoint.y-gridOrigin.y) / gridSize.y );
264 
265  // Ensure start coordinate > end coordinate
266  if( gridStartX > gridEndX )
267  std::swap( gridStartX, gridEndX );
268 
269  if( gridStartY > gridEndY )
270  std::swap( gridStartY, gridEndY );
271 
272  // Draw the grid behind all other layers
273  SetLayerDepth( depthRange.y * 0.75 );
274 
276  {
277  SetIsFill( false );
278  SetIsStroke( true );
280 
281  // Now draw the grid, every coarse grid line gets the double width
282 
283  // Vertical lines
284  for( int j = gridStartY-1; j <= gridEndY; j++ )
285  {
286  const double y = j * gridSize.y + gridOrigin.y;
287 
288  if( axesEnabled && y == 0 )
289  continue;
290 
291  if( j % gridTick == 0 && gridScreenSizeDense > gridThreshold )
292  SetLineWidth( doubleMarker );
293  else
294  SetLineWidth( marker );
295 
296  if( ( j % gridTick == 0 && gridScreenSizeCoarse > gridThreshold )
297  || gridScreenSizeDense > gridThreshold )
298  {
299  drawGridLine( VECTOR2D( gridStartX * gridSize.x + gridOrigin.x, y ),
300  VECTOR2D( gridEndX * gridSize.x + gridOrigin.x, y ) );
301  }
302  }
303 
304  // Horizontal lines
305  for( int i = gridStartX-1; i <= gridEndX; i++ )
306  {
307  const double x = i * gridSize.x + gridOrigin.x;
308 
309  if( axesEnabled && x == 0 )
310  continue;
311 
312  if( i % gridTick == 0 && gridScreenSizeDense > gridThreshold )
313  SetLineWidth( doubleMarker );
314  else
315  SetLineWidth( marker );
316 
317  if( ( i % gridTick == 0 && gridScreenSizeCoarse > gridThreshold )
318  || gridScreenSizeDense > gridThreshold )
319  {
320  drawGridLine( VECTOR2D( x, gridStartY * gridSize.y + gridOrigin.y ),
321  VECTOR2D( x, gridEndY * gridSize.y + gridOrigin.y ) );
322  }
323  }
324  }
325  else if( gridStyle == GRID_STYLE::SMALL_CROSS )
326  {
327  SetIsFill( false );
328  SetIsStroke( true );
330 
331  SetLineWidth( marker );
332  double lineLen = GetLineWidth() * 2;
333 
334  // Vertical positions:
335  for( int j = gridStartY-1; j <= gridEndY; j++ )
336  {
337  if( ( j % gridTick == 0 && gridScreenSizeCoarse > gridThreshold )
338  || gridScreenSizeDense > gridThreshold )
339  {
340  int posY = j * gridSize.y + gridOrigin.y;
341 
342  // Horizontal positions:
343  for( int i = gridStartX-1; i <= gridEndX; i++ )
344  {
345  if( ( i % gridTick == 0 && gridScreenSizeCoarse > gridThreshold )
346  || gridScreenSizeDense > gridThreshold )
347  {
348  int posX = i * gridSize.x + gridOrigin.x;
349 
350  drawGridLine( VECTOR2D( posX - lineLen, posY ),
351  VECTOR2D( posX + lineLen, posY ) );
352 
353  drawGridLine( VECTOR2D( posX, posY - lineLen ),
354  VECTOR2D( posX, posY + lineLen ) );
355  }
356  }
357  }
358  }
359  }
360  else // Dotted grid
361  {
362  bool tickX, tickY;
363  SetIsFill( true );
364  SetIsStroke( false );
366 
367  for( int j = gridStartY-1; j <= gridEndY; j++ )
368  {
369  if( j % gridTick == 0 && gridScreenSizeDense > gridThreshold )
370  tickY = true;
371  else
372  tickY = false;
373 
374  for( int i = gridStartX-1; i <= gridEndX; i++ )
375  {
376  if( i % gridTick == 0 && gridScreenSizeDense > gridThreshold )
377  tickX = true;
378  else
379  tickX = false;
380 
381  if( tickX || tickY || gridScreenSizeDense > gridThreshold )
382  {
383  double radius = ( ( tickX && tickY ) ? doubleMarker : marker ) / 2.0;
384  DrawRectangle( VECTOR2D( i * gridSize.x - radius + gridOrigin.x,
385  j * gridSize.y - radius + gridOrigin.y ),
386  VECTOR2D( i * gridSize.x + radius + gridOrigin.x,
387  j * gridSize.y + radius + gridOrigin.y ) );
388  }
389  }
390  }
391  }
392 }
double computeMinGridSpacing() const
compute minimum grid spacing from the grid settings
int gridTick
Every tick line gets the double width.
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
Use lines for the grid.
bool axesEnabled
Should the axes be drawn.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
GRID_STYLE gridStyle
Grid display style.
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
VECTOR2D depthRange
Range of the depth.
MATRIX3x3D screenWorldMatrix
Screen transformation.
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
virtual void drawGridLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a grid line (usually a simplified line function).
Auxiliary rendering target (noncached)
Definition: definitions.h:42
virtual void SetLineWidth(double aLineWidth)
Set the line width.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
COLOR4D axesColor
Color of the axes.
VECTOR2D gridOrigin
The grid origin.
Use small cross instead of dots for the grid.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
COLOR4D gridColor
Color of the grid.
bool gridVisibility
Should the grid be shown.
#define max(a, b)
Definition: auxiliary.h:86
double worldScale
The scale factor world->screen.
VECTOR2D gridSize
The grid size.
VECTOR2I screenSize
Screen size in screen coordinates.
double GetLineWidth() const
Get the line width.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual void SetTarget(RENDER_TARGET aTarget)
Sets the target for rendering.
double gridLineWidth
Line width of the grid.
virtual void KIGFX::GAL::drawGridLine ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inlineprotectedvirtual

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

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

Reimplemented in KIGFX::CAIRO_GAL.

Definition at line 1062 of file graphics_abstraction_layer.h.

Referenced by DrawGrid().

1062 {};
virtual void KIGFX::GAL::DrawGroup ( int  aGroupNumber)
inlinevirtual

Draw the stored group.

Parameters
aGroupNumberis the group number.

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

Definition at line 552 of file graphics_abstraction_layer.h.

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

552 {};
virtual void KIGFX::GAL::DrawLine ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inlinevirtual

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

Definition at line 95 of file graphics_abstraction_layer.h.

Referenced by KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::PCB_PAINTER::draw(), drawBacksideTicks(), ROUTER_PREVIEW_ITEM::drawLineChain(), KIGFX::PREVIEW::CENTRELINE_RECT_ITEM::drawPreviewShape(), and KIGFX::STROKE_FONT::drawSingleLineText().

95 {};
virtual void KIGFX::GAL::DrawPolygon ( const std::deque< VECTOR2D > &  aPointList)
inlinevirtual

Draw a polygon.

Parameters
aPointListis the list of the polygon points.

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

Definition at line 167 of file graphics_abstraction_layer.h.

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

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

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

Definition at line 168 of file graphics_abstraction_layer.h.

168 {};
virtual void KIGFX::GAL::DrawPolygon ( const SHAPE_POLY_SET aPolySet)
inlinevirtual

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

Definition at line 169 of file graphics_abstraction_layer.h.

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

Draw a polyline.

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

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

Definition at line 113 of file graphics_abstraction_layer.h.

Referenced by KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), and KIGFX::STROKE_FONT::drawSingleLineText().

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

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

Definition at line 114 of file graphics_abstraction_layer.h.

114 {};
virtual void KIGFX::GAL::DrawPolyline ( const SHAPE_LINE_CHAIN aLineChain)
inlinevirtual

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

Definition at line 115 of file graphics_abstraction_layer.h.

115 {};
virtual void KIGFX::GAL::DrawRectangle ( const VECTOR2D aStartPoint,
const VECTOR2D aEndPoint 
)
inlinevirtual

Draw a rectangle.

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

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

Definition at line 160 of file graphics_abstraction_layer.h.

Referenced by KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::drawBorder(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), and DrawGrid().

160 {};
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.

Definition at line 106 of file graphics_abstraction_layer.h.

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

106 {};
virtual void KIGFX::GAL::EndDrawing ( )
inlinevirtual

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

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

Definition at line 79 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

79 {};
virtual void KIGFX::GAL::EndGroup ( )
inlinevirtual

End the group.

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

Definition at line 545 of file graphics_abstraction_layer.h.

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

545 {};
virtual void KIGFX::GAL::EndUpdate ( )
inlinevirtual
virtual void KIGFX::GAL::Flush ( )
inlinevirtual

Force all remaining objects to be drawn.

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

Definition at line 199 of file graphics_abstraction_layer.h.

199 {};
const COLOR4D& KIGFX::GAL::GetClearColor ( ) const
inline

Definition at line 206 of file graphics_abstraction_layer.h.

References m_clearColor.

207  {
208  return m_clearColor;
209  }
COLOR4D GAL::getCursorColor ( ) const
protected

Gets the actual cursor color to draw.

Definition at line 417 of file graphics_abstraction_layer.cpp.

References color, cursorColor, and isCursorEnabled.

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

418 {
419  auto color = cursorColor;
420 
421  // dim the cursor if it's only on because it was forced
422  // (this helps to provide a hint for active tools)
423  if( !isCursorEnabled )
424  {
425  color.a = color.a * 0.5;
426  }
427 
428  return color;
429 }
bool isCursorEnabled
Is the cursor enabled?
COLOR4D cursorColor
Cursor color.
double KIGFX::GAL::GetGridLineWidth ( ) const
inline

Get the grid line width.

Returns
the grid line width

Definition at line 884 of file graphics_abstraction_layer.h.

References gridLineWidth.

885  {
886  return gridLineWidth;
887  }
double gridLineWidth
Line width of the grid.
VECTOR2D GAL::GetGridPoint ( const VECTOR2D aPoint) const

Function GetGridPoint() 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 395 of file graphics_abstraction_layer.cpp.

References gridOffset, gridSize, KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by EDIT_POINTS_FACTORY::buildForPolyOutline(), and KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition().

396 {
397 #if 0
398  // This old code expects a non zero grid size, which can be wrong here.
399  return VECTOR2D( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x,
400  KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y );
401 #else
402  // if grid size == 0.0 there is no grid, so use aPoint as grid reference position
403  double cx = gridSize.x > 0.0 ? KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x
404  : aPoint.x;
405  double cy = gridSize.y > 0.0 ? KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y
406  : aPoint.y;
407 
408  return VECTOR2D( cx, cy );
409 #endif
410 }
VECTOR2D gridOffset
The grid offset to compensate cursor position.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
VECTOR2D gridSize
The grid size.
const VECTOR2D& KIGFX::GAL::GetGridSize ( ) const
inline

Returns the grid size.

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

Definition at line 836 of file graphics_abstraction_layer.h.

References gridSize.

837  {
838  return gridSize;
839  }
VECTOR2D gridSize
The grid size.
EDA_TEXT_HJUSTIFY_T KIGFX::GAL::GetHorizontalJustify ( ) const
inline

Returns current text horizontal justification setting.

Definition at line 468 of file graphics_abstraction_layer.h.

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

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

469  {
471  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
EDA_TEXT_HJUSTIFY_T m_horizontalJustify
Horizontal justification.
double KIGFX::GAL::GetLineWidth ( void  ) const
inline
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.

References lookAtPoint.

664  {
665  return lookAtPoint;
666  }
VECTOR2D lookAtPoint
Point to be looked at in world space.
double KIGFX::GAL::GetMaxDepth ( ) const
inline

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

Definition at line 712 of file graphics_abstraction_layer.h.

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

713  {
714  return depthRange.y;
715  }
VECTOR2D depthRange
Range of the depth.
double KIGFX::GAL::GetMinDepth ( ) const
inline

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

Definition at line 704 of file graphics_abstraction_layer.h.

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

705  {
706  return depthRange.x;
707  }
VECTOR2D depthRange
Range of the depth.
double KIGFX::GAL::GetOverbarVerticalPosition ( ) const
inline

Compute the vertical position of an overbar, sometimes used in texts.

This is the distance between the text base line and the overbar.

Returns
the relative position of the overbar axis.

Definition at line 363 of file graphics_abstraction_layer.h.

References KIGFX::STROKE_FONT::computeOverbarVerticalPosition(), and strokeFont.

364  {
366  }
STROKE_FONT strokeFont
Instance of object that stores information about how to draw texts.
double computeOverbarVerticalPosition() const
Compute the vertical position of an overbar, sometimes used in texts.
const VECTOR2I& KIGFX::GAL::GetScreenPixelSize ( ) const
inline

Returns GAL canvas size in pixels.

Definition at line 193 of file graphics_abstraction_layer.h.

References screenSize.

Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), KIGFX::VIEW::GetScreenPixelSize(), KIGFX::VIEW::GetViewport(), KIGFX::VIEW::Redraw(), KIGFX::VIEW::SetViewport(), and KIGFX::WX_VIEW_CONTROLS::WarpCursor().

194  {
195  return screenSize;
196  }
VECTOR2I screenSize
Screen size in screen coordinates.
const MATRIX3x3D& KIGFX::GAL::GetScreenWorldMatrix ( ) const
inline

Get the screen <-> world transformation matrix.

Returns
the transformation matrix.

Definition at line 604 of file graphics_abstraction_layer.h.

References screenWorldMatrix.

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

605  {
606  return screenWorldMatrix;
607  }
MATRIX3x3D screenWorldMatrix
Screen transformation.
const COLOR4D& KIGFX::GAL::GetStrokeColor ( ) const
inline

Get the stroke color.

Returns
the color for stroking the outline.

Definition at line 266 of file graphics_abstraction_layer.h.

References strokeColor.

267  {
268  return strokeColor;
269  }
COLOR4D strokeColor
The color of the outlines.
const STROKE_FONT& KIGFX::GAL::GetStrokeFont ( ) const
inline

Definition at line 308 of file graphics_abstraction_layer.h.

References strokeFont.

Referenced by EDA_TEXT::GetTextBox().

309  {
310  return strokeFont;
311  }
STROKE_FONT strokeFont
Instance of object that stores information about how to draw texts.
virtual RENDER_TARGET KIGFX::GAL::GetTarget ( ) const
inlinevirtual

Gets the currently used target for rendering.

Returns
The current rendering target.

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

Definition at line 766 of file graphics_abstraction_layer.h.

References KIGFX::TARGET_CACHED.

766 { return TARGET_CACHED; };
Main rendering target (cached)
Definition: definitions.h:41
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 168 of file graphics_abstraction_layer.cpp.

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

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

169 {
170  // Compute the X and Y size of a given text.
171  // Because computeTextLineSize expects a one line text,
172  // aText is expected to be only one line text.
173  return strokeFont.computeTextLineSize( aText );
174 }
STROKE_FONT 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.
EDA_TEXT_VJUSTIFY_T KIGFX::GAL::GetVerticalJustify ( ) const
inline

Returns current text vertical justification setting.

Definition at line 486 of file graphics_abstraction_layer.h.

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

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

487  {
489  }
EDA_TEXT_VJUSTIFY_T m_verticalJustify
Vertical justification.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
double KIGFX::GAL::GetWorldScale ( ) const
inline
const MATRIX3x3D& KIGFX::GAL::GetWorldScreenMatrix ( ) const
inline

Get the world <-> screen transformation matrix.

Returns
the transformation matrix.

Definition at line 594 of file graphics_abstraction_layer.h.

References worldScreenMatrix.

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

595  {
596  return worldScreenMatrix;
597  }
MATRIX3x3D worldScreenMatrix
World transformation.
double KIGFX::GAL::GetZoomFactor ( ) const
inline

Get the zoom factor.

Returns
the zoom factor.

Definition at line 683 of file graphics_abstraction_layer.h.

References zoomFactor.

Referenced by EDA_DRAW_PANEL_GAL::GetLegacyZoom(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), EDA_DRAW_FRAME::UseGalCanvas(), and COMMON_TOOLS::ZoomPreset().

684  {
685  return zoomFactor;
686  }
double zoomFactor
The zoom factor.
bool KIGFX::GAL::IsCursorEnabled ( ) const
inline

Returns information about cursor visibility.

Returns
True if cursor is visible.

Definition at line 937 of file graphics_abstraction_layer.h.

References forceDisplayCursor, and isCursorEnabled.

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

938  {
940  }
bool isCursorEnabled
Is the cursor enabled?
bool forceDisplayCursor
Always show cursor.
bool KIGFX::GAL::IsFontBold ( ) const
inline

Returns true if current font has 'bold' attribute enabled.

Definition at line 414 of file graphics_abstraction_layer.h.

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

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

415  {
416  return textProperties.m_bold;
417  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
bool KIGFX::GAL::IsFontItalic ( ) const
inline

Returns true if current font has 'italic' attribute enabled.

Definition at line 432 of file graphics_abstraction_layer.h.

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

Referenced by KIGFX::STROKE_FONT::ComputeStringBoundaryLimits(), and KIGFX::STROKE_FONT::drawSingleLineText().

433  {
434  return textProperties.m_italic;
435  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
virtual bool KIGFX::GAL::IsInitialized ( ) const
inlinevirtual

Returns the initalization status for the canvas.

Reimplemented in KIGFX::OPENGL_GAL.

Definition at line 66 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onRefreshTimer().

66 { return true; }
bool KIGFX::GAL::IsTextMirrored ( ) const
inline

Returns true if text should displayed mirrored.

Definition at line 450 of file graphics_abstraction_layer.h.

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

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

451  {
452  return textProperties.m_mirrored;
453  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
virtual bool KIGFX::GAL::IsVisible ( ) const
inlinevirtual

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

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

Definition at line 69 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onShowTimer().

69 { return true; }
void GAL::OnGalDisplayOptionsChanged ( const GAL_DISPLAY_OPTIONS aOptions)
overrideprotectedvirtual

Handler for observer settings changes.

Implements KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER.

Definition at line 88 of file graphics_abstraction_layer.cpp.

References updatedGalDisplayOptions().

89 {
90  // defer to the child class first
91  updatedGalDisplayOptions( aOptions );
92 
93  // there is no refresh to do at this level
94 }
virtual bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions)
Function updatedGalDisplayOptions.
void KIGFX::GAL::PopDepth ( )
inline

Restores previously stored drawing depth for the depth stack.

Definition at line 979 of file graphics_abstraction_layer.h.

References depthStack, and layerDepth.

980  {
981  layerDepth = depthStack.top();
982  depthStack.pop();
983  }
double layerDepth
The actual layer depth.
std::stack< double > depthStack
Stored depth values.
void KIGFX::GAL::PushDepth ( )
inline

Stores current drawing depth on the depth stack.

Definition at line 971 of file graphics_abstraction_layer.h.

References depthStack, and layerDepth.

972  {
973  depthStack.push( layerDepth );
974  }
double layerDepth
The actual layer depth.
std::stack< double > depthStack
Stored depth values.
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 153 of file graphics_abstraction_layer.cpp.

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

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

154 {
155  // Tiny but non-zero - this will always need setting
156  // there is no built-in default
157  SetGlyphSize( { 1.0, 1.0 } );
158 
161 
162  SetFontBold( false );
163  SetFontItalic( false );
164  SetTextMirrored( false );
165 }
void SetFontItalic(const bool aItalic)
Set italic property of current font.
void SetFontBold(const bool aBold)
Set bold property of current font.
void SetTextMirrored(const bool aMirrored)
Set a mirrored property of text.
void SetVerticalJustify(const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
Set the vertical justify for text drawing.
void SetGlyphSize(const VECTOR2D aGlyphSize)
Set the font glyph size.
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
virtual void KIGFX::GAL::ResizeScreen ( int  aWidth,
int  aHeight 
)
inlinevirtual

Resizes the canvas.

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

Definition at line 187 of file graphics_abstraction_layer.h.

Referenced by EDA_DRAW_PANEL_GAL::onSize(), and EDA_DRAW_PANEL_GAL::SwitchBackend().

187 {};
virtual void KIGFX::GAL::Restore ( )
inlinevirtual
virtual void KIGFX::GAL::RestoreScreen ( )
inlinevirtual

Restore the screen contents.

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

Definition at line 752 of file graphics_abstraction_layer.h.

752 {};
virtual void KIGFX::GAL::Rotate ( double  aAngle)
inlinevirtual

Rotate the context.

Parameters
aAngleis the rotation angle in radians.

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

Definition at line 508 of file graphics_abstraction_layer.h.

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

508 {};
virtual void KIGFX::GAL::Save ( )
inlinevirtual
virtual void KIGFX::GAL::SaveScreen ( )
inlinevirtual

Save the screen contents.

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

Definition at line 747 of file graphics_abstraction_layer.h.

747 {};
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::CAIRO_GAL, and KIGFX::OPENGL_GAL.

Definition at line 522 of file graphics_abstraction_layer.h.

522 {};
void KIGFX::GAL::SetAxesColor ( const COLOR4D aAxesColor)
inline

Set the axes color.

Parameters
aAxesColoris the color to draw the axes if enabled.

Definition at line 856 of file graphics_abstraction_layer.h.

References axesColor.

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

857  {
858  axesColor = aAxesColor;
859  }
COLOR4D axesColor
Color of the axes.
void KIGFX::GAL::SetAxesEnabled ( bool  aAxesEnabled)
inline

Enables drawing the axes.

Definition at line 864 of file graphics_abstraction_layer.h.

References axesEnabled.

Referenced by GAL(), and FOOTPRINT_EDIT_FRAME::UseGalCanvas().

865  {
866  axesEnabled = aAxesEnabled;
867  }
bool axesEnabled
Should the axes be drawn.
void KIGFX::GAL::SetClearColor ( const COLOR4D aColor)
inline

Definition at line 201 of file graphics_abstraction_layer.h.

References m_clearColor.

Referenced by EDA_DRAW_PANEL_GAL::onPaint().

202  {
203  m_clearColor = aColor;
204  }
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 874 of file graphics_abstraction_layer.h.

References gridTick.

Referenced by GAL().

875  {
876  gridTick = aInterval;
877  }
int gridTick
Every tick line gets the double width.
void KIGFX::GAL::SetCursorColor ( const COLOR4D aCursorColor)
inline

Set the cursor color.

Parameters
aCursorColoris the color of the cursor.

Definition at line 947 of file graphics_abstraction_layer.h.

References cursorColor.

Referenced by GAL(), EDA_DRAW_PANEL_GAL::onPaint(), and PCB_DRAW_PANEL_GAL::UseColorScheme().

948  {
949  cursorColor = aCursorColor;
950  }
COLOR4D cursorColor
Cursor color.
void KIGFX::GAL::SetCursorEnabled ( bool  aCursorEnabled)
inline

Enable/disable cursor.

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

Definition at line 928 of file graphics_abstraction_layer.h.

References isCursorEnabled.

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

929  {
930  isCursorEnabled = aCursorEnabled;
931  }
bool isCursorEnabled
Is the cursor enabled?
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 696 of file graphics_abstraction_layer.h.

References depthRange.

Referenced by GAL().

697  {
698  depthRange = aDepthRange;
699  }
VECTOR2D depthRange
Range of the depth.
virtual void KIGFX::GAL::SetFillColor ( const COLOR4D aColor)
inlinevirtual

Set the fill color.

Parameters
aColoris the color for filling.

Reimplemented in KIGFX::CAIRO_GAL.

Definition at line 246 of file graphics_abstraction_layer.h.

References fillColor.

Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), DrawGrid(), GAL(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), and EDIT_POINTS::ViewDraw().

247  {
248  fillColor = aColor;
249  }
COLOR4D fillColor
The fill color.
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 733 of file graphics_abstraction_layer.h.

References globalFlipX, and globalFlipY.

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

734  {
735  globalFlipX = xAxis;
736  globalFlipY = yAxis;
737  }
bool globalFlipX
Flag for X axis flipping.
bool globalFlipY
Flag for Y axis flipping.
void KIGFX::GAL::SetFontBold ( const bool  aBold)
inline

Set bold property of current font.

Parameters
aBoldtells if the font should be bold or not.

Definition at line 406 of file graphics_abstraction_layer.h.

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

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

407  {
408  textProperties.m_bold = aBold;
409  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
void KIGFX::GAL::SetFontItalic ( const bool  aItalic)
inline

Set italic property of current font.

Parameters
aItalictells if the font should be italic or not.

Definition at line 424 of file graphics_abstraction_layer.h.

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

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

425  {
426  textProperties.m_italic = aItalic;
427  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
void KIGFX::GAL::SetGlyphSize ( const VECTOR2D  aGlyphSize)
inline

Set the font glyph size.

Parameters
aGlyphSizeis the new font glyph size.

Definition at line 388 of file graphics_abstraction_layer.h.

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

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

389  {
390  textProperties.m_glyphSize = aGlyphSize;
391  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
VECTOR2D m_glyphSize
Size of the glyphs.
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 846 of file graphics_abstraction_layer.h.

References gridColor.

Referenced by KIGFX::CAIRO_GAL::CAIRO_GAL(), PCB_LAYER_WIDGET::OnRenderColorChange(), KIGFX::OPENGL_GAL::OPENGL_GAL(), GERBVIEW_FRAME::SetGridColor(), and GERBVIEW_FRAME::UseGalCanvas().

847  {
848  gridColor = aGridColor;
849  }
COLOR4D gridColor
Color of the grid.
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 807 of file graphics_abstraction_layer.h.

References gridOffset, gridOrigin, gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCB_BASE_EDIT_FRAME::SetBoard(), setOrigin(), and EDA_DRAW_FRAME::UseGalCanvas().

808  {
809  gridOrigin = aGridOrigin;
810 
811  if( gridSize.x == 0.0 || gridSize.y == 0.0 )
812  gridOffset = VECTOR2D(0.0, 0.0);
813  else
814  gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x,
815  (long) gridOrigin.y % (long) gridSize.y );
816  }
VECTOR2D gridOffset
The grid offset to compensate cursor position.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
VECTOR2D gridOrigin
The grid origin.
VECTOR2D gridSize
The grid size.
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 823 of file graphics_abstraction_layer.h.

References gridOffset, gridOrigin, gridSize, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by DIALOG_PAD_PROPERTIES::prepareCanvas(), COMMON_TOOLS::updateGrid(), PCBNEW_CONTROL::updateGrid(), and EDA_DRAW_FRAME::UseGalCanvas().

824  {
825  gridSize = aGridSize;
826 
827  gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x,
828  (long) gridOrigin.y % (long) gridSize.y );
829  }
VECTOR2D gridOffset
The grid offset to compensate cursor position.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
VECTOR2D gridOrigin
The grid origin.
VECTOR2D gridSize
The grid size.
void KIGFX::GAL::SetGridVisibility ( bool  aVisibility)
inline

Sets the visibility setting of the grid.

Parameters
aVisibilityis the new visibility setting of the grid.

Definition at line 797 of file graphics_abstraction_layer.h.

References gridVisibility.

Referenced by GAL(), PCB_LAYER_WIDGET::OnRenderEnable(), GERBER_LAYER_WIDGET::OnRenderEnable(), EDA_DRAW_FRAME::OnToggleGridState(), and EDA_DRAW_FRAME::UseGalCanvas().

798  {
799  gridVisibility = aVisibility;
800  }
bool gridVisibility
Should the grid be shown.
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 460 of file graphics_abstraction_layer.h.

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

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

461  {
462  textProperties.m_horizontalJustify = aHorizontalJustify;
463  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
EDA_TEXT_HJUSTIFY_T m_horizontalJustify
Horizontal justification.
virtual void KIGFX::GAL::SetIsFill ( bool  aIsFillEnabled)
inlinevirtual

Enable/disable fill.

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

Reimplemented in KIGFX::CAIRO_GAL.

Definition at line 226 of file graphics_abstraction_layer.h.

References isFillEnabled.

Referenced by KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::drawBorder(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), DrawGraphicText(), DrawGrid(), GAL(), and KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal().

227  {
228  isFillEnabled = aIsFillEnabled;
229  }
bool isFillEnabled
Is filling of graphic objects enabled ?
virtual void KIGFX::GAL::SetIsStroke ( bool  aIsStrokeEnabled)
inlinevirtual
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.

Definition at line 296 of file graphics_abstraction_layer.h.

References depthRange, layerDepth, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::VIEW::draw(), DrawGrid(), GAL(), KIGFX::VIEW::redrawRect(), KIGFX::CAIRO_GAL::SetLayerDepth(), KIGFX::VIEW::updateItemGeometry(), and ROUTER_PREVIEW_ITEM::ViewDraw().

297  {
298  assert( aLayerDepth <= depthRange.y );
299  assert( aLayerDepth >= depthRange.x );
300 
301  layerDepth = aLayerDepth;
302  }
double layerDepth
The actual layer depth.
VECTOR2D depthRange
Range of the depth.
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.

References lookAtPoint.

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

654  {
655  lookAtPoint = aPoint;
656  }
VECTOR2D lookAtPoint
Point to be looked at in world space.
virtual void KIGFX::GAL::SetNegativeDrawMode ( bool  aSetting)
inlinevirtual

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

Definition at line 786 of file graphics_abstraction_layer.h.

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

786 {};
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.

References screenDPI.

Referenced by GAL().

642  {
643  screenDPI = aScreenDPI;
644  }
double screenDPI
The dots per inch of the screen.
virtual void KIGFX::GAL::SetStrokeColor ( const COLOR4D aColor)
inlinevirtual

Set the stroke color.

Parameters
aColoris the color for stroking the outline.

Reimplemented in KIGFX::CAIRO_GAL.

Definition at line 256 of file graphics_abstraction_layer.h.

References strokeColor.

Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::WORKSHEET_VIEWITEM::drawBorder(), DrawGrid(), GAL(), and KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal().

257  {
258  strokeColor = aColor;
259  }
COLOR4D strokeColor
The color of the outlines.
virtual void KIGFX::GAL::SetTarget ( RENDER_TARGET  aTarget)
inlinevirtual

Sets the target for rendering.

Parameters
aTargetis the new target for rendering.

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

Definition at line 759 of file graphics_abstraction_layer.h.

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

759 {};
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 142 of file graphics_abstraction_layer.cpp.

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

Referenced by KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::PCB_PAINTER::draw(), and DrawGraphicText().

143 {
144  SetGlyphSize( VECTOR2D( aText->GetTextSize() ) );
147  SetFontBold( aText->IsBold() );
148  SetFontItalic( aText->IsItalic() );
149  SetTextMirrored( aText->IsMirrored() );
150 }
void SetFontItalic(const bool aItalic)
Set italic property of current font.
bool IsItalic() const
Definition: eda_text.h:170
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:190
bool IsBold() const
Definition: eda_text.h:173
void SetFontBold(const bool aBold)
Set bold property of current font.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
void SetTextMirrored(const bool aMirrored)
Set a mirrored property of text.
void SetVerticalJustify(const EDA_TEXT_VJUSTIFY_T aVerticalJustify)
Set the vertical justify for text drawing.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:191
bool IsMirrored() const
Definition: eda_text.h:179
void SetGlyphSize(const VECTOR2D aGlyphSize)
Set the font glyph size.
const wxSize & GetTextSize() const
Definition: eda_text.h:215
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
void KIGFX::GAL::SetTextMirrored ( const 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.

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

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

443  {
444  textProperties.m_mirrored = aMirrored;
445  }
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
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 478 of file graphics_abstraction_layer.h.

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

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

479  {
480  textProperties.m_verticalJustify = aVerticalJustify;
481  }
EDA_TEXT_VJUSTIFY_T m_verticalJustify
Vertical justification.
struct KIGFX::GAL::TEXT_PROPERTIES textProperties
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 614 of file graphics_abstraction_layer.h.

References worldScreenMatrix.

615  {
616  worldScreenMatrix = aMatrix;
617  }
MATRIX3x3D worldScreenMatrix
World transformation.
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 628 of file graphics_abstraction_layer.h.

References worldUnitLength.

Referenced by GAL().

629  {
630  worldUnitLength = aWorldUnitLength;
631  }
double worldUnitLength
The unit length of the world coordinates [inch].
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.

References zoomFactor.

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

674  {
675  zoomFactor = aZoomFactor;
676  }
double zoomFactor
The zoom factor.
virtual bool KIGFX::GAL::Show ( bool  aShow)
inlinevirtual

Shows/hides the GAL canvas.

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

Definition at line 190 of file graphics_abstraction_layer.h.

190 { return true; };
virtual void KIGFX::GAL::StrokeText ( const wxString &  aText,
const VECTOR2D aPosition,
double  aRotationAngle 
)
inlinevirtual

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

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

Referenced by BitmapText(), KIGFX::WORKSHEET_VIEWITEM::draw(), KIGFX::PCB_PAINTER::draw(), and DrawGraphicText().

322  {
323  strokeFont.Draw( aText, aPosition, aRotationAngle );
324  }
STROKE_FONT 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.
VECTOR2D KIGFX::GAL::ToScreen ( const VECTOR2D aPoint) const
inline

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

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

Definition at line 918 of file graphics_abstraction_layer.h.

References worldScreenMatrix.

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

919  {
920  return VECTOR2D( worldScreenMatrix * aPoint );
921  }
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
MATRIX3x3D worldScreenMatrix
World transformation.
VECTOR2D KIGFX::GAL::ToWorld ( const VECTOR2D aPoint) const
inline

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

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

Definition at line 907 of file graphics_abstraction_layer.h.

References screenWorldMatrix.

908  {
909  return VECTOR2D( screenWorldMatrix * aPoint );
910  }
MATRIX3x3D screenWorldMatrix
Screen transformation.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
virtual void KIGFX::GAL::Transform ( const MATRIX3x3D aTransformation)
inlinevirtual

Transform the context.

Parameters
aTransformationis the ransformation matrix.

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

Definition at line 501 of file graphics_abstraction_layer.h.

501 {};
virtual void KIGFX::GAL::Translate ( const VECTOR2D aTranslation)
inlinevirtual

Translate the context.

Parameters
aTranslationis the translation vector.

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

Definition at line 515 of file graphics_abstraction_layer.h.

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

515 {};
bool GAL::updatedGalDisplayOptions ( const GAL_DISPLAY_OPTIONS aOptions)
protectedvirtual

Function updatedGalDisplayOptions.

handler for updated 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 97 of file graphics_abstraction_layer.cpp.

References axesEnabled, forceDisplayCursor, fullscreenCursor, gridLineWidth, gridMinSpacing, gridStyle, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth, KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing, KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle, and options.

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

98 {
99  bool refresh = false;
100 
101  if( options.m_gridStyle != gridStyle )
102  {
104  refresh = true;
105  }
106 
108  {
110  refresh = true;
111  }
112 
114  {
116  refresh = true;
117  }
118 
120  {
122  refresh = true;
123  }
124 
126  {
128  refresh = true;
129  }
130 
132  {
134  refresh = true;
135  }
136 
137  // tell the derived class if the base class needs an update or not
138  return refresh;
139 }
bool axesEnabled
Should the axes be drawn.
KIGFX::GRID_STYLE m_gridStyle
The grid style to draw the grid in
int gridMinSpacing
Minimum screen size of the grid (pixels) below which the grid is not drawn.
GRID_STYLE gridStyle
Grid display style.
GAL_DISPLAY_OPTIONS & options
bool m_forceDisplayCursor
Force cursor display
double m_gridMinSpacing
Minimum pixel distance between displayed grid lines
bool m_axesEnabled
Whether or not to draw the coordinate system axes
bool fullscreenCursor
Shape of the cursor (fullscreen or small cross)
double m_gridLineWidth
Thickness to render grid lines/dots
bool m_fullscreenCursor
Fullscreen crosshair or small cross
bool forceDisplayCursor
Always show cursor.
double gridLineWidth
Line width of the grid.

Member Data Documentation

COLOR4D KIGFX::GAL::axesColor
protected

Color of the axes.

Definition at line 1026 of file graphics_abstraction_layer.h.

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

bool KIGFX::GAL::axesEnabled
protected

Should the axes be drawn.

Definition at line 1027 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::DrawGrid(), DrawGrid(), SetAxesEnabled(), and updatedGalDisplayOptions().

COLOR4D KIGFX::GAL::cursorColor
protected

Cursor color.

Definition at line 1036 of file graphics_abstraction_layer.h.

Referenced by getCursorColor(), and SetCursorColor().

VECTOR2D KIGFX::GAL::cursorPosition
protected
VECTOR2D KIGFX::GAL::depthRange
protected
std::stack<double> KIGFX::GAL::depthStack
protected

Stored depth values.

Definition at line 992 of file graphics_abstraction_layer.h.

Referenced by PopDepth(), and PushDepth().

bool KIGFX::GAL::forceDisplayCursor
protected

Always show cursor.

Definition at line 1035 of file graphics_abstraction_layer.h.

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

bool KIGFX::GAL::fullscreenCursor
protected

Shape of the cursor (fullscreen or small cross)

Definition at line 1037 of file graphics_abstraction_layer.h.

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

bool KIGFX::GAL::globalFlipX
protected

Flag for X axis flipping.

Definition at line 1004 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), BitmapText(), ComputeWorldScreenMatrix(), and SetFlip().

bool KIGFX::GAL::globalFlipY
protected

Flag for Y axis flipping.

Definition at line 1005 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), ComputeWorldScreenMatrix(), and SetFlip().

const int GAL::GRID_DEPTH = MAX_DEPTH - 1
staticprotected

Depth level on which the grid is drawn.

Definition at line 1069 of file graphics_abstraction_layer.h.

COLOR4D KIGFX::GAL::gridColor
protected

Color of the grid.

Definition at line 1025 of file graphics_abstraction_layer.h.

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

double KIGFX::GAL::gridLineWidth
protected

Line width of the grid.

Definition at line 1029 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::DrawGrid(), DrawGrid(), GAL(), GetGridLineWidth(), and updatedGalDisplayOptions().

int KIGFX::GAL::gridMinSpacing
protected

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

Definition at line 1030 of file graphics_abstraction_layer.h.

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

VECTOR2D KIGFX::GAL::gridOffset
protected

The grid offset to compensate cursor position.

Definition at line 1024 of file graphics_abstraction_layer.h.

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

VECTOR2D KIGFX::GAL::gridOrigin
protected

The grid origin.

Definition at line 1023 of file graphics_abstraction_layer.h.

Referenced by KIGFX::OPENGL_GAL::DrawGrid(), DrawGrid(), SetGridOrigin(), and SetGridSize().

VECTOR2D KIGFX::GAL::gridSize
protected
GRID_STYLE KIGFX::GAL::gridStyle
protected

Grid display style.

Definition at line 1021 of file graphics_abstraction_layer.h.

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

int KIGFX::GAL::gridTick
protected

Every tick line gets the double width.

Definition at line 1028 of file graphics_abstraction_layer.h.

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

bool KIGFX::GAL::gridVisibility
protected

Should the grid be shown.

Definition at line 1020 of file graphics_abstraction_layer.h.

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

bool KIGFX::GAL::isCursorEnabled
protected

Is the cursor enabled?

Definition at line 1034 of file graphics_abstraction_layer.h.

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

VECTOR2D KIGFX::GAL::lookAtPoint
protected

Point to be looked at in world space.

Definition at line 997 of file graphics_abstraction_layer.h.

Referenced by ComputeWorldScreenMatrix(), GetLookAtPoint(), and SetLookAtPoint().

const int GAL::MAX_DEPTH = 1023
staticprotected

Definition at line 1066 of file graphics_abstraction_layer.h.

Referenced by GAL().

const double GAL::METRIC_UNIT_LENGTH = 1e9
static

Definition at line 985 of file graphics_abstraction_layer.h.

Referenced by GAL().

const int GAL::MIN_DEPTH = -1024
staticprotected

Possible depth range.

Definition at line 1062 of file graphics_abstraction_layer.h.

Referenced by GAL().

UTIL::LINK KIGFX::GAL::observerLink
protected

Definition at line 990 of file graphics_abstraction_layer.h.

Referenced by GAL().

double KIGFX::GAL::screenDPI
protected

The dots per inch of the screen.

Definition at line 996 of file graphics_abstraction_layer.h.

Referenced by SetScreenDPI().

MATRIX3x3D KIGFX::GAL::screenWorldMatrix
protected
STROKE_FONT KIGFX::GAL::strokeFont
protected

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

Definition at line 1041 of file graphics_abstraction_layer.h.

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

double KIGFX::GAL::worldScale
protected
MATRIX3x3D KIGFX::GAL::worldScreenMatrix
protected
double KIGFX::GAL::worldUnitLength
protected

The unit length of the world coordinates [inch].

Definition at line 995 of file graphics_abstraction_layer.h.

Referenced by SetWorldUnitLength().

double KIGFX::GAL::zoomFactor
protected

The zoom factor.

Definition at line 999 of file graphics_abstraction_layer.h.

Referenced by computeWorldScale(), GetZoomFactor(), and SetZoomFactor().


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