refactoring: removed dependency of libpcbcommon on 3d-viewer.

This commit is contained in:
Tomasz Włostowski 2017-10-27 16:25:20 +02:00
parent 08a9dc01c5
commit 90ab5860dc
25 changed files with 83 additions and 62 deletions

View File

@ -44,7 +44,6 @@ class S3D_CACHE_ENTRY;
class SCENEGRAPH; class SCENEGRAPH;
class S3D_FILENAME_RESOLVER; class S3D_FILENAME_RESOLVER;
class S3D_PLUGIN_MANAGER; class S3D_PLUGIN_MANAGER;
struct S3D_INFO;
class S3D_CACHE class S3D_CACHE

View File

@ -36,9 +36,13 @@
#include <wx/string.h> #include <wx/string.h>
#include <plugins/3dapi/sg_base.h> #include <plugins/3dapi/sg_base.h>
class MODULE_3D_SETTINGS;
struct S3D_INFO struct S3D_INFO
{ {
S3D_INFO();
S3D_INFO( const MODULE_3D_SETTINGS& aModel );
SGPOINT m_Scale; ///< scaling factors for the 3D footprint shape 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_Rotation; ///< an X,Y,Z rotation (unit = degrees) for the 3D shape
SGPOINT m_Offset; ///< an offset (unit = inch) for the 3D shape SGPOINT m_Offset; ///< an offset (unit = inch) for the 3D shape

View File

@ -36,7 +36,6 @@
class wxWindow; class wxWindow;
class KICAD_PLUGIN_LDR_3D; class KICAD_PLUGIN_LDR_3D;
struct S3D_INFO;
class SCENEGRAPH; class SCENEGRAPH;
class S3D_PLUGIN_MANAGER class S3D_PLUGIN_MANAGER

View File

@ -32,7 +32,7 @@
bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, 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 ) if( NULL == aModel )
return false; return false;

View File

@ -28,12 +28,11 @@
class S3D_CACHE; class S3D_CACHE;
class S3D_FILENAME_RESOLVER; class S3D_FILENAME_RESOLVER;
struct S3D_INFO;
namespace S3D namespace S3D
{ {
bool Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, 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 ); bool Configure3DPaths( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver );
}; };

View File

@ -31,6 +31,7 @@
#include "3d_cache_dialogs.h" #include "3d_cache_dialogs.h"
#include <3d_model_viewer/c3d_model_viewer.h> #include <3d_model_viewer/c3d_model_viewer.h>
#include <common_ogl/cogl_att_list.h> #include <common_ogl/cogl_att_list.h>
#include <pcbnew/class_module.h>
#define ID_FILE_TREE ( wxID_LAST + 1 ) #define ID_FILE_TREE ( wxID_LAST + 1 )
#define ID_SET_DIR ( ID_FILE_TREE + 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, 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, wxDialog( aParent, wxID_ANY, _( "Select 3D Model" ), wxDefaultPosition,
wxSize( 500,200 ), wxCAPTION | wxRESIZE_BORDER | wxCLOSE_BOX wxSize( 500,200 ), wxCAPTION | wxRESIZE_BORDER | wxCLOSE_BOX
| wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU ), | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU ),

View File

@ -38,7 +38,7 @@
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/frame.h> #include <wx/frame.h>
struct S3D_INFO; struct MODULE_3D_SETTINGS;
class S3D_CACHE; class S3D_CACHE;
class S3D_FILENAME_RESOLVER; class S3D_FILENAME_RESOLVER;
class C3D_MODEL_VIEWER; class C3D_MODEL_VIEWER;
@ -47,7 +47,7 @@ class C3D_MODEL_VIEWER;
class DLG_SELECT_3DMODEL : public wxDialog class DLG_SELECT_3DMODEL : public wxDialog
{ {
private: 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_CACHE* m_cache; // cache manager
S3D_FILENAME_RESOLVER* m_resolver; // 3D filename resolver S3D_FILENAME_RESOLVER* m_resolver; // 3D filename resolver
@ -61,7 +61,7 @@ private:
void updateDirChoiceList( void ); void updateDirChoiceList( void );
public: 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 ); wxString& prevModelSelectDir, int& prevModelWildcard );
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;

View File

@ -45,7 +45,7 @@
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager, PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager,
MODULE* aModuleCopy, MODULE* aModuleCopy,
COLORS_DESIGN_SETTINGS *aColors, COLORS_DESIGN_SETTINGS *aColors,
std::vector<S3D_INFO> *aParentInfoList ): std::vector<MODULE_3D_SETTINGS> *aParentInfoList ):
PANEL_PREV_3D_BASE( aParent, wxID_ANY ) PANEL_PREV_3D_BASE( aParent, wxID_ANY )
{ {
initPanel(); initPanel();
@ -204,7 +204,7 @@ void PANEL_PREV_3D::SetModelDataIdx( int idx, bool aReloadPreviewModule )
// next updates, it will set first an // next updates, it will set first an
// invalid selection // 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 ) ); xscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.x ) );
yscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.y ) ); yscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.y ) );
@ -360,9 +360,15 @@ void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event )
getOrientationVars( scale, rotation, offset ); getOrientationVars( scale, rotation, offset );
m_modelInfo.m_Scale = scale; m_modelInfo.m_Scale.x = scale.x;
m_modelInfo.m_Offset = offset; m_modelInfo.m_Scale.y = scale.y;
m_modelInfo.m_Rotation = rotation; 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 ) if( m_currentSelectedIdx >= 0 )
{ {
@ -590,9 +596,12 @@ bool PANEL_PREV_3D::ValidateWithMessage( wxString& aErrorMessage )
{ {
wxString msg; wxString msg;
bool addError = false; 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 ) 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() void PANEL_PREV_3D::updateListOnModelCopy()
{ {
std::list<S3D_INFO>* draw3D = &m_copyModule->Models(); auto draw3D = &m_copyModule->Models();
draw3D->clear(); draw3D->clear();
draw3D->insert( draw3D->end(), m_parentInfoList->begin(), m_parentInfoList->end() ); draw3D->insert( draw3D->end(), m_parentInfoList->begin(), m_parentInfoList->end() );
} }

View File

@ -38,7 +38,6 @@
#include "panel_prev_3d_base.h" #include "panel_prev_3d_base.h"
#include "../3d_info.h"
#include <vector> #include <vector>
#include <3d_canvas/eda_3d_canvas.h> #include <3d_canvas/eda_3d_canvas.h>
@ -76,7 +75,7 @@ public:
PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager, PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager,
MODULE* aModuleCopy, MODULE* aModuleCopy,
COLORS_DESIGN_SETTINGS *aColors, COLORS_DESIGN_SETTINGS *aColors,
std::vector<S3D_INFO> *aParentInfoList = NULL ); std::vector<MODULE_3D_SETTINGS> *aParentInfoList = NULL );
~PANEL_PREV_3D(); ~PANEL_PREV_3D();
@ -96,14 +95,14 @@ private:
/// A pointer to a new copy of the original module /// A pointer to a new copy of the original module
MODULE *m_copyModule; MODULE *m_copyModule;
/// A pointer to the parent S3D_INFO list that we will use to copy to the preview module /// A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module
std::vector<S3D_INFO> *m_parentInfoList; std::vector<MODULE_3D_SETTINGS> *m_parentInfoList;
/// The current selected index of the S3D_INFO list /// The current selected index of the MODULE_3D_SETTINGS list
int m_currentSelectedIdx; int m_currentSelectedIdx;
/// Current S3D_INFO that is being edited /// Current MODULE_3D_SETTINGS that is being edited
S3D_INFO m_modelInfo; MODULE_3D_SETTINGS m_modelInfo;
// Methods of the class // Methods of the class
private: private:

View File

@ -934,8 +934,8 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models()
if( !module->Models().empty() ) if( !module->Models().empty() )
{ {
// Get the list of model files for this model // Get the list of model files for this model
std::list<S3D_INFO>::const_iterator sM = module->Models().begin(); auto sM = module->Models().begin();
std::list<S3D_INFO>::const_iterator eM = module->Models().end(); auto eM = module->Models().end();
while( sM != eM ) while( sM != eM )
{ {

View File

@ -1026,8 +1026,8 @@ void C3D_RENDER_OGL_LEGACY::render_3D_module( const MODULE* module,
modelunit_to_3d_units_factor ); modelunit_to_3d_units_factor );
// Get the list of model files for this model // Get the list of model files for this model
std::list<S3D_INFO>::const_iterator sM = module->Models().begin(); auto sM = module->Models().begin();
std::list<S3D_INFO>::const_iterator eM = module->Models().end(); auto eM = module->Models().end();
while( sM != eM ) while( sM != eM )
{ {

View File

@ -1248,8 +1248,8 @@ void C3D_RENDER_RAYTRACING::load_3D_models()
// Get the list of model files for this model // Get the list of model files for this model
std::list<S3D_INFO>::const_iterator sM = module->Models().begin(); auto sM = module->Models().begin();
std::list<S3D_INFO>::const_iterator eM = module->Models().end(); auto eM = module->Models().end();
while( sM != eM ) while( sM != eM )
{ {

View File

@ -35,7 +35,6 @@
class SGNODE; class SGNODE;
class SCENEGRAPH; class SCENEGRAPH;
struct S3D_INFO;
struct S3D_POINT; struct S3D_POINT;
namespace S3D namespace S3D

View File

@ -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 ) if( NULL == a3DModel )
return; return;

View File

@ -42,7 +42,6 @@
#include <class_text_mod.h> #include <class_text_mod.h>
#include <PolyLine.h> #include <PolyLine.h>
#include "zones.h" #include "zones.h"
#include <3d_cache/3d_info.h>
#include <core/iterators.h> #include <core/iterators.h>
@ -80,6 +79,19 @@ enum MODULE_ATTR_T
///< board (Like edge card connectors, mounting hole...) ///< 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 class MODULE : public BOARD_ITEM_CONTAINER
{ {
@ -147,8 +159,8 @@ public:
return DLIST_ITERATOR_WRAPPER<BOARD_ITEM>( m_Drawings ); return DLIST_ITERATOR_WRAPPER<BOARD_ITEM>( m_Drawings );
} }
std::list<S3D_INFO>& Models() { return m_3D_Drawings; } std::list<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
const std::list<S3D_INFO>& Models() const { return m_3D_Drawings; } const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
@ -546,9 +558,9 @@ public:
* Function Add3DModel * Function Add3DModel
* adds \a a3DModel definition to the end of the 3D model list. * 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; SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
@ -669,7 +681,7 @@ public:
private: private:
DLIST<D_PAD> m_Pads; ///< Linked list of pads. DLIST<D_PAD> m_Pads; ///< Linked list of pads.
DLIST<BOARD_ITEM> m_Drawings; ///< Linked list of graphical items. DLIST<BOARD_ITEM> m_Drawings; ///< Linked list of graphical items.
std::list<S3D_INFO> m_3D_Drawings; ///< Linked list of 3D models. std::list<MODULE_3D_SETTINGS> m_3D_Drawings; ///< Linked list of 3D models.
double m_Orient; ///< Orientation in tenths of a degree, 900=90.0 degrees. 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. wxPoint m_Pos; ///< Position of module on the board in internal units.
TEXTE_MODULE* m_Reference; ///< Component reference designator value (U34, R18..) TEXTE_MODULE* m_Reference; ///< Component reference designator value (U34, R18..)

View File

@ -289,8 +289,8 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
// Init 3D shape list // Init 3D shape list
m_3D_ShapeNameListBox->Clear(); m_3D_ShapeNameListBox->Clear();
std::list<S3D_INFO>::iterator sM = m_CurrentModule->Models().begin(); auto sM = m_CurrentModule->Models().begin();
std::list<S3D_INFO>::iterator eM = m_CurrentModule->Models().end(); auto eM = m_CurrentModule->Models().end();
m_shapes3D_list.clear(); m_shapes3D_list.clear();
wxString origPath; wxString origPath;
@ -525,7 +525,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName()
void DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile() void DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile()
{ {
PROJECT& prj = Prj(); PROJECT& prj = Prj();
S3D_INFO model; MODULE_3D_SETTINGS model;
wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
@ -733,7 +733,7 @@ bool DIALOG_MODULE_BOARD_EDITOR::TransferDataFromWindow()
return false; return false;
} }
std::list<S3D_INFO>* draw3D = &m_CurrentModule->Models(); std::list<MODULE_3D_SETTINGS>* draw3D = &m_CurrentModule->Models();
draw3D->clear(); draw3D->clear();
draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );

View File

@ -40,7 +40,7 @@ private:
MODULE* m_CurrentModule; MODULE* m_CurrentModule;
TEXTE_MODULE* m_ReferenceCopy; TEXTE_MODULE* m_ReferenceCopy;
TEXTE_MODULE* m_ValueCopy; TEXTE_MODULE* m_ValueCopy;
std::vector <S3D_INFO> m_shapes3D_list; std::vector <MODULE_3D_SETTINGS> m_shapes3D_list;
int m_LastSelected3DShapeIndex; int m_LastSelected3DShapeIndex;
static size_t m_page; // remember the last open page during session static size_t m_page; // remember the last open page during session
PANEL_PREV_3D* m_PreviewPane; PANEL_PREV_3D* m_PreviewPane;

View File

@ -139,8 +139,8 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
// Init 3D shape list // Init 3D shape list
m_3D_ShapeNameListBox->Clear(); m_3D_ShapeNameListBox->Clear();
std::list<S3D_INFO>::iterator sM = m_currentModule->Models().begin(); auto sM = m_currentModule->Models().begin();
std::list<S3D_INFO>::iterator eM = m_currentModule->Models().end(); auto eM = m_currentModule->Models().end();
m_shapes3D_list.clear(); m_shapes3D_list.clear();
@ -383,7 +383,7 @@ void DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName()
void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile() void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile()
{ {
PROJECT& prj = Prj(); PROJECT& prj = Prj();
S3D_INFO model; MODULE_3D_SETTINGS model;
wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
@ -520,7 +520,7 @@ bool DIALOG_MODULE_MODULE_EDITOR::TransferDataFromWindow()
m_currentModule->SetLocalSolderPasteMarginRatio( dtmp / 100 ); m_currentModule->SetLocalSolderPasteMarginRatio( dtmp / 100 );
std::list<S3D_INFO>* draw3D = &m_currentModule->Models(); std::list<MODULE_3D_SETTINGS>* draw3D = &m_currentModule->Models();
draw3D->clear(); draw3D->clear();
draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );

View File

@ -40,7 +40,7 @@ private:
MODULE* m_currentModule; MODULE* m_currentModule;
TEXTE_MODULE* m_referenceCopy; TEXTE_MODULE* m_referenceCopy;
TEXTE_MODULE* m_valueCopy; TEXTE_MODULE* m_valueCopy;
std::vector<S3D_INFO> m_shapes3D_list; std::vector<MODULE_3D_SETTINGS> m_shapes3D_list;
int m_lastSelected3DShapeIndex; int m_lastSelected3DShapeIndex;
static size_t m_page; // remember the last open page during session static size_t m_page; // remember the last open page during session
PANEL_PREV_3D* m_PreviewPane; PANEL_PREV_3D* m_PreviewPane;

View File

@ -379,8 +379,8 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
IDF3_COMPONENT* comp = NULL; IDF3_COMPONENT* comp = NULL;
std::list<S3D_INFO>::const_iterator sM = aModule->Models().begin(); auto sM = aModule->Models().begin();
std::list<S3D_INFO>::const_iterator eM = aModule->Models().end(); auto eM = aModule->Models().end();
wxFileName idfFile; wxFileName idfFile;
wxString idfExt; wxString idfExt;

View File

@ -1304,8 +1304,8 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
bool isFlipped = aModule->GetLayer() == B_Cu; bool isFlipped = aModule->GetLayer() == B_Cu;
// Export the object VRML model(s) // Export the object VRML model(s)
std::list<S3D_INFO>::iterator sM = aModule->Models().begin(); auto sM = aModule->Models().begin();
std::list<S3D_INFO>::iterator eM = aModule->Models().end(); auto eM = aModule->Models().end();
wxFileName subdir( SUBDIR_3D, "" ); wxFileName subdir( SUBDIR_3D, "" );

View File

@ -1131,8 +1131,8 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
format( pad, aNestLevel+1 ); format( pad, aNestLevel+1 );
// Save 3D info. // Save 3D info.
std::list<S3D_INFO>::const_iterator bs3D = aModule->Models().begin(); auto bs3D = aModule->Models().begin();
std::list<S3D_INFO>::const_iterator es3D = aModule->Models().end(); auto es3D = aModule->Models().end();
while( bs3D != es3D ) while( bs3D != es3D )
{ {

View File

@ -1867,7 +1867,7 @@ void LEGACY_PLUGIN::loadMODULE_TEXT( TEXTE_MODULE* aText )
void LEGACY_PLUGIN::load3D( MODULE* aModule ) void LEGACY_PLUGIN::load3D( MODULE* aModule )
{ {
S3D_INFO t3D; MODULE_3D_SETTINGS t3D;
char* line; char* line;
while( ( line = READLINE( m_reader ) ) != NULL ) 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 void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
{ {
std::list<S3D_INFO>::const_iterator sM = me->Models().begin(); auto sM = me->Models().begin();
std::list<S3D_INFO>::const_iterator eM = me->Models().end(); auto eM = me->Models().end();
while( sM != eM ) while( sM != eM )
{ {

View File

@ -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, 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; T token;
S3D_INFO* n3D = new S3D_INFO; MODULE_3D_SETTINGS* n3D = new MODULE_3D_SETTINGS;
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
n3D->m_Filename = FromUTF8(); n3D->m_Filename = FromUTF8();

View File

@ -35,7 +35,6 @@
#include <layers_id_colors_and_visibility.h> // PCB_LAYER_ID #include <layers_id_colors_and_visibility.h> // PCB_LAYER_ID
#include <common.h> // KiROUND #include <common.h> // KiROUND
#include <convert_to_biu.h> // IU_PER_MM #include <convert_to_biu.h> // IU_PER_MM
#include <3d_cache/3d_info.h>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
@ -55,6 +54,7 @@ class MODULE;
class PCB_TARGET; class PCB_TARGET;
class VIA; class VIA;
class ZONE_CONTAINER; class ZONE_CONTAINER;
class MODULE_3D_SETTINGS;
struct LAYER; struct LAYER;
@ -198,7 +198,7 @@ class PCB_PARSER : public PCB_LEXER
*/ */
void parseEDA_TEXT( EDA_TEXT* aText ); void parseEDA_TEXT( EDA_TEXT* aText );
S3D_INFO* parse3DModel(); MODULE_3D_SETTINGS* parse3DModel();
/** /**
* Function parseDouble * Function parseDouble