22#ifndef WX_GERBER_STRUCT_H
23#define WX_GERBER_STRUCT_H
35#define NO_AVAILABLE_LAYERS UNDEFINED_LAYER
55#define GERBVIEW_FRAME_NAME wxT( "GerberFrame" )
65 bool OpenProjectFiles(
const std::vector<wxString>& aFileSet,
int aCtl )
override;
77 std::vector<int>* aFileType );
163 void SetActiveLayer(
int aLayer,
bool doLayerWidgetUpdate =
true );
239 void OnQuit( wxCommandEvent& event );
344 void RemapLayers(
const std::unordered_map<int, int>& remapping );
356 UNDO_REDO aTypeCommand = UNDO_REDO::UNSPECIFIED ) { }
440 int SelectPCBLayer(
int aDefaultLayer,
int aCopperLayerCount,
const wxString& aGerberName );
456 DECLARE_EVENT_TABLE()
490 const wxString& dialogTitle, const
int filetype );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Color settings are a bit different than most of the settings objects in that there can be more than o...
Helper to display a DCode list and select a DCode id.
The base class for create windows for drawing purpose.
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
This class implements a file history object to store a list of files, that can then be added to a men...
A list of GERBER_DRAW_ITEM objects currently loaded.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
Hold the image data and parameters for one gerber file and layer parameters.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
void SetLayerColor(int aLayer, const COLOR4D &aColor)
void OnUpdateSelectDCode(wxUpdateUIEvent &aEvent)
void OnQuit(wxCommandEvent &event)
Called on request of application quit.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
wxStaticText * m_dcodeText
wxChoice * m_SelAperAttributesBox
void UpdateXORLayers()
Update each layers' differential option.
void UpdateStatusBar() override
Update the status bar information.
COLOR4D GetVisibleElementColor(int aLayerID)
Return the color of a gerber visible element.
GERBVIEW_SETTINGS * gvconfig() const
const PAGE_INFO & GetPageSettings() const override
bool IsLayerVisible(int aLayer) const
Test whether a given layer is visible.
void DisplayGridMsg() override
Display the current grid pane on the status bar.
void OnDrlFileHistory(wxCommandEvent &event)
Delete the current data and load a drill file in Excellon format selected from history list on curren...
void OnUpdateLayerSelectBox(wxUpdateUIEvent &aEvent)
void SortLayersByX2Attributes()
void SetLayout(GBR_LAYOUT *aLayout)
Set the m_gerberLayout member in such as way as to ensure deleting any previous GBR_LAYOUT.
void ReCreateHToolbar() override
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
GBR_LAYER_BOX_SELECTOR * m_SelLayerBox
void UpdateToolbarControlSizes() override
Update the sizes of any controls in the toolbars of the frame.
bool Read_EXCELLON_File(const wxString &aFullFileName)
bool m_show_layer_manager_tools
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ShowChangedLanguage() override
GBR_LAYOUT * m_gerberLayout
void SetPageSettings(const PAGE_INFO &aPageSettings) override
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
bool LoadFileOrShowDialog(const wxString &aFileName, const wxString &dialogFiletypes, const wxString &dialogTitle, const int filetype)
Loads the file provided or shows a dialog to get the file(s) from the user.
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
void OnClearDrlFileHistory(wxCommandEvent &aEvent)
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
int SelectPCBLayer(int aDefaultLayer, int aCopperLayerCount, const wxString &aGerberName)
Show the dialog box for layer selection.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void syncLayerBox(bool aRebuildLayerBox=false)
Update the currently "selected" layer within m_SelLayerBox.
const VECTOR2I & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
GBR_LAYOUT * GetGerberLayout() const
bool LoadGerberFiles(const wxString &aFileName)
Load a given Gerber file or selected file(s), if the filename is empty.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
void updateDCodeSelectBox()
bool unarchiveFiles(const wxString &aFullFileName, REPORTER *aReporter=nullptr)
Extract gerber and drill files from the zip archive, and load them.
void ReCreateAuxiliaryToolbar() override
void doCloseWindow() override
void OnSelectHighlightChoice(wxCommandEvent &event)
Handles the changing of the highlighted component/net/attribute.
wxChoice * m_SelComponentBox
FILE_HISTORY m_jobFileHistory
std::unique_ptr< NL_GERBVIEW_PLUGIN > m_spaceMouse
void OnJobFileHistory(wxCommandEvent &event)
Delete the current data and load a gerber job file selected from the history list.
void SetGridOrigin(const VECTOR2I &aPoint) override
wxChoice * m_SelNetnameBox
void OnZipFileHistory(wxCommandEvent &event)
Delete the current data and load a zip archive file selected from the history list.
int GetActiveLayer() const
Return the active layer.
bool IsElementVisible(int aLayerID) const
Test whether a given element category is visible.
DCODE_SELECTION_BOX * m_DCodeSelector
GERBER_LAYER_WIDGET * m_LayersManager
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
void syncLayerWidget()
Update the currently "selected" layer within the GERBER_LAYER_WIDGET.
void SetVisibleElementColor(int aLayerID, const COLOR4D &aColor)
unsigned ImagesMaxCount() const
The max number of file images.
void updateAperAttributesSelectBox()
void ReCreateOptToolbar() override
Create or update the left vertical toolbar (option toolbar)
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
wxStaticText * m_apertText
bool Read_GERBER_File(const wxString &GERBER_FullFileName)
COLOR4D GetLayerColor(int aLayer) const
bool Clear_DrawLayers(bool query)
void SortLayersByFileExtension()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
void handleActivateEvent(wxActivateEvent &aEvent) override
Handle a window activation event.
void updateComponentListSelectBox()
void SetGridVisibility(bool aVisible) override
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
bool LoadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, std::vector< int > *aFileType)
Load a list of Gerber and NC drill files and updates the view based on them.
void SaveCopyInUndoList(GERBER_DRAW_ITEM *aItemToCopy, UNDO_REDO aTypeCommand=UNDO_REDO::UNSPECIFIED)
void ToggleLayerManager()
const TITLE_BLOCK & GetTitleBlock() const override
bool LoadAutodetectedFiles(const wxString &aFileName)
Load a given file or selected file(s), if the filename is empty.
void OnSelectActiveLayer(wxCommandEvent &event)
Select the active layer:
void RemapLayers(const std::unordered_map< int, int > &remapping)
Takes a layer remapping and reorders the layers.
void ReFillLayerWidget()
Change out all the layers in m_Layers; called upon loading new gerber files.
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO aTypeCommand)
Create a new entry in undo list of commands and add a list of pickers to handle a list of items.
FILE_HISTORY m_zipFileHistory
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl) override
Open a project or set of files given by aFileList.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
int getNextAvailableLayer() const
Find the next empty layer.
void Erase_Current_DrawLayer(bool query)
void updateNetnameListSelectBox()
bool LoadZipArchiveFile(const wxString &aFileName)
Load a zipped archive file.
void UpdateTitleAndInfo()
Display the short filename (if exists) of the selected layer on the caption of the main GerbView wind...
void OnClearGbrFileHistory(wxCommandEvent &aEvent)
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.
virtual void SetGridColor(const COLOR4D &aColor) override
void OnSelectActiveDCode(wxCommandEvent &event)
Select the active DCode for the current active layer.
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
const VECTOR2I GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
void handleIconizeEvent(wxIconizeEvent &aEvent) override
Handle a window iconize event.
void OnClearZipFileHistory(wxCommandEvent &aEvent)
void DoWithAcceptedFiles() override
Execute action on accepted dropped file.
void ReCreateVToolbar() override
Create or update the right vertical toolbar.
void OnGbrFileHistory(wxCommandEvent &event)
Delete the current data and loads a Gerber file selected from history list on current layer.
FILE_HISTORY m_drillFileHistory
bool LoadExcellonFiles(const wxString &aFileName)
Load a drill (EXCELLON) file or many files.
void doReCreateMenuBar() override
void OnClearJobFileHistory(wxCommandEvent &aEvent)
COLOR4D GetGridColor() override
A color representation with 4 components: red, green, blue, alpha.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
LSET is a set of PCB_LAYER_IDs.
The class that implements the public interface to the SpaceMouse plug-in.
Describe the page size and margins of a paper page on which to eventually print or plot.
A holder to handle information on schematic or board items.
A pure virtual class used to derive REPORTER objects from.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Class CLASS_GBR_LAYOUT to handle info to draw loaded Gerber images and page frame reference.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...