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 ( GERBVIEW_FRAME aFrame,
wxWindow *  aWindow 
)

Definition at line 36 of file panel_gerbview_display_options.cpp.

References EDA_DRAW_FRAME::GetGalDisplayOptions(), PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, m_galOptsPanel, and m_Parent.

37  :
38  PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( aWindow, wxID_ANY ),
39  m_Parent( aFrame )
40 {
42  m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
43  m_galOptionsSizer->Add( m_galOptsPanel, 0, wxEXPAND | wxLEFT, 5 );
44 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
Definition: draw_frame.h:926
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)
PANEL_GERBVIEW_DISPLAY_OPTIONS::~PANEL_GERBVIEW_DISPLAY_OPTIONS ( )
inline

Definition at line 42 of file panel_gerbview_display_options.h.

References TransferDataFromWindow(), and TransferDataToWindow().

42 {};

Member Function Documentation

bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow ( )
overrideprivate

Definition at line 64 of file panel_gerbview_display_options.cpp.

References EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::GERBVIEW_PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::GetView(), LAYER_DCODES, KIGFX::GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions(), 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, EDA_DRAW_PANEL::Refresh(), KIGFX::REPAINT, GERBVIEW_FRAME::SetElementVisibility(), KIGFX::TARGET_NONCACHED, and GAL_OPTIONS_PANEL::TransferDataFromWindow().

Referenced by ~PANEL_GERBVIEW_DISPLAY_OPTIONS().

65 {
66  auto displayOptions = (GBR_DISPLAY_OPTIONS*) m_Parent->GetDisplayOptions();
67 
68  bool needs_repaint = false, option;
69 
70  option = !m_OptDisplayLines->GetValue();
71 
73  needs_repaint = true;
74 
76 
77  option = !m_OptDisplayFlashedItems->GetValue();
78 
80  needs_repaint = true;
81 
83 
84  option = !m_OptDisplayPolygons->GetValue();
85 
87  needs_repaint = true;
88 
90 
92 
94 
95  // Apply changes to the GAL
96  auto view = m_Parent->GetGalCanvas()->GetView();
97  auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
98  auto settings = painter->GetSettings();
99  settings->LoadDisplayOptions( displayOptions );
100  view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
101 
102  if( needs_repaint )
103  view->UpdateAllItems( KIGFX::REPAINT );
104 
105  m_Parent->GetCanvas()->Refresh();
106 
107  return true;
108 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:388
void LoadDisplayOptions(const GBR_DISPLAY_OPTIONS *aOptions)
Function LoadDisplayOptions Loads settings related to display options.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
Auxiliary rendering target (noncached)
Definition: definitions.h:42
Item is being added to the view.
Definition: view_item.h:60
Class GERBVIEW_PAINTER Contains methods for drawing GerbView-specific items.
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
virtual GERBVIEW_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:908
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
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.
Definition: draw_frame.h:921
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataToWindow ( )
overrideprivate

Definition at line 47 of file panel_gerbview_display_options.cpp.

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

Referenced by ~PANEL_GERBVIEW_DISPLAY_OPTIONS().

48 {
50 
51  // Show Option Draw Lines. We use DisplayPcbTrackFill as Lines draw option
54 
55  // Show Option Draw polygons
57 
59 
60  return true;
61 }
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.

Member Data Documentation

wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited
GAL_OPTIONS_PANEL* PANEL_GERBVIEW_DISPLAY_OPTIONS::m_galOptsPanel
private
wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayDCodes
protectedinherited
wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayFlashedItems
protectedinherited
wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayLines
protectedinherited
wxCheckBox* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_OptDisplayPolygons
protectedinherited
GERBVIEW_FRAME* PANEL_GERBVIEW_DISPLAY_OPTIONS::m_Parent
private
wxBoxSizer* PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::m_UpperSizer
protectedinherited

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