mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 09:51:40 +00:00
MODULE -> FOOTPRINT.
This commit is contained in:
parent
3451ac3088
commit
bdbb68f813
3d-viewer
3d_cache/dialogs
3d_canvas
board_adapter.hcreate_3Dgraphic_brd_items.cppcreate_layer_items.cppcreate_layer_poly.cppeda_3d_canvas.cpp
3d_rendering
3d_render_ogl_legacy
3d_render_raytracing
common
cvpcb
eeschema/tools
include
pcbnew
array_creator.cpparray_pad_name_provider.cpparray_pad_name_provider.h
autorouter
board.cppboard.hboard_commit.cppboard_items_to_polygon_shape_transform.cppbuild_BOM_from_board.cppcollectors.cppcollectors.hconnectivity
convert_drawsegment_list_to_polygon.cppcross-probing.cppdialogs
dialog_board_reannotate.cppdialog_board_reannotate.hdialog_board_statistics.cppdialog_choose_footprint.hdialog_cleanup_graphics.cppdialog_edit_footprint_for_fp_editor.cppdialog_edit_footprint_for_fp_editor.hdialog_exchange_footprints.cppdialog_exchange_footprints.hdialog_find.cppdialog_footprint_properties.cppdialog_footprint_properties.hdialog_gendrill.cppdialog_global_deletion.cppdialog_global_edit_text_and_graphics.cppdialog_net_inspector.cppdialog_netlist.hdialog_pad_properties.cppdialog_text_properties.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.cppdrc_test_provider_silk_clearance.cpp
edit.cppexporters
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.cppgerber_placefile_writer.h
files.cppfootprint.cppfootprint.hfootprint_edit_frame.cppfootprint_edit_frame.hfootprint_editor_utils.cppfootprint_info_impl.cppfootprint_libraries_utils.cppfootprint_preview_panel.cppfootprint_preview_panel.hfootprint_viewer_frame.cppfootprint_wizard.hfootprint_wizard_frame.hfootprint_wizard_frame_functions.cppfp_shape.cppfp_shape.hfp_text.cppfp_text.hgenerate_footprint_info.cppgraphics_cleaner.cppgraphics_cleaner.himport_gfx
invoke_pcb_dialog.hio_mgr.hkicad_clipboard.cppkicad_clipboard.hload_select_footprint.cppmicrowave
microwave_footprint.cppmicrowave_inductor.cppmicrowave_polygon.cppmicrowave_tool.cppmicrowave_tool.h
netinfo_item.cppnetinfo_list.cppnetlist_reader
pad.cpppad.hpcb_base_frame.cpppcb_draw_panel_gal.cpppcb_edit_frame.cpppcb_edit_frame.hpcb_expr_evaluator.cpppcb_painter.cpppcb_painter.hpcb_shape.cpppcb_shape.hpcb_text.cpppcb_view.cpppcbplot.hplot_board_layers.cppplot_brditems_plotter.cppplugin.cppplugins
altium
cadstar
eagle
geda
kicad
legacy
pcad
router
specctra_import_export
swig
board.iboard_connected_item.iboard_item.ifootprint.ipad.ipcbnew.ipcbnew_action_plugins.cpppcbnew_footprint_wizards.cpppcbnew_footprint_wizards.h
text_mod_grid_table.htools
convert_tool.cppdrawing_tool.cppedit_tool.cppfootprint_editor_tools.cppfootprint_editor_tools.hglobal_edit_tool.cppgrid_helper.cppgroup_tool.cpppad_tool.cpppcb_editor_control.cpppcb_inspection_tool.cpppcb_tool_base.cpppcb_tool_base.hpcb_viewer_tools.cpppcb_viewer_tools.hpcbnew_control.cpppcbnew_selection.cppplacement_tool.cppselection_tool.cppzone_create_helper.cpp
undo_redo.cppzone_filler.cppqa
@ -41,7 +41,7 @@
|
||||
#include <widgets/infobar.h>
|
||||
|
||||
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList ) :
|
||||
PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
|
||||
m_previewPane( nullptr ),
|
||||
@ -86,7 +86,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
|
||||
|
||||
m_parentModelList = aParentModelList;
|
||||
|
||||
m_dummyFootprint = new MODULE( *aFootprint );
|
||||
m_dummyFootprint = new FOOTPRINT( *aFootprint );
|
||||
m_dummyBoard->Add( m_dummyFootprint );
|
||||
|
||||
// Create the infobar
|
||||
|
@ -69,12 +69,12 @@ class S3D_CACHE;
|
||||
class FILENAME_RESOLVER;
|
||||
class BOARD;
|
||||
class BOARD_ADAPTER;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
|
||||
class PANEL_PREV_3D: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREV_3D_BASE
|
||||
{
|
||||
public:
|
||||
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRINT* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList );
|
||||
|
||||
~PANEL_PREV_3D();
|
||||
@ -87,7 +87,7 @@ private:
|
||||
CTRACK_BALL m_trackBallCamera;
|
||||
|
||||
BOARD* m_dummyBoard;
|
||||
MODULE* m_dummyFootprint;
|
||||
FOOTPRINT* m_dummyFootprint;
|
||||
|
||||
std::vector<FP_3DMODEL>* m_parentModelList;
|
||||
int m_selected; /// Index into m_parentInfoList
|
||||
|
@ -543,13 +543,13 @@ class BOARD_ADAPTER
|
||||
|
||||
COBJECT2D *createNewPadDrill( const PAD* aPad, int aInflateValue );
|
||||
|
||||
void AddPadsWithClearanceToContainer( const MODULE *aFootprint,
|
||||
void AddPadsWithClearanceToContainer( const FOOTPRINT *aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId, int aInflateValue,
|
||||
bool aSkipNPTHPadsWihNoCopper, bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads );
|
||||
|
||||
void AddFPShapesWithClearanceToContainer( const MODULE *aFootprint,
|
||||
void AddFPShapesWithClearanceToContainer( const FOOTPRINT *aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId, int aInflateValue );
|
||||
|
||||
@ -580,7 +580,7 @@ class BOARD_ADAPTER
|
||||
void buildPadShapeThickOutlineAsPolygon( const PAD *aPad, SHAPE_POLY_SET &aCornerBuffer,
|
||||
int aWidth) const;
|
||||
|
||||
void transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer,
|
||||
void transformFPShapesToPolygon( const FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer,
|
||||
SHAPE_POLY_SET& aCornerBuffer ) const;
|
||||
|
||||
public:
|
||||
|
@ -185,7 +185,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DIMENSION_BASE* aDim
|
||||
// Based on
|
||||
// void FOOTPRINT::TransformFPShapesWithClearanceToPolygonSet
|
||||
// board_items_to_polygon_shape_transform.cpp#L204
|
||||
void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const MODULE* aFootprint,
|
||||
void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const FOOTPRINT* aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue )
|
||||
@ -473,7 +473,7 @@ COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const PAD* aPad, int aInflateValue
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const MODULE* aFootprint,
|
||||
void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const FOOTPRINT* aFootprint,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue,
|
||||
|
@ -463,7 +463,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
// Add holes of footprints
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
@ -497,7 +497,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
// Add contours of the pad holes (pads can be Circle or Segment holes)
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
@ -549,7 +549,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
|
||||
|
||||
// ADD PADS
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
@ -564,7 +564,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
if( renderPlatedPadsAsPlated )
|
||||
{
|
||||
// ADD PLATED PADS
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu,
|
||||
0, true, false, true );
|
||||
@ -588,7 +588,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
|
||||
|
||||
// Add pads to polygon list
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
@ -604,7 +604,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
if( renderPlatedPadsAsPlated )
|
||||
{
|
||||
// ADD PLATED PADS contourns
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
footprint->TransformPadsWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu,
|
||||
0, ARC_HIGH_DEF, ERROR_INSIDE,
|
||||
@ -977,7 +977,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
// Add footprints tech layers - objects
|
||||
// /////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
||||
{
|
||||
@ -1002,7 +1002,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
|
||||
// Add footprints tech layers - contours
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const PAD* aPad,
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer,
|
||||
void BOARD_ADAPTER::transformFPShapesToPolygon( const FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer,
|
||||
SHAPE_POLY_SET& aCornerBuffer ) const
|
||||
{
|
||||
for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
|
||||
|
@ -763,7 +763,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event )
|
||||
|
||||
case PCB_FOOTPRINT_T:
|
||||
{
|
||||
MODULE* footprint = dynamic_cast<MODULE *>( intersectedBoardItem );
|
||||
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT *>( intersectedBoardItem );
|
||||
|
||||
if( footprint )
|
||||
activityReporter.Report( footprint->GetReference() );
|
||||
|
@ -862,7 +862,7 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads()
|
||||
tht_inner_holes_poly.RemoveAllContours();
|
||||
|
||||
// Insert pads holes (vertical cylinders)
|
||||
for( const MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( const FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
@ -965,7 +965,7 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models( REPORTER* aStatusReporter )
|
||||
}
|
||||
|
||||
// Go for all footprints
|
||||
for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( const FP_3DMODEL& model : footprint->Models() )
|
||||
{
|
||||
|
@ -1265,7 +1265,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot,
|
||||
C_OGL_3DMODEL::BeginDrawMulti( !aRenderSelectedOnly );
|
||||
|
||||
// Go for all footprints
|
||||
for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
const bool isIntersected = ( fp == m_currentIntersectedBoardItem );
|
||||
|
||||
@ -1319,7 +1319,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models( bool aRenderTopOrBot,
|
||||
}
|
||||
|
||||
|
||||
void C3D_RENDER_OGL_LEGACY::render_3D_footprint( const MODULE* aFootprint,
|
||||
void C3D_RENDER_OGL_LEGACY::render_3D_footprint( const FOOTPRINT* aFootprint,
|
||||
bool aRenderTransparentOnly,
|
||||
bool aIsSelected )
|
||||
{
|
||||
|
@ -201,9 +201,11 @@ private:
|
||||
*/
|
||||
void render_3D_models( bool aRenderTopOrBot, bool aRenderTransparentOnly );
|
||||
|
||||
void render_3D_models_selected( bool aRenderTopOrBot, bool aRenderTransparentOnly, bool aRenderSelectedOnly );
|
||||
void render_3D_models_selected( bool aRenderTopOrBot, bool aRenderTransparentOnly,
|
||||
bool aRenderSelectedOnly );
|
||||
|
||||
void render_3D_footprint( const MODULE* aFootprint, bool aRenderTransparentOnly, bool aIsSelected );
|
||||
void render_3D_footprint( const FOOTPRINT* aFootprint, bool aRenderTransparentOnly,
|
||||
bool aIsSelected );
|
||||
|
||||
void setLight_Front( bool enabled );
|
||||
void setLight_Top( bool enabled );
|
||||
|
@ -1386,7 +1386,7 @@ void C3D_RENDER_RAYTRACING::add_3D_vias_and_pads_to_container()
|
||||
}
|
||||
|
||||
// Insert pads holes (vertical cylinders)
|
||||
for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
if( pad->GetAttribute () != PAD_ATTRIB_NPTH )
|
||||
@ -1400,7 +1400,7 @@ 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( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
if( !fp->Models().empty()
|
||||
&& m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) )
|
||||
|
@ -307,8 +307,8 @@ const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )
|
||||
}
|
||||
|
||||
|
||||
static void setLibNickname( MODULE* aModule,
|
||||
const wxString& aNickname, const wxString& aFootprintName )
|
||||
static void setLibNickname( FOOTPRINT* aModule, const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
{
|
||||
// The library cannot know its own name, because it might have been renamed or moved.
|
||||
// Therefore footprints cannot know their own library nickname when residing in
|
||||
@ -331,8 +331,8 @@ static void setLibNickname( MODULE* aModule,
|
||||
}
|
||||
|
||||
|
||||
const MODULE* FP_LIB_TABLE::GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
const FOOTPRINT* FP_LIB_TABLE::GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
@ -359,13 +359,13 @@ bool FP_LIB_TABLE::FootprintExists( const wxString& aNickname, const wxString& a
|
||||
}
|
||||
|
||||
|
||||
MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString& aFootprintName )
|
||||
FOOTPRINT* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString& aFootprintName )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
|
||||
MODULE* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
||||
row->GetProperties() );
|
||||
FOOTPRINT* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
||||
row->GetProperties() );
|
||||
|
||||
setLibNickname( ret, row->GetNickName(), aFootprintName );
|
||||
|
||||
@ -374,7 +374,7 @@ MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString&
|
||||
|
||||
|
||||
FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
||||
const MODULE* aFootprint, bool aOverwrite )
|
||||
const FOOTPRINT* aFootprint, bool aOverwrite )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
@ -386,8 +386,9 @@ FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
||||
|
||||
wxString fpname = aFootprint->GetFPID().GetLibItemName();
|
||||
|
||||
std::unique_ptr<MODULE> footprint( row->plugin->FootprintLoad( row->GetFullURI( true ),
|
||||
fpname, row->GetProperties() ) );
|
||||
std::unique_ptr<FOOTPRINT> footprint( row->plugin->FootprintLoad( row->GetFullURI( true ),
|
||||
fpname,
|
||||
row->GetProperties() ) );
|
||||
|
||||
if( footprint.get() )
|
||||
return SAVE_SKIPPED;
|
||||
@ -432,7 +433,7 @@ void FP_LIB_TABLE::FootprintLibCreate( const wxString& aNickname )
|
||||
}
|
||||
|
||||
|
||||
MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId )
|
||||
FOOTPRINT* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId )
|
||||
{
|
||||
wxString nickname = aFootprintId.GetLibNickname();
|
||||
wxString fpname = aFootprintId.GetLibItemName();
|
||||
@ -452,7 +453,7 @@ MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootprin
|
||||
{
|
||||
// FootprintLoad() returns NULL on not found, does not throw exception
|
||||
// unless there's an IO_ERROR.
|
||||
MODULE* ret = FootprintLoad( nicks[i], fpname );
|
||||
FOOTPRINT* ret = FootprintLoad( nicks[i], fpname );
|
||||
|
||||
if( ret )
|
||||
return ret;
|
||||
|
@ -54,7 +54,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
|
||||
{
|
||||
case PCB_FOOTPRINT_T:
|
||||
{
|
||||
const MODULE* footprint = static_cast<const MODULE*>( aItem );
|
||||
const FOOTPRINT* footprint = static_cast<const FOOTPRINT*>( aItem );
|
||||
|
||||
ret = hash_board_item( footprint, aFlags );
|
||||
|
||||
|
@ -42,13 +42,13 @@
|
||||
#include <kicad_string.h>
|
||||
#include <common.h> // needed for wxString hash template
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
struct EINSTANCE;
|
||||
struct EPART;
|
||||
struct ETEXT;
|
||||
|
||||
typedef std::unordered_map<wxString, wxXmlNode*> NODE_MAP;
|
||||
typedef std::map<wxString, MODULE*> MODULE_MAP;
|
||||
typedef std::map<wxString, FOOTPRINT*> FOOTPRINT_MAP;
|
||||
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
|
||||
typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
|
||||
|
||||
|
@ -171,7 +171,7 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
|
||||
if( m_toolManager )
|
||||
m_toolManager->ShutdownAllTools();
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->StopDrawing();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
// Be sure any event cannot be fired after frame deletion:
|
||||
@ -371,11 +371,11 @@ COLOR4D DISPLAY_FOOTPRINTS_FRAME::GetGridColor()
|
||||
}
|
||||
|
||||
|
||||
MODULE* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
||||
REPORTER& aReporter )
|
||||
FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
||||
REPORTER& aReporter )
|
||||
{
|
||||
MODULE* footprint = NULL;
|
||||
LIB_ID fpid;
|
||||
FOOTPRINT* footprint = NULL;
|
||||
LIB_ID fpid;
|
||||
|
||||
if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
|
||||
{
|
||||
@ -434,10 +434,10 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintName,
|
||||
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
{
|
||||
CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
|
||||
MODULE* footprint = nullptr;
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
const FOOTPRINT_INFO* fpInfo = nullptr;
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
wxString footprintName = parentframe->GetSelectedFootprint();
|
||||
@ -500,7 +500,7 @@ void DISPLAY_FOOTPRINTS_FRAME::updateView()
|
||||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel()
|
||||
{
|
||||
MODULE* footprint = GetBoard()->GetFirstFootprint();
|
||||
FOOTPRINT* footprint = GetBoard()->GetFirstFootprint();
|
||||
MSG_PANEL_ITEMS items;
|
||||
|
||||
if( footprint )
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
*/
|
||||
COLOR4D GetGridColor() override;
|
||||
|
||||
MODULE* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
|
||||
FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
|
||||
|
||||
/* SaveCopyInUndoList() virtual
|
||||
* currently: do nothing in CvPcb.
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
};
|
||||
|
||||
///> Map to hold NETLIST footprints data
|
||||
using PCB_MODULES_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA>>;
|
||||
using PCB_FOOTPRINTS_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA>>;
|
||||
|
||||
using CHANGELIST_ITEM = std::pair<SCH_REFERENCE, std::shared_ptr<PCB_FP_DATA>>;
|
||||
|
||||
@ -111,7 +111,7 @@ private:
|
||||
bool m_processNetNames;
|
||||
bool m_dryRun;
|
||||
|
||||
PCB_MODULES_MAP m_pcbFootprints;
|
||||
PCB_FOOTPRINTS_MAP m_pcbFootprints;
|
||||
SCH_REFERENCE_LIST m_refs;
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP m_multiUnitsRefs;
|
||||
std::deque<CHANGELIST_ITEM> m_changelist;
|
||||
|
@ -86,7 +86,7 @@ enum KICAD_T
|
||||
SCREEN_T, ///< not really an item, used to identify a screen
|
||||
|
||||
// Items in pcb
|
||||
PCB_FOOTPRINT_T, ///< class MODULE, a footprint
|
||||
PCB_FOOTPRINT_T, ///< class FOOTPRINT, a footprint
|
||||
PCB_PAD_T, ///< class PAD, a pad in a footprint
|
||||
PCB_SHAPE_T, ///< class PCB_SHAPE, a segment not on copper layers
|
||||
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <lib_table_base.h>
|
||||
#include <io_mgr.h>
|
||||
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class FP_LIB_TABLE_GRID;
|
||||
|
||||
|
||||
@ -182,12 +182,12 @@ public:
|
||||
*
|
||||
* @param aFootprintName is the name of the footprint to load.
|
||||
*
|
||||
* @return MODULE* - if found caller owns it, else NULL if not found.
|
||||
* @return FOOTPRINT* - if found caller owns it, else NULL if not found.
|
||||
*
|
||||
* @throw IO_ERROR if the library cannot be found or read. No exception
|
||||
* is thrown in the case where aFootprintName cannot be found.
|
||||
*/
|
||||
MODULE* FootprintLoad( const wxString& aNickname, const wxString& aFootprintName );
|
||||
FOOTPRINT* FootprintLoad( const wxString& aNickname, const wxString& aFootprintName );
|
||||
|
||||
/**
|
||||
* Function FootprintExists
|
||||
@ -203,8 +203,8 @@ public:
|
||||
* cache management. Return value is const to allow it to return a reference to a cached
|
||||
* item.
|
||||
*/
|
||||
const MODULE* GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName );
|
||||
const FOOTPRINT* GetEnumeratedFootprint( const wxString& aNickname,
|
||||
const wxString& aFootprintName );
|
||||
/**
|
||||
* Enum SAVE_T
|
||||
* is the set of return values from FootprintSave() below.
|
||||
@ -233,7 +233,7 @@ public:
|
||||
*
|
||||
* @throw IO_ERROR if there is a problem saving.
|
||||
*/
|
||||
SAVE_T FootprintSave( const wxString& aNickname, const MODULE* aFootprint,
|
||||
SAVE_T FootprintSave( const wxString& aNickname, const FOOTPRINT* aFootprint,
|
||||
bool aOverwrite = true );
|
||||
|
||||
/**
|
||||
@ -271,13 +271,13 @@ public:
|
||||
*
|
||||
* @param aFootprintId the [nickname] & footprint name of the footprint to load.
|
||||
*
|
||||
* @return MODULE* - if found caller owns it, else NULL if not found.
|
||||
* @return FOOTPRINT* - if found caller owns it, else NULL if not found.
|
||||
*
|
||||
* @throw IO_ERROR if the library cannot be found or read. No exception
|
||||
* is thrown in the case where aFootprintName cannot be found.
|
||||
* @throw PARSE_ERROR if @a aFootprintId is not parsed OK.
|
||||
*/
|
||||
MODULE* FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* FootprintLoadWithOptionalNickname( const LIB_ID& aFootprintId );
|
||||
|
||||
/**
|
||||
* Function LoadGlobalTable
|
||||
|
@ -50,7 +50,7 @@ class APP_SETTINGS_BASE;
|
||||
class BOARD;
|
||||
class BOARD_CONNECTED_ITEM;
|
||||
class COLOR_SETTINGS;
|
||||
class MODULE;
|
||||
class FOOTPRINT;
|
||||
class TRACK;
|
||||
class PAD;
|
||||
class EDA_3D_VIEWER;
|
||||
@ -86,12 +86,12 @@ protected:
|
||||
* attempts to load \a aFootprintId from the footprint library table.
|
||||
*
|
||||
* @param aFootprintId is the #LIB_ID of component footprint to load.
|
||||
* @return the #MODULE if found or NULL if \a aFootprintId not found in any of the
|
||||
* @return the #FOOTPRINT if found or NULL if \a aFootprintId not found in any of the
|
||||
* libraries in the table returned from #Prj().PcbFootprintLibs().
|
||||
* @throw IO_ERROR if an I/O error occurs or a #PARSE_ERROR if a file parsing error
|
||||
* occurs while reading footprint library files.
|
||||
*/
|
||||
MODULE* loadFootprint( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* loadFootprint( const LIB_ID& aFootprintId );
|
||||
|
||||
public:
|
||||
PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||
@ -124,10 +124,10 @@ public:
|
||||
* attempts to load \a aFootprintId from the footprint library table.
|
||||
*
|
||||
* @param aFootprintId is the #LIB_ID of component footprint to load.
|
||||
* @return the #MODULE if found or NULL if \a aFootprintId not found in any of the
|
||||
* @return the #FOOTPRINT if found or NULL if \a aFootprintId not found in any of the
|
||||
* libraries in table returned from #Prj().PcbFootprintLibs().
|
||||
*/
|
||||
MODULE* LoadFootprint( const LIB_ID& aFootprintId );
|
||||
FOOTPRINT* LoadFootprint( const LIB_ID& aFootprintId );
|
||||
|
||||
/**
|
||||
* Function GetBoardBoundingBox
|
||||
@ -275,7 +275,7 @@ public:
|
||||
* reference is entered by the user from a dialog (by awxTextCtlr, or a list of
|
||||
* available references)
|
||||
*/
|
||||
MODULE* GetFootprintFromBoardByReference();
|
||||
FOOTPRINT* GetFootprintFromBoardByReference();
|
||||
|
||||
/**
|
||||
* Function OnModify
|
||||
@ -298,7 +298,7 @@ public:
|
||||
* when the fooprint is placed on a board and a netlist is read
|
||||
* @param aFootprintName = name of the new footprint in library
|
||||
*/
|
||||
MODULE* CreateNewFootprint( const wxString& aFootprintName );
|
||||
FOOTPRINT* CreateNewFootprint( const wxString& aFootprintName );
|
||||
|
||||
/**
|
||||
* Function PlaceFootprint
|
||||
@ -307,7 +307,7 @@ public:
|
||||
*
|
||||
* @param aRecreateRatsnest A bool true redraws the footprint ratsnest.
|
||||
*/
|
||||
void PlaceFootprint( MODULE* aFootprint, bool aRecreateRatsnest = true );
|
||||
void PlaceFootprint( FOOTPRINT* aFootprint, bool aRecreateRatsnest = true );
|
||||
|
||||
void ShowPadPropertiesDialog( PAD* aPad );
|
||||
|
||||
@ -317,14 +317,14 @@ public:
|
||||
*
|
||||
* @param aPreslect = if valid, the LIB_ID to select (otherwise the global history is used)
|
||||
*/
|
||||
MODULE* SelectFootprintFromLibTree( LIB_ID aPreselect = LIB_ID() );
|
||||
FOOTPRINT* SelectFootprintFromLibTree( LIB_ID aPreselect = LIB_ID() );
|
||||
|
||||
/**
|
||||
* Adds the given footprint to the board.
|
||||
* @param aFootprint
|
||||
* @param aDC (can be NULL ) = the current Device Context, to draw the new footprint
|
||||
*/
|
||||
virtual void AddFootprintToBoard( MODULE* aFootprint );
|
||||
virtual void AddFootprintToBoard( FOOTPRINT* aFootprint );
|
||||
|
||||
/**
|
||||
* Function SelectFootprintFromLibBrowser
|
||||
|
@ -52,7 +52,7 @@ void ARRAY_CREATOR::Invoke()
|
||||
if( m_selection.Size() == 0 )
|
||||
return;
|
||||
|
||||
MODULE* const fp = m_isFootprintEditor ? m_parent.GetBoard()->GetFirstFootprint() : nullptr;
|
||||
FOOTPRINT* const fp = m_isFootprintEditor ? m_parent.GetBoard()->GetFirstFootprint() : nullptr;
|
||||
|
||||
const bool enableArrayNumbering = m_isFootprintEditor;
|
||||
const wxPoint rotPoint = (wxPoint) m_selection.GetCenter();
|
||||
@ -77,7 +77,7 @@ void ARRAY_CREATOR::Invoke()
|
||||
if( item->Type() == PCB_PAD_T && !m_isFootprintEditor )
|
||||
{
|
||||
// If it is not the footprint editor, then duplicate the parent footprint instead
|
||||
item = static_cast<MODULE*>( item )->GetParent();
|
||||
item = static_cast<FOOTPRINT*>( item )->GetParent();
|
||||
}
|
||||
|
||||
// The first item in list is the original item. We do not modify it
|
||||
@ -130,8 +130,8 @@ void ARRAY_CREATOR::Invoke()
|
||||
// @TODO: renumber footprints if asked. This needs UI to enable.
|
||||
// something like this, but needs a "block offset" to prevent
|
||||
// multiple selections overlapping.
|
||||
// if( new_item->Type() == PCB_MODULE_T )
|
||||
// static_cast<MODULE&>( *new_item ).IncrementReference( ptN );
|
||||
// if( new_item->Type() == PCB_FOOTPRINT_T )
|
||||
// static_cast<FOOTPRINT&>( *new_item ).IncrementReference( ptN );
|
||||
|
||||
// @TODO: we should merge zones. This is a bit tricky, because
|
||||
// the undo command needs saving old area, if it is merged.
|
||||
@ -147,7 +147,7 @@ void ARRAY_CREATOR::Invoke()
|
||||
|
||||
if( this_item->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
static_cast<MODULE*>( this_item )->RunOnChildren(
|
||||
static_cast<FOOTPRINT*>( this_item )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* aItem )
|
||||
{
|
||||
aItem->ClearSelected();
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <pad.h>
|
||||
|
||||
|
||||
ARRAY_PAD_NAME_PROVIDER::ARRAY_PAD_NAME_PROVIDER( const MODULE* aFootprint,
|
||||
ARRAY_PAD_NAME_PROVIDER::ARRAY_PAD_NAME_PROVIDER( const FOOTPRINT* aFootprint,
|
||||
const ARRAY_OPTIONS& aArrayOpts )
|
||||
: m_arrayOpts( aArrayOpts )
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
* @param aFootprint the footprint to gather existing names from (nullptr for no footprint)
|
||||
* @oaram aArrayOpts the array options that provide the candidate names
|
||||
*/
|
||||
ARRAY_PAD_NAME_PROVIDER( const MODULE* aFootprint, const ARRAY_OPTIONS& aArrayOpts );
|
||||
ARRAY_PAD_NAME_PROVIDER( const FOOTPRINT* aFootprint, const ARRAY_OPTIONS& aArrayOpts );
|
||||
|
||||
/**
|
||||
* Get the next available pad name.
|
||||
|
@ -82,7 +82,7 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard )
|
||||
m_board = aBoard;
|
||||
m_connectivity = std::make_unique<CONNECTIVITY_DATA>( );
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
m_connectivity->Add( footprint );
|
||||
|
||||
m_gridSize = Millimeter2iu( STEP_AR_MM );
|
||||
@ -92,7 +92,7 @@ AR_AUTOPLACER::AR_AUTOPLACER( BOARD* aBoard )
|
||||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::placeFootprint( MODULE* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
void AR_AUTOPLACER::placeFootprint( FOOTPRINT* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
const wxPoint& aPos )
|
||||
{
|
||||
if( !aFootprint )
|
||||
@ -271,7 +271,7 @@ bool AR_AUTOPLACER::fillMatrix()
|
||||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::rotateFootprint( MODULE* aFootprint, double angle, bool incremental )
|
||||
void AR_AUTOPLACER::rotateFootprint( FOOTPRINT* aFootprint, double angle, bool incremental )
|
||||
{
|
||||
if( aFootprint == NULL )
|
||||
return;
|
||||
@ -332,7 +332,7 @@ void AR_AUTOPLACER::addPad( PAD* aPad, int aClearance )
|
||||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::buildFpAreas( MODULE* aFootprint, int aFpClearance )
|
||||
void AR_AUTOPLACER::buildFpAreas( FOOTPRINT* aFootprint, int aFpClearance )
|
||||
{
|
||||
m_fpAreaTop.RemoveAllContours();
|
||||
m_fpAreaBottom.RemoveAllContours();
|
||||
@ -365,7 +365,7 @@ void AR_AUTOPLACER::buildFpAreas( MODULE* aFootprint, int aFpClearance )
|
||||
}
|
||||
|
||||
|
||||
void AR_AUTOPLACER::genModuleOnRoutingMatrix( MODULE* Module )
|
||||
void AR_AUTOPLACER::genModuleOnRoutingMatrix( FOOTPRINT* Module )
|
||||
{
|
||||
int ox, oy, fx, fy;
|
||||
LSET layerMask;
|
||||
@ -546,7 +546,7 @@ unsigned int AR_AUTOPLACER::calculateKeepOutArea( const EDA_RECT& aRect, int sid
|
||||
* Returns the value TstRectangle().
|
||||
* Module is known by its bounding box
|
||||
*/
|
||||
int AR_AUTOPLACER::testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide,
|
||||
int AR_AUTOPLACER::testFootprintOnBoard( FOOTPRINT* aFootprint, bool TstOtherSide,
|
||||
const wxPoint& aOffset )
|
||||
{
|
||||
int side = AR_SIDE_TOP;
|
||||
@ -584,7 +584,7 @@ int AR_AUTOPLACER::testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide,
|
||||
}
|
||||
|
||||
|
||||
int AR_AUTOPLACER::getOptimalFPPlacement( MODULE* aFootprint )
|
||||
int AR_AUTOPLACER::getOptimalFPPlacement( FOOTPRINT* aFootprint )
|
||||
{
|
||||
int error = 1;
|
||||
wxPoint lastPosOK;
|
||||
@ -678,12 +678,12 @@ int AR_AUTOPLACER::getOptimalFPPlacement( MODULE* aFootprint )
|
||||
}
|
||||
|
||||
|
||||
const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefFP, PAD* aRefPad, const wxPoint& aOffset)
|
||||
const PAD* AR_AUTOPLACER::nearestPad( FOOTPRINT *aRefFP, PAD* aRefPad, const wxPoint& aOffset)
|
||||
{
|
||||
const PAD* nearest = nullptr;
|
||||
int64_t nearestDist = INT64_MAX;
|
||||
|
||||
for ( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if ( footprint == aRefFP )
|
||||
continue;
|
||||
@ -710,7 +710,7 @@ const PAD* AR_AUTOPLACER::nearestPad( MODULE *aRefFP, PAD* aRefPad, const wxPoin
|
||||
}
|
||||
|
||||
|
||||
double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wxPoint& aOffset )
|
||||
double AR_AUTOPLACER::computePlacementRatsnestCost( FOOTPRINT *aFootprint, const wxPoint& aOffset )
|
||||
{
|
||||
double curr_cost;
|
||||
VECTOR2I start; // start point of a ratsnest
|
||||
@ -719,7 +719,7 @@ double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wx
|
||||
|
||||
curr_cost = 0;
|
||||
|
||||
for ( PAD* pad : aFootprint->Pads() )
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
{
|
||||
const PAD* nearest = nearestPad( aFootprint, pad, aOffset );
|
||||
|
||||
@ -758,7 +758,7 @@ double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aFootprint, const wx
|
||||
|
||||
|
||||
// Sort routines
|
||||
static bool sortFootprintsByComplexity( MODULE* ref, MODULE* compare )
|
||||
static bool sortFootprintsByComplexity( FOOTPRINT* ref, FOOTPRINT* compare )
|
||||
{
|
||||
double ff1, ff2;
|
||||
|
||||
@ -769,7 +769,7 @@ static bool sortFootprintsByComplexity( MODULE* ref, MODULE* compare )
|
||||
}
|
||||
|
||||
|
||||
static bool sortFootprintsByRatsnestSize( MODULE* ref, MODULE* compare )
|
||||
static bool sortFootprintsByRatsnestSize( FOOTPRINT* ref, FOOTPRINT* compare )
|
||||
{
|
||||
double ff1, ff2;
|
||||
|
||||
@ -779,12 +779,12 @@ static bool sortFootprintsByRatsnestSize( MODULE* ref, MODULE* compare )
|
||||
}
|
||||
|
||||
|
||||
MODULE* AR_AUTOPLACER::pickFootprint( )
|
||||
FOOTPRINT* AR_AUTOPLACER::pickFootprint( )
|
||||
{
|
||||
std::vector<MODULE*> fpList;
|
||||
std::vector<FOOTPRINT*> fpList;
|
||||
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
footprint->CalculateBoundingBox();
|
||||
fpList.push_back( footprint );
|
||||
@ -794,7 +794,7 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
||||
|
||||
for( unsigned kk = 0; kk < fpList.size(); kk++ )
|
||||
{
|
||||
MODULE* footprint = fpList[kk];
|
||||
FOOTPRINT* footprint = fpList[kk];
|
||||
footprint->SetFlag( 0 );
|
||||
|
||||
if( !footprint->NeedsPlaced() )
|
||||
@ -807,7 +807,7 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
||||
|
||||
for( unsigned kk = 0; kk < fpList.size(); kk++ )
|
||||
{
|
||||
MODULE* footprint = fpList[kk];
|
||||
FOOTPRINT* footprint = fpList[kk];
|
||||
|
||||
auto edges = m_connectivity->GetRatsnestForComponent( footprint, true );
|
||||
|
||||
@ -817,12 +817,12 @@ MODULE* AR_AUTOPLACER::pickFootprint( )
|
||||
sort( fpList.begin(), fpList.end(), sortFootprintsByRatsnestSize );
|
||||
|
||||
// Search for "best" footprint.
|
||||
MODULE* bestFootprint = nullptr;
|
||||
MODULE* altFootprint = nullptr;
|
||||
FOOTPRINT* bestFootprint = nullptr;
|
||||
FOOTPRINT* altFootprint = nullptr;
|
||||
|
||||
for( unsigned ii = 0; ii < fpList.size(); ii++ )
|
||||
{
|
||||
MODULE* footprint = fpList[ii];
|
||||
FOOTPRINT* footprint = fpList[ii];
|
||||
|
||||
if( !footprint->NeedsPlaced() )
|
||||
continue;
|
||||
@ -874,7 +874,7 @@ void AR_AUTOPLACER::drawPlacementRoutingMatrix( )
|
||||
}
|
||||
|
||||
|
||||
AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
||||
AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprints,
|
||||
BOARD_COMMIT* aCommit,
|
||||
bool aPlaceOffboardModules )
|
||||
{
|
||||
@ -896,33 +896,33 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
||||
|
||||
int placedCount = 0;
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
footprint->SetNeedsPlaced( false );
|
||||
|
||||
std::vector<MODULE*> offboardMods;
|
||||
std::vector<FOOTPRINT*> offboardMods;
|
||||
|
||||
if( aPlaceOffboardModules )
|
||||
{
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( !m_matrix.m_BrdBox.Contains( footprint->GetPosition() ) )
|
||||
offboardMods.push_back( footprint );
|
||||
}
|
||||
}
|
||||
|
||||
for( MODULE* footprint : aFootprints )
|
||||
for( FOOTPRINT* footprint : aFootprints )
|
||||
{
|
||||
footprint->SetNeedsPlaced( true );
|
||||
aCommit->Modify( footprint );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : offboardMods )
|
||||
for( FOOTPRINT* footprint : offboardMods )
|
||||
{
|
||||
footprint->SetNeedsPlaced( true );
|
||||
aCommit->Modify( footprint );
|
||||
}
|
||||
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
if( footprint->NeedsPlaced() ) // Erase from screen
|
||||
placedCount++;
|
||||
@ -945,7 +945,7 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<MODULE*>& aFootprints,
|
||||
if( m_refreshCallback )
|
||||
m_refreshCallback( nullptr );
|
||||
|
||||
MODULE* footprint;
|
||||
FOOTPRINT* footprint;
|
||||
|
||||
while( ( footprint = pickFootprint() ) != nullptr )
|
||||
{
|
||||
@ -1075,7 +1075,7 @@ end_of_tst:
|
||||
|
||||
m_matrix.UnInitRoutingMatrix();
|
||||
|
||||
for( MODULE* fp : m_board->Footprints() )
|
||||
for( FOOTPRINT* fp : m_board->Footprints() )
|
||||
fp->CalculateBoundingBox();
|
||||
|
||||
return cancelled ? AR_CANCELLED : AR_COMPLETED;
|
||||
|
@ -59,7 +59,7 @@ class AR_AUTOPLACER
|
||||
public:
|
||||
AR_AUTOPLACER( BOARD* aBoard );
|
||||
|
||||
AR_RESULT AutoplaceFootprints( std::vector<MODULE*>& aFootprints, BOARD_COMMIT* aCommit,
|
||||
AR_RESULT AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprints, BOARD_COMMIT* aCommit,
|
||||
bool aPlaceOffboardModules = false );
|
||||
|
||||
/**
|
||||
@ -74,7 +74,7 @@ public:
|
||||
* a callback function to redraw on screen the view after changes,
|
||||
* for instance after moving a footprint
|
||||
*/
|
||||
void SetRefreshCallback( std::function<int( MODULE* aModule )> aCallback )
|
||||
void SetRefreshCallback( std::function<int( FOOTPRINT* aFootprint )> aCallback )
|
||||
{
|
||||
m_refreshCallback = aCallback;
|
||||
}
|
||||
@ -85,33 +85,32 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void drawPlacementRoutingMatrix(); // draw the working area (shows free and occupied areas)
|
||||
void rotateFootprint( MODULE* aFootprint, double angle, bool incremental );
|
||||
int genPlacementRoutingMatrix();
|
||||
void drawPlacementRoutingMatrix(); // draw the working area (shows free and occupied areas)
|
||||
void rotateFootprint( FOOTPRINT* aFootprint, double angle, bool incremental );
|
||||
int genPlacementRoutingMatrix();
|
||||
|
||||
/** fills m_matrix cells from m_boardShape.
|
||||
* cells inside m_boardShape are set to CELL_IS_ZONE
|
||||
*/
|
||||
bool fillMatrix();
|
||||
void genModuleOnRoutingMatrix( MODULE* Module );
|
||||
bool fillMatrix();
|
||||
void genModuleOnRoutingMatrix( FOOTPRINT* aFootprint );
|
||||
|
||||
int testRectangle( const EDA_RECT& aRect, int side );
|
||||
int testRectangle( const EDA_RECT& aRect, int side );
|
||||
unsigned int calculateKeepOutArea( const EDA_RECT& aRect, int side );
|
||||
int testFootprintOnBoard( MODULE* aFootprint, bool TstOtherSide, const wxPoint& aOffset );
|
||||
int getOptimalFPPlacement( MODULE* aFootprint );
|
||||
double computePlacementRatsnestCost( MODULE* aFootprint, const wxPoint& aOffset );
|
||||
int testFootprintOnBoard( FOOTPRINT* aFootprint, bool TstOtherSide, const wxPoint& aOffset );
|
||||
int getOptimalFPPlacement( FOOTPRINT* aFootprint );
|
||||
double computePlacementRatsnestCost( FOOTPRINT* aFootprint, const wxPoint& aOffset );
|
||||
|
||||
/**
|
||||
* Find the "best" footprint place. The criteria are:
|
||||
* - Maximum ratsnest with footprints already placed
|
||||
* - Max size, and number of pads max
|
||||
*/
|
||||
MODULE* pickFootprint();
|
||||
FOOTPRINT* pickFootprint();
|
||||
|
||||
void placeFootprint( MODULE* aFootprint, bool aDoNotRecreateRatsnest,
|
||||
const wxPoint& aPos );
|
||||
void placeFootprint( FOOTPRINT* aFootprint, bool aDoNotRecreateRatsnest, const wxPoint& aPos );
|
||||
|
||||
const PAD* nearestPad( MODULE* aRefFP, PAD* aRefPad, const wxPoint& aOffset );
|
||||
const PAD* nearestPad( FOOTPRINT* aRefFP, PAD* aRefPad, const wxPoint& aOffset );
|
||||
|
||||
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
|
||||
void addFpBody( wxPoint aStart, wxPoint aEnd, LSET aLayerMask );
|
||||
@ -121,7 +120,7 @@ private:
|
||||
|
||||
// Build m_fpAreaTop and m_fpAreaBottom polygonal shapes for aFootprint.
|
||||
// aFpClearance is a mechanical clearance.
|
||||
void buildFpAreas( MODULE* aFootprint, int aFpClearance );
|
||||
void buildFpAreas( FOOTPRINT* aFootprint, int aFpClearance );
|
||||
|
||||
AR_MATRIX m_matrix;
|
||||
SHAPE_POLY_SET m_topFreeArea; // The polygonal description of the top side free areas;
|
||||
@ -136,10 +135,10 @@ private:
|
||||
double m_minCost;
|
||||
int m_gridSize;
|
||||
|
||||
std::shared_ptr<KIGFX::VIEW_OVERLAY> m_overlay;
|
||||
std::unique_ptr<CONNECTIVITY_DATA> m_connectivity;
|
||||
std::function<int( MODULE* aModule )> m_refreshCallback;
|
||||
PROGRESS_REPORTER* m_progressReporter;
|
||||
std::shared_ptr<KIGFX::VIEW_OVERLAY> m_overlay;
|
||||
std::unique_ptr<CONNECTIVITY_DATA> m_connectivity;
|
||||
std::function<int( FOOTPRINT* aFootprint )> m_refreshCallback;
|
||||
PROGRESS_REPORTER* m_progressReporter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user