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 33 of file panel_gerbview_display_options.cpp.

34  :
35  PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( aWindow, wxID_ANY ),
36  m_Parent( aFrame )
37 {
39  m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
40  m_galOptionsSizer->Add( m_galOptsPanel, 0, wxEXPAND | wxLEFT, 5 );
41 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
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)

References EDA_DRAW_FRAME::GetGalDisplayOptions(), 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 42 of file panel_gerbview_display_options.h.

42 {};

Member Function Documentation

◆ TransferDataFromWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow ( )
overrideprivate

Definition at line 61 of file panel_gerbview_display_options.cpp.

62 {
63  auto displayOptions = (GBR_DISPLAY_OPTIONS*) m_Parent->GetDisplayOptions();
64 
65  bool needs_repaint = false, option;
66 
67  option = !m_OptDisplayLines->GetValue();
68 
70  needs_repaint = true;
71 
73 
74  option = !m_OptDisplayFlashedItems->GetValue();
75 
77  needs_repaint = true;
78 
80 
81  option = !m_OptDisplayPolygons->GetValue();
82 
84  needs_repaint = true;
85 
87 
89 
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.
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
Auxiliary rendering target (noncached)
Definition: definitions.h:49
Item is being added to the view.
Definition: view_item.h:60
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:585
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
virtual KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) 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)
Function SetElementVisibility changes the visibility of an element category.
virtual void * GetDisplayOptions()
A way to pass info to draw functions.
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.

References EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_FRAME::GetDisplayOptions(), EDA_DRAW_PANEL_GAL::GetView(), LAYER_DCODES, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GERBVIEW_FRAME::m_DisplayOptions, 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, and GAL_OPTIONS_PANEL::TransferDataFromWindow().

◆ TransferDataToWindow()

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow ( )
overrideprivate

Definition at line 44 of file panel_gerbview_display_options.cpp.

45 {
47 
48  // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
51 
52  // Show Option Draw polygons
54 
56 
57  return true;
58 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
bool TransferDataToWindow() override
Load the panel controls from the given opt.
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
bool IsElementVisible(int aLayerID) const
Function IsElementVisible tests whether a given element category is visible.

References GERBVIEW_FRAME::IsElementVisible(), LAYER_DCODES, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GERBVIEW_FRAME::m_DisplayOptions, 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: