From c4c19018c3f7dee2505d0cd80a75dd955ebb695d Mon Sep 17 00:00:00 2001 From: John Beard Date: Wed, 4 Mar 2026 15:51:05 +0800 Subject: [PATCH] Pcbnew: Restrict includes of pad.h/footprint.h There are some headers which don't need to include pad.h (which brings padstack.h) - they just need forward defines. While pad.h is not an especially heavy include on the scale of things, footprint is quite heavy. And both reduce inclusion load and reduce the number of files needlessly sensitive to changes in headers. --- 3d-viewer/3d_canvas/board_adapter.cpp | 1 + 3d-viewer/3d_canvas/board_adapter.h | 6 ++-- 3d-viewer/3d_canvas/create_layer_items.cpp | 3 ++ 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 6 ++-- .../3d_rendering/opengl/render_3d_opengl.h | 1 + .../3d_rendering/raytracing/create_scene.cpp | 1 + .../raytracing/render_3d_raytrace_gl.cpp | 5 ++- .../raytracing/render_3d_raytrace_gl.h | 5 +++ 3d-viewer/dialogs/panel_preview_3d_model.cpp | 1 + pcbnew/array_pad_number_provider.h | 3 +- pcbnew/autorouter/ar_autoplacer.h | 2 -- pcbnew/autorouter/autoplace_tool.cpp | 1 + pcbnew/autorouter/spread_footprints.cpp | 5 ++- pcbnew/autorouter/spread_footprints.h | 5 +-- pcbnew/board.cpp | 1 + pcbnew/board_commit.cpp | 1 + .../component_class_cache_proxy.h | 3 +- pcbnew/connectivity/connectivity_algo.cpp | 3 ++ pcbnew/connectivity/connectivity_algo.h | 13 +++----- pcbnew/connectivity/connectivity_data.cpp | 2 ++ pcbnew/connectivity/from_to_cache.cpp | 4 +++ pcbnew/dialogs/dialog_board_reannotate.cpp | 7 ++-- pcbnew/dialogs/dialog_board_reannotate.h | 3 -- pcbnew/dialogs/dialog_board_statistics.cpp | 7 ++++ pcbnew/dialogs/dialog_board_statistics.h | 11 ++----- .../dialogs/dialog_footprint_properties.cpp | 1 + pcbnew/dialogs/dialog_footprint_properties.h | 7 ++-- .../dialog_footprint_properties_fp_editor.cpp | 1 + pcbnew/dialogs/dialog_fp_edit_pad_table.h | 1 - .../dialogs/dialog_global_edit_teardrops.cpp | 2 +- .../dialog_multichannel_repeat_layout.cpp | 1 + pcbnew/dialogs/dialog_pad_properties.h | 5 ++- pcbnew/drc/drc_cache_generator.cpp | 2 +- pcbnew/drc/drc_rtree.h | 1 - .../drc/drc_test_provider_edge_clearance.cpp | 3 +- .../drc_test_provider_schematic_parity.cpp | 1 + pcbnew/exporters/place_file_exporter.cpp | 1 + pcbnew/exporters/place_file_exporter.h | 1 - pcbnew/footprint.cpp | 4 ++- pcbnew/footprint_chooser_frame.cpp | 10 +++--- pcbnew/footprint_chooser_frame.h | 1 + pcbnew/footprint_viewer_frame.cpp | 2 +- pcbnew/footprint_wizard_frame.cpp | 18 ++++++---- pcbnew/kicad_clipboard.cpp | 1 + pcbnew/kicad_clipboard.h | 1 - .../length_delay_calculation.cpp | 1 + .../length_delay_calculation_item.cpp | 1 + .../length_delay_calculation_item.h | 6 +++- .../tuning_profile_parameters_iface.h | 1 + ...tuning_profile_parameters_user_defined.cpp | 1 + .../netlist_reader/kicad_netlist_reader.cpp | 2 ++ .../netlist_reader/legacy_netlist_reader.cpp | 4 ++- pcbnew/netlist_reader/netlist.cpp | 1 + pcbnew/netlist_reader/pcb_component.cpp | 22 ++++++++++++- pcbnew/netlist_reader/pcb_component.h | 21 ++++-------- pcbnew/netlist_reader/pcb_netlist.cpp | 33 +++++++++++++++++-- pcbnew/netlist_reader/pcb_netlist.h | 23 ++++--------- pcbnew/pad_utils.cpp | 2 ++ pcbnew/pad_utils.h | 6 ++-- pcbnew/pcb_base_frame.cpp | 2 ++ pcbnew/pcb_draw_panel_gal.cpp | 1 + pcbnew/pcb_edit_frame.cpp | 13 +++++--- pcbnew/pcb_io/altium/altium_parser_pcb.cpp | 1 + pcbnew/pcb_io/altium/altium_parser_pcb.h | 8 ++++- pcbnew/pcb_io/altium/altium_pcb.cpp | 1 + pcbnew/pcb_io/altium/altium_pcb.h | 1 + pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h | 3 +- pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp | 3 ++ pcbnew/pcb_io/odbpp/odb_component.cpp | 1 + pcbnew/pcb_io/odbpp/odb_eda_data.cpp | 2 ++ pcbnew/pcb_io/odbpp/odb_entity.cpp | 1 + pcbnew/pcb_io/odbpp/odb_feature.cpp | 2 ++ pcbnew/pcb_io/odbpp/odb_feature.h | 5 +-- pcbnew/pcb_io/odbpp/pcb_io_odbpp.cpp | 2 ++ pcbnew/pcb_io/odbpp/pcb_io_odbpp.h | 4 ++- pcbnew/pcb_io/pcb_io_mgr.cpp | 1 + pcbnew/pcb_reference_image.cpp | 1 + pcbnew/pcbexpr_functions.cpp | 4 +++ pcbnew/pcbnew.cpp | 1 + pcbnew/pcbnew_jobs_handler.cpp | 1 + pcbnew/python/swig/pcbnew.i | 3 +- pcbnew/ratsnest/ratsnest.cpp | 2 +- pcbnew/ratsnest/ratsnest_data.cpp | 2 +- pcbnew/router/pns_meander_placer.cpp | 2 ++ pcbnew/teardrop/teardrop.h | 8 ++--- pcbnew/tools/align_distribute_tool.cpp | 1 + pcbnew/tools/array_tool.cpp | 1 + pcbnew/tools/board_inspection_tool.cpp | 4 ++- pcbnew/tools/board_reannotate_tool.cpp | 7 ++-- pcbnew/tools/drawing_tool.cpp | 1 + pcbnew/tools/drc_tool.cpp | 1 + pcbnew/tools/edit_tool.cpp | 1 + pcbnew/tools/edit_tool_move_fct.cpp | 1 + pcbnew/tools/multichannel_tool.cpp | 5 +-- pcbnew/tools/multichannel_tool.h | 4 +-- pcbnew/tools/pcb_grid_helper.cpp | 30 +++++++++++++++++ pcbnew/tools/pcb_grid_helper.h | 31 +++-------------- pcbnew/tools/pcb_selection_tool.cpp | 3 +- pcbnew/tools/pcb_viewer_tools.cpp | 2 ++ pcbnew/tracks_cleaner.cpp | 1 + pcbnew/widgets/search_handlers.cpp | 21 +++++++++++- pcbnew/widgets/search_handlers.h | 16 +-------- pcbnew/zone_manager/dialog_zone_manager.h | 1 - 103 files changed, 320 insertions(+), 174 deletions(-) diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index e19528bd1c..15dc14171a 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -34,6 +34,7 @@ #include <3d_rendering/raytracing/shapes2D/polygon_2d.h> #include #include +#include #include #include <3d_math.h> #include "3d_fastmath.h" diff --git a/3d-viewer/3d_canvas/board_adapter.h b/3d-viewer/3d_canvas/board_adapter.h index daca2e6a3b..675967f305 100644 --- a/3d-viewer/3d_canvas/board_adapter.h +++ b/3d-viewer/3d_canvas/board_adapter.h @@ -38,22 +38,22 @@ #include "../3d_viewer/eda_3d_viewer_settings.h" #include -#include #include #include #include #include #include #include -#include -#include #include #include class COLOR_SETTINGS; +class FOOTPRINT; +class PAD; class PCB_BARCODE; class PCB_TEXTBOX; class PCB_TRACK; +class ZONE; /// A type that stores a container of 2d objects for each layer id typedef std::map MAP_CONTAINER_2D_BASE; diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 966e02eb3c..feb26e0371 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -35,13 +35,16 @@ #include "raytracing/shapes2D/triangle_2d.h" #include #include +#include #include #include #include #include +#include #include #include #include +#include #ifdef PRINT_STATISTICS_3D_VIEWER #include diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 72b2f45758..63a7fc3c03 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -28,6 +28,8 @@ #include +#include + #include "../common_ogl/ogl_utils.h" #include "eda_3d_canvas.h" #include @@ -38,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -54,9 +57,8 @@ #include #include #include -#include - #include +#include /** diff --git a/3d-viewer/3d_rendering/opengl/render_3d_opengl.h b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h index 34c5a7053b..ca6a3d97aa 100644 --- a/3d-viewer/3d_rendering/opengl/render_3d_opengl.h +++ b/3d-viewer/3d_rendering/opengl/render_3d_opengl.h @@ -43,6 +43,7 @@ #include "3d_cache/3d_info.h" #include +#include // For PAD_DRILL_POST_MACHINING_MODE #include diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index 53899c59fd..1e06383c11 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.cpp b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.cpp index b92d3dc9a9..e442a02942 100644 --- a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.cpp +++ b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.cpp @@ -30,10 +30,13 @@ #include #include +#include + #include "render_3d_raytrace_gl.h" #include "../common_ogl/ogl_utils.h" + #include // To use GetRunningMicroSecs or another profiling utility -#include +#include RENDER_3D_RAYTRACE_GL::RENDER_3D_RAYTRACE_GL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, diff --git a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.h b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.h index 9e619bb9c2..b7c357232d 100644 --- a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.h +++ b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace_gl.h @@ -30,6 +30,11 @@ #include +class EDA_3D_CANVAS; +class BOARD_ADAPTER; +class REPORTER; + + class RENDER_3D_RAYTRACE_GL : public RENDER_3D_RAYTRACE_BASE { public: diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index fd54418f5b..b924949076 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/array_pad_number_provider.h b/pcbnew/array_pad_number_provider.h index 00269250d2..6b68784118 100644 --- a/pcbnew/array_pad_number_provider.h +++ b/pcbnew/array_pad_number_provider.h @@ -24,10 +24,9 @@ #ifndef PCBNEW_ARRAY_PAD_NAME_PROVIDER__H #define PCBNEW_ARRAY_PAD_NAME_PROVIDER__H +#include #include -#include -#include /** * Simple class that sequentially provides numbers from an #ARRAY_OPTIONS object, making sure diff --git a/pcbnew/autorouter/ar_autoplacer.h b/pcbnew/autorouter/ar_autoplacer.h index d2a39add07..2ec220837b 100644 --- a/pcbnew/autorouter/ar_autoplacer.h +++ b/pcbnew/autorouter/ar_autoplacer.h @@ -31,8 +31,6 @@ #include "ar_matrix.h" -#include -#include #include #include diff --git a/pcbnew/autorouter/autoplace_tool.cpp b/pcbnew/autorouter/autoplace_tool.cpp index 7550004105..e17e8f8125 100644 --- a/pcbnew/autorouter/autoplace_tool.cpp +++ b/pcbnew/autorouter/autoplace_tool.cpp @@ -23,6 +23,7 @@ #include +#include #include #include #include diff --git a/pcbnew/autorouter/spread_footprints.cpp b/pcbnew/autorouter/spread_footprints.cpp index c37f2cac6e..afa19219b5 100644 --- a/pcbnew/autorouter/spread_footprints.cpp +++ b/pcbnew/autorouter/spread_footprints.cpp @@ -34,9 +34,12 @@ * their selection. */ -#include +#include "spread_footprints.h" + #include #include + +#include #include #include #include diff --git a/pcbnew/autorouter/spread_footprints.h b/pcbnew/autorouter/spread_footprints.h index a08ab7de26..15093a9486 100644 --- a/pcbnew/autorouter/spread_footprints.h +++ b/pcbnew/autorouter/spread_footprints.h @@ -27,10 +27,11 @@ #include -#include #include #include -#include + +class FOOTPRINT; + /** * Footprints (after loaded by reading a netlist for instance) are moved diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 2f9e12851f..1fbc94de13 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index df4c991a17..76c8849399 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/component_classes/component_class_cache_proxy.h b/pcbnew/component_classes/component_class_cache_proxy.h index 38e40dc131..2e8b5bab4c 100644 --- a/pcbnew/component_classes/component_class_cache_proxy.h +++ b/pcbnew/component_classes/component_class_cache_proxy.h @@ -23,7 +23,8 @@ #include #include -#include + +class FOOTPRINT; /* * A class which acts as a cache-aware proxy for a FOOTPRINT's component class. diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index 3366d4d46b..2ca70efa67 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -33,8 +33,11 @@ #include #include #include +#include #include #include +#include +#include #include #include diff --git a/pcbnew/connectivity/connectivity_algo.h b/pcbnew/connectivity/connectivity_algo.h index 63f463a66b..c533dca08b 100644 --- a/pcbnew/connectivity/connectivity_algo.h +++ b/pcbnew/connectivity/connectivity_algo.h @@ -30,18 +30,14 @@ #ifndef __CONNECTIVITY_ALGO_H #define __CONNECTIVITY_ALGO_H -#include -#include -#include -#include - #include -#include #include -#include -#include #include +#include +#include +#include +#include #include #include @@ -51,6 +47,7 @@ class CN_RATSNEST_NODES; class BOARD; class BOARD_CONNECTED_ITEM; class BOARD_ITEM; +class FOOTPRINT; class ZONE; class PROGRESS_REPORTER; diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index 605f95f44d..38d049362f 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index 3bb4118461..6abe6e3ed6 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -19,8 +19,11 @@ #include #include + #include #include +#include +#include #include #include @@ -30,6 +33,7 @@ #include + void FROM_TO_CACHE::buildEndpointList( ) { m_ftEndpoints.clear(); diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 232c2c7c5d..3450d0f2b4 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -26,11 +26,16 @@ #include "dialog_board_reannotate.h" #include + +#include +#include + #include #include #include #include #include +#include #include #include // StrNumCmp #include @@ -39,8 +44,6 @@ #include #include #include -#include -#include bool g_SortYFirst; diff --git a/pcbnew/dialogs/dialog_board_reannotate.h b/pcbnew/dialogs/dialog_board_reannotate.h index 864cb25a62..5b8aaa8aa0 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.h +++ b/pcbnew/dialogs/dialog_board_reannotate.h @@ -25,8 +25,6 @@ #pragma once -#include -#include #include #include #include @@ -181,4 +179,3 @@ private: std::vector m_refDesPrefixInfos; std::vector m_excludeArray; }; - diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index cb4c6ce5d7..659663da33 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -26,19 +26,26 @@ #include "dialog_board_statistics.h" #include +#include + #include +#include #include #include #include +#include #include #include #include +#include #include #include #include + + #define COL_LABEL 0 #define COL_AMOUNT 1 diff --git a/pcbnew/dialogs/dialog_board_statistics.h b/pcbnew/dialogs/dialog_board_statistics.h index 9176a8d645..57673dfa45 100644 --- a/pcbnew/dialogs/dialog_board_statistics.h +++ b/pcbnew/dialogs/dialog_board_statistics.h @@ -26,16 +26,11 @@ #ifndef _DIALOG_BOARD_STATISTICS_H #define _DIALOG_BOARD_STATISTICS_H - -#include -#include #include -#include #include -#include -#include -#include -#include + + +class PCB_EDIT_FRAME; /** * Dialog to show common board info. diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 9dd09591c8..07dc674991 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_footprint_properties.h b/pcbnew/dialogs/dialog_footprint_properties.h index 9fb469ecf1..9fbded24a8 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.h +++ b/pcbnew/dialogs/dialog_footprint_properties.h @@ -22,15 +22,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #ifndef DIALOG_FOOTPRINT_PROPERTIES_H #define DIALOG_FOOTPRINT_PROPERTIES_H - #include + #include -#include -#include + #include #include @@ -38,6 +36,7 @@ class PCB_EDIT_FRAME; class PANEL_FP_PROPERTIES_3D_MODEL; class PANEL_EMBEDDED_FILES; +class PCB_FIELDS_GRID_TABLE; class DIALOG_FOOTPRINT_PROPERTIES: public DIALOG_FOOTPRINT_PROPERTIES_BASE { diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index 03c94186dc..5c38694133 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/dialogs/dialog_fp_edit_pad_table.h b/pcbnew/dialogs/dialog_fp_edit_pad_table.h index ae731f564f..24da765daf 100644 --- a/pcbnew/dialogs/dialog_fp_edit_pad_table.h +++ b/pcbnew/dialogs/dialog_fp_edit_pad_table.h @@ -88,4 +88,3 @@ private: std::unique_ptr m_unitsProvider; bool m_summaryDirty; }; - diff --git a/pcbnew/dialogs/dialog_global_edit_teardrops.cpp b/pcbnew/dialogs/dialog_global_edit_teardrops.cpp index 5ccdc6dff2..576a7eccd5 100644 --- a/pcbnew/dialogs/dialog_global_edit_teardrops.cpp +++ b/pcbnew/dialogs/dialog_global_edit_teardrops.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -505,4 +506,3 @@ int GLOBAL_EDIT_TOOL::EditTeardrops( const TOOL_EVENT& aEvent ) dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR return 0; } - diff --git a/pcbnew/dialogs/dialog_multichannel_repeat_layout.cpp b/pcbnew/dialogs/dialog_multichannel_repeat_layout.cpp index b2851575ee..8c603106a3 100644 --- a/pcbnew/dialogs/dialog_multichannel_repeat_layout.cpp +++ b/pcbnew/dialogs/dialog_multichannel_repeat_layout.cpp @@ -31,6 +31,7 @@ #include #include #include +#include DIALOG_MULTICHANNEL_REPEAT_LAYOUT::DIALOG_MULTICHANNEL_REPEAT_LAYOUT( PCB_BASE_FRAME* aFrame, diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index b64328a292..9fb5971651 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -28,9 +28,10 @@ #define _DIALOG_PAD_PROPERTIES_H_ #include + #include + #include -#include #include #include #include @@ -40,6 +41,8 @@ #include #include +class PAD; + /** * DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, * created by wxFormBuilder diff --git a/pcbnew/drc/drc_cache_generator.cpp b/pcbnew/drc/drc_cache_generator.cpp index 645dcbb571..86fb84b9e9 100644 --- a/pcbnew/drc/drc_cache_generator.cpp +++ b/pcbnew/drc/drc_cache_generator.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -306,4 +307,3 @@ bool DRC_CACHE_GENERATOR::Run() return !m_drcEngine->IsCancelled(); } - diff --git a/pcbnew/drc/drc_rtree.h b/pcbnew/drc/drc_rtree.h index 0efbde2fa6..364a19d41a 100644 --- a/pcbnew/drc/drc_rtree.h +++ b/pcbnew/drc/drc_rtree.h @@ -26,7 +26,6 @@ #define DRC_RTREE_H_ #include -#include #include #include #include diff --git a/pcbnew/drc/drc_test_provider_edge_clearance.cpp b/pcbnew/drc/drc_test_provider_edge_clearance.cpp index 9b9bde64e8..ef05aae5a8 100644 --- a/pcbnew/drc/drc_test_provider_edge_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_edge_clearance.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,7 @@ #include #include #include -#include "drc_rtree.h" +#include /* Board edge clearance test. Checks all items for their mechanical clearances against the board diff --git a/pcbnew/drc/drc_test_provider_schematic_parity.cpp b/pcbnew/drc/drc_test_provider_schematic_parity.cpp index cfa4e91225..2804b16b4e 100644 --- a/pcbnew/drc/drc_test_provider_schematic_parity.cpp +++ b/pcbnew/drc/drc_test_provider_schematic_parity.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/exporters/place_file_exporter.cpp b/pcbnew/exporters/place_file_exporter.cpp index 7c2201fa6b..bfe9185dc7 100644 --- a/pcbnew/exporters/place_file_exporter.cpp +++ b/pcbnew/exporters/place_file_exporter.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/exporters/place_file_exporter.h b/pcbnew/exporters/place_file_exporter.h index 9839e0448d..d68f0304e5 100644 --- a/pcbnew/exporters/place_file_exporter.h +++ b/pcbnew/exporters/place_file_exporter.h @@ -26,7 +26,6 @@ #include -#include /** * The ASCII format of the kicad place file is: diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index a1ede8e31d..97da73a901 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -23,6 +23,9 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#include "footprint.h" + #include #include @@ -46,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_chooser_frame.cpp b/pcbnew/footprint_chooser_frame.cpp index 0f87c2c40d..344d8daccf 100644 --- a/pcbnew/footprint_chooser_frame.cpp +++ b/pcbnew/footprint_chooser_frame.cpp @@ -22,14 +22,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include +#include +#include + #include #include #include #include #include -#include -#include -#include +#include #include #include #include @@ -889,5 +891,3 @@ void FOOTPRINT_CHOOSER_FRAME::setupUIConditions() #undef CHECK // clang-format on } - - diff --git a/pcbnew/footprint_chooser_frame.h b/pcbnew/footprint_chooser_frame.h index 1b6f8e7741..973f1a6e42 100644 --- a/pcbnew/footprint_chooser_frame.h +++ b/pcbnew/footprint_chooser_frame.h @@ -34,6 +34,7 @@ #include <3d_canvas/board_adapter.h> #include <3d_rendering/track_ball.h> +class EDA_3D_CANVAS; class PANEL_FOOTPRINT_CHOOSER; class wxCheckBox; class BITMAP_BUTTON; diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 3946bd8943..07a7415720 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1086,4 +1087,3 @@ BOARD_ITEM_CONTAINER* FOOTPRINT_VIEWER_FRAME::GetModel() const { return GetBoard()->GetFirstFootprint(); } - diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 06dac301e7..0d940cfb8e 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -24,6 +24,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "footprint_wizard_frame.h" + +#include +#include +#include +#include +#include + +#include + #include #include #include @@ -34,17 +44,12 @@ #include #include #include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include @@ -59,7 +64,6 @@ #include #include #include -#include "footprint_wizard_frame.h" BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, PCB_BASE_EDIT_FRAME ) diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index 26c65cffb7..150362800a 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/kicad_clipboard.h b/pcbnew/kicad_clipboard.h index 47f6583897..6bb9ff2def 100644 --- a/pcbnew/kicad_clipboard.h +++ b/pcbnew/kicad_clipboard.h @@ -31,7 +31,6 @@ #define KICAD_CLIPBOARD_H #include -#include #include #include #include diff --git a/pcbnew/length_delay_calculation/length_delay_calculation.cpp b/pcbnew/length_delay_calculation/length_delay_calculation.cpp index 6f147bdddb..87b2b1ab56 100644 --- a/pcbnew/length_delay_calculation/length_delay_calculation.cpp +++ b/pcbnew/length_delay_calculation/length_delay_calculation.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp b/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp index efcb318411..01d87b2606 100644 --- a/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp +++ b/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp @@ -25,6 +25,7 @@ #include #include +#include #include diff --git a/pcbnew/length_delay_calculation/length_delay_calculation_item.h b/pcbnew/length_delay_calculation/length_delay_calculation_item.h index de46670803..c7cbda40c0 100644 --- a/pcbnew/length_delay_calculation/length_delay_calculation_item.h +++ b/pcbnew/length_delay_calculation/length_delay_calculation_item.h @@ -26,9 +26,13 @@ #include #include -#include #include +class BOARD; +class PAD; +class NETCLASS; + + /** * Lightweight class which holds a pad, via, or a routed trace outline. Proxied objects passed by pointer are not * owned by this container. diff --git a/pcbnew/length_delay_calculation/tuning_profile_parameters_iface.h b/pcbnew/length_delay_calculation/tuning_profile_parameters_iface.h index 0ccf723f9d..e923af96ff 100644 --- a/pcbnew/length_delay_calculation/tuning_profile_parameters_iface.h +++ b/pcbnew/length_delay_calculation/tuning_profile_parameters_iface.h @@ -27,6 +27,7 @@ #include #include +class BOARD; class LENGTH_DELAY_CALCULATION; /** diff --git a/pcbnew/length_delay_calculation/tuning_profile_parameters_user_defined.cpp b/pcbnew/length_delay_calculation/tuning_profile_parameters_user_defined.cpp index 527efa874c..cb1f14218a 100644 --- a/pcbnew/length_delay_calculation/tuning_profile_parameters_user_defined.cpp +++ b/pcbnew/length_delay_calculation/tuning_profile_parameters_user_defined.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include diff --git a/pcbnew/netlist_reader/kicad_netlist_reader.cpp b/pcbnew/netlist_reader/kicad_netlist_reader.cpp index 95ee4b17f9..702db7ee95 100644 --- a/pcbnew/netlist_reader/kicad_netlist_reader.cpp +++ b/pcbnew/netlist_reader/kicad_netlist_reader.cpp @@ -22,6 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include // netlist_lexer is common to Eeschema and Pcbnew #include #include diff --git a/pcbnew/netlist_reader/legacy_netlist_reader.cpp b/pcbnew/netlist_reader/legacy_netlist_reader.cpp index a01e4fe074..64fd143d15 100644 --- a/pcbnew/netlist_reader/legacy_netlist_reader.cpp +++ b/pcbnew/netlist_reader/legacy_netlist_reader.cpp @@ -23,11 +23,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include // to define strncasecmp for some platforms #include #include #include "pcb_netlist.h" -#include "netlist_reader.h" +#include + void LEGACY_NETLIST_READER::LoadNetlist() { diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 97d55df586..9d82881680 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -39,6 +39,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include #include diff --git a/pcbnew/netlist_reader/pcb_component.cpp b/pcbnew/netlist_reader/pcb_component.cpp index dfd59a9bcc..9730f7735c 100644 --- a/pcbnew/netlist_reader/pcb_component.cpp +++ b/pcbnew/netlist_reader/pcb_component.cpp @@ -21,8 +21,28 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "netlist_reader/pcb_component.h" + #include -#include + + +PCB_COMPONENT::PCB_COMPONENT( const LIB_ID& aFPID, + const wxString& aReference, + const wxString& aValue, + const KIID_PATH& aPath, + const std::vector& aKiids ) + : COMPONENT( aFPID, aReference, aValue, aPath, aKiids ) +{ +} + + +PCB_COMPONENT::~PCB_COMPONENT() {}; + + +FOOTPRINT* PCB_COMPONENT::GetFootprint( bool aRelease ) +{ + return ( aRelease ) ? m_footprint.release() : m_footprint.get(); +} void PCB_COMPONENT::SetFootprint( FOOTPRINT* aFootprint ) diff --git a/pcbnew/netlist_reader/pcb_component.h b/pcbnew/netlist_reader/pcb_component.h index 22b5d75188..82b58ec4f4 100644 --- a/pcbnew/netlist_reader/pcb_component.h +++ b/pcbnew/netlist_reader/pcb_component.h @@ -21,12 +21,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef PCB_COMPONENT_H -#define PCB_COMPONENT_H +#pragma once + +#include #include -#include -#include /** @@ -39,17 +38,11 @@ public: const wxString& aReference, const wxString& aValue, const KIID_PATH& aPath, - const std::vector& aKiids ) - : COMPONENT( aFPID, aReference, aValue, aPath, aKiids ) - { - } + const std::vector& aKiids ); - virtual ~PCB_COMPONENT() { }; + virtual ~PCB_COMPONENT(); - FOOTPRINT* GetFootprint( bool aRelease = false ) - { - return ( aRelease ) ? m_footprint.release() : m_footprint.get(); - } + FOOTPRINT* GetFootprint( bool aRelease = false ); void SetFootprint( FOOTPRINT* aFootprint ); @@ -60,5 +53,3 @@ private: typedef boost::ptr_vector< PCB_COMPONENT > PCB_COMPONENTS; - -#endif // PCB_COMPONENT_H diff --git a/pcbnew/netlist_reader/pcb_netlist.cpp b/pcbnew/netlist_reader/pcb_netlist.cpp index a063e28ead..f0c0fde567 100644 --- a/pcbnew/netlist_reader/pcb_netlist.cpp +++ b/pcbnew/netlist_reader/pcb_netlist.cpp @@ -23,14 +23,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - #include "pcb_netlist.h" +#include +#include + #include #include #include -#include -#include int COMPONENT_NET::Format( OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl ) @@ -40,6 +40,33 @@ int COMPONENT_NET::Format( OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl ) aOut->Quotew( m_netName ).c_str() ); } +COMPONENT::COMPONENT( const LIB_ID& aFPID, + const wxString& aReference, + const wxString& aValue, + const KIID_PATH& aPath, + const std::vector& aKiids ) +{ + m_fpid = aFPID; + m_reference = aReference; + m_value = aValue; + m_pinCount = 0; + m_path = aPath; + m_kiids = aKiids; + m_duplicatePadNumbersAreJumpers = false; + m_group = nullptr; +} + + +COMPONENT::~COMPONENT() +{ +} + + +FOOTPRINT* COMPONENT::GetFootprint( bool aRelease ) +{ + return ( aRelease ) ? m_footprint.release() : m_footprint.get(); +} + void COMPONENT::SetFootprint( FOOTPRINT* aFootprint ) { diff --git a/pcbnew/netlist_reader/pcb_netlist.h b/pcbnew/netlist_reader/pcb_netlist.h index e59e14eea5..81789a2a6d 100644 --- a/pcbnew/netlist_reader/pcb_netlist.h +++ b/pcbnew/netlist_reader/pcb_netlist.h @@ -31,13 +31,15 @@ #include #include +#include #include -#include #include #include class REPORTER; +class FOOTPRINT; +class OUTPUTFORMATTER; /** @@ -123,19 +125,9 @@ public: const wxString& aReference, const wxString& aValue, const KIID_PATH& aPath, - const std::vector& aKiids ) - { - m_fpid = aFPID; - m_reference = aReference; - m_value = aValue; - m_pinCount = 0; - m_path = aPath; - m_kiids = aKiids; - m_duplicatePadNumbersAreJumpers = false; - m_group = nullptr; - } + const std::vector& aKiids ); - virtual ~COMPONENT() { }; + virtual ~COMPONENT(); void AddNet( const wxString& aPinName, const wxString& aNetName, const wxString& aPinFunction, const wxString& aPinType ) @@ -193,10 +185,7 @@ public: void SetPinCount( int aPinCount ) { m_pinCount = aPinCount; } int GetPinCount() const { return m_pinCount; } - FOOTPRINT* GetFootprint( bool aRelease = false ) - { - return ( aRelease ) ? m_footprint.release() : m_footprint.get(); - } + FOOTPRINT* GetFootprint( bool aRelease = false ); void SetFootprint( FOOTPRINT* aFootprint ); diff --git a/pcbnew/pad_utils.cpp b/pcbnew/pad_utils.cpp index a61ae404e8..b36263a086 100644 --- a/pcbnew/pad_utils.cpp +++ b/pcbnew/pad_utils.cpp @@ -23,6 +23,8 @@ #include "pad_utils.h" +#include + double PAD_UTILS::GetDefaultIpcRoundingRatio( const PAD& aPad, PCB_LAYER_ID aLayer ) { diff --git a/pcbnew/pad_utils.h b/pcbnew/pad_utils.h index 0606bf7634..b0d830fa79 100644 --- a/pcbnew/pad_utils.h +++ b/pcbnew/pad_utils.h @@ -23,7 +23,9 @@ #pragma once -#include +#include + +class PAD; namespace PAD_UTILS { @@ -42,4 +44,4 @@ bool PadHasMeaningfulRoundingRadius( const PAD& aPad, PCB_LAYER_ID aLayer ); */ double GetDefaultIpcRoundingRatio( const PAD& aPad, PCB_LAYER_ID aLayer ); -} // namespace PAD_UTILS \ No newline at end of file +} // namespace PAD_UTILS diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 13263df9d9..4e04ff079d 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 9c56ba340c..3dd06fb181 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index a716bcf16f..e1c5425d75 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -20,6 +20,12 @@ * with this program. If not, see . */ +#include +#include +#include +#include +#include + #include #include #include @@ -39,13 +45,9 @@ #include #include #include +#include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -57,6 +59,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/altium/altium_parser_pcb.cpp b/pcbnew/pcb_io/altium/altium_parser_pcb.cpp index 7f9e8b0eaf..a9c234677a 100644 --- a/pcbnew/pcb_io/altium/altium_parser_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_parser_pcb.cpp @@ -29,6 +29,7 @@ #include #include +#include #include "altium_parser_pcb.h" #include "io/altium/altium_binary_parser.h" diff --git a/pcbnew/pcb_io/altium/altium_parser_pcb.h b/pcbnew/pcb_io/altium/altium_parser_pcb.h index 4035444cd9..a42077e2e0 100644 --- a/pcbnew/pcb_io/altium/altium_parser_pcb.h +++ b/pcbnew/pcb_io/altium/altium_parser_pcb.h @@ -27,12 +27,18 @@ #include #include +#include +#include #include +#include #include -#include #include +#include +#include + + // tthis constant specifies an unconnected net const uint16_t ALTIUM_NET_UNCONNECTED = std::numeric_limits::max(); diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 14e40d5c5d..5e2791f020 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/altium/altium_pcb.h b/pcbnew/pcb_io/altium/altium_pcb.h index 20f7676650..5bedfc52a8 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.h +++ b/pcbnew/pcb_io/altium/altium_pcb.h @@ -85,6 +85,7 @@ enum class ALTIUM_PCB_DIR class BOARD; +class EDA_TEXT; class FP_SHAPE; class PCB_SHAPE; class PCB_TEXTBOX; diff --git a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h index 6b99aacc5a..dee57a8868 100644 --- a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h +++ b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h @@ -25,10 +25,11 @@ #ifndef PCB_IO_EASYEDA_PLUGIN_H_ #define PCB_IO_EASYEDA_PLUGIN_H_ -#include #include #include +class FOOTPRINT; + class PCB_IO_EASYEDA : public PCB_IO { public: diff --git a/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp b/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp index 96811ed558..cf524c10b0 100644 --- a/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp +++ b/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp @@ -31,8 +31,11 @@ #include #include #include +#include #include +#include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/odbpp/odb_component.cpp b/pcbnew/pcb_io/odbpp/odb_component.cpp index c7eb57679b..9b821153f5 100644 --- a/pcbnew/pcb_io/odbpp/odb_component.cpp +++ b/pcbnew/pcb_io/odbpp/odb_component.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "odb_component.h" #include "odb_util.h" diff --git a/pcbnew/pcb_io/odbpp/odb_eda_data.cpp b/pcbnew/pcb_io/odbpp/odb_eda_data.cpp index 8ad5d49762..4519cbe911 100644 --- a/pcbnew/pcb_io/odbpp/odb_eda_data.cpp +++ b/pcbnew/pcb_io/odbpp/odb_eda_data.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include diff --git a/pcbnew/pcb_io/odbpp/odb_entity.cpp b/pcbnew/pcb_io/odbpp/odb_entity.cpp index 10983de0db..fdea47615d 100644 --- a/pcbnew/pcb_io/odbpp/odb_entity.cpp +++ b/pcbnew/pcb_io/odbpp/odb_entity.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/odbpp/odb_feature.cpp b/pcbnew/pcb_io/odbpp/odb_feature.cpp index 185aabf450..281aaf9a01 100644 --- a/pcbnew/pcb_io/odbpp/odb_feature.cpp +++ b/pcbnew/pcb_io/odbpp/odb_feature.cpp @@ -25,6 +25,8 @@ #include +#include "footprint.h" +#include "pad.h" #include "pcb_shape.h" #include "odb_defines.h" #include "pcb_track.h" diff --git a/pcbnew/pcb_io/odbpp/odb_feature.h b/pcbnew/pcb_io/odbpp/odb_feature.h index daf9945115..b9b90ccdb1 100644 --- a/pcbnew/pcb_io/odbpp/odb_feature.h +++ b/pcbnew/pcb_io/odbpp/odb_feature.h @@ -23,9 +23,8 @@ #define _ODB_FEATURE_H_ #include "odb_attribute.h" -#include "pad.h" #include "convert_basic_shapes_to_polygon.h" -#include "footprint.h" + #include #include "math/vector2d.h" #include "odb_defines.h" @@ -44,6 +43,8 @@ class ODB_PAD; class ODB_SURFACE; class ODB_FEATURE; class PCB_IO_ODBPP; +class FOOTPRINT; +class PAD; class PCB_VIA; class FEATURES_MANAGER : public ATTR_MANAGER diff --git a/pcbnew/pcb_io/odbpp/pcb_io_odbpp.cpp b/pcbnew/pcb_io/odbpp/pcb_io_odbpp.cpp index e5b12a0242..6cc520fcaf 100644 --- a/pcbnew/pcb_io/odbpp/pcb_io_odbpp.cpp +++ b/pcbnew/pcb_io/odbpp/pcb_io_odbpp.cpp @@ -28,6 +28,8 @@ #include "odb_entity.h" #include "wx/log.h" +#include + double PCB_IO_ODBPP::m_scale = 1.0 / PCB_IU_PER_MM; double PCB_IO_ODBPP::m_symbolScale = 1.0 / PL_IU_PER_MM; diff --git a/pcbnew/pcb_io/odbpp/pcb_io_odbpp.h b/pcbnew/pcb_io/odbpp/pcb_io_odbpp.h index 75f9f02050..e6ee00623f 100644 --- a/pcbnew/pcb_io/odbpp/pcb_io_odbpp.h +++ b/pcbnew/pcb_io/odbpp/pcb_io_odbpp.h @@ -26,7 +26,6 @@ #include #include -#include #include // PCB_LAYER_ID #include #include @@ -34,6 +33,7 @@ #include #include "odb_entity.h" + struct ODB_DRILL_SPAN { ODB_DRILL_SPAN() @@ -102,11 +102,13 @@ class PROGRESS_REPORTER; class NETINFO_ITEM; class PAD; class PCB_SHAPE; +class PCB_TRACK; class PCB_VIA; class PROGRESS_REPORTER; class SHAPE_POLY_SET; class SHAPE_SEGMENT; class EDA_DATA; +class ZONE; class PCB_IO_ODBPP : public PCB_IO diff --git a/pcbnew/pcb_io/pcb_io_mgr.cpp b/pcbnew/pcb_io/pcb_io_mgr.cpp index 4296a428a8..b87c1cc4e4 100644 --- a/pcbnew/pcb_io/pcb_io_mgr.cpp +++ b/pcbnew/pcb_io/pcb_io_mgr.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_reference_image.cpp b/pcbnew/pcb_reference_image.cpp index efe52128fc..59c33f24a5 100644 --- a/pcbnew/pcb_reference_image.cpp +++ b/pcbnew/pcb_reference_image.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcbexpr_functions.cpp b/pcbnew/pcbexpr_functions.cpp index 9ed0b320da..464dacb23d 100644 --- a/pcbnew/pcbexpr_functions.cpp +++ b/pcbnew/pcbexpr_functions.cpp @@ -25,13 +25,17 @@ #include #include #include + #include + #include #include #include #include #include +#include #include +#include #include #include #include diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index c442cca8da..8883b9d06a 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index f2c6586ded..5955615b94 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/python/swig/pcbnew.i b/pcbnew/python/swig/pcbnew.i index a3f56483ac..468fbbb8d6 100644 --- a/pcbnew/python/swig/pcbnew.i +++ b/pcbnew/python/swig/pcbnew.i @@ -85,6 +85,7 @@ class BASE_SET {}; #include #include #include +#include #include #include @@ -149,5 +150,3 @@ HANDLE_EXCEPTIONS(WriteDRCReport) %include plugins.i %include units.i %include version.i - - diff --git a/pcbnew/ratsnest/ratsnest.cpp b/pcbnew/ratsnest/ratsnest.cpp index 8a6e8e2bf3..bb4bbd2355 100644 --- a/pcbnew/ratsnest/ratsnest.cpp +++ b/pcbnew/ratsnest/ratsnest.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include @@ -41,4 +42,3 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus ) if( aDisplayStatus ) SetMsgPanel( m_pcb ); } - diff --git a/pcbnew/ratsnest/ratsnest_data.cpp b/pcbnew/ratsnest/ratsnest_data.cpp index 046def1205..1815aaf04d 100644 --- a/pcbnew/ratsnest/ratsnest_data.cpp +++ b/pcbnew/ratsnest/ratsnest_data.cpp @@ -41,6 +41,7 @@ using namespace std::placeholders; #include #include #include +#include #include @@ -678,4 +679,3 @@ bool RN_NET::NearestBicoloredPair( RN_NET* aOtherNet, VECTOR2I& aPos1, VECTOR2I& return rv; } - diff --git a/pcbnew/router/pns_meander_placer.cpp b/pcbnew/router/pns_meander_placer.cpp index 079adb02b9..bfa3cd6105 100644 --- a/pcbnew/router/pns_meander_placer.cpp +++ b/pcbnew/router/pns_meander_placer.cpp @@ -27,6 +27,8 @@ #include "pns_solid.h" #include "pns_topology.h" +#include + #include namespace PNS { diff --git a/pcbnew/teardrop/teardrop.h b/pcbnew/teardrop/teardrop.h index 2ca503b105..b058beb436 100644 --- a/pcbnew/teardrop/teardrop.h +++ b/pcbnew/teardrop/teardrop.h @@ -26,15 +26,13 @@ #define TEARDROP_H #include -#include -#include -#include -#include #include #include "teardrop_parameters.h" - +class BOARD; class PCB_TRACK; +class ZONE; + // A class to store tracks grouped by layer and netcode class TRACK_BUFFER diff --git a/pcbnew/tools/align_distribute_tool.cpp b/pcbnew/tools/align_distribute_tool.cpp index 3f1b7afe5c..ca3c641de2 100644 --- a/pcbnew/tools/align_distribute_tool.cpp +++ b/pcbnew/tools/align_distribute_tool.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/tools/array_tool.cpp b/pcbnew/tools/array_tool.cpp index 4fbbab13e8..a4b902537a 100644 --- a/pcbnew/tools/array_tool.cpp +++ b/pcbnew/tools/array_tool.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 581461eff5..0415e801d3 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -21,8 +21,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "tools/board_inspection_tool.h" + #include #include +#include #include #include #include @@ -40,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/tools/board_reannotate_tool.cpp b/pcbnew/tools/board_reannotate_tool.cpp index e912627ea3..aa9ecc27d3 100644 --- a/pcbnew/tools/board_reannotate_tool.cpp +++ b/pcbnew/tools/board_reannotate_tool.cpp @@ -23,12 +23,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "tools/board_reannotate_tool.h" + +#include + +#include #include #include #include #include -#include -#include BOARD_REANNOTATE_TOOL::BOARD_REANNOTATE_TOOL() : diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index fab1d95ea2..d689281cda 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/drc_tool.cpp b/pcbnew/tools/drc_tool.cpp index d648a4e815..3f39b52583 100644 --- a/pcbnew/tools/drc_tool.cpp +++ b/pcbnew/tools/drc_tool.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index dab71761c2..ea2a0bf8c8 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 4651ddceb4..7a1a0b07da 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/multichannel_tool.cpp b/pcbnew/tools/multichannel_tool.cpp index eaad2cc71a..c7964f3950 100644 --- a/pcbnew/tools/multichannel_tool.cpp +++ b/pcbnew/tools/multichannel_tool.cpp @@ -38,20 +38,17 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include #include #include -#include #include -#include -#include #include #include #include diff --git a/pcbnew/tools/multichannel_tool.h b/pcbnew/tools/multichannel_tool.h index 0f6b0386ef..5f4e713602 100644 --- a/pcbnew/tools/multichannel_tool.h +++ b/pcbnew/tools/multichannel_tool.h @@ -33,12 +33,12 @@ #include #include -#include -#include #include #include class wxWindow; +class EDA_ITEM; +class FOOTPRINT; struct REPEAT_LAYOUT_OPTIONS { diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index f6e4d6a03a..5c3d724312 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -472,6 +473,35 @@ VECTOR2I PCB_GRID_HELPER::SnapToPad( const VECTOR2I& aMousePos, std::deque } +void PCB_GRID_HELPER::OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aRemovedItem ) +{ + // If the item being removed is involved in the snap, clear the snap item + if( m_snapItem ) + { + for( EDA_ITEM* eda_item : m_snapItem->items ) + { + if( eda_item->IsBOARD_ITEM() ) + { + BOARD_ITEM* item = static_cast( eda_item ); + + if( item == aRemovedItem || item->GetParentFootprint() == aRemovedItem ) + { + m_snapItem = std::nullopt; + break; + } + } + } + } +} + + +void PCB_GRID_HELPER::OnBoardItemsRemoved( BOARD& aBoard, std::vector& aBoardItems ) +{ + // This is a bulk-remove. Simply clearing the snap item will be the most performant. + m_snapItem = std::nullopt; +} + + VECTOR2I PCB_GRID_HELPER::BestDragOrigin( const VECTOR2I &aMousePos, std::vector& aItems, GRID_HELPER_GRIDS aGrid, diff --git a/pcbnew/tools/pcb_grid_helper.h b/pcbnew/tools/pcb_grid_helper.h index 5e49384c18..ea5d83e842 100644 --- a/pcbnew/tools/pcb_grid_helper.h +++ b/pcbnew/tools/pcb_grid_helper.h @@ -30,11 +30,11 @@ #include #include -#include -#include #include #include +#include + class LSET; class SHAPE_ARC; @@ -73,32 +73,9 @@ public: VECTOR2I SnapToPad( const VECTOR2I& aMousePos, std::deque& aPads ); - virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aRemovedItem ) override - { - // If the item being removed is involved in the snap, clear the snap item - if( m_snapItem ) - { - for( EDA_ITEM* eda_item : m_snapItem->items ) - { - if( eda_item->IsBOARD_ITEM() ) - { - BOARD_ITEM* item = static_cast( eda_item ); + void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aRemovedItem ) override; - if( item == aRemovedItem || item->GetParentFootprint() == aRemovedItem ) - { - m_snapItem = std::nullopt; - break; - } - } - } - } - } - - virtual void OnBoardItemsRemoved( BOARD& aBoard, std::vector& aBoardItems ) override - { - // This is a bulk-remove. Simply clearing the snap item will be the most performant. - m_snapItem = std::nullopt; - } + void OnBoardItemsRemoved( BOARD& aBoard, std::vector& aBoardItems ) override; /** * Chooses the "best" snap anchor around the given point, optionally taking layers from diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index ba5d1eff77..7ea0b28356 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -24,7 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include @@ -34,6 +33,8 @@ using namespace std::placeholders; #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index f5f70b7e58..1a7fcd8222 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -26,9 +26,11 @@ #include #include <3d_viewer/eda_3d_viewer_frame.h> +#include #include #include #include +#include #include #include #include diff --git a/pcbnew/tracks_cleaner.cpp b/pcbnew/tracks_cleaner.cpp index 6e0b422a24..7f8514ea9b 100644 --- a/pcbnew/tracks_cleaner.cpp +++ b/pcbnew/tracks_cleaner.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/widgets/search_handlers.cpp b/pcbnew/widgets/search_handlers.cpp index fec9efc778..0dbcf72491 100644 --- a/pcbnew/widgets/search_handlers.cpp +++ b/pcbnew/widgets/search_handlers.cpp @@ -18,6 +18,9 @@ * with this program. If not, see . */ +#include "search_handlers.h" + +#include #include #include #include @@ -34,7 +37,6 @@ #include #include #include -#include "search_handlers.h" void PCB_SEARCH_HANDLER::ActivateItem( long aItemRow ) @@ -46,6 +48,23 @@ void PCB_SEARCH_HANDLER::ActivateItem( long aItemRow ) } +wxString PCB_SEARCH_HANDLER::GetResultCell( int aRow, int aCol ) +{ + if( m_frame->IsClosing() ) + return wxEmptyString; + + if( aRow >= static_cast(m_hitlist.size() ) ) + return wxEmptyString; + + BOARD_ITEM* item = m_hitlist[aRow]; + + if( !item ) + return wxEmptyString; + + return getResultCell( item, aCol ); +} + + void PCB_SEARCH_HANDLER::Sort( int aCol, bool aAscending, std::vector* aSelection ) { std::vector selection; diff --git a/pcbnew/widgets/search_handlers.h b/pcbnew/widgets/search_handlers.h index 92289b1e61..151f5774e7 100644 --- a/pcbnew/widgets/search_handlers.h +++ b/pcbnew/widgets/search_handlers.h @@ -39,21 +39,7 @@ public: m_frame( aFrame ) {} - wxString GetResultCell( int aRow, int aCol ) override - { - if( m_frame->IsClosing() ) - return wxEmptyString; - - if( aRow >= static_cast(m_hitlist.size() ) ) - return wxEmptyString; - - BOARD_ITEM* item = m_hitlist[aRow]; - - if( !item ) - return wxEmptyString; - - return getResultCell( item, aCol ); - } + wxString GetResultCell( int aRow, int aCol ) override; void Sort( int aCol, bool aAscending, std::vector* aSelection ) override; diff --git a/pcbnew/zone_manager/dialog_zone_manager.h b/pcbnew/zone_manager/dialog_zone_manager.h index bbd4458c80..e39bba550b 100644 --- a/pcbnew/zone_manager/dialog_zone_manager.h +++ b/pcbnew/zone_manager/dialog_zone_manager.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include