KiCad PCB EDA Suite
PANEL_GERBVIEW_DISPLAY_OPTIONS Class Reference

#include <panel_gerbview_display_options.h>

Inheritance diagram for PANEL_GERBVIEW_DISPLAY_OPTIONS:
PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE

Public Member Functions

 PANEL_GERBVIEW_DISPLAY_OPTIONS (GERBVIEW_FRAME *aFrame, wxWindow *aWindow)
 
 ~PANEL_GERBVIEW_DISPLAY_OPTIONS ()
 

Protected Attributes

wxBoxSizer * m_UpperSizer
 
wxBoxSizer * m_galOptionsSizer
 
wxCheckBox * m_OptDisplayDCodes
 
wxCheckBox * m_OptDisplayFlashedItems
 
wxCheckBox * m_OptDisplayLines
 
wxCheckBox * m_OptDisplayPolygons
 

Private Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 

Private Attributes

GERBVIEW_FRAMEm_Parent
 
GAL_OPTIONS_PANELm_galOptsPanel
 

Detailed Description

Definition at line 34 of file panel_gerbview_display_options.h.

Constructor & Destructor Documentation

◆ PANEL_GERBVIEW_DISPLAY_OPTIONS()

PANEL_GERBVIEW_DISPLAY_OPTIONS::PANEL_GERBVIEW_DISPLAY_OPTIONS ( GERBVIEW_FRAME aFrame,
wxWindow *  aWindow 
)

Definition at line 31 of file panel_gerbview_display_options.cpp.

32  :
33  PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( aWindow, wxID_ANY ),
34  m_Parent( aFrame )
35 {
37  m_galOptionsSizer->Add( m_galOptsPanel, 0, wxEXPAND | wxLEFT, 5 );
38 }
PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

References PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, m_galOptsPanel, and m_Parent.

◆ ~PANEL_GERBVIEW_DISPLAY_OPTIONS()

PANEL_GERBVIEW_DISPLAY_OPTIONS::~PANEL_GERBVIEW_DISPLAY_OPTIONS ( )
inline

Definition at line 38 of file panel_gerbview_display_options.h.

38 {};

Member Function Documentation

◆ TransferDataFromWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow ( )
overrideprivate

Definition at line 58 of file panel_gerbview_display_options.cpp.

59 {
61 
62  bool needs_repaint = false, option;
63 
64  option = !m_OptDisplayLines->GetValue();
65 
66  if( option != displayOptions.m_DisplayLinesFill )
67  needs_repaint = true;
68 
69  displayOptions.m_DisplayLinesFill = option;
70 
71  option = !m_OptDisplayFlashedItems->GetValue();
72 
74  needs_repaint = true;
75 
76  displayOptions.m_DisplayFlashedItemsFill = option;
77 
78  option = !m_OptDisplayPolygons->GetValue();
79 
80  if( option != displayOptions.m_DisplayPolygonsFill )
81  needs_repaint = true;
82 
83  displayOptions.m_DisplayPolygonsFill = option;
84 
86 
88 
89  if( displayOptions.m_DiffMode )
91 
92  // Apply changes to the GAL
93  auto view = m_Parent->GetCanvas()->GetView();
94  auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
95  auto settings = painter->GetSettings();
96  settings->LoadDisplayOptions( displayOptions );
98 
99  if( needs_repaint )
100  view->UpdateAllItems( KIGFX::REPAINT );
101 
102  m_Parent->GetCanvas()->Refresh();
103 
104  return true;
105 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
void UpdateDiffLayers()
Update each layers' differential option.
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
Auxiliary rendering target (noncached)
Definition: definitions.h:49
bool m_DiffMode
Display layers in diff mode.
Item needs to be redrawn.
Definition: view_item.h:52
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:609
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.

References EDA_DRAW_FRAME::GetCanvas(), GERBVIEW_FRAME::GetDisplayOptions(), EDA_DRAW_PANEL_GAL::GetView(), LAYER_DCODES, GBR_DISPLAY_OPTIONS::m_DiffMode, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, m_galOptsPanel, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons, m_Parent, KIGFX::VIEW::MarkTargetDirty(), EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::REPAINT, GERBVIEW_FRAME::SetElementVisibility(), KIGFX::TARGET_NONCACHED, GAL_OPTIONS_PANEL::TransferDataFromWindow(), and GERBVIEW_FRAME::UpdateDiffLayers().

◆ TransferDataToWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow ( )
overrideprivate

Definition at line 41 of file panel_gerbview_display_options.cpp.

42 {
44 
45  // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
48 
49  // Show Option Draw polygons
51 
53 
54  return true;
55 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
bool TransferDataToWindow() override
Load the panel controls from the given opt.
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
bool IsElementVisible(int aLayerID) const
Test whether a given element category is visible.

References GERBVIEW_FRAME::GetDisplayOptions(), GERBVIEW_FRAME::IsElementVisible(), LAYER_DCODES, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, m_galOptsPanel, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines, PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons, m_Parent, and GAL_OPTIONS_PANEL::TransferDataToWindow().

Member Data Documentation

◆ m_galOptionsSizer

wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited

◆ m_galOptsPanel

GAL_OPTIONS_PANEL* PANEL_GERBVIEW_DISPLAY_OPTIONS::m_galOptsPanel
private

◆ m_OptDisplayDCodes

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes
protectedinherited

◆ m_OptDisplayFlashedItems

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems
protectedinherited

◆ m_OptDisplayLines

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines
protectedinherited

◆ m_OptDisplayPolygons

wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons
protectedinherited

◆ m_Parent

GERBVIEW_FRAME* PANEL_GERBVIEW_DISPLAY_OPTIONS::m_Parent
private

◆ m_UpperSizer

wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_UpperSizer
protectedinherited

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