84 m_printMirror( false ),
85 m_oneFileOnly( false )
94 { wxID_CANCEL,
_(
"Close" ) } } );
125 cfg->m_ExportSvg.layers.clear();
133 cfg->m_ExportSvg.layers.push_back( layer );
150 wxCommandEvent
dummy;
203 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
205 if( dirDialog.ShowModal() == wxID_CANCEL )
208 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
210 wxMessageDialog dialog(
this,
_(
"Use a relative path?" ),
_(
"Plot Output Directory" ),
211 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
213 if( dialog.ShowModal() == wxID_YES )
217 boardFilePath = wxPathOnly( boardFilePath );
219 if( !dirName.MakeRelativeTo( boardFilePath ) )
220 wxMessageBox(
_(
"Cannot make path relative (target volume different from board "
222 _(
"Plot Output Directory" ), wxOK | wxICON_ERROR );
254 std::function<bool( wxString* )> textResolver =
255 [&]( wxString* token ) ->
bool
265 wxFileName outputDir = wxFileName::DirName(
path );
272 wxString msg =
wxString::Format(
_(
"Could not write plot files to folder '%s'." ),
273 outputDir.GetPath() );
291 for(
LSEQ seq = all_selected.
Seq(); seq; ++seq )
294 wxFileName fn( boardFilename );
298 wxString svgPath = fn.GetFullPath();
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
bool ResolveTextVar(wxString *token, int aDepth) const
const wxString & GetFileName() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Class DIALOG_EXPORT_SVG_BASE.
wxCheckBox * m_checkboxPagePerLayer
wxCheckListBox * m_CopperLayersList
wxRadioBox * m_ModeColorOption
wxRadioBox * m_rbSvgPageSizeOpt
WX_HTML_REPORT_PANEL * m_messagesPanel
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_checkboxEdgesOnAllPages
wxCheckBox * m_printMirrorOpt
wxCheckListBox * m_TechnicalLayersList
wxTextCtrl * m_outputDirectoryName
~DIALOG_EXPORT_SVG() override
DIALOG_EXPORT_SVG(PCB_EDIT_FRAME *aParent, BOARD *aBoard)
void OnOutputDirectoryBrowseClicked(wxCommandEvent &event) override
PCB_EDIT_FRAME * m_parent
void OnButtonPlot(wxCommandEvent &event) override
void onPagePerLayerClicked(wxCommandEvent &event) override
LSET getCheckBoxSelectedLayers() const
std::pair< wxCheckListBox *, int > m_boxSelectLayer[PCB_LAYER_ID_COUNT]
void ExportSVGFile(bool aOnlyOneFile)
wxString m_outputDirectory
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
DIALOG_EXPORT_SVG m_ExportSvg
PCBNEW_SETTINGS * GetPcbNewSettings() const
The main frame for Pcbnew.
static bool Plot(BOARD *aBoard, const PCB_PLOT_SVG_OPTIONS &aSvgPlotOptions)
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void SetFileName(const wxString &aReportFileName)
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
const std::string SVGFileExtension
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Plotting engines similar to ps (PostScript, Gerber, svg)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
std::vector< FAB_LAYER_COLOR > dummy
std::vector< int > layers
Definition of file extensions used in Kicad.