mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 00:21:31 +00:00
More module -> footprint.
This commit is contained in:
parent
a3a9ef4f32
commit
52a46341db
3d-viewer
pcbnew
autorouter
board.cppboard.hboard_commit.cppboard_items_to_polygon_shape_transform.cppbuild_BOM_from_board.cppconnectivity
cross-probing.cppdialogs
dialog_board_reannotate.cppdialog_board_statistics.cppdialog_exchange_footprints.cppdialog_find.cppdialog_gendrill.cppdialog_global_deletion.cppdialog_global_edit_text_and_graphics.cppdialog_net_inspector.cppdialog_unused_pad_layers.cpp
drc
drc_engine.cppdrc_test_provider.cppdrc_test_provider_copper_clearance.cppdrc_test_provider_courtyard_clearance.cppdrc_test_provider_hole_clearance.cppdrc_test_provider_hole_size.cppdrc_test_provider_lvs.cpp
exporters
export_d356.cppexport_footprint_associations.cppexport_footprints_placefile.cppexport_gencad.cppexport_hyperlynx.cppexport_idf.cppexport_vrml.cppgendrill_file_writer_base.cppgerber_jobfile_writer.cppgerber_placefile_writer.cpp
files.cppfootprint_edit_frame.cppfootprint_libraries_utils.cppinitpcb.cppkicad_clipboard.cppload_select_footprint.cppnetinfo_item.cppnetinfo_list.cppnetlist_reader
pcb_draw_panel_gal.cpppcb_expr_evaluator.cppplot_board_layers.cppplot_brditems_plotter.cppplugins
router
specctra_import_export
tools
drawing_tool.cpppad_tool.cpppcb_editor_control.cpppcb_inspection_tool.cpppcb_viewer_tools.cpppcbnew_control.cppselection_tool.cpp
undo_redo.cppzone_filler.cppqa/pcbnew_tools/tools/polygon_generator
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -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) )
|
||||
{
|
||||
|
@ -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,
|
||||
|
||||
|
@ -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() )
|
||||
{
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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<float>(),
|
||||
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
|
||||
}
|
||||
|
||||
|
||||
if( module->IsFlipped() )
|
||||
if( fp->IsFlipped() )
|
||||
{
|
||||
moduleMatrix = glm::rotate( moduleMatrix,
|
||||
glm::pi<float>(),
|
||||
@ -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<BOARD_ITEM*>( module );
|
||||
BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( 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 )
|
||||
{
|
||||
|
@ -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() );
|
||||
|
@ -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 );
|
||||
|
@ -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, "",
|
||||
|
@ -82,8 +82,8 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard )
|
||||
m_board = aBoard;
|
||||
m_connectivity = std::make_unique<CONNECTIVITY_DATA>( );
|
||||
|
||||
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 <MODULE*> 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<MODULE*>& 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<MODULE*> 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;
|
||||
}
|
||||
|
@ -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<KIID, EDA_ITEM*>& 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<MODULE*>( m_modules, inspector, testData, p );
|
||||
result = IterateForward<MODULE*>( 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<PAD*>& 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<ZONE*> 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<PAD*> BOARD::GetPads() const
|
||||
{
|
||||
std::vector<PAD*> 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_CONNECTED_ITEM*> 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 );
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 ||
|
||||
|
@ -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
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -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() )
|
||||
{
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -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() );
|
||||
|
@ -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<RefDesInfo>& aBadRefD
|
||||
m_FrontModules.clear();
|
||||
m_BackModules.clear();
|
||||
m_ExcludeArray.clear();
|
||||
m_modules = m_frame->GetBoard()->Modules();
|
||||
m_modules = m_frame->GetBoard()->Footprints();
|
||||
|
||||
std::vector<KIID> selected;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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<FP_TEXT*>( 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<const VIA*>( 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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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() );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user