diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index 8e15d52659..d4e5ccb416 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -93,12 +93,12 @@ BOARD_ADAPTER::BOARD_ADAPTER() : m_calc_seg_max_factor3DU = 0.0f; SetFlag( FL_USE_REALISTIC_MODE, true ); - SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, true ); + SetFlag( FL_FP_ATTRIBUTES_NORMAL, true ); SetFlag( FL_SHOW_BOARD_BODY, true ); SetFlag( FL_CLIP_SILK_ON_VIA_ANNULUS, false ); - SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, true ); - SetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, true ); - SetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL, true ); + SetFlag( FL_FP_ATTRIBUTES_NORMAL, true ); + SetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT, true ); + SetFlag( FL_FP_ATTRIBUTES_VIRTUAL, true ); SetFlag( FL_ZONE, true ); SetFlag( FL_SILKSCREEN, true ); SetFlag( FL_SOLDERMASK, true ); @@ -241,11 +241,11 @@ void BOARD_ADAPTER::SetFlag( DISPLAY3D_FLG aFlag, bool aState ) bool BOARD_ADAPTER::ShouldModuleBeDisplayed( MODULE_ATTR_T aModuleAttributs ) const { if( aModuleAttributs & MOD_SMD ) - return GetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT ); + return GetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT ); else if( aModuleAttributs & MOD_THROUGH_HOLE ) - return GetFlag( FL_MODULE_ATTRIBUTES_NORMAL ); + return GetFlag( FL_FP_ATTRIBUTES_NORMAL ); else - return GetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL ); + return GetFlag( FL_FP_ATTRIBUTES_VIRTUAL ); } diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 601a58f7c8..69c72df004 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -463,9 +463,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Add holes of footprints // ///////////////////////////////////////////////////////////////////////// - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { const wxSize padHole = pad->GetDrillSize(); @@ -497,9 +497,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Add contours of the pad holes (pads can be Circle or Segment holes) // ///////////////////////////////////////////////////////////////////////// - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { const wxSize padHole = pad->GetDrillSize(); @@ -549,28 +549,28 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id]; // ADD PADS - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { // Note: NPTH pads are not drawn on copper layers when the pad // has same shape as its hole - AddPadsShapesWithClearanceToContainer( module, layerContainer, curr_layer_id, 0, + AddPadsShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0, true, renderPlatedPadsAsPlated, false ); // Micro-wave footprints may have items on copper layers - AddGraphicsShapesWithClearanceToContainer( module, layerContainer, curr_layer_id, 0 ); + AddGraphicsShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0 ); } } if( renderPlatedPadsAsPlated ) { // ADD PLATED PADS - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - AddPadsShapesWithClearanceToContainer( module, m_platedpads_container2D_F_Cu, F_Cu, 0, - true, false, true ); + AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu, + 0, true, false, true ); - AddPadsShapesWithClearanceToContainer( module, m_platedpads_container2D_B_Cu, B_Cu, 0, - true, false, true ); + AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_B_Cu, B_Cu, + 0, true, false, true ); } m_platedpads_container2D_F_Cu->BuildBVH(); @@ -588,33 +588,33 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id]; // Add pads to polygon list - for( auto module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { // Note: NPTH pads are not drawn on copper layers when the pad // has same shape as its hole - module->TransformPadsShapesWithClearanceToPolygon( *layerPoly, curr_layer_id, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, renderPlatedPadsAsPlated, - false ); + footprint->TransformPadsShapesWithClearanceToPolygon( *layerPoly, curr_layer_id, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, renderPlatedPadsAsPlated, + false ); - transformGraphicModuleEdgeToPolygonSet( module, curr_layer_id, *layerPoly ); + transformGraphicModuleEdgeToPolygonSet( footprint, curr_layer_id, *layerPoly ); } } if( renderPlatedPadsAsPlated ) { // ADD PLATED PADS contourns - for( auto module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - module->TransformPadsShapesWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, false, true ); + footprint->TransformPadsShapesWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, false, true ); //transformGraphicModuleEdgeToPolygonSet( module, F_Cu, *m_F_Cu_PlatedPads_poly ); - module->TransformPadsShapesWithClearanceToPolygon( *m_B_Cu_PlatedPads_poly, B_Cu, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, false, true ); + footprint->TransformPadsShapesWithClearanceToPolygon( *m_B_Cu_PlatedPads_poly, B_Cu, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, false, true ); //transformGraphicModuleEdgeToPolygonSet( module, B_Cu, *m_B_Cu_PlatedPads_poly ); } @@ -994,7 +994,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Add footprints tech layers - objects // ///////////////////////////////////////////////////////////////////// - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) ) { @@ -1021,7 +1021,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Add footprints tech layers - contours - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) ) { diff --git a/3d-viewer/3d_enums.h b/3d-viewer/3d_enums.h index 314af9c39a..f9e02e8c57 100644 --- a/3d-viewer/3d_enums.h +++ b/3d-viewer/3d_enums.h @@ -42,9 +42,9 @@ enum DISPLAY3D_FLG FL_COMMENTS, FL_ECO, - FL_MODULE_ATTRIBUTES_NORMAL, - FL_MODULE_ATTRIBUTES_NORMAL_INSERT, - FL_MODULE_ATTRIBUTES_VIRTUAL, + FL_FP_ATTRIBUTES_NORMAL, + FL_FP_ATTRIBUTES_NORMAL_INSERT, + FL_FP_ATTRIBUTES_VIRTUAL, FL_USE_SELECTION, 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 1b644c9485..8ac6d04088 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 @@ -862,9 +862,9 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads() tht_inner_holes_poly.RemoveAllContours(); // Insert pads holes (vertical cylinders) - for( const auto module : m_boardAdapter.GetBoard()->Modules() ) + for( const MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() ) { - for( auto pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( pad->GetAttribute() != PAD_ATTRIB_NPTH ) { @@ -957,15 +957,17 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads() */ void C3D_RENDER_OGL_LEGACY::load_3D_models( REPORTER* aStatusReporter ) { - if((!m_boardAdapter.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL )) && - (!m_boardAdapter.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT )) && - (!m_boardAdapter.GetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL )) ) + if( !m_boardAdapter.GetFlag( FL_FP_ATTRIBUTES_NORMAL ) + && !m_boardAdapter.GetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT ) + && !m_boardAdapter.GetFlag( FL_FP_ATTRIBUTES_VIRTUAL ) ) + { return; + } // Go for all footprints - for( MODULE* module : m_boardAdapter.GetBoard()->Modules() ) + for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() ) { - for( const MODULE_3D_SETTINGS& model : module->Models() ) + for( const MODULE_3D_SETTINGS& model : footprint->Models() ) { if( model.m_Show && !model.m_Filename.empty() ) { 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 b5ad0c2eb7..eb0412842f 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 @@ -970,8 +970,7 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( bool aIsMoving, REPORTER* aStatusReporter, glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - // Enables Texture Env so it can combine model transparency with - // each module opacity setting + // Enables Texture Env so it can combine model transparency with each footprint opacity glEnable( GL_TEXTURE_2D ); glActiveTexture( GL_TEXTURE0 ); @@ -1266,15 +1265,16 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot, C_OGL_3DMODEL::BeginDrawMulti( !aRenderSelectedOnly ); // Go for all footprints - for( auto module : m_boardAdapter.GetBoard()->Modules() ) + for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() ) { - const bool isIntersected = ( module == m_currentIntersectedBoardItem ); + const bool isIntersected = ( fp == m_currentIntersectedBoardItem ); - if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) && - !isIntersected && - ( ( aRenderSelectedOnly && !module->IsSelected() ) || - ( !aRenderSelectedOnly && module->IsSelected() ) ) ) + if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) && !isIntersected + && ( ( aRenderSelectedOnly && !fp->IsSelected() ) + || ( !aRenderSelectedOnly && fp->IsSelected() ) ) ) + { continue; + } if( isIntersected && aRenderSelectedOnly ) { @@ -1285,11 +1285,17 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot, glLineWidth( 6 ); } - if( !module->Models().empty() ) - if( m_boardAdapter.ShouldModuleBeDisplayed((MODULE_ATTR_T) module->GetAttributes() ) ) - if( ( aRenderTopOrBot && !module->IsFlipped() ) - || ( !aRenderTopOrBot && module->IsFlipped() ) ) - render_3D_module( module, aRenderTransparentOnly, isIntersected ); + if( !fp->Models().empty() ) + { + if( m_boardAdapter.ShouldModuleBeDisplayed( (MODULE_ATTR_T) fp->GetAttributes() ) ) + { + if( ( aRenderTopOrBot && !fp->IsFlipped() ) + || ( !aRenderTopOrBot && fp->IsFlipped() ) ) + { + render_3D_module( fp, aRenderTransparentOnly, isIntersected ); + } + } + } if( isIntersected && aRenderSelectedOnly ) { 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 1ac4bcc59f..ad28726833 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 @@ -1376,7 +1376,7 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container() // ///////////////////////////////////////////////////////////////////////// // Insert vias holes (vertical cylinders) - for( auto track : m_boardAdapter.GetBoard()->Tracks() ) + for( TRACK* track : m_boardAdapter.GetBoard()->Tracks() ) { if( track->Type() == PCB_VIA_T ) { @@ -1386,9 +1386,9 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container() } // Insert pads holes (vertical cylinders) - for( auto module : m_boardAdapter.GetBoard()->Modules() ) + for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() ) { - for( auto pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) if( pad->GetAttribute () != PAD_ATTRIB_NPTH ) { insert3DPadHole( pad ); @@ -1400,14 +1400,14 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container() void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSkipMaterialInformation ) { // Go for all footprints - for( auto module : m_boardAdapter.GetBoard()->Modules() ) + for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() ) { - if((!module->Models().empty() ) && - m_boardAdapter.ShouldModuleBeDisplayed((MODULE_ATTR_T)module->GetAttributes() ) ) + if( !fp->Models().empty() + && m_boardAdapter.ShouldModuleBeDisplayed( (MODULE_ATTR_T)fp->GetAttributes() ) ) { - double zpos = m_boardAdapter.GetModulesZcoord3DIU( module->IsFlipped() ); + double zpos = m_boardAdapter.GetModulesZcoord3DIU( fp->IsFlipped() ); - wxPoint pos = module->GetPosition(); + wxPoint pos = fp->GetPosition(); glm::mat4 moduleMatrix = glm::mat4( 1.0f ); @@ -1416,16 +1416,16 @@ void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSki -pos.y * m_boardAdapter.BiuTo3Dunits(), zpos ) ); - if( module->GetOrientation() ) + if( fp->GetOrientation() ) { moduleMatrix = glm::rotate( moduleMatrix, - ( (float)(module->GetOrientation() / 10.0f) / 180.0f ) * + ( (float)(fp->GetOrientation() / 10.0f) / 180.0f ) * glm::pi(), SFVEC3F( 0.0f, 0.0f, 1.0f ) ); } - if( module->IsFlipped() ) + if( fp->IsFlipped() ) { moduleMatrix = glm::rotate( moduleMatrix, glm::pi(), @@ -1444,12 +1444,12 @@ void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSki modelunit_to_3d_units_factor, modelunit_to_3d_units_factor ) ); - BOARD_ITEM* boardItem = dynamic_cast( module ); + BOARD_ITEM* boardItem = dynamic_cast( fp ); // Get the list of model files for this model S3D_CACHE* cacheMgr = m_boardAdapter.Get3DCacheManager(); - auto sM = module->Models().begin(); - auto eM = module->Models().end(); + auto sM = fp->Models().begin(); + auto eM = fp->Models().end(); while( sM != eM ) { diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp index bd387c063c..40914d3aea 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp @@ -188,9 +188,9 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow() m_checkBoxBoardBody->SetValue( m_settings.GetFlag( FL_SHOW_BOARD_BODY ) ); m_checkBoxAreas->SetValue( m_settings.GetFlag( FL_ZONE ) ); - m_checkBox3DshapesTH->SetValue( m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL ) ); - m_checkBox3DshapesSMD->SetValue( m_settings.GetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT ) ); - m_checkBox3DshapesVirtual->SetValue( m_settings.GetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL ) ); + m_checkBox3DshapesTH->SetValue( m_settings.GetFlag( FL_FP_ATTRIBUTES_NORMAL ) ); + m_checkBox3DshapesSMD->SetValue( m_settings.GetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT ) ); + m_checkBox3DshapesVirtual->SetValue( m_settings.GetFlag( FL_FP_ATTRIBUTES_VIRTUAL ) ); m_checkBoxSilkscreen->SetValue( m_settings.GetFlag( FL_SILKSCREEN ) ); m_checkBoxSolderMask->SetValue( m_settings.GetFlag( FL_SOLDERMASK ) ); @@ -259,9 +259,9 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow() m_settings.SetFlag( FL_RENDER_PLATED_PADS_AS_PLATED, m_checkBoxRenderPlatedPadsAsPlated->GetValue() ); // Set 3D shapes visibility - m_settings.SetFlag( FL_MODULE_ATTRIBUTES_NORMAL, m_checkBox3DshapesTH->GetValue() ); - m_settings.SetFlag( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, m_checkBox3DshapesSMD->GetValue() ); - m_settings.SetFlag( FL_MODULE_ATTRIBUTES_VIRTUAL, m_checkBox3DshapesVirtual->GetValue() ); + m_settings.SetFlag( FL_FP_ATTRIBUTES_NORMAL, m_checkBox3DshapesTH->GetValue() ); + m_settings.SetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT, m_checkBox3DshapesSMD->GetValue() ); + m_settings.SetFlag( FL_FP_ATTRIBUTES_VIRTUAL, m_checkBox3DshapesVirtual->GetValue() ); // Set Layer visibility m_settings.SetFlag( FL_SILKSCREEN, m_checkBoxSilkscreen->GetValue() ); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index c5dc9f2aec..1fcc9e4068 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -520,9 +520,9 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg ) TRANSFER_SETTING( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, raytrace_procedural_textures ); TRANSFER_SETTING( FL_AXIS, show_axis ); - TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL, show_footprints_normal ); - TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_NORMAL_INSERT, show_footprints_insert ); - TRANSFER_SETTING( FL_MODULE_ATTRIBUTES_VIRTUAL, show_footprints_virtual ); + TRANSFER_SETTING( FL_FP_ATTRIBUTES_NORMAL, show_footprints_normal ); + TRANSFER_SETTING( FL_FP_ATTRIBUTES_NORMAL_INSERT, show_footprints_insert ); + TRANSFER_SETTING( FL_FP_ATTRIBUTES_VIRTUAL, show_footprints_virtual ); TRANSFER_SETTING( FL_ZONE, show_zones ); TRANSFER_SETTING( FL_ADHESIVE, show_adhesive ); TRANSFER_SETTING( FL_SILKSCREEN, show_silkscreen ); @@ -688,9 +688,9 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg ) TRANSFER_SETTING( renderPlatedPadsAsPlated, FL_RENDER_PLATED_PADS_AS_PLATED ); TRANSFER_SETTING( show_comments, FL_COMMENTS ); TRANSFER_SETTING( show_eco, FL_ECO ); - TRANSFER_SETTING( show_footprints_insert, FL_MODULE_ATTRIBUTES_NORMAL_INSERT ); - TRANSFER_SETTING( show_footprints_normal, FL_MODULE_ATTRIBUTES_NORMAL ); - TRANSFER_SETTING( show_footprints_virtual, FL_MODULE_ATTRIBUTES_VIRTUAL ); + TRANSFER_SETTING( show_footprints_insert, FL_FP_ATTRIBUTES_NORMAL_INSERT ); + TRANSFER_SETTING( show_footprints_normal, FL_FP_ATTRIBUTES_NORMAL ); + TRANSFER_SETTING( show_footprints_virtual, FL_FP_ATTRIBUTES_VIRTUAL ); TRANSFER_SETTING( show_silkscreen, FL_SILKSCREEN ); TRANSFER_SETTING( show_soldermask, FL_SOLDERMASK ); TRANSFER_SETTING( show_solderpaste, FL_SOLDERPASTE ); diff --git a/3d-viewer/3d_viewer/tools/3d_actions.cpp b/3d-viewer/3d_viewer/tools/3d_actions.cpp index a63537ccb8..128e7892b1 100644 --- a/3d-viewer/3d_viewer/tools/3d_actions.cpp +++ b/3d-viewer/3d_viewer/tools/3d_actions.cpp @@ -208,19 +208,19 @@ TOOL_ACTION EDA_3D_ACTIONS::attributesTHT( "3DViewer.Control.attributesTHT", AS_ACTIVE, 'T', "", _( "Toggle Through Hole 3D models" ), _( "Toggle 3D models with 'Through hole' attribute" ), - nullptr, AF_NONE, (void*) FL_MODULE_ATTRIBUTES_NORMAL ); + nullptr, AF_NONE, (void*) FL_FP_ATTRIBUTES_NORMAL ); TOOL_ACTION EDA_3D_ACTIONS::attributesSMD( "3DViewer.Control.attributesSMD", AS_ACTIVE, 'S', "", _( "Toggle SMD 3D models" ), _( "Toggle 3D models with 'Surface mount' attribute" ), - nullptr, AF_NONE, (void*) FL_MODULE_ATTRIBUTES_NORMAL_INSERT ); + nullptr, AF_NONE, (void*) FL_FP_ATTRIBUTES_NORMAL_INSERT ); TOOL_ACTION EDA_3D_ACTIONS::attributesVirtual( "3DViewer.Control.attributesVirtual", AS_ACTIVE, 'V', "", _( "Toggle Virtual 3D models" ), _( "Toggle 3D models with 'Virtual' attribute" ), - nullptr, AF_NONE, (void*) FL_MODULE_ATTRIBUTES_VIRTUAL ); + nullptr, AF_NONE, (void*) FL_FP_ATTRIBUTES_VIRTUAL ); TOOL_ACTION EDA_3D_ACTIONS::showBoundingBoxes( "3DViewer.Control.showBoundingBoxes", AS_GLOBAL, 0, "", diff --git a/pcbnew/autorouter/ar_autoplacer.cpp b/pcbnew/autorouter/ar_autoplacer.cpp index c8d7a6c5c3..8a7ef8a420 100644 --- a/pcbnew/autorouter/ar_autoplacer.cpp +++ b/pcbnew/autorouter/ar_autoplacer.cpp @@ -82,8 +82,8 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard ) m_board = aBoard; m_connectivity = std::make_unique( ); - for( auto mod : m_board->Modules() ) - m_connectivity->Add( mod ); + for( MODULE* footprint : m_board->Footprints() ) + m_connectivity->Add( footprint ); m_gridSize = Millimeter2iu( STEP_AR_MM ); m_progressReporter = nullptr; @@ -684,17 +684,17 @@ const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefModule, PAD* aRefPad, const wx const PAD* nearest = nullptr; int64_t nearestDist = INT64_MAX; - for ( auto mod : m_board->Modules() ) + for ( MODULE* footprint : m_board->Footprints() ) { - if ( mod == aRefModule ) + if ( footprint == aRefModule ) continue; - if( !m_matrix.m_BrdBox.Contains( mod->GetPosition() ) ) + if( !m_matrix.m_BrdBox.Contains( footprint->GetPosition() ) ) continue; - for ( auto pad: mod->Pads() ) + for( PAD* pad: footprint->Pads() ) { - if ( pad->GetNetCode() != aRefPad->GetNetCode() || pad->GetNetCode() <= 0 ) + if( pad->GetNetCode() != aRefPad->GetNetCode() || pad->GetNetCode() <= 0 ) continue; auto dist = (VECTOR2I( aRefPad->GetPosition() - aOffset ) - VECTOR2I( pad->GetPosition() ) ).EuclideanNorm(); @@ -786,10 +786,10 @@ MODULE* AR_AUTOPLACER::pickModule( ) std::vector moduleList; - for( auto m : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - m->CalculateBoundingBox(); - moduleList.push_back( m ); + footprint->CalculateBoundingBox(); + moduleList.push_back( footprint ); } sort( moduleList.begin(), moduleList.end(), sortFootprintsByComplexity ); @@ -898,40 +898,38 @@ AR_RESULT AR_AUTOPLACER::AutoplaceModules( std::vector& aModules, BOARD int moduleCount = 0; - for ( auto m : m_board->Modules() ) - { - m->SetNeedsPlaced( false ); - } + for( MODULE* footprint : m_board->Footprints() ) + footprint->SetNeedsPlaced( false ); std::vector offboardMods; if( aPlaceOffboardModules ) { - for( MODULE* m : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - if( !m_matrix.m_BrdBox.Contains( m->GetPosition() ) ) - offboardMods.push_back( m ); + if( !m_matrix.m_BrdBox.Contains( footprint->GetPosition() ) ) + offboardMods.push_back( footprint ); } } - for( MODULE* m : aModules ) + for( MODULE* footprint : aModules ) { - m->SetNeedsPlaced( true ); - aCommit->Modify(m); + footprint->SetNeedsPlaced( true ); + aCommit->Modify( footprint ); } - for( MODULE* m : offboardMods ) + for( MODULE* footprint : offboardMods ) { - m->SetNeedsPlaced( true ); - aCommit->Modify(m); + footprint->SetNeedsPlaced( true ); + aCommit->Modify( footprint ); } - for( MODULE* m : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - if( m->NeedsPlaced() ) // Erase from screen + if( footprint->NeedsPlaced() ) // Erase from screen moduleCount++; else - genModuleOnRoutingMatrix( m ); + genModuleOnRoutingMatrix( footprint ); } @@ -1079,8 +1077,8 @@ end_of_tst: m_matrix.UnInitRoutingMatrix(); - for( MODULE* m : m_board->Modules() ) - m->CalculateBoundingBox(); + for( MODULE* footprint : m_board->Footprints() ) + footprint->CalculateBoundingBox(); return cancelled ? AR_CANCELLED : AR_COMPLETED; } diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 76db4d8767..9be5ca1c96 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -107,10 +107,10 @@ BOARD::~BOARD() m_zones.clear(); - for( MODULE* m : m_modules ) - delete m; + for( MODULE* footprint : m_footprints ) + delete footprint; - m_modules.clear(); + m_footprints.clear(); for( TRACK* t : m_tracks ) delete t; @@ -514,7 +514,7 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID aLayer, bool isEnabled ) for( TRACK* track : Tracks() ) track->SetLocalRatsnestVisible( isEnabled ); - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads() ) pad->SetLocalRatsnestVisible( isEnabled ); @@ -598,9 +598,9 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) case PCB_MODULE_T: if( aMode == ADD_MODE::APPEND ) - m_modules.push_back( (MODULE*) aBoardItem ); + m_footprints.push_back((MODULE*) aBoardItem ); else - m_modules.push_front( (MODULE*) aBoardItem ); + m_footprints.push_front((MODULE*) aBoardItem ); break; @@ -677,11 +677,11 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem ) break; case PCB_MODULE_T: - m_modules.erase( std::remove_if( m_modules.begin(), m_modules.end(), - [aBoardItem]( BOARD_ITEM* aItem ) - { - return aItem == aBoardItem; - } ) ); + m_footprints.erase( std::remove_if( m_footprints.begin(), m_footprints.end(), + [aBoardItem]( BOARD_ITEM* aItem ) + { + return aItem == aBoardItem; + } ) ); break; case PCB_TRACE_T: @@ -768,7 +768,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const return track; } - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { if( footprint->m_Uuid == aID ) return footprint; @@ -844,7 +844,7 @@ void BOARD::FillItemMap( std::map& aMap ) for( TRACK* track : Tracks() ) aMap[ track->m_Uuid ] = track; - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { aMap[ footprint->m_Uuid ] = footprint; @@ -900,7 +900,7 @@ wxString BOARD::ConvertCrossReferencesToKIIDs( const wxString& aSource ) wxString remainder; wxString ref = token.BeforeFirst( ':', &remainder ); - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { if( footprint->GetReference().CmpNoCase( ref ) == 0 ) { @@ -975,7 +975,7 @@ unsigned BOARD::GetNodesCount( int aNet ) const { unsigned retval = 0; - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads() ) { @@ -1012,7 +1012,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const } // Check footprints - for( MODULE* footprint : m_modules ) + for( MODULE* footprint : m_footprints ) { if( !( footprint->GetLayerSet() & visible ).any() ) continue; @@ -1123,7 +1123,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s case PCB_FP_ZONE_T: // this calls MODULE::Visit() on each module. - result = IterateForward( m_modules, inspector, testData, p ); + result = IterateForward( m_footprints, inspector, testData, p ); // skip over any types handled in the above call. for( ; ; ) @@ -1254,7 +1254,7 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const MODULE* BOARD::FindModuleByReference( const wxString& aReference ) const { - for( MODULE* footprint : m_modules ) + for( MODULE* footprint : m_footprints ) { if( aReference == footprint->GetReference() ) return footprint; @@ -1266,7 +1266,7 @@ MODULE* BOARD::FindModuleByReference( const wxString& aReference ) const MODULE* BOARD::FindModuleByPath( const KIID_PATH& aPath ) const { - for( MODULE* footprint : m_modules ) + for( MODULE* footprint : m_footprints ) { if( footprint->GetPath() == aPath ) return footprint; @@ -1448,7 +1448,7 @@ PAD* BOARD::GetPad( const wxPoint& aPosition, LSET aLayerSet ) if( !aLayerSet.any() ) aLayerSet = LSET::AllCuMask(); - for( MODULE* footprint : m_modules ) + for( MODULE* footprint : m_footprints ) { PAD* pad = NULL; @@ -1475,7 +1475,7 @@ PAD* BOARD::GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint ) PAD* BOARD::GetPadFast( const wxPoint& aPosition, LSET aLayerSet ) { - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads() ) { @@ -1601,7 +1601,7 @@ bool sortPadsByXthenYCoord( PAD* const & ref, PAD* const & comp ) void BOARD::GetSortedPadListByXthenYCoord( std::vector& aVector, int aNetCode ) { - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads( ) ) { @@ -1676,7 +1676,7 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer int alt_min_dim = 0x7FFFFFFF; bool current_layer_back = IsBackLayer( aActiveLayer ); - for( MODULE* candidate : m_modules ) + for( MODULE* candidate : m_footprints ) { // is the ref point within the footprint's bounds? if( !candidate->HitTest( aPosition ) ) @@ -1740,7 +1740,7 @@ std::list BOARD::GetZoneList( bool aIncludeZonesInFootprints ) if( aIncludeZonesInFootprints ) { - for( MODULE* footprint : m_modules ) + for( MODULE* footprint : m_footprints ) { for( FP_ZONE* zone : footprint->Zones() ) zones.push_back( zone ); @@ -1860,7 +1860,7 @@ const std::vector BOARD::GetPads() const { std::vector allPads; - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads() ) allPads.push_back( pad ); @@ -1874,7 +1874,7 @@ unsigned BOARD::GetPadCount() const { unsigned retval = 0; - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) retval += footprint->Pads().size(); return retval; @@ -1888,7 +1888,7 @@ const std::vector BOARD::AllConnectedItems() for( TRACK* track : Tracks() ) items.push_back( track ); - for( MODULE* footprint : Modules() ) + for( MODULE* footprint : Footprints() ) { for( PAD* pad : footprint->Pads() ) items.push_back( pad ); diff --git a/pcbnew/board.h b/pcbnew/board.h index c1c5c53ec8..1986de9666 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -194,7 +194,7 @@ private: wxString m_fileName; MARKERS m_markers; DRAWINGS m_drawings; - MODULES m_modules; + MODULES m_footprints; TRACKS m_tracks; GROUPS m_groups; ZONES m_zones; @@ -281,8 +281,8 @@ public: TRACKS& Tracks() { return m_tracks; } const TRACKS& Tracks() const { return m_tracks; } - MODULES& Modules() { return m_modules; } - const MODULES& Modules() const { return m_modules; } + MODULES& Footprints() { return m_footprints; } + const MODULES& Footprints() const { return m_footprints; } DRAWINGS& Drawings() { return m_drawings; } const DRAWINGS& Drawings() const { return m_drawings; } @@ -328,7 +328,7 @@ public: bool IsEmpty() const { - return m_drawings.empty() && m_modules.empty() && m_tracks.empty() && m_zones.empty(); + return m_drawings.empty() && m_footprints.empty() && m_tracks.empty() && m_zones.empty(); } void Move( const wxPoint& aMoveVector ) override; @@ -347,7 +347,7 @@ public: */ MODULE* GetFirstFootprint() const { - return m_modules.empty() ? nullptr : m_modules.front(); + return m_footprints.empty() ? nullptr : m_footprints.front(); } /** @@ -355,10 +355,10 @@ public: */ void DeleteAllModules() { - for( MODULE* mod : m_modules ) - delete mod; + for( MODULE* footprint : m_footprints ) + delete footprint; - m_modules.clear(); + m_footprints.clear(); } /** diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 1cf7b3fecf..a49c8a2fdc 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -143,10 +143,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a // footprints inside footprints are not supported yet wxASSERT( boardItem->Type() != PCB_MODULE_T ); - boardItem->SetParent( board->Modules().front() ); + boardItem->SetParent( board->Footprints().front() ); if( !( changeFlags & CHT_DONE ) ) - board->Modules().front()->Add( boardItem ); + board->Footprints().front()->Add( boardItem ); } else if( boardItem->Type() == PCB_FP_TEXT_T || boardItem->Type() == PCB_FP_SHAPE_T || diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 4c85e9059b..48668561d5 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -77,14 +77,14 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_ } // convert pads - for( MODULE* module : m_modules ) + for( MODULE* footprint : m_footprints ) { - module->TransformPadsShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, - ERROR_INSIDE ); + footprint->TransformPadsShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, + ERROR_INSIDE ); // Micro-wave footprints may have items on copper layers - module->TransformGraphicShapesWithClearanceToPolygonSet( aOutlines, aLayer, 0, maxError, - ERROR_INSIDE ); + footprint->TransformGraphicShapesWithClearanceToPolygonSet( aOutlines, aLayer, 0, maxError, + ERROR_INSIDE ); } // convert copper zones diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index 7b30266e2e..2716b2bd49 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -74,7 +74,7 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) FILE* fp_bom; wxString msg; - if( GetBoard()->Modules().empty() ) + if( GetBoard()->Footprints().empty() ) { ShowInfoBarError( _( "Cannot export BOM: there are no footprints on the PCB." ) ); return; @@ -119,7 +119,7 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) CmpList::iterator iter; int i = 1; - for( MODULE* module : GetBoard()->Modules() ) + for( MODULE* fp : GetBoard()->Footprints() ) { bool valExist = false; @@ -128,10 +128,10 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) { cmp* current = *iter; - if( (current->m_Val == module->GetValue()) && (current->m_fpid == module->GetFPID()) ) + if( (current->m_Val == fp->GetValue()) && (current->m_fpid == fp->GetFPID()) ) { current->m_Ref.Append( wxT( ", " ), 1 ); - current->m_Ref.Append( module->Reference().GetShownText() ); + current->m_Ref.Append( fp->Reference().GetShownText() ); current->m_CmpCount++; valExist = true; @@ -144,9 +144,9 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) { comp = new cmp(); comp->m_Id = i++; - comp->m_Val = module->Value().GetShownText(); - comp->m_Ref = module->Reference().GetShownText(); - comp->m_fpid = module->GetFPID(); + comp->m_Val = fp->Value().GetShownText(); + comp->m_Ref = fp->Reference().GetShownText(); + comp->m_fpid = fp->GetFPID(); comp->m_CmpCount = 1; list.Append( comp ); } diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index 47ec8b0e21..0ef858c910 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -433,8 +433,8 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter ) size += aBoard->Zones().size(); size += aBoard->Tracks().size(); - for( MODULE* mod : aBoard->Modules() ) - size += mod->Pads().size(); + for( MODULE* footprint : aBoard->Footprints() ) + size += footprint->Pads().size(); size *= 2; // Our caller us gets the other half of the progress bar @@ -450,7 +450,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter ) reportProgress( aReporter, ii++, size, delta ); } - for( MODULE* footprint : aBoard->Modules() ) + for( MODULE* footprint : aBoard->Footprints() ) { for( PAD* pad : footprint->Pads() ) { diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index fe5bd69e12..2790859301 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -35,15 +35,15 @@ void FROM_TO_CACHE::buildEndpointList( ) { m_ftEndpoints.clear(); - for( auto mod : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( auto pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { FT_ENDPOINT ent; - ent.name = mod->GetReference() + "-" + pad->GetName(); + ent.name = footprint->GetReference() + "-" + pad->GetName(); ent.parent = pad; m_ftEndpoints.push_back( ent ); - ent.name = mod->GetReference(); + ent.name = footprint->GetReference(); ent.parent = pad; m_ftEndpoints.push_back( ent ); } diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index 5031076b19..282bf416e7 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -250,15 +250,17 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( crossProbingSettings.center_on_items ) { - for( auto zone : pcb->Zones() ) + for( ZONE* zone : pcb->Zones() ) merge_area( zone ); - for( auto track : pcb->Tracks() ) + for( TRACK* track : pcb->Tracks() ) merge_area( track ); - for( auto mod : pcb->Modules() ) - for( auto mod_pad : mod->Pads() ) - merge_area( mod_pad ); + for( MODULE* footprint : pcb->Footprints() ) + { + for( PAD* pad : footprint->Pads() ) + merge_area( pad ); + } } } else @@ -508,7 +510,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) NETLIST netlist; STRING_FORMATTER sf; - for( MODULE* module : this->GetBoard()->Modules() ) + for( MODULE* module : this->GetBoard()->Footprints() ) { COMPONENT* component = new COMPONENT( module->GetFPID(), module->GetReference(), module->GetValue(), module->GetPath() ); diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 69ca139b4f..412970cddd 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -97,7 +97,7 @@ wxString ActionMessage[] = { DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame ) : DIALOG_BOARD_REANNOTATE_BASE( aParentFrame ), - m_modules( aParentFrame->GetBoard()->Modules() ) + m_modules( aParentFrame->GetBoard()->Footprints() ) { m_Config = Kiface().KifaceSettings(); InitValues(); @@ -706,7 +706,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildModuleList( std::vector& aBadRefD m_FrontModules.clear(); m_BackModules.clear(); m_ExcludeArray.clear(); - m_modules = m_frame->GetBoard()->Modules(); + m_modules = m_frame->GetBoard()->Footprints(); std::vector selected; diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 816895bdbe..8fab523731 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -181,18 +181,18 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() BOARD* board = m_parentFrame->GetBoard(); // Get footprints and pads count - for( MODULE* module : board->Modules() ) + for( MODULE* footprint : board->Footprints() ) { // Do not proceed footprints with no pads if checkbox checked - if( m_checkBoxExcludeComponentsNoPins->GetValue() && ! module->Pads().size() ) + if( m_checkBoxExcludeComponentsNoPins->GetValue() && ! footprint->Pads().size() ) continue; // Go through components types list for( auto& type : m_componentsTypes ) { - if( ( module->GetAttributes() & type.attribute ) > 0 ) + if(( footprint->GetAttributes() & type.attribute ) > 0 ) { - if( module->IsFlipped() ) + if( footprint->IsFlipped() ) type.backSideQty++; else type.frontSideQty++; @@ -200,7 +200,7 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() } } - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { // Go through pads types list for( auto& type : m_padsTypes ) @@ -229,10 +229,11 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() } drillType_t drill( pad->GetDrillSize().x, pad->GetDrillSize().y, - pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB_NPTH, - true, top, bottom ); + pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB_NPTH, + true, top, bottom ); auto it = m_drillTypes.begin(); + for( ; it != m_drillTypes.end(); it++ ) { if( *it == drill ) @@ -267,9 +268,10 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() } drillType_t drill( via->GetDrillValue(), via->GetDrillValue(), PAD_DRILL_SHAPE_CIRCLE, - true, false, via->TopLayer(), via->BottomLayer() ); + true, false, via->TopLayer(), via->BottomLayer() ); auto it = m_drillTypes.begin(); + for( ; it != m_drillTypes.end(); it++ ) { if( *it == drill ) @@ -289,7 +291,7 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB() } sort( m_drillTypes.begin(), m_drillTypes.end(), - drillType_t::COMPARE( drillType_t::COL_COUNT, false ) ); + drillType_t::COMPARE( drillType_t::COL_COUNT, false ) ); bool boundingBoxCreated = false; //flag if bounding box initialized BOX2I bbox; diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index c7a97ba16f..cde387583d 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -313,7 +313,7 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints() LIB_ID newFPID; wxString value; - if( m_parent->GetBoard()->Modules().empty() ) + if( m_parent->GetBoard()->Footprints().empty() ) return false; if( !m_updateMode ) @@ -327,8 +327,8 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints() /* The change is done from the last footprint because processFootprint() modifies the last * item in the list. */ - for( auto it = m_parent->GetBoard()->Modules().rbegin(); - it != m_parent->GetBoard()->Modules().rend(); it++ ) + for( auto it = m_parent->GetBoard()->Footprints().rbegin(); + it != m_parent->GetBoard()->Footprints().rend(); it++ ) { auto mod = *it; diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index 96f1f65da9..9a595b2e72 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -220,26 +220,25 @@ void DIALOG_FIND::search( bool aDirection ) if( FindIncludeTexts || FindIncludeValues || FindIncludeReferences ) { - for( MODULE* module : m_frame->GetBoard()->Modules() ) + for( MODULE* fp : m_frame->GetBoard()->Footprints() ) { - if( ( module->Reference().Matches( m_frame->GetFindReplaceData(), nullptr ) - && FindIncludeReferences ) - || ( module->Value().Matches( m_frame->GetFindReplaceData(), nullptr ) - && FindIncludeValues ) ) + if( ( fp->Reference().Matches( m_frame->GetFindReplaceData(), nullptr ) + && FindIncludeReferences ) + || ( fp->Value().Matches( m_frame->GetFindReplaceData(), nullptr ) + && FindIncludeValues ) ) { - m_hitList.push_back( module ); + m_hitList.push_back( fp ); } if( m_includeTexts->GetValue() ) { - for( BOARD_ITEM* item : module->GraphicalItems() ) + for( BOARD_ITEM* item : fp->GraphicalItems() ) { FP_TEXT* textItem = dynamic_cast( item ); - if( textItem - && textItem->Matches( m_frame->GetFindReplaceData(), nullptr ) ) + if( textItem && textItem->Matches( m_frame->GetFindReplaceData(), nullptr ) ) { - m_hitList.push_back( module ); + m_hitList.push_back( fp ); } } } diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 1f1f85dcee..7e2823fbbb 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -139,9 +139,9 @@ void DIALOG_GENDRILL::InitDisplayParams() m_microViasCount = 0; m_blindOrBuriedViasCount = 0; - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( pad->GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE ) { @@ -169,6 +169,7 @@ void DIALOG_GENDRILL::InitDisplayParams() for( TRACK* track : m_board->Tracks() ) { const VIA *via = dynamic_cast( track ); + if( via ) { switch( via->GetViaType() ) @@ -262,8 +263,11 @@ void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event ) void DIALOG_GENDRILL::UpdatePrecisionOptions() { - if( m_Choice_Unit->GetSelection()== 1 ) // Units = inches + if( m_Choice_Unit->GetSelection()== 1 ) + { + // Units = inches m_staticTextPrecision->SetLabel( precisionListForInches.GetPrecisionString() ); + } else { // metric options diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 6a8799a2fc..940c598c93 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -170,7 +170,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete() if( delAll || m_DelModules->GetValue() ) { - for( auto item : pcb->Modules() ) + for( MODULE* item : pcb->Footprints() ) { bool del_fp = delAll; diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index 11ad023053..ba76fab6ca 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -378,7 +378,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() BOARD_COMMIT commit( m_parent ); // Go through the footprints - for( MODULE* fp : m_parent->GetBoard()->Modules() ) + for( MODULE* fp : m_parent->GetBoard()->Footprints() ) { if( m_references->GetValue() ) visitItem( commit, &fp->Reference() ); diff --git a/pcbnew/dialogs/dialog_net_inspector.cpp b/pcbnew/dialogs/dialog_net_inspector.cpp index 6fddf8d0c1..e75d8da990 100644 --- a/pcbnew/dialogs/dialog_net_inspector.cpp +++ b/pcbnew/dialogs/dialog_net_inspector.cpp @@ -1471,7 +1471,7 @@ void DIALOG_NET_INSPECTOR::buildNetsList() // count the pads for each net. since the nets are sorted by netcode // iterating over the modules' pads is faster. - for( MODULE* footprint : m_brd->Modules() ) + for( MODULE* footprint : m_brd->Footprints() ) { for( PAD* pad : footprint->Pads() ) { diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.cpp b/pcbnew/dialogs/dialog_unused_pad_layers.cpp index 5ea16e6bc1..9b2409a723 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.cpp +++ b/pcbnew/dialogs/dialog_unused_pad_layers.cpp @@ -90,7 +90,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow() { if( m_cbSelectedOnly->IsChecked() ) { - for( auto item : m_items ) + for( EDA_ITEM* item : m_items ) { m_commit.Modify( item ); @@ -103,9 +103,9 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow() if( item->Type() == PCB_MODULE_T && m_rbScope->GetSelection() == SCOPE_PADS ) { - MODULE* mod = static_cast( item ); + MODULE* footprint = static_cast( item ); - for( auto pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { pad->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE ); pad->SetKeepTopBottom( m_cbPreservePads->IsChecked() ); @@ -125,12 +125,11 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow() { if( m_rbScope->GetSelection() == SCOPE_PADS ) { - for( auto item : m_frame->GetBoard()->Modules() ) + for( MODULE* footprint : m_frame->GetBoard()->Footprints() ) { - m_commit.Modify( item ); - MODULE* mod = static_cast( item ); + m_commit.Modify( footprint ); - for( auto pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { pad->SetRemoveUnconnected( m_rbAction->GetSelection() == PAD_ACTION_REMOVE ); pad->SetKeepTopBottom( m_cbPreservePads->IsChecked() ); @@ -139,7 +138,7 @@ bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow() } else { - for( auto item : m_frame->GetBoard()->Tracks() ) + for( TRACK* item : m_frame->GetBoard()->Tracks() ) { if( item->Type() != PCB_VIA_T ) continue; diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 4101a665aa..5eb6d2df0b 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -365,7 +365,7 @@ void DRC_ENGINE::loadImplicitRules() keepoutZones.push_back( zone ); } - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { for( ZONE* zone : footprint->Zones() ) { @@ -659,7 +659,7 @@ void DRC_ENGINE::RunTests( EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aT for( ZONE* zone : m_board->Zones() ) zone->CacheBoundingBox(); - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( ZONE* zone : module->Zones() ) zone->CacheBoundingBox(); diff --git a/pcbnew/drc/drc_test_provider.cpp b/pcbnew/drc/drc_test_provider.cpp index e36bd50217..5d833ae288 100644 --- a/pcbnew/drc/drc_test_provider.cpp +++ b/pcbnew/drc/drc_test_provider.cpp @@ -218,7 +218,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, { for( ZONE* item : brd->Zones() ) { - if( (item->GetLayerSet() & aLayers).any() ) + if( ( item->GetLayerSet() & aLayers ).any() ) { if( !aFunc( item ) ) return n; @@ -228,21 +228,21 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, } } - for( MODULE* mod : brd->Modules() ) + for( MODULE* footprint : brd->Footprints() ) { if( typeMask[ PCB_FP_TEXT_T ] ) { - if( (mod->Reference().GetLayerSet() & aLayers).any() ) + if( ( footprint->Reference().GetLayerSet() & aLayers ).any() ) { - if( !aFunc( &mod->Reference() ) ) + if( !aFunc( &footprint->Reference() ) ) return n; n++; } - if( (mod->Value().GetLayerSet() & aLayers).any() ) + if( ( footprint->Value().GetLayerSet() & aLayers ).any() ) { - if( !aFunc( &mod->Value() ) ) + if( !aFunc( &footprint->Value() ) ) return n; n++; @@ -251,7 +251,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, if( typeMask[ PCB_PAD_T ] ) { - for( PAD* pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( ( pad->GetLayerSet() & aLayers ).any() ) { @@ -263,7 +263,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, } } - for( BOARD_ITEM* dwg : mod->GraphicalItems() ) + for( BOARD_ITEM* dwg : footprint->GraphicalItems() ) { if( (dwg->GetLayerSet() & aLayers).any() ) { @@ -286,7 +286,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, if( typeMask[ PCB_FP_ZONE_T ] ) { - for( ZONE* zone : mod->Zones() ) + for( ZONE* zone : footprint->Zones() ) { if( (zone->GetLayerSet() & aLayers).any() ) { @@ -300,7 +300,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, if( typeMask[ PCB_MODULE_T ] ) { - if( !aFunc( mod ) ) + if( !aFunc( footprint ) ) return n; n++; diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index 0d3be48b8e..0dc4cbc496 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -127,7 +127,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run() m_zones.push_back( zone ); } - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { for( ZONE* zone : footprint->Zones() ) { @@ -513,16 +513,16 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( ) size_t count = 0; - for( MODULE* module : m_board->Modules() ) - count += module->Pads().size(); + for( MODULE* footprint : m_board->Footprints() ) + count += footprint->Pads().size(); reportAux( "Testing %d pads...", count ); int ii = 0; - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( !reportProgress( ii++, count, delta ) ) break; diff --git a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp index 88852ff9bb..a57a61d580 100644 --- a/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_courtyard_clearance.cpp @@ -82,9 +82,9 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions() int ii = 0; - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - if( !reportProgress( ii++, m_board->Modules().size(), delta ) ) + if( !reportProgress( ii++, m_board->Footprints().size(), delta ) ) return; if( ( footprint->GetFlags() & MALFORMED_COURTYARD ) != 0 ) @@ -128,9 +128,9 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards() int ii = 0; - for( auto it1 = m_board->Modules().begin(); it1 != m_board->Modules().end(); it1++ ) + for( auto it1 = m_board->Footprints().begin(); it1 != m_board->Footprints().end(); it1++ ) { - if( !reportProgress( ii++, m_board->Modules().size(), delta ) ) + if( !reportProgress( ii++, m_board->Footprints().size(), delta ) ) break; if( m_drcEngine->IsErrorLimitExceeded( DRCE_OVERLAPPING_FOOTPRINTS) ) @@ -143,7 +143,7 @@ void DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testOverlappingComponentCourtyards() if( footprintFront.OutlineCount() == 0 && footprintBack.OutlineCount() == 0 ) continue; // No courtyards defined - for( auto it2 = it1 + 1; it2 != m_board->Modules().end(); it2++ ) + for( auto it2 = it1 + 1; it2 != m_board->Footprints().end(); it2++ ) { MODULE* test = *it2; SHAPE_POLY_SET& testFront = test->GetPolyCourtyardFront(); diff --git a/pcbnew/drc/drc_test_provider_hole_clearance.cpp b/pcbnew/drc/drc_test_provider_hole_clearance.cpp index 0dd572206d..95fec7bf2c 100644 --- a/pcbnew/drc/drc_test_provider_hole_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_hole_clearance.cpp @@ -196,7 +196,7 @@ bool DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run() via->SetFlags( SKIP_STRUCT ); } - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { for( PAD* pad : footprint->Pads() ) { diff --git a/pcbnew/drc/drc_test_provider_hole_size.cpp b/pcbnew/drc/drc_test_provider_hole_size.cpp index 36ee0e1a09..3df1ac237b 100644 --- a/pcbnew/drc/drc_test_provider_hole_size.cpp +++ b/pcbnew/drc/drc_test_provider_hole_size.cpp @@ -81,12 +81,12 @@ bool DRC_TEST_PROVIDER_HOLE_SIZE::Run() m_board = m_drcEngine->GetBoard(); - for( MODULE* module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_TOO_SMALL_DRILL ) ) break; - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_TOO_SMALL_DRILL ) ) break; diff --git a/pcbnew/drc/drc_test_provider_lvs.cpp b/pcbnew/drc/drc_test_provider_lvs.cpp index 3e5b53ac72..90c3dbe12c 100644 --- a/pcbnew/drc/drc_test_provider_lvs.cpp +++ b/pcbnew/drc/drc_test_provider_lvs.cpp @@ -85,22 +85,22 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) return x->GetReference().CmpNoCase( y->GetReference() ) < 0; }; - auto mods = std::set( compare ); + auto footprints = std::set( compare ); // Search for duplicate footprints on the board - for( MODULE* mod : board->Modules() ) + for( MODULE* footprint : board->Footprints() ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_DUPLICATE_FOOTPRINT ) ) break; - auto ins = mods.insert( mod ); + auto ins = footprints.insert( footprint ); if( !ins.second ) { std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_DUPLICATE_FOOTPRINT ); - drcItem->SetItems( mod, *ins.first ); + drcItem->SetItems( footprint, *ins.first ); - reportViolation( drcItem, mod->GetPosition() ); + reportViolation( drcItem, footprint->GetPosition() ); } } @@ -108,9 +108,9 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) for( unsigned ii = 0; ii < aNetlist.GetCount(); ii++ ) { COMPONENT* component = aNetlist.GetComponent( ii ); - MODULE* module = board->FindModuleByReference( component->GetReference() ); + MODULE* footprint = board->FindModuleByReference( component->GetReference() ); - if( module == nullptr ) + if( footprint == nullptr ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_MISSING_FOOTPRINT ) ) break; @@ -126,7 +126,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) } else { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_NET_CONFLICT ) ) break; @@ -141,7 +141,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( m_msg ); drcItem->SetItems( pad ); - reportViolation( drcItem, module->GetPosition() ); + reportViolation( drcItem, footprint->GetPosition() ); } else if( pcb_netname.IsEmpty() && !sch_net.GetNetName().IsEmpty() ) { @@ -151,7 +151,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( m_msg ); drcItem->SetItems( pad ); - reportViolation( drcItem, module->GetPosition() ); + reportViolation( drcItem, footprint->GetPosition() ); } else if( pcb_netname != sch_net.GetNetName() ) { @@ -162,7 +162,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( m_msg ); drcItem->SetItems( pad ); - reportViolation( drcItem, module->GetPosition() ); + reportViolation( drcItem, footprint->GetPosition() ); } } @@ -173,35 +173,35 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) const COMPONENT_NET& sch_net = component->GetNet( jj ); - if( !module->FindPadByName( sch_net.GetPinName() ) ) + if( !footprint->FindPadByName( sch_net.GetPinName() ) ) { m_msg.Printf( _( "No pad found for pin %s in schematic." ), sch_net.GetPinName() ); std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( m_msg ); - drcItem->SetItems( module ); - reportViolation( drcItem, module->GetPosition() ); + drcItem->SetItems( footprint ); + reportViolation( drcItem, footprint->GetPosition() ); } } } } // Search for component footprints found on board but not in netlist. - for( MODULE* module : board->Modules() ) + for( MODULE* footprint : board->Footprints() ) { if( m_drcEngine->IsErrorLimitExceeded( DRCE_EXTRA_FOOTPRINT ) ) break; - if( module->GetAttributes() & MOD_BOARD_ONLY ) + if( footprint->GetAttributes() & MOD_BOARD_ONLY ) continue; - if( !aNetlist.GetComponentByReference( module->GetReference() ) ) + if( !aNetlist.GetComponentByReference( footprint->GetReference() ) ) { std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_EXTRA_FOOTPRINT ); - drcItem->SetItems( module ); - reportViolation( drcItem, module->GetPosition() ); + drcItem->SetItems( footprint ); + reportViolation( drcItem, footprint->GetPosition() ); } } } diff --git a/pcbnew/exporters/export_d356.cpp b/pcbnew/exporters/export_d356.cpp index 514ff9359b..720624e0a4 100644 --- a/pcbnew/exporters/export_d356.cpp +++ b/pcbnew/exporters/export_d356.cpp @@ -94,9 +94,9 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector & aRecor { wxPoint origin = aPcb->GetDesignSettings().m_AuxOrigin; - for( auto module : aPcb->Modules() ) + for( MODULE* footprint : aPcb->Footprints() ) { - for( auto pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { D356_RECORD rk; rk.access = compute_pad_access_code( aPcb, pad->GetLayerSet() ); @@ -106,7 +106,7 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector & aRecor { rk.netname = pad->GetNetname(); rk.pin = pad->GetName(); - rk.refdes = module->GetReference(); + rk.refdes = footprint->GetReference(); rk.midpoint = false; // XXX MAYBE need to be computed (how?) const wxSize& drill = pad->GetDrillSize(); rk.drill = std::min( drill.x, drill.y ); diff --git a/pcbnew/exporters/export_footprint_associations.cpp b/pcbnew/exporters/export_footprint_associations.cpp index 861139b1c4..1509b638ac 100644 --- a/pcbnew/exporters/export_footprint_associations.cpp +++ b/pcbnew/exporters/export_footprint_associations.cpp @@ -39,16 +39,16 @@ bool RecreateCmpFile( BOARD * aBrd, const wxString& aFullCmpFileName ) fprintf( cmpFile, "Cmp-Mod V01 Created by PcbNew date = %s\n", TO_UTF8( DateAndTime() ) ); - for( auto module : aBrd->Modules() ) + for( MODULE* fp : aBrd->Footprints() ) { fprintf( cmpFile, "\nBeginCmp\n" ); - fprintf( cmpFile, "TimeStamp = %s\n", TO_UTF8( module->m_Uuid.AsString() ) ); - fprintf( cmpFile, "Path = %s\n", TO_UTF8( module->GetPath().AsString() ) ); + fprintf( cmpFile, "TimeStamp = %s\n", TO_UTF8( fp->m_Uuid.AsString() ) ); + fprintf( cmpFile, "Path = %s\n", TO_UTF8( fp->GetPath().AsString() ) ); fprintf( cmpFile, "Reference = %s;\n", - !module->GetReference().IsEmpty() ? TO_UTF8( module->GetReference() ) : "[NoRef]" ); + !fp->GetReference().IsEmpty() ? TO_UTF8( fp->GetReference() ) : "[NoRef]" ); fprintf( cmpFile, "ValeurCmp = %s;\n", - !module->GetValue().IsEmpty() ? TO_UTF8( module->GetValue() ) : "[NoVal]" ); - fprintf( cmpFile, "IdModule = %s;\n", module->GetFPID().Format().c_str() ); + !fp->GetValue().IsEmpty() ? TO_UTF8( fp->GetValue() ) : "[NoVal]" ); + fprintf( cmpFile, "IdModule = %s;\n", fp->GetFPID().Format().c_str() ); fprintf( cmpFile, "EndCmp\n" ); } diff --git a/pcbnew/exporters/export_footprints_placefile.cpp b/pcbnew/exporters/export_footprints_placefile.cpp index a9d1e200dd..d2fc94ccbc 100644 --- a/pcbnew/exporters/export_footprints_placefile.cpp +++ b/pcbnew/exporters/export_footprints_placefile.cpp @@ -113,7 +113,7 @@ std::string PLACE_FILE_EXPORTER::GenPositionData() // Build and sort the list of footprints alphabetically std::vector list; - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { if( m_side != PCB_BOTH_SIDES ) { @@ -303,61 +303,61 @@ std::string PLACE_FILE_EXPORTER::GenReportData() buffer += "$EndBOARD\n\n"; - std::vector sortedModules; + std::vector sortedFootprints; - for( MODULE* module : m_board->Modules() ) - sortedModules.push_back( module ); + for( MODULE* footprint : m_board->Footprints() ) + sortedFootprints.push_back( footprint ); - std::sort( sortedModules.begin(), sortedModules.end(), + std::sort( sortedFootprints.begin(), sortedFootprints.end(), []( MODULE* a, MODULE* b ) -> bool { return StrNumCmp( a->GetReference(), b->GetReference(), true ) < 0; }); - for( MODULE* module : sortedModules ) + for( MODULE* footprint : sortedFootprints ) { - wxString ref = module->Reference().GetShownText(); + wxString ref = footprint->Reference().GetShownText(); sprintf( line, "$MODULE %s\n", TO_UTF8( ref ) ); buffer += line; sprintf( line, "reference %s\n", TO_UTF8( ref ) ); - sprintf( line, "value %s\n", EscapedUTF8( module->Value().GetShownText() ).c_str() ); - sprintf( line, "footprint %s\n", module->GetFPID().Format().c_str() ); + sprintf( line, "value %s\n", EscapedUTF8( footprint->Value().GetShownText() ).c_str() ); + sprintf( line, "footprint %s\n", footprint->GetFPID().Format().c_str() ); buffer += line; buffer += "attribut"; - if( ( module->GetAttributes() & ( MOD_THROUGH_HOLE | MOD_SMD ) ) == 0 ) + if(( footprint->GetAttributes() & ( MOD_THROUGH_HOLE | MOD_SMD ) ) == 0 ) buffer += " virtual"; - if( module->GetAttributes() & MOD_SMD ) + if( footprint->GetAttributes() & MOD_SMD ) buffer += " smd"; - if( module->GetAttributes() & MOD_THROUGH_HOLE ) + if( footprint->GetAttributes() & MOD_THROUGH_HOLE ) buffer += " none"; buffer += "\n"; - wxPoint module_pos = module->GetPosition(); + wxPoint module_pos = footprint->GetPosition(); module_pos -= m_place_Offset; sprintf( line, "position %9.6f %9.6f orientation %.2f\n", module_pos.x * conv_unit, module_pos.y * conv_unit, - module->GetOrientation() / 10.0 ); + footprint->GetOrientation() / 10.0 ); buffer += line; - if( module->GetLayer() == F_Cu ) + if( footprint->GetLayer() == F_Cu ) buffer += "layer front\n"; - else if( module->GetLayer() == B_Cu ) + else if( footprint->GetLayer() == B_Cu ) buffer += "layer back\n"; else buffer += "layer other\n"; std::vector sortedPads; - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) sortedPads.push_back( pad ); std::sort( sortedPads.begin(), sortedPads.end(), @@ -390,7 +390,7 @@ std::string PLACE_FILE_EXPORTER::GenReportData() pad->GetPos0().y * conv_unit, pad->GetSize().x * conv_unit, pad->GetSize().y * conv_unit, - ( pad->GetOrientation() - module->GetOrientation()) / 10.0 ); + ( pad->GetOrientation() - footprint->GetOrientation()) / 10.0 ); buffer += line; sprintf( line, "drill %9.6f\n", pad->GetDrillSize().x * conv_unit ); diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 186391121b..1f36c6e9f1 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -275,14 +275,14 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent ) */ BOARD* pcb = GetBoard(); - for( MODULE* module : pcb->Modules() ) + for( MODULE* footprint : pcb->Footprints() ) { - module->SetFlag( 0 ); + footprint->SetFlag( 0 ); - if( module->GetLayer() == B_Cu ) + if( footprint->GetLayer() == B_Cu ) { - module->Flip( module->GetPosition(), Settings().m_FlipLeftRight ); - module->SetFlag( 1 ); + footprint->Flip( footprint->GetPosition(), Settings().m_FlipLeftRight ); + footprint->SetFlag( 1 ); } } @@ -311,12 +311,12 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent ) fclose( file ); // Undo the footprints modifications (flipped footprints) - for( auto module : pcb->Modules() ) + for( MODULE* footprint : pcb->Footprints() ) { - if( module->GetFlag() ) + if( footprint->GetFlag() ) { - module->Flip( module->GetPosition(), Settings().m_FlipLeftRight ); - module->SetFlag( 0 ); + footprint->Flip( footprint->GetPosition(), Settings().m_FlipLeftRight ); + footprint->SetFlag( 0 ); } } @@ -694,7 +694,7 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb ) fputs( "$SHAPES\n", aFile ); - for( MODULE* module : aPcb->Modules() ) + for( MODULE* footprint : aPcb->Footprints() ) { if( !individualShapes ) { @@ -702,10 +702,10 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb ) // It is necessary to compute hash (i.e. check all children objects) as // certain components instances might have been modified on the board. // In such case the shape will be different despite the same LIB_ID. - wxString shapeName = module->GetFPID().Format(); + wxString shapeName = footprint->GetFPID().Format(); auto shapeIt = shapes.find( shapeName ); - size_t modHash = hashModule( module ); + size_t modHash = hashModule( footprint ); if( shapeIt != shapes.end() ) { @@ -731,26 +731,26 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb ) if( shapeIt != shapes.end() && modHash == shapeIt->second ) { // shape found, so reuse it - componentShapes[module] = modHash; + componentShapes[footprint] = modHash; continue; } } // new shape - componentShapes[module] = modHash; + componentShapes[footprint] = modHash; shapeNames[modHash] = shapeName; shapes[shapeName] = modHash; - FootprintWriteShape( aFile, module, shapeName ); + FootprintWriteShape( aFile, footprint, shapeName ); } else // individual shape for each component { - FootprintWriteShape( aFile, module, module->GetReference() ); + FootprintWriteShape( aFile, footprint, footprint->GetReference() ); } // set of already emitted pins to check for duplicates std::set pins; - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { /* Padstacks are defined using the correct layers for the pads, therefore to * all pads need to be marked as TOP to use the padstack information correctly. @@ -778,11 +778,11 @@ static void CreateShapesSection( FILE* aFile, BOARD* aPcb ) pins.insert( pinname ); } - double orient = pad->GetOrientation() - module->GetOrientation(); + double orient = pad->GetOrientation() - footprint->GetOrientation(); NORMALIZE_ANGLE_POS( orient ); // Bottom side footprints use the flipped padstack - fprintf( aFile, ( flipBottomPads && module->GetFlag() ) ? + fprintf( aFile, ( flipBottomPads && footprint->GetFlag() ) ? "PIN \"%s\" PAD%dF %g %g %s %g %s\n" : "PIN \"%s\" PAD%d %g %g %s %g %s\n", TO_UTF8( escapeString( pinname ) ), pad->GetSubRatsnest(), @@ -807,13 +807,13 @@ static void CreateComponentsSection( FILE* aFile, BOARD* aPcb ) int cu_count = aPcb->GetCopperLayerCount(); - for( MODULE* module : aPcb->Modules() ) + for( MODULE* footprint : aPcb->Footprints() ) { const char* mirror; const char* flip; - double fp_orient = module->GetOrientation(); + double fp_orient = footprint->GetOrientation(); - if( module->GetFlag() ) + if( footprint->GetFlag() ) { mirror = "MIRRORX"; flip = "FLIP"; @@ -826,25 +826,25 @@ static void CreateComponentsSection( FILE* aFile, BOARD* aPcb ) } fprintf( aFile, "\nCOMPONENT \"%s\"\n", - TO_UTF8( escapeString( module->GetReference() ) ) ); + TO_UTF8( escapeString( footprint->GetReference() ) ) ); fprintf( aFile, "DEVICE \"DEV_%s\"\n", - TO_UTF8( escapeString( getShapeName( module ) ) ) ); + TO_UTF8( escapeString( getShapeName( footprint ) ) ) ); fprintf( aFile, "PLACE %g %g\n", - MapXTo( module->GetPosition().x ), - MapYTo( module->GetPosition().y ) ); + MapXTo( footprint->GetPosition().x ), + MapYTo( footprint->GetPosition().y ) ); fprintf( aFile, "LAYER %s\n", - module->GetFlag() ? "BOTTOM" : "TOP" ); + footprint->GetFlag() ? "BOTTOM" : "TOP" ); fprintf( aFile, "ROTATION %g\n", fp_orient / 10.0 ); fprintf( aFile, "SHAPE \"%s\" %s %s\n", - TO_UTF8( escapeString( getShapeName( module ) ) ), + TO_UTF8( escapeString( getShapeName( footprint ) ) ), mirror, flip ); // Text on silk layer: RefDes and value (are they actually useful?) - for( FP_TEXT* textItem : { &module->Reference(), &module->Value() } ) + for( FP_TEXT* textItem : { &footprint->Reference(), &footprint->Value() } ) { double txt_orient = textItem->GetTextAngle(); - std::string layer = GenCADLayerName( cu_count, module->GetFlag() ? B_SilkS : F_SilkS ); + std::string layer = GenCADLayerName( cu_count, footprint->GetFlag() ? B_SilkS : F_SilkS ); fprintf( aFile, "TEXT %g %g %g %g %s %s \"%s\"", textItem->GetPos0().x / SCALE_FACTOR, @@ -863,8 +863,8 @@ static void CreateComponentsSection( FILE* aFile, BOARD* aPcb ) // The SHEET is a 'generic description' for referencing the component fprintf( aFile, "SHEET \"RefDes: %s, Value: %s\"\n", - TO_UTF8( module->GetReference() ), - TO_UTF8( module->GetValue() ) ); + TO_UTF8( footprint->GetReference() ), + TO_UTF8( footprint->GetValue() ) ); } fputs( "$ENDCOMPONENTS\n\n", aFile ); @@ -898,15 +898,15 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb ) fputs( TO_UTF8( msg ), aFile ); fputs( "\n", aFile ); - for( MODULE* module : aPcb->Modules() ) + for( MODULE* footprint : aPcb->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( pad->GetNetCode() != net->GetNet() ) continue; msg.Printf( wxT( "NODE \"%s\" \"%s\"" ), - escapeString( module->GetReference() ), + escapeString( footprint->GetReference() ), escapeString( pad->GetName() ) ); fputs( TO_UTF8( msg ), aFile ); @@ -922,8 +922,8 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb ) // Creates the header section static bool CreateHeaderInfoData( FILE* aFile, PCB_EDIT_FRAME* aFrame ) { - wxString msg; - BOARD *board = aFrame->GetBoard(); + wxString msg; + BOARD* board = aFrame->GetBoard(); fputs( "$HEADER\n", aFile ); fputs( "GENCAD 1.4\n", aFile ); diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index 21e9f6ce2f..b33cc87d3e 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -383,10 +383,10 @@ bool HYPERLYNX_EXPORTER::writeDevices() { m_out->Print( 0, "{DEVICES\n" ); - for( MODULE* mod : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - wxString ref = mod->GetReference(); - wxString layerName = m_board->GetLayerName( mod->GetLayer() ); + wxString ref = footprint->GetReference(); + wxString layerName = m_board->GetLayerName( footprint->GetLayer() ); if( ref.IsEmpty() ) ref = "EMPTY"; @@ -402,9 +402,9 @@ bool HYPERLYNX_EXPORTER::writeDevices() bool HYPERLYNX_EXPORTER::writePadStacks() { - for( MODULE* mod : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { HYPERLYNX_PAD_STACK* ps = addPadStack( HYPERLYNX_PAD_STACK( m_board, pad ) ); m_padMap[pad] = ps; @@ -546,7 +546,7 @@ const std::vector HYPERLYNX_EXPORTER::collectNetObjects( int netcod return false; }; - for( MODULE* mod : m_board->Modules() ) + for( MODULE* mod : m_board->Footprints() ) { for( PAD* pad : mod->Pads() ) { diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index 34082e1820..411a76cdf0 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -617,8 +617,8 @@ bool PCB_EDIT_FRAME::Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, idf_export_outline( aPcb, idfBoard ); // Output the drill holes and module (library) data. - for( auto module : aPcb->Modules() ) - idf_export_module( aPcb, module, idfBoard ); + for( MODULE* footprint : aPcb->Footprints() ) + idf_export_module( aPcb, footprint, idfBoard ); if( !idfBoard.WriteFile( aFullFileName, idfUnit, false ) ) { diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 1282d654ba..5b9156ee40 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -1655,8 +1655,8 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt output_file << " children [\n"; // Export footprints - for( MODULE* module : pcb->Modules() ) - export_vrml_module( model3d, pcb, module, &output_file ); + for( MODULE* footprint : pcb->Footprints() ) + export_vrml_module( model3d, pcb, footprint, &output_file ); // write out the board and all layers write_layers( model3d, pcb, TO_UTF8( aFullFileName ), &output_file ); @@ -1669,8 +1669,8 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt else { // Export footprints - for( MODULE* module : pcb->Modules() ) - export_vrml_module( model3d, pcb, module, NULL ); + for( MODULE* footprint : pcb->Footprints() ) + export_vrml_module( model3d, pcb, footprint, NULL ); // write out the board and all layers write_layers( model3d, pcb, TO_UTF8( aFullFileName ), NULL ); diff --git a/pcbnew/exporters/gendrill_file_writer_base.cpp b/pcbnew/exporters/gendrill_file_writer_base.cpp index f508a8de29..4c7f35d907 100644 --- a/pcbnew/exporters/gendrill_file_writer_base.cpp +++ b/pcbnew/exporters/gendrill_file_writer_base.cpp @@ -119,9 +119,9 @@ void GENDRILL_WRITER_BASE::buildHolesList( DRILL_LAYER_PAIR aLayerPair, if( aLayerPair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) ) { // add holes for thru hole pads - for( auto module : m_pcb->Modules() ) + for( MODULE* footprint : m_pcb->Footprints() ) { - for( auto& pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( !m_merge_PTH_NPTH ) { diff --git a/pcbnew/exporters/gerber_jobfile_writer.cpp b/pcbnew/exporters/gerber_jobfile_writer.cpp index 89be395317..b96d96b155 100644 --- a/pcbnew/exporters/gerber_jobfile_writer.cpp +++ b/pcbnew/exporters/gerber_jobfile_writer.cpp @@ -464,9 +464,9 @@ void GERBER_JOBFILE_WRITER::addJSONDesignRules() int minPadClearanceOuter = defaultNC.GetClearance(); int minPadClearanceInner = defaultNC.GetClearance(); - for( MODULE* module : m_pcb->Modules() ) + for( MODULE* footprint : m_pcb->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { for( PCB_LAYER_ID layer : pad->GetLayerSet().Seq() ) { diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index 8639a796fb..fd64185d42 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -67,7 +67,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER // Collect footprints on the right layer std::vector fp_list; - for( MODULE* footprint : m_pcb->Modules() ) + for( MODULE* footprint : m_pcb->Footprints() ) { if( footprint->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ) continue; diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 93b10eaf0c..cb77887f50 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -1104,15 +1104,15 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) // Update module LIB_IDs to point to the just imported Eagle library - for( MODULE* module : GetBoard()->Modules() ) + for( MODULE* footprint : GetBoard()->Footprints() ) { - LIB_ID libId = module->GetFPID(); + LIB_ID libId = footprint->GetFPID(); if( libId.GetLibItemName().empty() ) continue; libId.SetLibNickname( newfilename.GetName() ); - module->SetFPID( libId ); + footprint->SetFPID( libId ); } diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 3edf6be5ca..91a81350ff 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -663,7 +663,7 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard( wxUpdateUIEvent& aEvent canInsert = true; // search if the source footprint was not deleted: - for( MODULE* candidate : mainpcb->Modules() ) + for( MODULE* candidate : mainpcb->Footprints() ) { if( editorFootprint->GetLink() == candidate->m_Uuid ) { diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 12823719c5..69ea8f70ee 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -638,7 +638,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr prj.SetRString( PROJECT::PCB_LIB_NICKNAME, nickname ); - for( MODULE* footprint : GetBoard()->Modules() ) + for( MODULE* footprint : GetBoard()->Footprints() ) { try { @@ -675,7 +675,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr IO_MGR::PCB_FILE_T piType = IO_MGR::KICAD_SEXP; PLUGIN::RELEASER pi( IO_MGR::PluginFind( piType ) ); - for( MODULE* footprint : GetBoard()->Modules() ) + for( MODULE* footprint : GetBoard()->Footprints() ) { try { @@ -804,7 +804,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) { sourceFootprint = nullptr; - for( MODULE* candidate : mainpcb->Modules() ) + for( MODULE* candidate : mainpcb->Footprints() ) { if( editorFootprint->GetLink() == candidate->m_Uuid ) { diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index acd897f2af..743a93861f 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -100,9 +100,12 @@ bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery ) { wxSafeYield( this, true ); // Allow frame to come to front before showing warning. - if( !HandleUnsavedChanges( this, _( "The current footprint has been modified. " - "Save changes?" ), - [&]() -> bool { return SaveFootprint( GetBoard()->Modules().front() ); } ) ) + if( !HandleUnsavedChanges( + this, _( "The current footprint has been modified. Save changes?" ), + [&]() -> bool + { + return SaveFootprint( GetBoard()->Footprints().front() ); + } ) ) { return false; } diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index e7d7dae034..e291c3fc7b 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -136,7 +136,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE } // Set the new relative internal local coordinates of copied items - MODULE* editedFootprint = m_board->Modules().front(); + MODULE* editedFootprint = m_board->Footprints().front(); wxPoint moveVector = partialFootprint.GetPosition() + editedFootprint->GetPosition(); partialFootprint.MoveAnchorPosition( moveVector ); diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 1c24b95c59..165295a532 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -331,7 +331,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::SelectFootprintFromBoard( BOARD* aPcb ) wxString msg; wxArrayString listnames; - for( MODULE* footprint : aPcb->Modules() ) + for( MODULE* footprint : aPcb->Footprints() ) listnames.Add( footprint->GetReference() ); msg.Printf( _( "Footprints [%u items]" ), (unsigned) listnames.GetCount() ); @@ -360,7 +360,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::SelectFootprintFromBoard( BOARD* aPcb ) oldName = fpname; - for( auto mod : aPcb->Modules() ) + for( auto mod : aPcb->Footprints() ) { if( fpname == mod->GetReference() ) return mod; @@ -431,7 +431,7 @@ MODULE* PCB_BASE_FRAME::GetFootprintFromBoardByReference() wxArrayString fplist; // Build list of available fp references, to display them in dialog - for( auto fp : GetBoard()->Modules() ) + for( auto fp : GetBoard()->Footprints() ) fplist.Add( fp->GetReference() + wxT(" ( ") + fp->GetValue() + wxT(" )") ); fplist.Sort(); @@ -447,7 +447,7 @@ MODULE* PCB_BASE_FRAME::GetFootprintFromBoardByReference() if( !footprintName.IsEmpty() ) { - for( auto mod : GetBoard()->Modules() ) + for( auto mod : GetBoard()->Footprints() ) { if( mod->GetReference().CmpNoCase( footprintName ) == 0 ) return mod; diff --git a/pcbnew/netinfo_item.cpp b/pcbnew/netinfo_item.cpp index f21778e619..968828fda8 100644 --- a/pcbnew/netinfo_item.cpp +++ b/pcbnew/netinfo_item.cpp @@ -88,7 +88,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorModules() ) + for( MODULE* mod : board->Footprints() ) { for( PAD* pad : mod->Pads() ) { diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index 10c5ee2f74..9f28605287 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -218,7 +218,7 @@ void NETINFO_MAPPING::Update() nets.insert( track->GetNetCode() ); // footprints/pads - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) nets.insert( pad->GetNetCode() ); diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index ae889e59e9..d874d415ef 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -624,7 +624,7 @@ bool BOARD_NETLIST_UPDATER::deleteUnusedComponents( NETLIST& aNetlist ) wxString msg; const COMPONENT* component; - for( MODULE* footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { if(( footprint->GetAttributes() & MOD_BOARD_ONLY ) > 0 ) continue; @@ -785,7 +785,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist ) m_errorCount = 0; m_warningCount = 0; m_newFootprintsCount = 0; - MODULE* lastPreexistingFootprint = m_board->Modules().empty() ? NULL : m_board->Modules().back(); + MODULE* lastPreexistingFootprint = m_board->Footprints().empty() ? NULL : m_board->Footprints().back(); cacheCopperZoneConnections(); @@ -813,7 +813,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist ) component->GetFPID().Format().wx_str() ); m_reporter->Report( msg, RPT_SEVERITY_INFO ); - for( auto footprint : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { bool match = false; diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index abc703893a..df3b8ea8c1 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -197,7 +197,7 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( BOARD* aBoard ) m_view->Add( track ); // Load footprints and its additional elements - for( auto module : aBoard->Modules() ) + for( auto module : aBoard->Footprints() ) m_view->Add( module ); // DRC markers diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 4015119228..012605f255 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -164,7 +164,7 @@ static void insideCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) } else { - for( MODULE* candidate : item->GetBoard()->Modules() ) + for( MODULE* candidate : item->GetBoard()->Footprints() ) { if( candidate->GetReference().Matches( arg->AsString() ) ) { @@ -322,7 +322,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self ) } } - for( MODULE* module : item->GetBoard()->Modules() ) + for( MODULE* module : item->GetBoard()->Footprints() ) { for( ZONE* candidate : module->Zones() ) { @@ -353,7 +353,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self ) } } - for( MODULE* module : item->GetBoard()->Modules() ) + for( MODULE* module : item->GetBoard()->Footprints() ) { for( ZONE* candidate : module->Zones() ) { diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 6cfac240c2..0393840985 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -219,15 +219,15 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, itemplotter.PlotBoardGraphicItems(); // Draw footprint texts: - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) itemplotter.PlotFootprintTextItems( module ); // Draw footprint other graphic items: - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) itemplotter.PlotFootprintGraphicItems( module ); // Plot footprint pads - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) { aPlotter->StartBlock( NULL ); @@ -632,7 +632,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ? SMALL_DRILL : INT_MAX; - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) { for( PAD* pad : module->Pads() ) { @@ -727,7 +727,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, itemplotter.PlotBoardGraphicItems(); - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) { for( BOARD_ITEM* item : module->GraphicalItems() ) { @@ -757,7 +757,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, #endif { // Plot pads - for( MODULE* module : aBoard->Modules() ) + for( MODULE* module : aBoard->Footprints() ) { // add shapes with their exact mask layer size in initialPolys module->TransformPadsShapesWithClearanceToPolygon( initialPolys, layer, 0, maxError, diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index bbdceb61c6..fec8377029 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -1022,7 +1022,7 @@ void BRDITEMS_PLOTTER::PlotDrillMarks() } } - for( auto Module : m_board->Modules() ) + for( auto Module : m_board->Footprints() ) { for( auto pad : Module->Pads() ) { diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index f0a460b502..48e36fbc0c 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -445,9 +445,9 @@ void ALTIUM_PCB::Parse( const CFB::CompoundFileReader& aReader, } // Finish Board by recalculating module boundingboxes - for( auto& module : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - module->CalculateBoundingBox(); + footprint->CalculateBoundingBox(); } // Otherwise we cannot save the imported board diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 8905c7dac2..31746031cc 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -619,8 +619,8 @@ void PCB_IO::formatHeader( BOARD* aBoard, int aNestLevel ) const void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const { - std::set sorted_modules( aBoard->Modules().begin(), - aBoard->Modules().end() ); + std::set sorted_modules( aBoard->Footprints().begin(), + aBoard->Footprints().end() ); std::set sorted_drawings( aBoard->Drawings().begin(), aBoard->Drawings().end() ); std::set sorted_tracks( aBoard->Tracks().begin(), diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 47d992f1eb..801d313a0a 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1186,7 +1186,7 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld ) syncZone( aWorld, zone, boardOutline ); } - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) { diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index 06232c91d5..b59a64955c 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -1736,7 +1736,7 @@ void SPECCTRA_DB::FlipMODULEs( BOARD* aBoard ) // top view. // Note: to export footprints, the footprints must be flipped around the X axis, // otherwise the rotation angle is not good - for( auto module : aBoard->Modules() ) + for( auto module : aBoard->Footprints() ) { module->SetFlag( 0 ); if( module->GetLayer() == B_Cu ) @@ -1758,7 +1758,7 @@ void SPECCTRA_DB::RevertMODULEs( BOARD* aBoard ) // DSN Images (=KiCad MODULES and pads) must be presented from the // top view. Restore those that were flipped. // Note: to export footprints, the footprints were flipped around the X axis, - for( auto module : aBoard->Modules() ) + for( auto module : aBoard->Footprints() ) { if( module->GetFlag() ) { diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index f52a7de857..05b8d69498 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2173,9 +2173,9 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) const wxPoint position = aVia->GetPosition(); const LSET lset = aVia->GetLayerSet(); - for( auto mod : m_board->Modules() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : mod->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( pad->HitTest( position ) && ( pad->GetLayerSet() & lset ).any() ) return -1; diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 40dcd130b9..9de25fa0ac 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -167,7 +167,7 @@ static void doPushPadProperties( BOARD& board, const PAD& aSrcPad, BOARD_COMMIT& double pad_orient = aSrcPad.GetOrientation() - moduleRef->GetOrientation(); - for( auto module : board.Modules() ) + for( auto module : board.Footprints() ) { if( !aSameFootprints && ( module != moduleRef ) ) continue; diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 0c015f9e46..770aa54eae 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -411,13 +411,13 @@ int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent ) // Footprint IDs are the most important, so give them the first crack at "claiming" a // particular KIID. - for( MODULE* footprint : board()->Modules() ) + for( MODULE* footprint : board()->Footprints() ) processItem( footprint ); // After that the principal use is for DRC marker pointers, which are most likely to pads // or tracks. - for( MODULE* footprint : board()->Modules() ) + for( MODULE* footprint : board()->Footprints() ) { for( PAD* pad : footprint->Pads() ) processItem( pad ); @@ -428,7 +428,7 @@ int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent ) // From here out I don't think order matters much. - for( MODULE* footprint : board()->Modules() ) + for( MODULE* footprint : board()->Footprints() ) { processItem( &footprint->Reference() ); processItem( &footprint->Value() ); diff --git a/pcbnew/tools/pcb_inspection_tool.cpp b/pcbnew/tools/pcb_inspection_tool.cpp index 06f9080710..b62e0791f0 100644 --- a/pcbnew/tools/pcb_inspection_tool.cpp +++ b/pcbnew/tools/pcb_inspection_tool.cpp @@ -403,7 +403,7 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) for( ZONE* zone : m_frame->GetBoard()->Zones() ) zone->CacheBoundingBox(); - for( MODULE* module : m_frame->GetBoard()->Modules() ) + for( MODULE* module : m_frame->GetBoard()->Footprints() ) { for( ZONE* zone : module->Zones() ) zone->CacheBoundingBox(); @@ -863,7 +863,7 @@ int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) if( selection.Empty() ) { // Clear the previous local ratsnest if we click off all items - for( MODULE* fp : board->Modules() ) + for( MODULE* fp : board->Footprints() ) { for( PAD* pad : fp->Pads() ) pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest ); @@ -900,7 +900,7 @@ int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) { if( aCondition != PCBNEW_PICKER_TOOL::END_ACTIVATE ) { - for( MODULE* fp : board->Modules() ) + for( MODULE* fp : board->Footprints() ) { for( PAD* pad : fp->Pads() ) pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest ); diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index 02c76c25ce..30196533eb 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -98,7 +98,7 @@ int PCB_VIEWER_TOOLS::ShowPadNumbers( const TOOL_EVENT& aEvent ) Flip( opts.m_DisplayPadNum ); frame()->SetDisplayOptions( opts ); - for( MODULE* fp : board()->Modules() ) + for( MODULE* fp : board()->Footprints() ) { for( PAD* pad : fp->Pads() ) view()->Update( pad, KIGFX::GEOMETRY ); @@ -117,7 +117,7 @@ int PCB_VIEWER_TOOLS::PadDisplayMode( const TOOL_EVENT& aEvent ) Flip( opts.m_DisplayPadFill ); frame()->SetDisplayOptions( opts ); - for( MODULE* fp : board()->Modules() ) + for( MODULE* fp : board()->Footprints() ) { for( PAD* pad : fp->Pads() ) view()->Update( pad, KIGFX::GEOMETRY ); @@ -136,7 +136,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent ) Flip( opts.m_DisplayGraphicsFill ); frame()->SetDisplayOptions( opts ); - for( MODULE* fp : board()->Modules() ) + for( MODULE* fp : board()->Footprints() ) { for( BOARD_ITEM* item : fp->GraphicalItems() ) { @@ -166,7 +166,7 @@ int PCB_VIEWER_TOOLS::TextOutlines( const TOOL_EVENT& aEvent ) Flip( opts.m_DisplayTextFill ); frame()->SetDisplayOptions( opts ); - for( MODULE* fp : board()->Modules() ) + for( MODULE* fp : board()->Footprints() ) { view()->Update( &fp->Reference(), KIGFX::GEOMETRY ); view()->Update( &fp->Value(), KIGFX::GEOMETRY ); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index f56ffae4f5..be54a2b650 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -669,7 +669,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) MODULE* editorFootprint = board()->GetFirstFootprint(); std::vector pastedItems; - for( MODULE* clipFootprint : clipBoard->Modules() ) + for( MODULE* clipFootprint : clipBoard->Footprints() ) pasteFootprintItemsToFootprintEditor( clipFootprint, board(), pastedItems ); for( BOARD_ITEM* clipDrawItem : clipBoard->Drawings() ) @@ -832,7 +832,7 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin ) std::vector items; moveUnflaggedItems( aBoard->Tracks(), items, isNew ); - moveUnflaggedItems( aBoard->Modules(), items, isNew ); + moveUnflaggedItems( aBoard->Footprints(), items, isNew ); moveUnflaggedItems( aBoard->Drawings(), items, isNew ); moveUnflaggedItems( aBoard->Zones(), items, isNew ); @@ -955,7 +955,7 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) for( auto track : brd->Tracks() ) track->SetFlags( SKIP_STRUCT ); - for( auto module : brd->Modules() ) + for( auto module : brd->Footprints() ) module->SetFlags( SKIP_STRUCT ); for( auto group : brd->Groups() ) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 0b4c0d28ae..d4a4bb7491 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1173,7 +1173,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) std::list modList; // store all footprints that are on that sheet path - for( MODULE* module : board()->Modules() ) + for( MODULE* module : board()->Footprints() ) { if( module == nullptr ) continue; diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 83e47a8c8c..fc0987f248 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -118,7 +118,7 @@ static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem ) return true; } - for( MODULE* item : aPcb->Modules() ) + for( MODULE* item : aPcb->Footprints() ) { if( aItem == static_cast( item ) ) return true; diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 63a13ffa6a..8e02e47476 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -119,7 +119,7 @@ bool ZONE_FILLER::Fill( std::vector& aZones, bool aCheck, wxWindow* aPare m_worstClearance = std::max( m_worstClearance, zone->GetLocalClearance() ); } - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) { @@ -615,7 +615,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer { SHAPE_POLY_SET holes; - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) { @@ -729,7 +729,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa } }; - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) { @@ -818,7 +818,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa } }; - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { knockoutGraphicClearance( &module->Reference() ); knockoutGraphicClearance( &module->Value() ); @@ -895,7 +895,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa } } - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( ZONE* otherZone : module->Zones() ) { @@ -947,7 +947,7 @@ void ZONE_FILLER::subtractHigherPriorityZones( const ZONE* aZone, PCB_LAYER_ID a } } - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( ZONE* otherZone : module->Zones() ) { @@ -1248,7 +1248,7 @@ void ZONE_FILLER::buildThermalSpokes( const ZONE* aZone, PCB_LAYER_ID aLayer, // us avoid the question. int epsilon = KiROUND( IU_PER_MM * 0.04 ); // about 1.5 mil - for( auto module : m_board->Modules() ) + for( auto module : m_board->Footprints() ) { for( auto pad : module->Pads() ) { @@ -1530,7 +1530,7 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer } } - for( MODULE* module : m_board->Modules() ) + for( MODULE* module : m_board->Footprints() ) { for( PAD* pad : module->Pads() ) { diff --git a/qa/pcbnew_tools/tools/polygon_generator/polygon_generator.cpp b/qa/pcbnew_tools/tools/polygon_generator/polygon_generator.cpp index 1c8ba152e7..109c097aee 100644 --- a/qa/pcbnew_tools/tools/polygon_generator/polygon_generator.cpp +++ b/qa/pcbnew_tools/tools/polygon_generator/polygon_generator.cpp @@ -82,7 +82,7 @@ int polygon_gererator_main( int argc, char* argv[] ) for( auto track : brd->Tracks() ) process( track, net ); - for( auto mod : brd->Modules() ) + for( auto mod : brd->Footprints() ) { for( auto pad : mod->Pads() ) process( pad, net );