KiCad PCB EDA Suite
Loading...
Searching...
No Matches
WIDGET_DIFF_CANVAS Class Reference

GAL-backed canvas for visualizing a KICAD_DIFF::DIFF_SCENE. More...

#include <widget_diff_canvas.h>

Inheritance diagram for WIDGET_DIFF_CANVAS:
EDA_DRAW_PANEL_GAL

Classes

struct  HIGHLIGHT_BOX_ITEM
 

Public Types

using DIMMER = std::function<void( KIGFX::VIEW_ITEM*, bool aDim )>
 Kiface-supplied callback that dims/undims a context item.
 
using PICK_HANDLER = std::function<void( const std::optional<KIID_PATH>& )>
 Register a callback to fire when the user left-clicks the canvas.
 
using ITEM_HANDLER = std::function<void( KIGFX::VIEW_ITEM* )>
 
enum  GAL_TYPE {
  GAL_TYPE_UNKNOWN = -1 , GAL_TYPE_NONE = 0 , GAL_TYPE_OPENGL , GAL_TYPE_CAIRO ,
  GAL_TYPE_LAST
}
 

Public Member Functions

 WIDGET_DIFF_CANVAS (wxWindow *aParent, wxWindowID aId=wxID_ANY)
 
 ~WIDGET_DIFF_CANVAS () override
 
void SetScene (KICAD_DIFF::DIFF_SCENE aScene)
 Replace the displayed scene. Pass an empty scene to clear the canvas.
 
void SetWorldUnitLength (double aWorldUnitLength)
 
void SetContextPainter (std::unique_ptr< KIGFX::PAINTER > aPainter)
 Install the native painter used for drawing source document context.
 
void SetContextItems (const std::vector< KIGFX::VIEW_ITEM * > &aItems)
 Replace source document context items.
 
void SetItemCategories (std::map< KIGFX::VIEW_ITEM *, KICAD_DIFF::CATEGORY > aMap)
 Tag context items by change category so SetCategoryVisible can hide / show them in lockstep with the diff-category checkboxes.
 
void SetItemDimmer (DIMMER aDimmer)
 
void HighlightChange (std::optional< KIID_PATH > aChangeId)
 Outline shape(s) whose SCENE_SHAPE::changeId matches the given path.
 
void SetCategoryVisible (KICAD_DIFF::CATEGORY aCategory, bool aVisible)
 Toggle whether shapes of a given change category render.
 
bool IsCategoryVisible (KICAD_DIFF::CATEGORY aCategory) const
 
void SetHiddenChanges (std::set< KIID_PATH > aHidden)
 Replace the set of muted changes.
 
bool IsChangeHidden (const KIID_PATH &aChangeId) const
 
void SetLayerVisible (PCB_LAYER_ID aLayer, bool aVisible)
 Toggle whether board-context geometry on a given PCB layer renders.
 
bool IsLayerVisible (PCB_LAYER_ID aLayer) const
 
void BeginUpdate ()
 Hold overlay rebuilds/zoom until EndUpdate, so a batch of changes (e.g.
 
void EndUpdate ()
 
void ZoomToFit ()
 Center the view on the scene's document bbox.
 
void ZoomToBBox (const BOX2I &aBBox)
 Zoom and center on a specific document-space bbox with a small margin.
 
void CenterOnHighlight ()
 Pan so the currently highlighted change is at the center of the canvas.
 
void SetPickHandler (PICK_HANDLER aHandler)
 
void SetDoubleClickHandler (ITEM_HANDLER aHandler)
 
void SetFocus () override
 
bool StatusPopupHasFocus ()
 
void SetStatusPopup (wxWindow *aPopup)
 
virtual bool SwitchBackend (GAL_TYPE aGalType)
 Switch method of rendering graphics.
 
GAL_TYPE GetBackend () const
 Return the type of backend currently used by GAL canvas.
 
KIGFX::GALGetGAL () const
 Return a pointer to the GAL instance used in the panel.
 
virtual KIGFX::VIEWGetView () const
 Return a pointer to the #VIEW instance used in the panel.
 
KIGFX::VIEW_CONTROLSGetViewControls () const
 Return a pointer to the #VIEW_CONTROLS instance used in the panel.
 
bool GetScreenshot (wxImage &aDstImage)
 Capture the current canvas contents into aDstImage.
 
virtual void Refresh (bool aEraseBackground=true, const wxRect *aRect=nullptr) override
 
void ForceRefresh ()
 Force a redraw.
 
void RequestRefresh ()
 Make sure a refresh gets done on the next idle event if it hasn't already.
 
void SetEventDispatcher (TOOL_DISPATCHER *aEventDispatcher)
 Set a dispatcher that processes events and forwards them to tools.
 
void StartDrawing ()
 Begin drawing if it was stopped previously.
 
void StopDrawing ()
 Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
 
virtual void SetHighContrastLayer (int aLayer)
 Take care of display settings for the given layer to be displayed in high contrast mode.
 
virtual void SetTopLayer (int aLayer)
 Move the selected layer to the top, so it is displayed above all others.
 
virtual void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
 
EDA_DRAW_FRAMEGetParentEDAFrame () const
 Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
 
bool IsDialogPreview () const
 
virtual void OnShow ()
 Called when the window is shown for the first time.
 
void SetStealsFocus (bool aStealsFocus)
 Set whether focus is taken on certain events (mouseover, keys, etc).
 
void SetCurrentCursor (KICURSOR aCursor)
 Set the current cursor shape for this panel.
 
virtual BOX2I GetDefaultViewBBox () const
 Return the bounding box of the view that should be used if model is not valid.
 
void OnEvent (wxEvent &aEvent)
 Used to forward events to the canvas from popups, etc.
 
bool DoRePaint (bool aAllowSkip=true)
 Repaint the canvas, and fix scrollbar cursors.
 
std::shared_ptr< KIGFX::VIEW_OVERLAYDebugOverlay ()
 Create an overlay for rendering debug graphics.
 
void ClearDebugOverlay ()
 Clear the contents of the debug overlay and removes it from the VIEW.
 

Static Public Member Functions

static KIGFX::VC_SETTINGS GetVcSettings ()
 Gets a populated View Controls settings object dervived from our program settings.
 

Public Attributes

bool m_MouseCapturedLost
 used on wxMSW: true after a wxEVT_MOUSE_CAPTURE_LOST was received false after the mouse is recaptured.
 
std::unique_ptr< PROF_COUNTERm_PaintEventCounter
 

Static Public Attributes

static constexpr GAL_TYPE GAL_FALLBACK = GAL_TYPE_CAIRO
 
static constexpr bool GAL_FALLBACK_AVAILABLE = GAL_FALLBACK != GAL_TYPE_OPENGL
 

Protected Member Functions

virtual void onPaint (wxPaintEvent &WXUNUSED(aEvent))
 
void onEnter (wxMouseEvent &aEvent)
 
void onLostFocus (wxFocusEvent &aEvent)
 
void onIdle (wxIdleEvent &aEvent)
 
void onRefreshTimer (wxTimerEvent &aEvent)
 
void onShowEvent (wxShowEvent &aEvent)
 
bool recoverFromGalError (const std::exception &aErr)
 

Protected Attributes

wxWindow * m_parent
 Pointer to the parent window.
 
EDA_DRAW_FRAMEm_edaFrame
 Parent EDA_DRAW_FRAME (if available)
 
wxLongLong m_lastRepaintStart
 Timestamp of the last repaint start.
 
wxLongLong m_lastRepaintEnd
 Timestamp of the last repaint end.
 
wxTimer m_refreshTimer
 Timer to prevent too-frequent refreshing.
 
std::mutex m_refreshMutex
 Blocks multiple calls to the draw.
 
bool m_drawing
 True if GAL is currently redrawing the view.
 
bool m_drawingEnabled
 Flag that determines if VIEW may use GAL for redrawing the screen.
 
bool m_needIdleRefresh
 True when canvas needs to be refreshed from idle handler.
 
VECTOR2D m_lastCursorPosition
 Last cursor position sent to GAL for drawing.
 
KIGFX::GALm_gal
 Interface for drawing objects on a 2D-surface.
 
KIGFX::VIEWm_view
 Stores view settings (scale, center, etc.) and items to be drawn.
 
std::unique_ptr< KIGFX::PAINTERm_painter
 Contains information about how to draw items using GAL.
 
KIGFX::WX_VIEW_CONTROLSm_viewControls
 Control for VIEW (moving, zooming, etc.)
 
GAL_TYPE m_backend
 Currently used GAL.
 
KIGFX::GAL_DISPLAY_OPTIONSm_options
 
TOOL_DISPATCHERm_eventDispatcher
 Processes and forwards events to tools.
 
bool m_lostFocus
 Flag to indicate that focus should be regained on the next mouse event.
 
bool m_glRecoveryAttempted
 Set after an OpenGL recovery attempt to prevent infinite retry loops.
 
bool m_stealsFocus
 Flag to indicate whether the panel should take focus at certain times (when moused over, and on various mouse/key events)
 
wxWindow * m_statusPopup
 
std::shared_ptr< KIGFX::VIEW_OVERLAYm_debugOverlay
 Optional overlay for drawing transient debug objects.
 

Private Member Functions

 WIDGET_DIFF_CANVAS (wxWindow *aParent, wxWindowID aId, std::unique_ptr< KIGFX::GAL_DISPLAY_OPTIONS > aGalOptions)
 Delegating ctor target — keeps the GAL options unique_ptr alive across the base-class initialization that needs to deref it.
 
void rebuildOverlay (bool aOverlayOnly=false)
 Rebuild the overlay from the render scene + current highlight state.
 
void buildRenderScene ()
 Recompute the cached render scene (layer-filtered geometry, cleared in native-context mode).
 
void refreshItemDimming ()
 Dim context items that are hidden, or unfocused while a highlight is active.
 
const KICAD_DIFF::SCENE_SHAPEshapeAt (const wxPoint &aScreenPoint) const
 Hit test in screen coordinates → topmost SCENE_SHAPE under the cursor.
 
std::optional< BOX2IhighlightedBBox () const
 Union bbox of all shapes whose changeId matches the current highlight, honoring per-category visibility.
 
void onLeftDown (wxMouseEvent &aEvent)
 
void onDoubleClick (wxMouseEvent &aEvent)
 
void onMotion (wxMouseEvent &aEvent)
 
void onLeave (wxMouseEvent &aEvent)
 
void onChar (wxKeyEvent &aEvent)
 
void onSize (wxSizeEvent &aEvent)
 

Private Attributes

KICAD_DIFF::DIFF_SCENE m_scene
 
KICAD_DIFF::DIFF_SCENE m_renderScene
 
std::optional< KIID_PATHm_highlight
 
std::optional< KIID_PATHm_hover
 
PICK_HANDLER m_pickHandler
 
ITEM_HANDLER m_dclickHandler
 
DIMMER m_itemDimmer
 
std::unique_ptr< HIGHLIGHT_BOX_ITEMm_highlightBox
 
std::unique_ptr< HIGHLIGHT_BOX_ITEMm_hoverBox
 
std::array< bool, KICAD_DIFF::CATEGORY_COUNTm_categoryVisible { { true, true, true, true } }
 
std::set< KIID_PATHm_hiddenChanges
 
bool m_holdRebuild = false
 While true, rebuildOverlay()/ZoomToFit() are held so a batch renders once.
 
LSET m_layerVisible
 
bool m_hasNativeContext = false
 
std::unique_ptr< KIGFX::VIEW_GROUPm_contextGroup
 
std::vector< KIGFX::VIEW_ITEM * > m_contextGroupItems
 
std::map< KIGFX::VIEW_ITEM *, KICAD_DIFF::CATEGORYm_itemCategories
 
std::shared_ptr< KIGFX::VIEW_OVERLAYm_overlay
 
std::unique_ptr< KIGFX::GAL_DISPLAY_OPTIONSm_galOptions
 EDA_DRAW_PANEL_GAL keeps a reference to the options struct, so it must outlive the panel.
 
bool m_zoomToFitPending = false
 True when a ZoomToFit was requested before the canvas had a real size — the next onSize will retry the fit and clear this.
 

Detailed Description

GAL-backed canvas for visualizing a KICAD_DIFF::DIFF_SCENE.

This is the hardware-accelerated counterpart to DIFF_THUMBNAIL.

The canvas owns a KIGFX::VIEW, a VIEW_OVERLAY, and an optional non-owning VIEW_GROUP for source document items. Module callers can install a native painter/context group so unchanged document context is drawn as real items, while the overlay still holds selectable diff change shapes.

Pan and zoom come from WX_VIEW_CONTROLS (mouse middle-drag, wheel) for free. Pick handling and home/F-zoom are wired explicitly so the public API matches DIFF_THUMBNAIL's contract; dialogs can swap one for the other without further changes.

Definition at line 68 of file widget_diff_canvas.h.

Member Typedef Documentation

◆ DIMMER

using WIDGET_DIFF_CANVAS::DIMMER = std::function<void( KIGFX::VIEW_ITEM*, bool aDim )>

Kiface-supplied callback that dims/undims a context item.

Definition at line 101 of file widget_diff_canvas.h.

◆ ITEM_HANDLER

using WIDGET_DIFF_CANVAS::ITEM_HANDLER = std::function<void( KIGFX::VIEW_ITEM* )>

Definition at line 153 of file widget_diff_canvas.h.

◆ PICK_HANDLER

using WIDGET_DIFF_CANVAS::PICK_HANDLER = std::function<void( const std::optional<KIID_PATH>& )>

Register a callback to fire when the user left-clicks the canvas.

The optional holds the picked change id when a shape was hit, or std::nullopt when the click landed on empty space (deselect).

Definition at line 149 of file widget_diff_canvas.h.

Member Enumeration Documentation

◆ GAL_TYPE

Enumerator
GAL_TYPE_UNKNOWN 

not specified: a GAL engine must be set by the client

GAL_TYPE_NONE 

GAL not used (the legacy wxDC engine is used)

GAL_TYPE_OPENGL 

OpenGL implementation.

GAL_TYPE_CAIRO 

Cairo implementation.

GAL_TYPE_LAST 

Sentinel, do not use as a parameter.

Definition at line 60 of file class_draw_panel_gal.h.

Constructor & Destructor Documentation

◆ WIDGET_DIFF_CANVAS() [1/2]

WIDGET_DIFF_CANVAS::WIDGET_DIFF_CANVAS ( wxWindow * aParent,
wxWindowID aId = wxID_ANY )

Definition at line 50 of file widget_diff_canvas.cpp.

References WIDGET_DIFF_CANVAS().

Referenced by WIDGET_DIFF_CANVAS().

◆ ~WIDGET_DIFF_CANVAS()

WIDGET_DIFF_CANVAS::~WIDGET_DIFF_CANVAS ( )
override

◆ WIDGET_DIFF_CANVAS() [2/2]

Member Function Documentation

◆ BeginUpdate()

void WIDGET_DIFF_CANVAS::BeginUpdate ( )

Hold overlay rebuilds/zoom until EndUpdate, so a batch of changes (e.g.

a reload that re-sets context and scene) renders once instead of flashing an intermediate state.

Definition at line 364 of file widget_diff_canvas.cpp.

References m_holdRebuild.

◆ buildRenderScene()

void WIDGET_DIFF_CANVAS::buildRenderScene ( )
private

Recompute the cached render scene (layer-filtered geometry, cleared in native-context mode).

Only depends on the scene, layer visibility, and context mode, so it runs when those change, not on every interaction.

Definition at line 463 of file widget_diff_canvas.cpp.

References KICAD_DIFF::FilterGeometryByVisibleLayers(), m_hasNativeContext, m_layerVisible, m_renderScene, and m_scene.

Referenced by SetContextItems(), SetLayerVisible(), and SetScene().

◆ CenterOnHighlight()

void WIDGET_DIFF_CANVAS::CenterOnHighlight ( )

Pan so the currently highlighted change is at the center of the canvas.

No-op when nothing is highlighted.

Definition at line 449 of file widget_diff_canvas.cpp.

References center, highlightedBBox(), EDA_DRAW_PANEL_GAL::m_view, and EDA_DRAW_PANEL_GAL::Refresh().

◆ ClearDebugOverlay()

void EDA_DRAW_PANEL_GAL::ClearDebugOverlay ( )
inherited

Clear the contents of the debug overlay and removes it from the VIEW.

Definition at line 847 of file draw_panel_gal.cpp.

References m_debugOverlay, and m_view.

◆ DebugOverlay()

std::shared_ptr< KIGFX::VIEW_OVERLAY > EDA_DRAW_PANEL_GAL::DebugOverlay ( )
inherited

Create an overlay for rendering debug graphics.

Definition at line 835 of file draw_panel_gal.cpp.

References m_debugOverlay, and m_view.

◆ DoRePaint()

◆ EndUpdate()

void WIDGET_DIFF_CANVAS::EndUpdate ( )

◆ ForceRefresh()

◆ GetBackend()

◆ GetDefaultViewBBox()

virtual BOX2I EDA_DRAW_PANEL_GAL::GetDefaultViewBBox ( ) const
inlinevirtualinherited

Return the bounding box of the view that should be used if model is not valid.

For example, the drawing sheet bounding box for an empty PCB

Returns
the default bounding box for the panel.

Reimplemented in GERBVIEW_DRAW_PANEL_GAL, and PCB_DRAW_PANEL_GAL.

Definition at line 226 of file class_draw_panel_gal.h.

Referenced by COMMON_TOOLS::doCenter(), and COMMON_TOOLS::doZoomFit().

◆ GetGAL()

◆ GetMsgPanelInfo()

virtual void EDA_DRAW_PANEL_GAL::GetMsgPanelInfo ( EDA_DRAW_FRAME * aFrame,
std::vector< MSG_PANEL_ITEM > & aList )
inlinevirtualinherited

Reimplemented in GERBVIEW_DRAW_PANEL_GAL, PCB_DRAW_PANEL_GAL, and PL_DRAW_PANEL_GAL.

Definition at line 190 of file class_draw_panel_gal.h.

◆ GetParentEDAFrame()

◆ GetScreenshot()

bool EDA_DRAW_PANEL_GAL::GetScreenshot ( wxImage & aDstImage)
inherited

Capture the current canvas contents into aDstImage.

Returns
true on success, false if the backend can't be captured this way (the caller should fall back to a DC blit).

Definition at line 573 of file draw_panel_gal.cpp.

References DoRePaint(), GAL_TYPE_OPENGL, GetScreenshot(), m_backend, and m_gal.

Referenced by GetScreenshot().

◆ GetVcSettings()

KIGFX::VC_SETTINGS EDA_DRAW_PANEL_GAL::GetVcSettings ( )
staticinherited

Gets a populated View Controls settings object dervived from our program settings.

Definition at line 857 of file draw_panel_gal.cpp.

References COMMON_SETTINGS::INPUT::auto_pan, COMMON_SETTINGS::INPUT::auto_pan_acceleration, COMMON_SETTINGS::INPUT::center_on_zoom, COMMON_SETTINGS::INPUT::drag_left, COMMON_SETTINGS::INPUT::drag_middle, COMMON_SETTINGS::INPUT::drag_right, COMMON_SETTINGS::INPUT::focus_follow_sch_pcb, PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::INPUT::horizontal_pan, KIGFX::VC_SETTINGS::m_autoPanAcceleration, KIGFX::VC_SETTINGS::m_autoPanSettingEnabled, KIGFX::VC_SETTINGS::m_dragLeft, KIGFX::VC_SETTINGS::m_dragMiddle, KIGFX::VC_SETTINGS::m_dragRight, KIGFX::VC_SETTINGS::m_focusFollowSchPcb, KIGFX::VC_SETTINGS::m_horizontalPan, COMMON_SETTINGS::m_Input, KIGFX::VC_SETTINGS::m_motionPanModifier, KIGFX::VC_SETTINGS::m_scrollModifierPanH, KIGFX::VC_SETTINGS::m_scrollModifierPanV, KIGFX::VC_SETTINGS::m_scrollModifierZoom, KIGFX::VC_SETTINGS::m_scrollReversePanH, KIGFX::VC_SETTINGS::m_scrollReverseZoom, KIGFX::VC_SETTINGS::m_warpCursor, KIGFX::VC_SETTINGS::m_zoomAcceleration, KIGFX::VC_SETTINGS::m_zoomSpeed, KIGFX::VC_SETTINGS::m_zoomSpeedAuto, COMMON_SETTINGS::INPUT::motion_pan_modifier, Pgm(), COMMON_SETTINGS::INPUT::reverse_scroll_pan_h, COMMON_SETTINGS::INPUT::reverse_scroll_zoom, COMMON_SETTINGS::INPUT::scroll_modifier_pan_h, COMMON_SETTINGS::INPUT::scroll_modifier_pan_v, COMMON_SETTINGS::INPUT::scroll_modifier_zoom, COMMON_SETTINGS::INPUT::zoom_acceleration, COMMON_SETTINGS::INPUT::zoom_speed, and COMMON_SETTINGS::INPUT::zoom_speed_auto.

Referenced by EDA_3D_VIEWER_FRAME::applySettings(), EDA_3D_VIEWER_FRAME::configureCanvas(), and SwitchBackend().

◆ GetView()

◆ GetViewControls()

◆ HighlightChange()

void WIDGET_DIFF_CANVAS::HighlightChange ( std::optional< KIID_PATH > aChangeId)

Outline shape(s) whose SCENE_SHAPE::changeId matches the given path.

Multiple shapes can share a changeId — DUPLICATE_UUID changes for example — and all matching shapes get the highlight treatment. Pass std::nullopt to clear.

Definition at line 190 of file widget_diff_canvas.cpp.

References KIGFX::COLOR4D::a, BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), m_contextGroupItems, m_highlight, m_highlightBox, m_hover, m_hoverBox, m_itemCategories, EDA_ITEM::m_Uuid, KICAD_DIFF::DIFF_COLOR_THEME::modified, rebuildOverlay(), and KICAD_DIFF::ThemeColorFor().

◆ highlightedBBox()

std::optional< BOX2I > WIDGET_DIFF_CANVAS::highlightedBBox ( ) const
private

Union bbox of all shapes whose changeId matches the current highlight, honoring per-category visibility.

std::nullopt when nothing matches.

Definition at line 694 of file widget_diff_canvas.cpp.

References KICAD_DIFF::HighlightedBBox(), m_categoryVisible, m_highlight, and m_scene.

Referenced by CenterOnHighlight(), and onChar().

◆ IsCategoryVisible()

bool WIDGET_DIFF_CANVAS::IsCategoryVisible ( KICAD_DIFF::CATEGORY aCategory) const

Definition at line 288 of file widget_diff_canvas.cpp.

References m_categoryVisible.

Referenced by shapeAt().

◆ IsChangeHidden()

bool WIDGET_DIFF_CANVAS::IsChangeHidden ( const KIID_PATH & aChangeId) const

Definition at line 309 of file widget_diff_canvas.cpp.

References m_hiddenChanges.

◆ IsDialogPreview()

bool EDA_DRAW_PANEL_GAL::IsDialogPreview ( ) const
inlineinherited

◆ IsLayerVisible()

bool WIDGET_DIFF_CANVAS::IsLayerVisible ( PCB_LAYER_ID aLayer) const

Definition at line 358 of file widget_diff_canvas.cpp.

References m_layerVisible.

◆ onChar()

void WIDGET_DIFF_CANVAS::onChar ( wxKeyEvent & aEvent)
private

◆ onDoubleClick()

◆ onEnter()

void EDA_DRAW_PANEL_GAL::onEnter ( wxMouseEvent & aEvent)
protectedinherited

◆ OnEvent()

void EDA_DRAW_PANEL_GAL::OnEvent ( wxEvent & aEvent)
inherited

◆ onIdle()

void EDA_DRAW_PANEL_GAL::onIdle ( wxIdleEvent & aEvent)
protectedinherited

Definition at line 788 of file draw_panel_gal.cpp.

References m_needIdleRefresh, and Refresh().

Referenced by ForceRefresh(), and StopDrawing().

◆ onLeave()

void WIDGET_DIFF_CANVAS::onLeave ( wxMouseEvent & aEvent)
private

Definition at line 632 of file widget_diff_canvas.cpp.

References m_hover, m_hoverBox, and rebuildOverlay().

Referenced by WIDGET_DIFF_CANVAS().

◆ onLeftDown()

void WIDGET_DIFF_CANVAS::onLeftDown ( wxMouseEvent & aEvent)
private

Definition at line 544 of file widget_diff_canvas.cpp.

References m_pickHandler, EDA_DRAW_PANEL_GAL::SetFocus(), and shapeAt().

Referenced by WIDGET_DIFF_CANVAS().

◆ onLostFocus()

void EDA_DRAW_PANEL_GAL::onLostFocus ( wxFocusEvent & aEvent)
protectedinherited

Definition at line 772 of file draw_panel_gal.cpp.

References m_eventDispatcher, m_lostFocus, and m_viewControls.

Referenced by EDA_DRAW_PANEL_GAL().

◆ onMotion()

void WIDGET_DIFF_CANVAS::onMotion ( wxMouseEvent & aEvent)
private

◆ onPaint()

void EDA_DRAW_PANEL_GAL::onPaint ( wxPaintEvent & WXUNUSEDaEvent)
protectedvirtualinherited

◆ onRefreshTimer()

void EDA_DRAW_PANEL_GAL::onRefreshTimer ( wxTimerEvent & aEvent)
protectedinherited

Definition at line 800 of file draw_panel_gal.cpp.

References ForceRefresh().

Referenced by EDA_DRAW_PANEL_GAL().

◆ OnShow()

virtual void EDA_DRAW_PANEL_GAL::OnShow ( )
inlinevirtualinherited

Called when the window is shown for the first time.

Reimplemented in GERBVIEW_DRAW_PANEL_GAL, PCB_DRAW_PANEL_GAL, SCH_DRAW_PANEL, and SCH_PREVIEW_PANEL.

Definition at line 205 of file class_draw_panel_gal.h.

Referenced by onShowEvent().

◆ onShowEvent()

void EDA_DRAW_PANEL_GAL::onShowEvent ( wxShowEvent & aEvent)
protectedinherited

Definition at line 806 of file draw_panel_gal.cpp.

References m_gal, and OnShow().

Referenced by EDA_DRAW_PANEL_GAL(), and ~EDA_DRAW_PANEL_GAL().

◆ onSize()

void WIDGET_DIFF_CANVAS::onSize ( wxSizeEvent & aEvent)
private

Definition at line 685 of file widget_diff_canvas.cpp.

References m_zoomToFitPending, and ZoomToFit().

Referenced by WIDGET_DIFF_CANVAS().

◆ rebuildOverlay()

void WIDGET_DIFF_CANVAS::rebuildOverlay ( bool aOverlayOnly = false)
private

Rebuild the overlay from the render scene + current highlight state.

aOverlayOnly marks only the overlay target dirty (for hover/highlight changes that leave the cached board untouched).

Definition at line 482 of file widget_diff_canvas.cpp.

References m_categoryVisible, m_hiddenChanges, m_highlight, m_highlightBox, m_holdRebuild, m_hoverBox, m_overlay, m_renderScene, EDA_DRAW_PANEL_GAL::m_view, EDA_DRAW_PANEL_GAL::Refresh(), KICAD_DIFF::RenderSceneToOverlay(), and KIGFX::TARGET_OVERLAY.

Referenced by EndUpdate(), HighlightChange(), onLeave(), onMotion(), SetCategoryVisible(), SetContextItems(), SetHiddenChanges(), SetLayerVisible(), and SetScene().

◆ recoverFromGalError()

bool EDA_DRAW_PANEL_GAL::recoverFromGalError ( const std::exception & aErr)
protectedinherited

◆ Refresh()

void EDA_DRAW_PANEL_GAL::Refresh ( bool aEraseBackground = true,
const wxRect * aRect = nullptr )
overridevirtualinherited

Reimplemented in SCH_PREVIEW_PANEL.

Definition at line 505 of file draw_panel_gal.cpp.

References delta, DoRePaint(), m_gal, m_lastRepaintEnd, m_refreshTimer, and RequestRefresh().

Referenced by PCB_EDIT_FRAME::ActivateGalCanvas(), SYMBOL_EDIT_FRAME::activateSymbolTab(), SCH_EDIT_FRAME::AnnotateSymbols(), WIDGET_DIFF_CANVAS::CenterOnHighlight(), GERBVIEW_CONTROL::ClearAllLayers(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), PCB_BASE_EDIT_FRAME::configureToolbars(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), COMMON_TOOLS::doCenter(), COMMON_TOOLS::doZoomFit(), SCH_EDIT_FRAME::EditVariantDescription(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), FOOTPRINT_PREVIEW_PANEL::fitToCurrentFootprint(), PCB_BASE_FRAME::FocusOnItems(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), PCB_VIEWER_TOOLS::GraphicOutlines(), API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings(), PL_EDITOR_FRAME::HardRedraw(), GERBVIEW_CONTROL::HighlightControl(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), POSITION_RELATIVE_TOOL::InteractiveOffset(), SCH_EDIT_FRAME::KiwayMailIn(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), GERBVIEW_FRAME::LoadListOfGerberAndDrillFiles(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), GERBVIEW_CONTROL::LoadZipfile(), PCB_VIEWER_TOOLS::MeasureTool(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), OnEvent(), PANEL_COMPONENT_CLASS_ASSIGNMENT::OnHighlightItemsClick(), onIdle(), SCH_EDIT_FRAME::OnModify(), PCB_EDIT_FRAME::OnNetlistChanged(), SCH_EDIT_FRAME::onNetNavigatorSelection(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), GERBVIEW_FRAME::OnSelectActiveDCode(), GERBVIEW_FRAME::OnSelectActiveLayer(), PL_EDITOR_FRAME::OnSelectCoordOriginCorner(), PL_EDITOR_FRAME::OnSelectPage(), PCB_EDIT_FRAME::onVariantSelected(), GERBVIEW_CONTROL::OpenJobFile(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), GERBVIEW_CONTROL::OpenZipFile(), PCB_VIEWER_TOOLS::PadDisplayMode(), ROUTER_TOOL::performRouting(), ROUTER_TOOL::prepareInteractive(), PCB_CONTROL::RatsnestModeCycle(), WIDGET_DIFF_CANVAS::rebuildOverlay(), SYMBOL_EDIT_FRAME::RebuildView(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), FOOTPRINT_WIZARD_FRAME::ReCreateParameterList(), SCH_BASE_FRAME::RedrawScreen(), SCH_PREVIEW_PANEL::Refresh(), ZONE_FILLER_TOOL::refresh(), EDA_DRAW_FRAME::RefreshCanvas(), FOOTPRINT_WIZARD_FRAME::RegenerateFootprint(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), DISPLAY_FOOTPRINTS_FRAME::ReloadFootprint(), GERBVIEW_FRAME::RemapLayers(), SCH_EDIT_FRAME::RemoveVariant(), PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList(), PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList(), FOOTPRINT_EDIT_FRAME::RevertFootprint(), PCB_BASE_EDIT_FRAME::RollbackFromUndo(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_FRAME::RollbackSchematicFromUndo(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), FOOTPRINT_EDIT_FRAME::SetActiveLayer(), GERBVIEW_FRAME::SetActiveLayer(), PCB_EDIT_FRAME::SetActiveLayer(), WIDGET_DIFF_CANVAS::SetContextPainter(), SYMBOL_EDIT_FRAME::SetCurSymbol(), PCB_BASE_FRAME::SetDisplayOptions(), EDA_DRAW_FRAME::SetGridVisibility(), GERBVIEW_FRAME::SetLayerDrawPrms(), PCB_BASE_FRAME::SetPlotSettings(), SYMBOL_VIEWER_FRAME::SetSelectedLibrary(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), SYMBOL_EDIT_FRAME::ShowChangedLanguage(), PCB_EDIT_FRAME::ShowFootprintPropertiesDialog(), PCB_VIEWER_TOOLS::ShowPadNumbers(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SCH_DRAW_PANEL::SwitchBackend(), PCB_BASE_FRAME::SwitchLayer(), PCB_EDIT_FRAME::SwitchLayer(), PCB_VIEWER_TOOLS::TextOutlines(), PCB_CONTROL::ToggleRatsnest(), PCB_CONTROL::TrackDisplayMode(), SYMBOL_VIEWER_FRAME::updatePreviewSymbol(), PANEL_ASSIGN_COMPONENT_CLASSES::Validate(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), GLOBAL_EDIT_TOOL::ZonesManager(), ZONE_PREVIEW_CANVAS::ZoomFitScreen(), and WIDGET_DIFF_CANVAS::ZoomToBBox().

◆ refreshItemDimming()

void WIDGET_DIFF_CANVAS::refreshItemDimming ( )
private

Dim context items that are hidden, or unfocused while a highlight is active.

Definition at line 315 of file widget_diff_canvas.cpp.

References m_contextGroupItems, m_hiddenChanges, m_itemDimmer, EDA_ITEM::m_Uuid, EDA_DRAW_PANEL_GAL::m_view, path, and KIGFX::REPAINT.

Referenced by SetHiddenChanges().

◆ RequestRefresh()

void EDA_DRAW_PANEL_GAL::RequestRefresh ( )
inherited

Make sure a refresh gets done on the next idle event if it hasn't already.

Definition at line 499 of file draw_panel_gal.cpp.

References m_needIdleRefresh.

Referenced by ZONE_PREVIEW_CANVAS::LockZoom(), Refresh(), ZONE_PREVIEW_CANVAS::ZONE_PREVIEW_CANVAS(), and ZONE_PREVIEW_CANVAS::ZoomFitScreen().

◆ SetCategoryVisible()

void WIDGET_DIFF_CANVAS::SetCategoryVisible ( KICAD_DIFF::CATEGORY aCategory,
bool aVisible )

Toggle whether shapes of a given change category render.

Defaults to all visible.

Definition at line 247 of file widget_diff_canvas.cpp.

References m_categoryVisible, m_itemCategories, EDA_DRAW_PANEL_GAL::m_view, rebuildOverlay(), and KIGFX::REPAINT.

◆ SetContextItems()

void WIDGET_DIFF_CANVAS::SetContextItems ( const std::vector< KIGFX::VIEW_ITEM * > & aItems)

Replace source document context items.

Items are not owned by the widget; callers must keep the source documents alive while the dialog is open.

Definition at line 160 of file widget_diff_canvas.cpp.

References buildRenderScene(), m_contextGroup, m_contextGroupItems, m_hasNativeContext, m_itemCategories, EDA_DRAW_PANEL_GAL::m_view, and rebuildOverlay().

Referenced by KICAD_DIFF::ConfigurePcbDiffCanvasContext(), KICAD_DIFF::ConfigureSchDiffCanvasContext(), and KICAD_DIFF::ConfigureSymDiffCanvasContext().

◆ SetContextPainter()

void WIDGET_DIFF_CANVAS::SetContextPainter ( std::unique_ptr< KIGFX::PAINTER > aPainter)

Install the native painter used for drawing source document context.

pcbnew/eeschema provide module-specific painters configured with a forced neutral color. The diff overlay remains owned by this widget.

Definition at line 148 of file widget_diff_canvas.cpp.

References EDA_DRAW_PANEL_GAL::m_painter, EDA_DRAW_PANEL_GAL::m_view, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by KICAD_DIFF::ConfigurePcbDiffCanvasContext(), KICAD_DIFF::ConfigureSchDiffCanvasContext(), and KICAD_DIFF::ConfigureSymDiffCanvasContext().

◆ SetCurrentCursor()

void EDA_DRAW_PANEL_GAL::SetCurrentCursor ( KICURSOR aCursor)
inherited

Set the current cursor shape for this panel.

Definition at line 815 of file draw_panel_gal.cpp.

References DPI_SCALING_COMMON::GetContentScaleFactor(), m_gal, and m_parent.

Referenced by EDIT_TOOL::doMoveSelection(), PAD_TOOL::EnumeratePads(), PCB_VIEWER_TOOLS::MeasureTool(), and SwitchBackend().

◆ SetDoubleClickHandler()

void WIDGET_DIFF_CANVAS::SetDoubleClickHandler ( ITEM_HANDLER aHandler)
inline

Definition at line 154 of file widget_diff_canvas.h.

References m_dclickHandler.

◆ SetEventDispatcher()

void EDA_DRAW_PANEL_GAL::SetEventDispatcher ( TOOL_DISPATCHER * aEventDispatcher)
inherited

Set a dispatcher that processes events and forwards them to tools.

#DRAW_PANEL_GAL does not take over the ownership. Passing NULL disconnects all event handlers from the #DRAW_PANEL_GAL and parent frame.

Parameters
aEventDispatcheris the object that will be used for dispatching events.

Definition at line 584 of file draw_panel_gal.cpp.

References m_eventDispatcher.

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), FOOTPRINT_EDIT_FRAME::doCloseWindow(), FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME(), FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME(), FOOTPRINT_EDIT_FRAME::setupTools(), PL_EDITOR_FRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), and SYMBOL_VIEWER_FRAME::setupTools().

◆ SetFocus()

◆ SetHiddenChanges()

void WIDGET_DIFF_CANVAS::SetHiddenChanges ( std::set< KIID_PATH > aHidden)

Replace the set of muted changes.

Hidden changes render muted grey and stop grabbing clicks.

Definition at line 298 of file widget_diff_canvas.cpp.

References m_hiddenChanges, rebuildOverlay(), and refreshItemDimming().

◆ SetHighContrastLayer()

void EDA_DRAW_PANEL_GAL::SetHighContrastLayer ( int aLayer)
virtualinherited

Take care of display settings for the given layer to be displayed in high contrast mode.

Reimplemented in GERBVIEW_DRAW_PANEL_GAL, and PCB_DRAW_PANEL_GAL.

Definition at line 608 of file draw_panel_gal.cpp.

References KIGFX::RENDER_SETTINGS::ClearHighContrastLayers(), m_view, KIGFX::RENDER_SETTINGS::SetLayerIsHighContrast(), and SetTopLayer().

Referenced by GERBVIEW_FRAME::SetActiveLayer(), and PCB_BASE_FRAME::SetDisplayOptions().

◆ SetItemCategories()

void WIDGET_DIFF_CANVAS::SetItemCategories ( std::map< KIGFX::VIEW_ITEM *, KICAD_DIFF::CATEGORY > aMap)

Tag context items by change category so SetCategoryVisible can hide / show them in lockstep with the diff-category checkboxes.

Definition at line 274 of file widget_diff_canvas.cpp.

References m_categoryVisible, m_itemCategories, and EDA_DRAW_PANEL_GAL::m_view.

Referenced by KICAD_DIFF::ConfigurePcbDiffCanvasContext(), and KICAD_DIFF::ConfigureSchDiffCanvasContext().

◆ SetItemDimmer()

void WIDGET_DIFF_CANVAS::SetItemDimmer ( DIMMER aDimmer)
inline

◆ SetLayerVisible()

void WIDGET_DIFF_CANVAS::SetLayerVisible ( PCB_LAYER_ID aLayer,
bool aVisible )

Toggle whether board-context geometry on a given PCB layer renders.

Layerless geometry remains visible regardless of this filter.

Definition at line 343 of file widget_diff_canvas.cpp.

References buildRenderScene(), m_layerVisible, EDA_DRAW_PANEL_GAL::m_view, PCB_LAYER_ID_COUNT, and rebuildOverlay().

◆ SetPickHandler()

void WIDGET_DIFF_CANVAS::SetPickHandler ( PICK_HANDLER aHandler)
inline

Definition at line 151 of file widget_diff_canvas.h.

References m_pickHandler.

◆ SetScene()

void WIDGET_DIFF_CANVAS::SetScene ( KICAD_DIFF::DIFF_SCENE aScene)

Replace the displayed scene. Pass an empty scene to clear the canvas.

Definition at line 129 of file widget_diff_canvas.cpp.

References buildRenderScene(), m_highlight, m_scene, rebuildOverlay(), and ZoomToFit().

◆ SetStatusPopup()

void EDA_DRAW_PANEL_GAL::SetStatusPopup ( wxWindow * aPopup)
inlineinherited

◆ SetStealsFocus()

void EDA_DRAW_PANEL_GAL::SetStealsFocus ( bool aStealsFocus)
inlineinherited

Set whether focus is taken on certain events (mouseover, keys, etc).

This should be true (and is by default) for any primary canvas, but can be false to make well behaved preview panes and the like.

Definition at line 213 of file class_draw_panel_gal.h.

References m_stealsFocus.

Referenced by SYMBOL_VIEWER_FRAME::ClickOnSymbolList(), FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL(), and SYMBOL_VIEWER_FRAME::SetSelectedLibrary().

◆ SetTopLayer()

void EDA_DRAW_PANEL_GAL::SetTopLayer ( int aLayer)
virtualinherited

Move the selected layer to the top, so it is displayed above all others.

Reimplemented in GERBVIEW_DRAW_PANEL_GAL, PCB_DRAW_PANEL_GAL, and PL_DRAW_PANEL_GAL.

Definition at line 622 of file draw_panel_gal.cpp.

References m_view.

Referenced by SetHighContrastLayer().

◆ SetWorldUnitLength()

void WIDGET_DIFF_CANVAS::SetWorldUnitLength ( double aWorldUnitLength)

◆ shapeAt()

const KICAD_DIFF::SCENE_SHAPE * WIDGET_DIFF_CANVAS::shapeAt ( const wxPoint & aScreenPoint) const
private

Hit test in screen coordinates → topmost SCENE_SHAPE under the cursor.

Definition at line 512 of file widget_diff_canvas.cpp.

References IsCategoryVisible(), KiROUND(), m_hiddenChanges, m_scene, EDA_DRAW_PANEL_GAL::m_view, KICAD_DIFF::PAINT_ORDER, KICAD_DIFF::ShapesFor(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by onLeftDown(), and onMotion().

◆ StartDrawing()

◆ StatusPopupHasFocus()

bool EDA_DRAW_PANEL_GAL::StatusPopupHasFocus ( )
inlineinherited

Definition at line 92 of file class_draw_panel_gal.h.

References m_statusPopup.

◆ StopDrawing()

◆ SwitchBackend()

◆ ZoomToBBox()

void WIDGET_DIFF_CANVAS::ZoomToBBox ( const BOX2I & aBBox)

Zoom and center on a specific document-space bbox with a small margin.

Definition at line 434 of file widget_diff_canvas.cpp.

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), BOX2< Vec >::Inflate(), EDA_DRAW_PANEL_GAL::m_view, and EDA_DRAW_PANEL_GAL::Refresh().

Referenced by onChar(), and ZoomToFit().

◆ ZoomToFit()

void WIDGET_DIFF_CANVAS::ZoomToFit ( )

Center the view on the scene's document bbox.

Safe to call before the canvas has been sized — the request will be deferred to the next wxEVT_SIZE.

Definition at line 380 of file widget_diff_canvas.cpp.

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), m_contextGroupItems, m_holdRebuild, m_scene, m_zoomToFitPending, BOX2< Vec >::Merge(), and ZoomToBBox().

Referenced by KICAD_DIFF::ConfigureSymDiffCanvasContext(), EndUpdate(), onChar(), onSize(), SetScene(), and SetWorldUnitLength().

Member Data Documentation

◆ GAL_FALLBACK

◆ GAL_FALLBACK_AVAILABLE

bool EDA_DRAW_PANEL_GAL::GAL_FALLBACK_AVAILABLE = GAL_FALLBACK != GAL_TYPE_OPENGL
staticconstexprinherited

Definition at line 74 of file class_draw_panel_gal.h.

Referenced by recoverFromGalError().

◆ m_backend

◆ m_categoryVisible

std::array<bool, KICAD_DIFF::CATEGORY_COUNT> WIDGET_DIFF_CANVAS::m_categoryVisible { { true, true, true, true } }
private

◆ m_contextGroup

std::unique_ptr<KIGFX::VIEW_GROUP> WIDGET_DIFF_CANVAS::m_contextGroup
private

Definition at line 206 of file widget_diff_canvas.h.

Referenced by SetContextItems(), WIDGET_DIFF_CANVAS(), and ~WIDGET_DIFF_CANVAS().

◆ m_contextGroupItems

std::vector<KIGFX::VIEW_ITEM*> WIDGET_DIFF_CANVAS::m_contextGroupItems
private

◆ m_dclickHandler

ITEM_HANDLER WIDGET_DIFF_CANVAS::m_dclickHandler
private

Definition at line 191 of file widget_diff_canvas.h.

Referenced by onDoubleClick(), and SetDoubleClickHandler().

◆ m_debugOverlay

std::shared_ptr<KIGFX::VIEW_OVERLAY> EDA_DRAW_PANEL_GAL::m_debugOverlay
protectedinherited

Optional overlay for drawing transient debug objects.

Definition at line 335 of file class_draw_panel_gal.h.

Referenced by ClearDebugOverlay(), and DebugOverlay().

◆ m_drawing

bool EDA_DRAW_PANEL_GAL::m_drawing
protectedinherited

True if GAL is currently redrawing the view.

Definition at line 291 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), EDA_DRAW_PANEL_GAL(), and ~EDA_DRAW_PANEL_GAL().

◆ m_drawingEnabled

bool EDA_DRAW_PANEL_GAL::m_drawingEnabled
protectedinherited

Flag that determines if VIEW may use GAL for redrawing the screen.

Definition at line 294 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), EDA_DRAW_PANEL_GAL(), ForceRefresh(), and StopDrawing().

◆ m_edaFrame

EDA_DRAW_FRAME* EDA_DRAW_PANEL_GAL::m_edaFrame
protectedinherited

◆ m_eventDispatcher

TOOL_DISPATCHER* EDA_DRAW_PANEL_GAL::m_eventDispatcher
protectedinherited

Processes and forwards events to tools.

Definition at line 319 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), OnEvent(), onLostFocus(), and SetEventDispatcher().

◆ m_gal

◆ m_galOptions

std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> WIDGET_DIFF_CANVAS::m_galOptions
private

EDA_DRAW_PANEL_GAL keeps a reference to the options struct, so it must outlive the panel.

Per-instance so siblings can vary if needed.

Definition at line 213 of file widget_diff_canvas.h.

Referenced by WIDGET_DIFF_CANVAS().

◆ m_glRecoveryAttempted

bool EDA_DRAW_PANEL_GAL::m_glRecoveryAttempted
protectedinherited

Set after an OpenGL recovery attempt to prevent infinite retry loops.

Definition at line 326 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), EDA_DRAW_PANEL_GAL(), and recoverFromGalError().

◆ m_hasNativeContext

bool WIDGET_DIFF_CANVAS::m_hasNativeContext = false
private

Definition at line 205 of file widget_diff_canvas.h.

Referenced by buildRenderScene(), and SetContextItems().

◆ m_hiddenChanges

std::set<KIID_PATH> WIDGET_DIFF_CANVAS::m_hiddenChanges
private

◆ m_highlight

std::optional<KIID_PATH> WIDGET_DIFF_CANVAS::m_highlight
private

◆ m_highlightBox

std::unique_ptr<HIGHLIGHT_BOX_ITEM> WIDGET_DIFF_CANVAS::m_highlightBox
private

Definition at line 193 of file widget_diff_canvas.h.

Referenced by HighlightChange(), rebuildOverlay(), and WIDGET_DIFF_CANVAS().

◆ m_holdRebuild

bool WIDGET_DIFF_CANVAS::m_holdRebuild = false
private

While true, rebuildOverlay()/ZoomToFit() are held so a batch renders once.

Definition at line 201 of file widget_diff_canvas.h.

Referenced by BeginUpdate(), EndUpdate(), rebuildOverlay(), and ZoomToFit().

◆ m_hover

std::optional<KIID_PATH> WIDGET_DIFF_CANVAS::m_hover
private

Definition at line 189 of file widget_diff_canvas.h.

Referenced by HighlightChange(), onLeave(), and onMotion().

◆ m_hoverBox

std::unique_ptr<HIGHLIGHT_BOX_ITEM> WIDGET_DIFF_CANVAS::m_hoverBox
private

◆ m_itemCategories

std::map<KIGFX::VIEW_ITEM*, KICAD_DIFF::CATEGORY> WIDGET_DIFF_CANVAS::m_itemCategories
private

◆ m_itemDimmer

DIMMER WIDGET_DIFF_CANVAS::m_itemDimmer
private

Definition at line 192 of file widget_diff_canvas.h.

Referenced by refreshItemDimming(), and SetItemDimmer().

◆ m_lastCursorPosition

VECTOR2D EDA_DRAW_PANEL_GAL::m_lastCursorPosition
protectedinherited

Last cursor position sent to GAL for drawing.

Definition at line 300 of file class_draw_panel_gal.h.

Referenced by DoRePaint().

◆ m_lastRepaintEnd

wxLongLong EDA_DRAW_PANEL_GAL::m_lastRepaintEnd
protectedinherited

Timestamp of the last repaint end.

Definition at line 285 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), EDA_DRAW_PANEL_GAL(), and Refresh().

◆ m_lastRepaintStart

wxLongLong EDA_DRAW_PANEL_GAL::m_lastRepaintStart
protectedinherited

Timestamp of the last repaint start.

Definition at line 284 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), and EDA_DRAW_PANEL_GAL().

◆ m_layerVisible

LSET WIDGET_DIFF_CANVAS::m_layerVisible
private

◆ m_lostFocus

bool EDA_DRAW_PANEL_GAL::m_lostFocus
protectedinherited

Flag to indicate that focus should be regained on the next mouse event.

It is a workaround for cases when the panel loses keyboard focus, so it does not react to hotkeys anymore.

Definition at line 323 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), OnEvent(), onLostFocus(), and SetFocus().

◆ m_MouseCapturedLost

bool EDA_DRAW_PANEL_GAL::m_MouseCapturedLost
inherited

used on wxMSW: true after a wxEVT_MOUSE_CAPTURE_LOST was received false after the mouse is recaptured.

Used to avoid calling twice a CaptureMouse(), not accepted by wxMSW

Definition at line 266 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL().

◆ m_needIdleRefresh

bool EDA_DRAW_PANEL_GAL::m_needIdleRefresh
protectedinherited

True when canvas needs to be refreshed from idle handler.

Definition at line 297 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), onIdle(), and RequestRefresh().

◆ m_options

KIGFX::GAL_DISPLAY_OPTIONS& EDA_DRAW_PANEL_GAL::m_options
protectedinherited

Definition at line 316 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), and SwitchBackend().

◆ m_overlay

std::shared_ptr<KIGFX::VIEW_OVERLAY> WIDGET_DIFF_CANVAS::m_overlay
private

Definition at line 209 of file widget_diff_canvas.h.

Referenced by rebuildOverlay(), and WIDGET_DIFF_CANVAS().

◆ m_painter

◆ m_PaintEventCounter

std::unique_ptr<PROF_COUNTER> EDA_DRAW_PANEL_GAL::m_PaintEventCounter
inherited

Definition at line 268 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL().

◆ m_parent

wxWindow* EDA_DRAW_PANEL_GAL::m_parent
protectedinherited

Pointer to the parent window.

Definition at line 281 of file class_draw_panel_gal.h.

Referenced by DoRePaint(), EDA_DRAW_PANEL_GAL(), IsDialogPreview(), recoverFromGalError(), SetCurrentCursor(), and SwitchBackend().

◆ m_pickHandler

PICK_HANDLER WIDGET_DIFF_CANVAS::m_pickHandler
private

Definition at line 190 of file widget_diff_canvas.h.

Referenced by onChar(), onLeftDown(), and SetPickHandler().

◆ m_refreshMutex

std::mutex EDA_DRAW_PANEL_GAL::m_refreshMutex
protectedinherited

Blocks multiple calls to the draw.

Definition at line 288 of file class_draw_panel_gal.h.

Referenced by DoRePaint().

◆ m_refreshTimer

wxTimer EDA_DRAW_PANEL_GAL::m_refreshTimer
protectedinherited

Timer to prevent too-frequent refreshing.

Definition at line 286 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), ForceRefresh(), Refresh(), StartDrawing(), and StopDrawing().

◆ m_renderScene

KICAD_DIFF::DIFF_SCENE WIDGET_DIFF_CANVAS::m_renderScene
private

Definition at line 187 of file widget_diff_canvas.h.

Referenced by buildRenderScene(), and rebuildOverlay().

◆ m_scene

KICAD_DIFF::DIFF_SCENE WIDGET_DIFF_CANVAS::m_scene
private

◆ m_statusPopup

wxWindow* EDA_DRAW_PANEL_GAL::m_statusPopup
protectedinherited

Definition at line 332 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), SetStatusPopup(), and StatusPopupHasFocus().

◆ m_stealsFocus

bool EDA_DRAW_PANEL_GAL::m_stealsFocus
protectedinherited

Flag to indicate whether the panel should take focus at certain times (when moused over, and on various mouse/key events)

Definition at line 330 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL(), onEnter(), OnEvent(), and SetStealsFocus().

◆ m_view

KIGFX::VIEW* EDA_DRAW_PANEL_GAL::m_view
protectedinherited

Stores view settings (scale, center, etc.) and items to be drawn.

Definition at line 306 of file class_draw_panel_gal.h.

Referenced by WIDGET_DIFF_CANVAS::CenterOnHighlight(), ClearDebugOverlay(), DebugOverlay(), PCB_DRAW_PANEL_GAL::DisplayBoard(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), DoRePaint(), EDA_DRAW_PANEL_GAL(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), GERBVIEW_DRAW_PANEL_GAL::GetDefaultViewBBox(), PCB_DRAW_PANEL_GAL::GetDefaultViewBBox(), GetView(), PCB_DRAW_PANEL_GAL::GetView(), SCH_DRAW_PANEL::GetView(), ZONE_PREVIEW_CANVAS::LockZoom(), WIDGET_DIFF_CANVAS::onDoubleClick(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), PCB_DRAW_PANEL_GAL::OnShow(), SCH_DRAW_PANEL::OnShow(), onSize(), PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), WIDGET_DIFF_CANVAS::rebuildOverlay(), PCB_DRAW_PANEL_GAL::RedrawRatsnest(), WIDGET_DIFF_CANVAS::refreshItemDimming(), SCH_DRAW_PANEL::SCH_DRAW_PANEL(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), WIDGET_DIFF_CANVAS::SetCategoryVisible(), WIDGET_DIFF_CANVAS::SetContextItems(), WIDGET_DIFF_CANVAS::SetContextPainter(), GERBVIEW_DRAW_PANEL_GAL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::setDefaultLayerDeps(), PL_DRAW_PANEL_GAL::setDefaultLayerDeps(), SCH_DRAW_PANEL::setDefaultLayerDeps(), SCH_PREVIEW_PANEL::setDefaultLayerDeps(), PCB_DRAW_PANEL_GAL::setDefaultLayerOrder(), SCH_DRAW_PANEL::setDefaultLayerOrder(), SCH_PREVIEW_PANEL::setDefaultLayerOrder(), GERBVIEW_DRAW_PANEL_GAL::SetDrawingSheet(), PCB_DRAW_PANEL_GAL::SetDrawingSheet(), SetHighContrastLayer(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), WIDGET_DIFF_CANVAS::SetItemCategories(), WIDGET_DIFF_CANVAS::SetLayerVisible(), SetTopLayer(), GERBVIEW_DRAW_PANEL_GAL::SetTopLayer(), PCB_DRAW_PANEL_GAL::SetTopLayer(), PL_DRAW_PANEL_GAL::SetTopLayer(), WIDGET_DIFF_CANVAS::shapeAt(), SwitchBackend(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), PCB_DRAW_PANEL_GAL::SyncLayersVisibility(), PCB_DRAW_PANEL_GAL::UpdateColors(), SCH_PREVIEW_PANEL::view(), WIDGET_DIFF_CANVAS::WIDGET_DIFF_CANVAS(), ZONE_PREVIEW_CANVAS::ZONE_PREVIEW_CANVAS(), ZONE_PREVIEW_CANVAS::ZoomFitScreen(), WIDGET_DIFF_CANVAS::ZoomToBBox(), ~EDA_DRAW_PANEL_GAL(), and WIDGET_DIFF_CANVAS::~WIDGET_DIFF_CANVAS().

◆ m_viewControls

◆ m_zoomToFitPending

bool WIDGET_DIFF_CANVAS::m_zoomToFitPending = false
private

True when a ZoomToFit was requested before the canvas had a real size — the next onSize will retry the fit and clear this.

Definition at line 217 of file widget_diff_canvas.h.

Referenced by EndUpdate(), onSize(), and ZoomToFit().


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