35 #include <wx/filedlg.h> 49 m_frame = getEditFrame<GERBVIEW_FRAME>();
110 if( layercount == 0 )
120 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
122 if( filedlg.ShowModal() == wxID_CANCEL )
125 wxFileName fileName = filedlg.GetPath();
131 int ok = layerdlg->ShowModal();
138 if( !fileName.HasExt() )
153 auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>(
getView()->GetPainter() )->GetSettings();
157 if( selection.Size() == 1 )
159 item = static_cast<GERBER_DRAW_ITEM*>( selection[0] );
168 settings->ClearHighlightSelections();
178 settings->m_netHighlightString = net_name;
184 settings->m_componentHighlightString = net_attr;
194 settings->m_attributeHighlightString = ap_name;
204 int dcodeSelected = -1;
210 if( dcodeSelected > 0 )
212 settings->m_dcodeHighlightValue = dcodeSelected;
229 bool needs_refresh =
false;
235 needs_refresh =
true;
239 options.m_DisplayFlashedItemsFill = !options.m_DisplayFlashedItemsFill;
240 needs_refresh =
true;
244 options.m_DisplayPolygonsFill = !options.m_DisplayPolygonsFill;
245 needs_refresh =
true;
259 options.m_HighContrastMode = !options.m_HighContrastMode;
260 needs_refresh =
true;
264 options.m_DiffMode = !options.m_DiffMode;
265 needs_refresh =
true;
269 options.m_FlipGerberView = !options.m_FlipGerberView;
272 view->
SetMirror( options.m_FlipGerberView,
false );
273 needs_refresh =
true;
323 static_cast<KIGFX::GERBVIEW_PAINTER*>(
getView()->GetPainter() )->GetSettings();
333 wxArrayString listOfGerberFiles;
372 if( selection.GetSize() == 1 )
376 std::vector<MSG_PANEL_ITEM> msgItems;
int OpenJobFile(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedEvent
void ToggleLayerManager()
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
bool Clear_DrawLayers(bool query)
static TOOL_ACTION openDrillFile
void SetMruPath(const wxString &aPath)
static TOOL_ACTION openGerber
static const TOOL_EVENT UnselectedEvent
int OpenZipFile(const TOOL_EVENT &aEvent)
This file is part of the common library.
void syncLayerBox(bool aRebuildLayerBox=false)
Update the currently "selected" layer within m_SelLayerBox.
int Print(const TOOL_EVENT &aEvent)
Set up handlers for various events.
static TOOL_ACTION clearAllLayers
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int LayerPrev(const TOOL_EVENT &aEvent)
Hold the image data and parameters for one gerber file and layer parameters.
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
static TOOL_ACTION layerNext
static TOOL_ACTION zoomFitScreen
LAYER_NUM * GetLayersLookUpTable()
int LAYER_NUM
This can be replaced with int and removed.
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION toggleLayerManager
const std::string KiCadPcbFileExtension
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
void Erase_Current_DrawLayer(bool query)
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
int HighlightControl(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightNet
int ClearLayer(const TOOL_EVENT &aEvent)
static TOOL_ACTION layerPrev
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
wxChoice * m_SelNetnameBox
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
static int GetCopperLayersCount()
static TOOL_ACTION toggleDiffMode
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
wxString GetMruPath() const
static TOOL_ACTION flipGerberView
void UpdateDisplayOptions(const GBR_DISPLAY_OPTIONS &aOptions)
Update the display options and refreshes the view as needed.
int ReloadAllLayers(const TOOL_EVENT &aEvent)
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
unsigned ImagesMaxCount()
bool LoadGerberFiles(const wxString &aFileName)
Load a given Gerber file or selected file(s), if the filename is empty.
bool LoadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, const std::vector< int > *aFileType=nullptr)
Load a list of Gerber and NC drill files and updates the view based on them.
static TOOL_ACTION highlightAttribute
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
bool LoadZipArchiveFile(const wxString &aFileName)
Load a zipped archive file.
static TOOL_ACTION linesDisplayOutlines
int m_Num_Dcode
D code value ( >= 10 )
#define GERBER_DRAWLAYERS_COUNT
static TOOL_ACTION openJobFile
Definition of file extensions used in Kicad.
bool IsElementVisible(int aLayerID) const
Test whether a given element category is visible.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
void ClearHighlightSelections()
Clear all highlight selections (dcode, net, component, attribute selection)
const GBR_NETLIST_METADATA & GetNetAttributes() const
FormatType fileType(const char *aFileName)
Store GerbView specific render settings.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
wxString UnescapeString(const wxString &aSource)
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
static TOOL_ACTION flashedDisplayOutlines
GBR_LAYOUT * GetGerberLayout() const
static TOOL_ACTION clearLayer
int GetActiveLayer() const
Return the active layer.
wxChoice * m_SelAperAttributesBox
A gerber DCODE (also called Aperture) definition.
int LayerNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION highlightClear
int OpenDrillFile(const TOOL_EVENT &aEvent)
static TOOL_ACTION polygonsDisplayOutlines
int ExportToPcbnew(const TOOL_EVENT &aEvent)
#define NAMELESS_PROJECT
default name for nameless projects
EDA_DRAW_PANEL_GAL * canvas()
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...
GERBER_FILE_IMAGE_LIST * GetImagesList() const
wxString PcbFileWildcard()
A base class for most all the KiCad significant classes used in schematics and boards.
wxChoice * m_SelComponentBox
static TOOL_ACTION highlightDCode
bool LoadExcellonFiles(const wxString &aFileName)
Load a drill (EXCELLON) file or many files.
bool ExportPcb(const LAYER_NUM *aLayerLookUpTable, int aCopperLayers)
Save a board from a set of Gerber images.
int DisplayControl(const TOOL_EVENT &aEvent)
int ToggleLayerManager(const TOOL_EVENT &aEvent)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
static TOOL_ACTION highContrastMode
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
A helper class to export a Gerber set of files to Pcbnew.
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.
int ClearAllLayers(const TOOL_EVENT &aEvent)
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightComponent