Commit bd381d94 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Added VRML export, from the patch sent by Lorenzo Marcantonio (...

Pcbnew: Added VRML export, from the patch sent by Lorenzo Marcantonio ( october 2009, 11). See changelog for more info.
parents 99ab2dca b4480408
...@@ -4,6 +4,17 @@ KiCad ChangeLog 2010 ...@@ -4,6 +4,17 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-apr-19, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
* Added VRML export, from the patch sent by Lorenzo Marcantonio ( october 2009, 11)
* Fixed :
options to control vrml export.
flipped footprints
* Tested using Cortona and Blender.
Needs more testing and refinements
2010-apr-16, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-apr-16, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++Cvpcb: ++Cvpcb:
......
...@@ -113,7 +113,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info ) ...@@ -113,7 +113,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
info.AddDeveloper( SetMsg( wxT( "Jerry Jacobs <xor.gate.engineering@gmail.com>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Jerry Jacobs <xor.gate.engineering@gmail.com>" ) ) );
info.AddDeveloper( SetMsg( wxT( "Jonas Diemer <diemer@gmx.de>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Jonas Diemer <diemer@gmx.de>" ) ) );
info.AddDeveloper( SetMsg( wxT( "KBool Library <http://boolean.klaasholwerda.nl/bool.html>" ) ) ); info.AddDeveloper( SetMsg( wxT( "KBool Library <http://boolean.klaasholwerda.nl/bool.html>" ) ) );
info.AddDeveloper( SetMsg( wxT( "Lorenzo <lomarcan@tin.it>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Lorenzo Marcantonio <lomarcan@tin.it>" ) ) );
info.AddDeveloper( SetMsg( wxT( "Marco Serantoni <marco.serantoni@gmail.com>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Marco Serantoni <marco.serantoni@gmail.com>" ) ) );
info.AddDeveloper( SetMsg( wxT( "Rok Markovic <rok@kanardia.eu>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Rok Markovic <rok@kanardia.eu>" ) ) );
info.AddDeveloper( SetMsg( wxT( "Tim Hanson <sideskate@gmail.com>" ) ) ); info.AddDeveloper( SetMsg( wxT( "Tim Hanson <sideskate@gmail.com>" ) ) );
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2010-04-13 BZR 23xx)" #define KICAD_BUILD_VERSION "(2010-04-19 BZR 23xx)"
#endif #endif
#define VERSION_STABILITY "unstable" #define VERSION_STABILITY "unstable"
......
...@@ -479,6 +479,25 @@ public: ...@@ -479,6 +479,25 @@ public:
void ExportToGenCAD( wxCommandEvent& event ); void ExportToGenCAD( wxCommandEvent& event );
/**
* Function OnExportVRML
* will export the current BOARD to a VRML file.
*/
void OnExportVRML( wxCommandEvent& event );
/**
* Function ExportVRML_File
* Creates the file(s) exporting current BOARD to a VRML file.
* @param aFullFileName = the full filename of the file to create
* @param aScale = the general scaling factor. 1.0 to export in inches
* @param aExport3DFiles = true to copy 3D shapes in the subir a3D_Subdir
* @param a3D_Subdir = sub directory where 3D sahpes files are copied
* used only when aExport3DFiles == true
* @return true if Ok.
*/
bool ExportVRML_File( const wxString & aFullFileName, double aScale,
bool aExport3DFiles, const wxString & a3D_Subdir );
/** /**
* Function ExporttoSPECCTRA * Function ExporttoSPECCTRA
* will export the current BOARD to a specctra dsn file. See * will export the current BOARD to a specctra dsn file. See
......
...@@ -51,6 +51,7 @@ set(PCBNEW_SRCS ...@@ -51,6 +51,7 @@ set(PCBNEW_SRCS
dialog_edit_module_text.cpp dialog_edit_module_text.cpp
dialog_edit_module_text_base.cpp dialog_edit_module_text_base.cpp
dialog_exchange_modules_base.cpp dialog_exchange_modules_base.cpp
dialog_export_3Dfiles_base.cpp
dialog_freeroute_exchange.cpp dialog_freeroute_exchange.cpp
dialog_freeroute_exchange_base.cpp dialog_freeroute_exchange_base.cpp
# dialog_gendrill.cpp # dialog_gendrill.cpp
...@@ -99,6 +100,7 @@ set(PCBNEW_SRCS ...@@ -99,6 +100,7 @@ set(PCBNEW_SRCS
edtxtmod.cpp edtxtmod.cpp
event_handlers_tracks_vias_sizes.cpp event_handlers_tracks_vias_sizes.cpp
export_gencad.cpp export_gencad.cpp
export_vrml.cpp
files.cpp files.cpp
find.cpp find.cpp
gen_drill_report_files.cpp gen_drill_report_files.cpp
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_export_3Dfiles_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_EXPORT_3DFILE_BASE::DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxVERTICAL );
bUpperSizer->SetMinSize( wxSize( 450,-1 ) );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Vrml main file filename:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bUpperSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_filePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Save VRML Board File"), wxT("*.wrl"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_SAVE );
bUpperSizer->Add( m_filePicker, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Vrml 3D footprints shapes subdir:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
bUpperSizer->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_SubdirNameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bUpperSizer->Add( m_SubdirNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizer1->Add( bUpperSizer, 0, wxEXPAND, 5 );
wxBoxSizer* bLowerSizer;
bLowerSizer = new wxBoxSizer( wxHORIZONTAL );
wxString m_rbSelectUnitsChoices[] = { _("Inch"), _("mm"), _("Meter") };
int m_rbSelectUnitsNChoices = sizeof( m_rbSelectUnitsChoices ) / sizeof( wxString );
m_rbSelectUnits = new wxRadioBox( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, m_rbSelectUnitsNChoices, m_rbSelectUnitsChoices, 1, wxRA_SPECIFY_COLS );
m_rbSelectUnits->SetSelection( 0 );
bLowerSizer->Add( m_rbSelectUnits, 1, wxALL|wxEXPAND, 5 );
wxString m_rb3DFilesOptionChoices[] = { _("Copy 3D Shapes Files in Subdir"), _("Use Absolute Path in Wrml File ") };
int m_rb3DFilesOptionNChoices = sizeof( m_rb3DFilesOptionChoices ) / sizeof( wxString );
m_rb3DFilesOption = new wxRadioBox( this, wxID_ANY, _("3D Shapes Files Option:"), wxDefaultPosition, wxDefaultSize, m_rb3DFilesOptionNChoices, m_rb3DFilesOptionChoices, 1, wxRA_SPECIFY_COLS );
m_rb3DFilesOption->SetSelection( 0 );
bLowerSizer->Add( m_rb3DFilesOption, 1, wxALL|wxEXPAND, 5 );
bSizer1->Add( bLowerSizer, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer1->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizer1->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
// Connect Events
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_3DFILE_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_3DFILE_BASE::OnOkClick ), NULL, this );
}
DIALOG_EXPORT_3DFILE_BASE::~DIALOG_EXPORT_3DFILE_BASE()
{
// Disconnect Events
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_3DFILE_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_3DFILE_BASE::OnOkClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_export_3Dfiles_base__
#define __dialog_export_3Dfiles_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/filepicker.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXPORT_3DFILE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EXPORT_3DFILE_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_staticText1;
wxFilePickerCtrl* m_filePicker;
wxStaticText* m_staticText3;
wxTextCtrl* m_SubdirNameCtrl;
wxRadioBox* m_rbSelectUnits;
wxRadioBox* m_rb3DFilesOption;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Vrml Board Export Options:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 370,252 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXPORT_3DFILE_BASE();
};
#endif //__dialog_export_3Dfiles_base__
This diff is collapsed.
...@@ -178,6 +178,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -178,6 +178,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
_( "Create a report of all modules on the current board" ) ); _( "Create a report of all modules on the current board" ) );
item->SetBitmap( tools_xpm ); item->SetBitmap( tools_xpm );
submenuexport->Append( item ); submenuexport->Append( item );
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_VRML,
_( "&VRML" ),
_( "Export a VRML board representation" ) );
item->SetBitmap( show_3d_xpm );
submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _( "&Export" ), ID_GEN_EXPORT_FILE, _( "&Export" ),
_( "Export board" ), export_xpm ); _( "Export board" ), export_xpm );
......
...@@ -94,6 +94,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -94,6 +94,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, WinEDA_PcbFrame::ExportToGenCAD ) EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, WinEDA_PcbFrame::ExportToGenCAD )
EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT,
WinEDA_PcbFrame::GenModuleReport ) WinEDA_PcbFrame::GenModuleReport )
EVT_MENU( ID_GEN_EXPORT_FILE_VRML, WinEDA_PcbFrame::OnExportVRML )
EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION, EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,
WinEDA_PcbFrame::ImportSpecctraSession ) WinEDA_PcbFrame::ImportSpecctraSession )
......
...@@ -210,6 +210,7 @@ enum pcbnew_ids ...@@ -210,6 +210,7 @@ enum pcbnew_ids
ID_MENU_LIST_NETS, ID_MENU_LIST_NETS,
ID_MENU_PCB_CLEAN, ID_MENU_PCB_CLEAN,
ID_MENU_PCB_SWAP_LAYERS, ID_MENU_PCB_SWAP_LAYERS,
ID_GEN_EXPORT_FILE_VRML,
ID_TOOLBARH_PCB_AUTOPLACE, ID_TOOLBARH_PCB_AUTOPLACE,
ID_TOOLBARH_PCB_AUTOROUTE, ID_TOOLBARH_PCB_AUTOROUTE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment