Browse Source

Add gltf export to step dialog

newinvert
Marek Roszko 2 years ago
parent
commit
ea3101587a
  1. 4
      common/wildcards_and_files_ext.cpp
  2. 4
      include/wildcards_and_files_ext.h
  3. 18
      pcbnew/dialogs/dialog_export_step.cpp
  4. 2
      pcbnew/dialogs/dialog_export_step_base.fbp
  5. 2
      pcbnew/dialogs/dialog_export_step_base.h
  6. 2
      pcbnew/dialogs/dialog_export_step_process_base.fbp
  7. 2
      pcbnew/dialogs/dialog_export_step_process_base.h

4
common/wildcards_and_files_ext.cpp

@ -192,6 +192,10 @@ const std::string CsvFileExtension( "csv" );
const std::string XmlFileExtension( "xml" );
const std::string JsonFileExtension( "json" );
const std::string StepFileExtension( "step" );
const std::string StepFileAbrvExtension( "stp" );
const std::string GltfBinaryFileExtension( "glb" );
const wxString GerberFileExtensionsRegex( "(gbr|gko|pho|(g[tb][alops])|(gm?\\d\\d*)|(gp[tb]))" );

4
include/wildcards_and_files_ext.h

@ -178,6 +178,10 @@ extern const std::string CsvFileExtension;
extern const std::string XmlFileExtension;
extern const std::string JsonFileExtension;
extern const std::string StepFileExtension;
extern const std::string StepFileAbrvExtension;
extern const std::string GltfBinaryFileExtension;
extern const wxString GerberFileExtensionsRegex;
bool IsGerberFileExtension( const wxString& ext );

18
pcbnew/dialogs/dialog_export_step.cpp

@ -148,9 +148,14 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aParent, const wxString&
bSizerTop->Hide( widget );
widget->Destroy();
wxString filter = _( "STEP files" )
+ AddFileExtListToFilter( { StepFileExtension, StepFileAbrvExtension } ) + "|"
+ _( "Binary GTLF files" )
+ AddFileExtListToFilter( { GltfBinaryFileExtension } );
m_filePickerSTEP = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString,
_( "Select a STEP export filename" ),
_( "STEP files" ) + AddFileExtListToFilter( { "STEP", "STP" } ),
filter,
wxDefaultPosition,
wxSize( -1, -1 ), wxFLP_SAVE | wxFLP_USE_TEXTCTRL );
bSizerTop->Add( m_filePickerSTEP, 1, wxTOP | wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
@ -368,7 +373,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ),
fn.GetFullPath() );
if( wxMessageBox( msg, _( "STEP Export" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
if( wxMessageBox( msg, _( "STEP/GLTF Export" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
return;
}
@ -400,7 +405,14 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
cmdK2S.Append( wxT( " pcb" ) );
cmdK2S.Append( wxT( " export" ) );
cmdK2S.Append( wxT( " step" ) );
cmdK2S.Append( wxT( " 3d" ) );
cmdK2S.Append( wxT( " --format" ) );
if( fn.GetExt() == GltfBinaryFileExtension )
cmdK2S.Append( wxT( " glb" ) );
else
cmdK2S.Append( wxT( " step" ) );
if( GetNoUnspecifiedOption() )
cmdK2S.Append( wxT( " --no-unspecified" ) );

2
pcbnew/dialogs/dialog_export_step_base.fbp

@ -50,7 +50,7 @@
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Export STEP</property>
<property name="title">Export STEP / GLTF</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>

2
pcbnew/dialogs/dialog_export_step_base.h

@ -74,7 +74,7 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
public:
DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export STEP"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export STEP / GLTF"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXPORT_STEP_BASE();

2
pcbnew/dialogs/dialog_export_step_process_base.fbp

@ -50,7 +50,7 @@
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">STEP Export</property>
<property name="title">3D Export</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>

2
pcbnew/dialogs/dialog_export_step_process_base.h

@ -43,7 +43,7 @@ class DIALOG_EXPORT_STEP_PROCESS_BASE : public DIALOG_SHIM
public:
DIALOG_EXPORT_STEP_PROCESS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("STEP Export"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_EXPORT_STEP_PROCESS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Export"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXPORT_STEP_PROCESS_BASE();

Loading…
Cancel
Save