101 catch(
const std::runtime_error& e )
103 wxFAIL_MSG( e.what() );
214 if( wxMessageBox(
_(
"Are you sure you want to overwrite the existing file?" ),
215 _(
"Warning" ), wxYES_NO | wxCENTER | wxICON_QUESTION,
this ) == wxNO )
226 static wxString subDirFor3Dshapes;
234 brdFile.SetExt( wxT(
"wrl" ) );
235 path = brdFile.GetFullPath();
238 if( subDirFor3Dshapes.IsEmpty() )
239 subDirFor3Dshapes = wxT(
"shapes3D" );
244 double scaleList[4] = { 1.0, 0.001, 10.0/25.4, 1.0/25.4 };
250 if( dlg.ShowModal() != wxID_OK )
280 wxFileName modelPath =
path;
285 modelPath.AppendDir( subDirFor3Dshapes );
287 if( export3DFiles && !modelPath.DirExists() )
289 if( !modelPath.Mkdir() )
291 wxString msg = wxString::Format(
_(
"Failed to create folder '%s'." ),
292 modelPath.GetPath() );
299 useRelativePaths, modelPath.GetPath(), aXRef, aYRef ) )
301 wxString msg = wxString::Format(
_(
"Failed to create file '%s'." ),
path );
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aIncludeHiddenText=false) const
Calculate the bounding box containing all board items (or board edge segments).
const wxString & GetFileName() const
const Vec GetCenter() const
Class DIALOG_EXPORT_3DFILE_BASE.
wxTextCtrl * m_SubdirNameCtrl
wxChoice * m_VRML_RefUnitChoice
wxCheckBox * m_cbCopyFiles
wxFilePickerCtrl * m_filePicker
wxCheckBox * m_cbRemoveDNP
wxRadioBox * m_rbCoordOrigin
wxCheckBox * m_cbRemoveUnspecified
wxRadioBox * m_rbSelectUnits
wxCheckBox * m_cbUseRelativePaths
bool GetNoUnspecifiedOption()
bool TransferDataFromWindow() override
bool GetCopyFilesOption()
DIALOG_EXPORT_3DFILE(PCB_EDIT_FRAME *parent)
wxString GetSubdir3Dshapes()
PCB_EDIT_FRAME * m_parent
void SetSubdir(const wxString &aDir)
void OnUpdateUseRelativePath(wxUpdateUIEvent &event) override
wxFilePickerCtrl * FilePicker()
bool GetUseRelativePathsOption()
bool m_useRelativePathsOpt
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...
DIALOG_EXPORT_VRML m_ExportVrml
PCBNEW_SETTINGS * GetPcbNewSettings() const
The main frame for Pcbnew.
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
void OnExportVRML(wxCommandEvent &event)
Export the current BOARD to a VRML file.
bool ExportVRML_File(const wxString &aFullFileName, double aMMtoWRMLunit, bool aIncludeUnspecified, bool aIncludeDNP, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Create the file(s) exporting current BOARD to a VRML file.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
KICOMMON_API double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function DoubleValueFromString converts aTextValue to a double.
std::vector< FAB_LAYER_COLOR > dummy
constexpr double IUTomm(int iu) const