From 90ab5860dc0611a7af55f485777d898c66fef5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Fri, 27 Oct 2017 16:25:20 +0200 Subject: [PATCH] refactoring: removed dependency of libpcbcommon on 3d-viewer. --- 3d-viewer/3d_cache/3d_cache.h | 1 - 3d-viewer/3d_cache/3d_info.h | 4 +++ 3d-viewer/3d_cache/3d_plugin_manager.h | 1 - .../3d_cache/dialogs/3d_cache_dialogs.cpp | 2 +- 3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h | 3 +-- .../3d_cache/dialogs/dlg_select_3dmodel.cpp | 3 ++- .../3d_cache/dialogs/dlg_select_3dmodel.h | 6 ++--- .../3d_cache/dialogs/panel_prev_model.cpp | 25 +++++++++++++------ 3d-viewer/3d_cache/dialogs/panel_prev_model.h | 13 +++++----- .../c3d_render_createscene_ogl_legacy.cpp | 4 +-- .../c3d_render_ogl_legacy.cpp | 4 +-- .../c3d_render_createscene.cpp | 4 +-- include/plugins/3dapi/ifsg_api.h | 1 - pcbnew/class_module.cpp | 2 +- pcbnew/class_module.h | 24 +++++++++++++----- .../dialog_edit_module_for_BoardEditor.cpp | 8 +++--- .../dialog_edit_module_for_BoardEditor.h | 2 +- .../dialog_edit_module_for_Modedit.cpp | 8 +++--- .../dialogs/dialog_edit_module_for_Modedit.h | 2 +- pcbnew/exporters/export_idf.cpp | 4 +-- pcbnew/exporters/export_vrml.cpp | 4 +-- pcbnew/kicad_plugin.cpp | 4 +-- pcbnew/legacy_plugin.cpp | 6 ++--- pcbnew/pcb_parser.cpp | 6 ++--- pcbnew/pcb_parser.h | 4 +-- 25 files changed, 83 insertions(+), 62 deletions(-) diff --git a/3d-viewer/3d_cache/3d_cache.h b/3d-viewer/3d_cache/3d_cache.h index 376b529f51..08d901ef3b 100644 --- a/3d-viewer/3d_cache/3d_cache.h +++ b/3d-viewer/3d_cache/3d_cache.h @@ -44,7 +44,6 @@ class S3D_CACHE_ENTRY; class SCENEGRAPH; class S3D_FILENAME_RESOLVER; class S3D_PLUGIN_MANAGER; -struct S3D_INFO; class S3D_CACHE diff --git a/3d-viewer/3d_cache/3d_info.h b/3d-viewer/3d_cache/3d_info.h index ff9910a8c5..72049346e1 100644 --- a/3d-viewer/3d_cache/3d_info.h +++ b/3d-viewer/3d_cache/3d_info.h @@ -36,9 +36,13 @@ #include #include +class MODULE_3D_SETTINGS; struct S3D_INFO { + S3D_INFO(); + S3D_INFO( const MODULE_3D_SETTINGS& aModel ); + SGPOINT m_Scale; ///< scaling factors for the 3D footprint shape SGPOINT m_Rotation; ///< an X,Y,Z rotation (unit = degrees) for the 3D shape SGPOINT m_Offset; ///< an offset (unit = inch) for the 3D shape diff --git a/3d-viewer/3d_cache/3d_plugin_manager.h b/3d-viewer/3d_cache/3d_plugin_manager.h index a1257e7cfa..6f489985cb 100644 --- a/3d-viewer/3d_cache/3d_plugin_manager.h +++ b/3d-viewer/3d_cache/3d_plugin_manager.h @@ -36,7 +36,6 @@ class wxWindow; class KICAD_PLUGIN_LDR_3D; -struct S3D_INFO; class SCENEGRAPH; class S3D_PLUGIN_MANAGER diff --git a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp index d4f4cb1b1f..8fb29884ce 100644 --- a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp +++ b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp @@ -32,7 +32,7 @@ bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, - wxString& prevModelSelectDir, int& prevModelWildcard, S3D_INFO* aModel ) + wxString& prevModelSelectDir, int& prevModelWildcard, MODULE_3D_SETTINGS* aModel ) { if( NULL == aModel ) return false; diff --git a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h index 02cfaa71ea..e2de72a6a7 100644 --- a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h +++ b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h @@ -28,12 +28,11 @@ class S3D_CACHE; class S3D_FILENAME_RESOLVER; -struct S3D_INFO; namespace S3D { bool Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, - wxString& prevModelSelectDir, int& prevModelWildcard, S3D_INFO* aModel ); + wxString& prevModelSelectDir, int& prevModelWildcard, MODULE_3D_SETTINGS* aModel ); bool Configure3DPaths( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver ); }; diff --git a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp index 7d327a0c74..9a1c013abf 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp +++ b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp @@ -31,6 +31,7 @@ #include "3d_cache_dialogs.h" #include <3d_model_viewer/c3d_model_viewer.h> #include +#include #define ID_FILE_TREE ( wxID_LAST + 1 ) #define ID_SET_DIR ( ID_FILE_TREE + 1 ) @@ -46,7 +47,7 @@ wxEND_EVENT_TABLE() DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, - S3D_INFO* aModelItem, wxString& prevModelSelectDir, int& prevModelWildcard ) : + MODULE_3D_SETTINGS* aModelItem, wxString& prevModelSelectDir, int& prevModelWildcard ) : wxDialog( aParent, wxID_ANY, _( "Select 3D Model" ), wxDefaultPosition, wxSize( 500,200 ), wxCAPTION | wxRESIZE_BORDER | wxCLOSE_BOX | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU ), diff --git a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h index 4eddc99fe1..652f9880b7 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h +++ b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h @@ -38,7 +38,7 @@ #include #include -struct S3D_INFO; +struct MODULE_3D_SETTINGS; class S3D_CACHE; class S3D_FILENAME_RESOLVER; class C3D_MODEL_VIEWER; @@ -47,7 +47,7 @@ class C3D_MODEL_VIEWER; class DLG_SELECT_3DMODEL : public wxDialog { private: - S3D_INFO* m_model; // data for the selected model + MODULE_3D_SETTINGS* m_model; // data for the selected model S3D_CACHE* m_cache; // cache manager S3D_FILENAME_RESOLVER* m_resolver; // 3D filename resolver @@ -61,7 +61,7 @@ private: void updateDirChoiceList( void ); public: - DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, S3D_INFO* aModelItem, + DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, MODULE_3D_SETTINGS* aModelItem, wxString& prevModelSelectDir, int& prevModelWildcard ); bool TransferDataFromWindow() override; diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp index 44282e3a23..3cc07b5e3b 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp @@ -45,7 +45,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager, MODULE* aModuleCopy, COLORS_DESIGN_SETTINGS *aColors, - std::vector *aParentInfoList ): + std::vector *aParentInfoList ): PANEL_PREV_3D_BASE( aParent, wxID_ANY ) { initPanel(); @@ -204,7 +204,7 @@ void PANEL_PREV_3D::SetModelDataIdx( int idx, bool aReloadPreviewModule ) // next updates, it will set first an // invalid selection - const S3D_INFO *aModel = (const S3D_INFO *)&((*m_parentInfoList)[idx]); + const MODULE_3D_SETTINGS *aModel = (const MODULE_3D_SETTINGS *)&((*m_parentInfoList)[idx]); xscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.x ) ); yscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.y ) ); @@ -360,9 +360,15 @@ void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event ) getOrientationVars( scale, rotation, offset ); - m_modelInfo.m_Scale = scale; - m_modelInfo.m_Offset = offset; - m_modelInfo.m_Rotation = rotation; + m_modelInfo.m_Scale.x = scale.x; + m_modelInfo.m_Scale.y = scale.y; + m_modelInfo.m_Scale.z = scale.z; + m_modelInfo.m_Offset.x = offset.x; + m_modelInfo.m_Offset.y = offset.y; + m_modelInfo.m_Offset.z = offset.z; + m_modelInfo.m_Rotation.x = rotation.x; + m_modelInfo.m_Rotation.y = rotation.y; + m_modelInfo.m_Rotation.z = rotation.z; if( m_currentSelectedIdx >= 0 ) { @@ -590,9 +596,12 @@ bool PANEL_PREV_3D::ValidateWithMessage( wxString& aErrorMessage ) { wxString msg; bool addError = false; - S3D_INFO& s3dshape = (*m_parentInfoList)[idx]; + MODULE_3D_SETTINGS& s3dshape = (*m_parentInfoList)[idx]; - SGPOINT scale = s3dshape.m_Scale; + SGPOINT scale; + scale.x = s3dshape.m_Scale.x; + scale.y = s3dshape.m_Scale.y; + scale.z = s3dshape.m_Scale.z; if( 1/MAX_SCALE > scale.x || MAX_SCALE < scale.x ) { @@ -646,7 +655,7 @@ bool PANEL_PREV_3D::ValidateWithMessage( wxString& aErrorMessage ) void PANEL_PREV_3D::updateListOnModelCopy() { - std::list* draw3D = &m_copyModule->Models(); + auto draw3D = &m_copyModule->Models(); draw3D->clear(); draw3D->insert( draw3D->end(), m_parentInfoList->begin(), m_parentInfoList->end() ); } diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.h b/3d-viewer/3d_cache/dialogs/panel_prev_model.h index bfe8095821..85cbb8ed64 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.h +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.h @@ -38,7 +38,6 @@ #include "panel_prev_3d_base.h" -#include "../3d_info.h" #include #include <3d_canvas/eda_3d_canvas.h> @@ -76,7 +75,7 @@ public: PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager, MODULE* aModuleCopy, COLORS_DESIGN_SETTINGS *aColors, - std::vector *aParentInfoList = NULL ); + std::vector *aParentInfoList = NULL ); ~PANEL_PREV_3D(); @@ -96,14 +95,14 @@ private: /// A pointer to a new copy of the original module MODULE *m_copyModule; - /// A pointer to the parent S3D_INFO list that we will use to copy to the preview module - std::vector *m_parentInfoList; + /// A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module + std::vector *m_parentInfoList; - /// The current selected index of the S3D_INFO list + /// The current selected index of the MODULE_3D_SETTINGS list int m_currentSelectedIdx; - /// Current S3D_INFO that is being edited - S3D_INFO m_modelInfo; + /// Current MODULE_3D_SETTINGS that is being edited + MODULE_3D_SETTINGS m_modelInfo; // Methods of the class private: diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp index 689b8c0356..ec48bd8a5b 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp @@ -934,8 +934,8 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models() if( !module->Models().empty() ) { // Get the list of model files for this model - std::list::const_iterator sM = module->Models().begin(); - std::list::const_iterator eM = module->Models().end(); + auto sM = module->Models().begin(); + auto eM = module->Models().end(); while( sM != eM ) { diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index c95850bae5..19b461658a 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -1026,8 +1026,8 @@ void C3D_RENDER_OGL_LEGACY::render_3D_module( const MODULE* module, modelunit_to_3d_units_factor ); // Get the list of model files for this model - std::list::const_iterator sM = module->Models().begin(); - std::list::const_iterator eM = module->Models().end(); + auto sM = module->Models().begin(); + auto eM = module->Models().end(); while( sM != eM ) { diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp index 88a3990ece..592d141408 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp @@ -1248,8 +1248,8 @@ void C3D_RENDER_RAYTRACING::load_3D_models() // Get the list of model files for this model - std::list::const_iterator sM = module->Models().begin(); - std::list::const_iterator eM = module->Models().end(); + auto sM = module->Models().begin(); + auto eM = module->Models().end(); while( sM != eM ) { diff --git a/include/plugins/3dapi/ifsg_api.h b/include/plugins/3dapi/ifsg_api.h index 7779528e59..7eb88e97e2 100644 --- a/include/plugins/3dapi/ifsg_api.h +++ b/include/plugins/3dapi/ifsg_api.h @@ -35,7 +35,6 @@ class SGNODE; class SCENEGRAPH; -struct S3D_INFO; struct S3D_POINT; namespace S3D diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index a23ef28a91..a3540c8a68 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -740,7 +740,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const } -void MODULE::Add3DModel( S3D_INFO* a3DModel ) +void MODULE::Add3DModel( MODULE_3D_SETTINGS* a3DModel ) { if( NULL == a3DModel ) return; diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 79431d458e..e3397bbf3c 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -42,7 +42,6 @@ #include #include #include "zones.h" -#include <3d_cache/3d_info.h> #include @@ -80,6 +79,19 @@ enum MODULE_ATTR_T ///< board (Like edge card connectors, mounting hole...) }; +class MODULE_3D_SETTINGS +{ + public: + struct VECTOR3D + { + double x, y, z; + }; + + VECTOR3D m_Scale; + VECTOR3D m_Rotation; + VECTOR3D m_Offset; + wxString m_Filename; ///< The 3D shape filename in 3D library +}; class MODULE : public BOARD_ITEM_CONTAINER { @@ -147,8 +159,8 @@ public: return DLIST_ITERATOR_WRAPPER( m_Drawings ); } - std::list& Models() { return m_3D_Drawings; } - const std::list& Models() const { return m_3D_Drawings; } + std::list& Models() { return m_3D_Drawings; } + const std::list& Models() const { return m_3D_Drawings; } void SetPosition( const wxPoint& aPos ) override; @@ -546,9 +558,9 @@ public: * Function Add3DModel * adds \a a3DModel definition to the end of the 3D model list. * - * @param a3DModel A pointer to a #S3D_INFO to add to the list. + * @param a3DModel A pointer to a #MODULE_3D_SETTINGS to add to the list. */ - void Add3DModel( S3D_INFO* a3DModel ); + void Add3DModel( MODULE_3D_SETTINGS* a3DModel ); SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; @@ -669,7 +681,7 @@ public: private: DLIST m_Pads; ///< Linked list of pads. DLIST m_Drawings; ///< Linked list of graphical items. - std::list m_3D_Drawings; ///< Linked list of 3D models. + std::list m_3D_Drawings; ///< Linked list of 3D models. double m_Orient; ///< Orientation in tenths of a degree, 900=90.0 degrees. wxPoint m_Pos; ///< Position of module on the board in internal units. TEXTE_MODULE* m_Reference; ///< Component reference designator value (U34, R18..) diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp index ea49892cb2..2d54fbcbda 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp @@ -289,8 +289,8 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties() // Init 3D shape list m_3D_ShapeNameListBox->Clear(); - std::list::iterator sM = m_CurrentModule->Models().begin(); - std::list::iterator eM = m_CurrentModule->Models().end(); + auto sM = m_CurrentModule->Models().begin(); + auto eM = m_CurrentModule->Models().end(); m_shapes3D_list.clear(); wxString origPath; @@ -525,7 +525,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName() void DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile() { PROJECT& prj = Prj(); - S3D_INFO model; + MODULE_3D_SETTINGS model; wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); @@ -733,7 +733,7 @@ bool DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow() return false; } - std::list* draw3D = &m_CurrentModule->Models(); + std::list* draw3D = &m_CurrentModule->Models(); draw3D->clear(); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h index 5e83f03f6c..b35d85727d 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.h @@ -40,7 +40,7 @@ private: MODULE* m_CurrentModule; TEXTE_MODULE* m_ReferenceCopy; TEXTE_MODULE* m_ValueCopy; - std::vector m_shapes3D_list; + std::vector m_shapes3D_list; int m_LastSelected3DShapeIndex; static size_t m_page; // remember the last open page during session PANEL_PREV_3D* m_PreviewPane; diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp index 867337bd85..8ac7e3302a 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp @@ -139,8 +139,8 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties() // Init 3D shape list m_3D_ShapeNameListBox->Clear(); - std::list::iterator sM = m_currentModule->Models().begin(); - std::list::iterator eM = m_currentModule->Models().end(); + auto sM = m_currentModule->Models().begin(); + auto eM = m_currentModule->Models().end(); m_shapes3D_list.clear(); @@ -383,7 +383,7 @@ void DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName() void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile() { PROJECT& prj = Prj(); - S3D_INFO model; + MODULE_3D_SETTINGS model; wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); @@ -520,7 +520,7 @@ bool DIALOG_MODULE_MODULE_EDITOR::TransferDataFromWindow() m_currentModule->SetLocalSolderPasteMarginRatio( dtmp / 100 ); - std::list* draw3D = &m_currentModule->Models(); + std::list* draw3D = &m_currentModule->Models(); draw3D->clear(); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit.h b/pcbnew/dialogs/dialog_edit_module_for_Modedit.h index 5d98198098..0142b87fa8 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit.h +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit.h @@ -40,7 +40,7 @@ private: MODULE* m_currentModule; TEXTE_MODULE* m_referenceCopy; TEXTE_MODULE* m_valueCopy; - std::vector m_shapes3D_list; + std::vector m_shapes3D_list; int m_lastSelected3DShapeIndex; static size_t m_page; // remember the last open page during session PANEL_PREV_3D* m_PreviewPane; diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index eaac990331..ea44fbfcec 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -379,8 +379,8 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule, IDF3_COMPONENT* comp = NULL; - std::list::const_iterator sM = aModule->Models().begin(); - std::list::const_iterator eM = aModule->Models().end(); + auto sM = aModule->Models().begin(); + auto eM = aModule->Models().end(); wxFileName idfFile; wxString idfExt; diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 3c0613d463..66dda6b64a 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -1304,8 +1304,8 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, bool isFlipped = aModule->GetLayer() == B_Cu; // Export the object VRML model(s) - std::list::iterator sM = aModule->Models().begin(); - std::list::iterator eM = aModule->Models().end(); + auto sM = aModule->Models().begin(); + auto eM = aModule->Models().end(); wxFileName subdir( SUBDIR_3D, "" ); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index c26599bd32..9431384acf 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -1131,8 +1131,8 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const format( pad, aNestLevel+1 ); // Save 3D info. - std::list::const_iterator bs3D = aModule->Models().begin(); - std::list::const_iterator es3D = aModule->Models().end(); + auto bs3D = aModule->Models().begin(); + auto es3D = aModule->Models().end(); while( bs3D != es3D ) { diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 8bf1f9c9ac..f98452d777 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -1867,7 +1867,7 @@ void LEGACY_PLUGIN::loadMODULE_TEXT( TEXTE_MODULE* aText ) void LEGACY_PLUGIN::load3D( MODULE* aModule ) { - S3D_INFO t3D; + MODULE_3D_SETTINGS t3D; char* line; while( ( line = READLINE( m_reader ) ) != NULL ) @@ -3071,8 +3071,8 @@ void LEGACY_PLUGIN::init( const PROPERTIES* aProperties ) void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const { - std::list::const_iterator sM = me->Models().begin(); - std::list::const_iterator eM = me->Models().end(); + auto sM = me->Models().begin(); + auto eM = me->Models().end(); while( sM != eM ) { diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index dfcc790dc9..36f1e9ccaf 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -332,14 +332,14 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) } -S3D_INFO* PCB_PARSER::parse3DModel() +MODULE_3D_SETTINGS* PCB_PARSER::parse3DModel() { wxCHECK_MSG( CurTok() == T_model, NULL, - wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as S3D_INFO." ) ); + wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE_3D_SETTINGS." ) ); T token; - S3D_INFO* n3D = new S3D_INFO; + MODULE_3D_SETTINGS* n3D = new MODULE_3D_SETTINGS; NeedSYMBOLorNUMBER(); n3D->m_Filename = FromUTF8(); diff --git a/pcbnew/pcb_parser.h b/pcbnew/pcb_parser.h index a92f2ab493..016b5b8064 100644 --- a/pcbnew/pcb_parser.h +++ b/pcbnew/pcb_parser.h @@ -35,7 +35,6 @@ #include // PCB_LAYER_ID #include // KiROUND #include // IU_PER_MM -#include <3d_cache/3d_info.h> #include #include @@ -55,6 +54,7 @@ class MODULE; class PCB_TARGET; class VIA; class ZONE_CONTAINER; +class MODULE_3D_SETTINGS; struct LAYER; @@ -198,7 +198,7 @@ class PCB_PARSER : public PCB_LEXER */ void parseEDA_TEXT( EDA_TEXT* aText ); - S3D_INFO* parse3DModel(); + MODULE_3D_SETTINGS* parse3DModel(); /** * Function parseDouble