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.
This commit is contained in:
John Beard
2026-03-05 02:18:34 +08:00
parent ea87a99c9e
commit c4c19018c3
103 changed files with 320 additions and 174 deletions
+1
View File
@@ -34,6 +34,7 @@
#include <3d_rendering/raytracing/shapes2D/polygon_2d.h>
#include <board.h>
#include <dialogs/dialog_color_picker.h>
#include <footprint.h>
#include <layer_range.h>
#include <3d_math.h>
#include "3d_fastmath.h"
+3 -3
View File
@@ -38,22 +38,22 @@
#include "../3d_viewer/eda_3d_viewer_settings.h"
#include <layer_ids.h>
#include <pad.h>
#include <pcb_base_frame.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_table.h>
#include <pcb_shape.h>
#include <pcb_dimension.h>
#include <zone.h>
#include <footprint.h>
#include <reporter.h>
#include <dialogs/dialog_color_picker.h>
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<PCB_LAYER_ID, BVH_CONTAINER_2D*> MAP_CONTAINER_2D_BASE;
@@ -35,13 +35,16 @@
#include "raytracing/shapes2D/triangle_2d.h"
#include <board_design_settings.h>
#include <board.h>
#include <footprint.h>
#include <layer_range.h>
#include <lset.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>
#include <pad.h>
#include <pcb_barcode.h>
#include <pcb_shape.h>
#include <pcb_track.h>
#include <zone.h>
#ifdef PRINT_STATISTICS_3D_VIEWER
#include <core/profile.h>
+4 -2
View File
@@ -28,6 +28,8 @@
#include <wx/tokenzr.h>
#include <fmt/format.h>
#include "../common_ogl/ogl_utils.h"
#include "eda_3d_canvas.h"
#include <eda_3d_viewer_frame.h>
@@ -38,6 +40,7 @@
#include <build_version.h>
#include <settings/color_settings.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_field.h>
#include <pcb_track.h>
@@ -54,9 +57,8 @@
#include <string_utils.h>
#include <mail_type.h>
#include <kiway_mail.h>
#include <fmt/format.h>
#include <widgets/wx_busy_indicator.h>
#include <zone.h>
/**
@@ -43,6 +43,7 @@
#include "3d_cache/3d_info.h"
#include <geometry/eda_angle.h>
#include <pad.h> // For PAD_DRILL_POST_MACHINING_MODE
#include <map>
@@ -44,6 +44,7 @@
#include <footprint_library_adapter.h>
#include <eda_3d_viewer_frame.h>
#include <project_pcb.h>
#include <pad.h>
#include <pcb_track.h>
#include <base_units.h>
@@ -30,10 +30,13 @@
#include <chrono>
#include <thread>
#include <wx/log.h>
#include "render_3d_raytrace_gl.h"
#include "../common_ogl/ogl_utils.h"
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
#include <wx/log.h>
#include <eda_3d_canvas.h>
RENDER_3D_RAYTRACE_GL::RENDER_3D_RAYTRACE_GL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
@@ -30,6 +30,11 @@
#include <kicad_gl/kiglad.h>
class EDA_3D_CANVAS;
class BOARD_ADAPTER;
class REPORTER;
class RENDER_3D_RAYTRACE_GL : public RENDER_3D_RAYTRACE_BASE
{
public:
@@ -39,6 +39,7 @@
#include <board.h>
#include <common_ogl/ogl_attr_list.h>
#include <dpi_scaling_common.h>
#include <footprint.h>
#include <lset.h>
#include <pgm_base.h>
#include <project_pcb.h>
+1 -2
View File
@@ -24,10 +24,9 @@
#ifndef PCBNEW_ARRAY_PAD_NAME_PROVIDER__H
#define PCBNEW_ARRAY_PAD_NAME_PROVIDER__H
#include <set>
#include <array_options.h>
#include <footprint.h>
#include <board_commit.h>
/**
* Simple class that sequentially provides numbers from an #ARRAY_OPTIONS object, making sure
-2
View File
@@ -31,8 +31,6 @@
#include "ar_matrix.h"
#include <board.h>
#include <footprint.h>
#include <lset.h>
#include <connectivity/connectivity_data.h>
+1
View File
@@ -23,6 +23,7 @@
#include <board_commit.h>
#include <footprint.h>
#include <tools/pcb_selection.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
+4 -1
View File
@@ -34,9 +34,12 @@
* their selection.
*/
#include <spread_footprints.h>
#include "spread_footprints.h"
#include <optional>
#include <algorithm>
#include <footprint.h>
#include <refdes_utils.h>
#include <string_utils.h>
#include <confirm.h>
+3 -2
View File
@@ -27,10 +27,11 @@
#include <vector>
#include <footprint.h>
#include <base_units.h>
#include <math/vector2d.h>
#include <board.h>
class FOOTPRINT;
/**
* Footprints (after loaded by reading a netlist for instance) are moved
+1
View File
@@ -45,6 +45,7 @@
#include <font/outline_font.h>
#include <length_delay_calculation/length_delay_calculation.h>
#include <lset.h>
#include <pad.h>
#include <pcb_base_frame.h>
#include <pcb_track.h>
#include <pcb_marker.h>
+1
View File
@@ -30,6 +30,7 @@
#include <component_classes/component_class_manager.h>
#include <footprint.h>
#include <lset.h>
#include <pad.h>
#include <pcb_group.h>
#include <pcb_track.h>
#include <pcb_shape.h>
@@ -23,7 +23,8 @@
#include <component_classes/component_class.h>
#include <component_classes/component_class_manager.h>
#include <footprint.h>
class FOOTPRINT;
/*
* A class which acts as a cache-aware proxy for a FOOTPRINT's component class.
@@ -33,8 +33,11 @@
#include <connectivity/connectivity_algo.h>
#include <progress_reporter.h>
#include <geometry/geometry_utils.h>
#include <board.h>
#include <board_commit.h>
#include <thread_pool.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_shape.h>
#include <pcb_track.h>
+5 -8
View File
@@ -30,18 +30,14 @@
#ifndef __CONNECTIVITY_ALGO_H
#define __CONNECTIVITY_ALGO_H
#include <board.h>
#include <pad.h>
#include <footprint.h>
#include <zone.h>
#include <geometry/shape_poly_set.h>
#include <memory>
#include <algorithm>
#include <functional>
#include <vector>
#include <deque>
#include <functional>
#include <list>
#include <memory>
#include <vector>
#include <connectivity/connectivity_rtree.h>
#include <connectivity/connectivity_data.h>
@@ -51,6 +47,7 @@ class CN_RATSNEST_NODES;
class BOARD;
class BOARD_CONNECTED_ITEM;
class BOARD_ITEM;
class FOOTPRINT;
class ZONE;
class PROGRESS_REPORTER;
@@ -40,6 +40,8 @@
#include <board_design_settings.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <ratsnest/ratsnest_data.h>
#include <progress_reporter.h>
+4
View File
@@ -19,8 +19,11 @@
#include <cstdio>
#include <memory>
#include <reporter.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <string_utils.h>
#include <pcbexpr_evaluator.h>
@@ -30,6 +33,7 @@
#include <connectivity/from_to_cache.h>
void FROM_TO_CACHE::buildEndpointList( )
{
m_ftEndpoints.clear();
+5 -2
View File
@@ -26,11 +26,16 @@
#include "dialog_board_reannotate.h"
#include <algorithm>
#include <wx/tokenzr.h>
#include <wx/valtext.h>
#include <base_units.h>
#include <bitmaps.h>
#include <board_commit.h>
#include <confirm.h>
#include <ctype.h>
#include <footprint.h>
#include <gal/graphics_abstraction_layer.h>
#include <string_utils.h> // StrNumCmp
#include <kiface_base.h>
@@ -39,8 +44,6 @@
#include <richio.h>
#include <tool/grid_menu.h>
#include <widgets/wx_html_report_panel.h>
#include <wx/tokenzr.h>
#include <wx/valtext.h>
bool g_SortYFirst;
-3
View File
@@ -25,8 +25,6 @@
#pragma once
#include <board.h>
#include <footprint.h>
#include <dialogs/dialog_board_reannotate_base.h>
#include <layer_ids.h>
#include <netlist_reader/pcb_netlist.h>
@@ -181,4 +179,3 @@ private:
std::vector<REFDES_PREFIX_INFO> m_refDesPrefixInfos;
std::vector<wxString> m_excludeArray;
};
@@ -26,19 +26,26 @@
#include "dialog_board_statistics.h"
#include <board_statistics.h>
#include <algorithm>
#include <wx/filedlg.h>
#include <board.h>
#include <kiplatform/ui.h>
#include <confirm.h>
#include <pad.h>
#include <pcb_edit_frame.h>
#include <macros.h>
#include <string_utils.h>
#include <wildcards_and_files_ext.h>
#include <widgets/ui_common.h>
#include <widgets/wx_grid.h>
#include <convert_basic_shapes_to_polygon.h>
#include <algorithm>
#define COL_LABEL 0
#define COL_AMOUNT 1
+3 -8
View File
@@ -26,16 +26,11 @@
#ifndef _DIALOG_BOARD_STATISTICS_H
#define _DIALOG_BOARD_STATISTICS_H
#include <board.h>
#include <footprint.h>
#include <dialog_board_statistics_base.h>
#include <board_statistics.h>
#include <board_statistics_report.h>
#include <pcb_base_frame.h>
#include <pcb_edit_frame.h>
#include <project.h>
#include <wx/datetime.h>
class PCB_EDIT_FRAME;
/**
* Dialog to show common board info.
@@ -35,6 +35,7 @@
#include <filename_resolver.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <pcb_fields_grid_table.h>
#include <pgm_base.h>
#include <project_pcb.h>
#include <kiplatform/ui.h>
+3 -4
View File
@@ -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 <dialog_footprint_properties_base.h>
#include <wx/valnum.h>
#include <pcb_fields_grid_table.h>
#include <footprint.h>
#include <widgets/unit_binder.h>
#include <widgets/margin_offset_binder.h>
@@ -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
{
@@ -59,6 +59,7 @@
#include <widgets/std_bitmap_button.h>
#include <widgets/text_ctrl_eval.h>
#include <widgets/wx_grid.h>
#include <zone.h>
#include <footprint_library_adapter.h>
#include <project_pcb.h>
@@ -88,4 +88,3 @@ private:
std::unique_ptr<UNITS_PROVIDER> m_unitsProvider;
bool m_summaryDirty;
};
@@ -28,6 +28,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <project/net_settings.h>
#include <pad.h>
#include <pcb_track.h>
#include <pcb_group.h>
#include <footprint.h>
@@ -505,4 +506,3 @@ int GLOBAL_EDIT_TOOL::EditTeardrops( const TOOL_EVENT& aEvent )
dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
return 0;
}
@@ -31,6 +31,7 @@
#include <widgets/grid_icon_text_helpers.h>
#include <zone.h>
#include <board.h>
#include <footprint.h>
DIALOG_MULTICHANNEL_REPEAT_LAYOUT::DIALOG_MULTICHANNEL_REPEAT_LAYOUT( PCB_BASE_FRAME* aFrame,
+4 -1
View File
@@ -28,9 +28,10 @@
#define _DIALOG_PAD_PROPERTIES_H_
#include <pcb_base_frame.h>
#include <wx/valnum.h>
#include <board.h>
#include <footprint.h>
#include <padstack.h>
#include <pcb_shape.h>
#include <origin_viewitem.h>
@@ -40,6 +41,8 @@
#include <widgets/unit_binder.h>
#include <widgets/margin_offset_binder.h>
class PAD;
/**
* DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE,
* created by wxFormBuilder
+1 -1
View File
@@ -23,6 +23,7 @@
#include <common.h>
#include <board_design_settings.h>
#include <pad.h>
#include <pcb_board_outline.h>
#include <footprint.h>
#include <thread_pool.h>
@@ -306,4 +307,3 @@ bool DRC_CACHE_GENERATOR::Run()
return !m_drcEngine->IsCancelled();
}
-1
View File
@@ -26,7 +26,6 @@
#define DRC_RTREE_H_
#include <board_item.h>
#include <pad.h>
#include <pcb_field.h>
#include <memory>
#include <unordered_set>
@@ -26,6 +26,7 @@
#include <pcb_board_outline.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <geometry/seg.h>
#include <geometry/shape_segment.h>
@@ -33,7 +34,7 @@
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider.h>
#include "drc_rtree.h"
#include <drc/drc_rtree.h>
/*
Board edge clearance test. Checks all items for their mechanical clearances against the board
@@ -22,6 +22,7 @@
*/
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <drc/drc_engine.h>
#include <drc/drc_item.h>
+1
View File
@@ -32,6 +32,7 @@
#include <board_design_settings.h>
#include <build_version.h>
#include <exporters/place_file_exporter.h>
#include <footprint.h>
#include <pad.h>
#include <fmt/format.h>
-1
View File
@@ -26,7 +26,6 @@
#include <board.h>
#include <footprint.h>
/**
* The ASCII format of the kicad place file is:
+3 -1
View File
@@ -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 <magic_enum.hpp>
#include <algorithm>
@@ -46,7 +49,6 @@
#include <embedded_files.h>
#include <font/font.h>
#include <font/outline_font.h>
#include <footprint.h>
#include <geometry/convex_hull.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_simple.h>
+5 -5
View File
@@ -22,14 +22,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/splitter.h>
#include <pgm_base.h>
#include <kiface_base.h>
#include <kiway.h>
#include <kiway_mail.h>
#include <board.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/splitter.h>
#include <footprint.h>
#include <kiplatform/ui.h>
#include <lset.h>
#include <widgets/panel_footprint_chooser.h>
@@ -889,5 +891,3 @@ void FOOTPRINT_CHOOSER_FRAME::setupUIConditions()
#undef CHECK
// clang-format on
}
+1
View File
@@ -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;
+1 -1
View File
@@ -43,6 +43,7 @@
#include <widgets/wx_listbox.h>
#include <widgets/wx_aui_utils.h>
#include <gal/graphics_abstraction_layer.h>
#include <pad.h>
#include <pcb_draw_panel_gal.h>
#include <pcb_painter.h>
#include <pcbnew_id.h>
@@ -1086,4 +1087,3 @@ BOARD_ITEM_CONTAINER* FOOTPRINT_VIEWER_FRAME::GetModel() const
{
return GetBoard()->GetFirstFootprint();
}
+11 -7
View File
@@ -24,6 +24,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "footprint_wizard_frame.h"
#include <wx/listbox.h>
#include <wx/numformatter.h>
#include <wx/statline.h>
#include <wx/tokenzr.h>
#include <wx/wupdlock.h>
#include <json_common.h>
#include <kiface_base.h>
#include <pcb_draw_panel_gal.h>
#include <pcb_edit_frame.h>
@@ -34,17 +44,12 @@
#include <grid_tricks.h>
#include <board.h>
#include <project/net_settings.h>
#include <footprint.h>
#include <footprint_edit_frame.h>
#include <footprint_editor_settings.h>
#include <pcbnew_id.h>
#include <widgets/aui_json_serializer.h>
#include <wx/listbox.h>
#include <wx/statline.h>
#include <nlohmann/json.hpp>
#include <wx/tokenzr.h>
#include <wx/numformatter.h>
#include <wx/wupdlock.h>
#include <pgm_base.h>
#include <settings/color_settings.h>
#include <settings/settings_manager.h>
@@ -59,7 +64,6 @@
#include <tools/footprint_wizard_tools.h>
#include <toolbars_footprint_wizard.h>
#include <python/scripting/pcb_scripting_tool.h>
#include "footprint_wizard_frame.h"
BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, PCB_BASE_EDIT_FRAME )
+1
View File
@@ -28,6 +28,7 @@
#include <board.h>
#include <build_version.h>
#include <core/ignore.h>
#include <footprint.h>
#include <font/fontconfig.h>
#include <pad.h>
#include <pcb_group.h>
-1
View File
@@ -31,7 +31,6 @@
#define KICAD_CLIPBOARD_H
#include <board_item.h>
#include <footprint.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
#include <memory.h>
@@ -28,6 +28,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <geometry/geometry_utils.h>
#include <pad.h>
#include <pcb_track.h>
@@ -25,6 +25,7 @@
#include <length_delay_calculation/length_delay_calculation_item.h>
#include <board.h>
#include <pad.h>
#include <pcb_track.h>
@@ -26,9 +26,13 @@
#include <geometry/shape_line_chain.h>
#include <layer_ids.h>
#include <pad.h>
#include <pcb_track_types.h>
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.
@@ -27,6 +27,7 @@
#include <length_delay_calculation/length_delay_calculation_item.h>
#include <netclass.h>
class BOARD;
class LENGTH_DELAY_CALCULATION;
/**
@@ -25,6 +25,7 @@
#include <board.h>
#include <length_delay_calculation/length_delay_calculation.h>
#include <pad.h>
#include <pcb_track.h>
#include <project/project_file.h>
@@ -22,6 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/log.h>
#include <netlist_lexer.h> // netlist_lexer is common to Eeschema and Pcbnew
#include <string_utils.h>
#include <json_common.h>
@@ -23,11 +23,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <config.h> // to define strncasecmp for some platforms
#include <richio.h>
#include <string_utils.h>
#include "pcb_netlist.h"
#include "netlist_reader.h"
#include <netlist_reader/netlist_reader.h>
void LEGACY_NETLIST_READER::LoadNetlist()
{
+1
View File
@@ -39,6 +39,7 @@ using namespace std::placeholders;
#include <board.h>
#include <component_classes/component_class_manager.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <spread_footprints.h>
#include <ratsnest/ratsnest_data.h>
+21 -1
View File
@@ -21,8 +21,28 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "netlist_reader/pcb_component.h"
#include <footprint.h>
#include <netlist_reader/pcb_component.h>
PCB_COMPONENT::PCB_COMPONENT( const LIB_ID& aFPID,
const wxString& aReference,
const wxString& aValue,
const KIID_PATH& aPath,
const std::vector<KIID>& 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 )
+6 -15
View File
@@ -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 <memory>
#include <netlist_reader/netlist.h>
#include <footprint.h>
#include <memory>
/**
@@ -39,17 +38,11 @@ public:
const wxString& aReference,
const wxString& aValue,
const KIID_PATH& aPath,
const std::vector<KIID>& aKiids )
: COMPONENT( aFPID, aReference, aValue, aPath, aKiids )
{
}
const std::vector<KIID>& 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
+30 -3
View File
@@ -23,14 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "pcb_netlist.h"
#include <wx/tokenzr.h>
#include <wx/log.h>
#include <footprint.h>
#include <richio.h>
#include <string_utils.h>
#include <wx/tokenzr.h>
#include <wx/log.h>
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<KIID>& 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 )
{
+6 -17
View File
@@ -31,13 +31,15 @@
#include <json_common.h>
#include <unordered_set>
#include <kiid.h>
#include <lib_id.h>
#include <footprint.h>
#include <ctl_flags.h>
#include <case_insensitive_map.h>
class REPORTER;
class FOOTPRINT;
class OUTPUTFORMATTER;
/**
@@ -123,19 +125,9 @@ public:
const wxString& aReference,
const wxString& aValue,
const KIID_PATH& aPath,
const std::vector<KIID>& 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<KIID>& 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 );
+2
View File
@@ -23,6 +23,8 @@
#include "pad_utils.h"
#include <pad.h>
double PAD_UTILS::GetDefaultIpcRoundingRatio( const PAD& aPad, PCB_LAYER_ID aLayer )
{
+4 -2
View File
@@ -23,7 +23,9 @@
#pragma once
#include <pad.h>
#include <layer_ids.h>
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
} // namespace PAD_UTILS
+2
View File
@@ -45,6 +45,7 @@
#include <footprint_library_adapter.h>
#include <lset.h>
#include <kiface_base.h>
#include <pad.h>
#include <pcb_painter.h>
#include <pcbnew_id.h>
#include <pcbnew_settings.h>
@@ -55,6 +56,7 @@
#include <project_pcb.h>
#include <trace_helpers.h>
#include <wildcards_and_files_ext.h>
#include <zone.h>
#include <math/vector2d.h>
#include <math/vector2wx.h>
+1
View File
@@ -34,6 +34,7 @@
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <macros.h>
#include <pcb_generator.h>
+8 -5
View File
@@ -20,6 +20,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <wx/log.h>
#include <wx/filename.h>
#include <wx/filedlg.h>
@@ -39,13 +45,9 @@
#include <geometry/geometry_utils.h>
#include <bitmaps.h>
#include <confirm.h>
#include <footprint.h>
#include <lset.h>
#include <trace_helpers.h>
#include <algorithm>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <pcbnew_id.h>
#include <pcbnew_settings.h>
#include <pcb_layer_box_selector.h>
@@ -57,6 +59,7 @@
#include <dialogs/dialog_dimension_properties.h>
#include <dialogs/dialog_table_properties.h>
#include <gal/graphics_abstraction_layer.h>
#include <pad.h>
#include <pcb_target.h>
#include <pcb_point.h>
#include <pcb_track.h>
@@ -29,6 +29,7 @@
#include <math/util.h>
#include <wx/log.h>
#include <wx/translation.h>
#include "altium_parser_pcb.h"
#include "io/altium/altium_binary_parser.h"
+7 -1
View File
@@ -27,12 +27,18 @@
#include <cstdint>
#include <cstring>
#include <limits>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <footprint.h>
#include <wx/gdicmn.h>
#include <math/vector2d.h>
#include <math/vector3.h>
// tthis constant specifies an unconnected net
const uint16_t ALTIUM_NET_UNCONNECTED = std::numeric_limits<uint16_t>::max();
+1
View File
@@ -31,6 +31,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <project/net_settings.h>
#include <footprint.h>
#include <layer_range.h>
#include <pcb_dimension.h>
#include <pad.h>
+1
View File
@@ -85,6 +85,7 @@ enum class ALTIUM_PCB_DIR
class BOARD;
class EDA_TEXT;
class FP_SHAPE;
class PCB_SHAPE;
class PCB_TEXTBOX;
@@ -25,10 +25,11 @@
#ifndef PCB_IO_EASYEDA_PLUGIN_H_
#define PCB_IO_EASYEDA_PLUGIN_H_
#include <footprint.h>
#include <pcb_io/pcb_io.h>
#include <pcb_io/pcb_io_mgr.h>
class FOOTPRINT;
class PCB_IO_EASYEDA : public PCB_IO
{
public:
+3
View File
@@ -31,8 +31,11 @@
#include <connectivity/connectivity_algo.h>
#include <convert_basic_shapes_to_polygon.h>
#include <font/font.h>
#include <footprint.h>
#include <hash_eda.h>
#include <pad.h>
#include <pcb_dimension.h>
#include <pcb_field.h>
#include <pcb_shape.h>
#include <pcb_textbox.h>
#include <pcb_track.h>
+1
View File
@@ -22,6 +22,7 @@
#include <wx/log.h>
#include <board.h>
#include <footprint.h>
#include "odb_component.h"
#include "odb_util.h"
+2
View File
@@ -23,6 +23,8 @@
#include <base_units.h>
#include <build_version.h>
#include <hash_eda.h>
#include <footprint.h>
#include <pad.h>
#include <string_utils.h>
#include <netinfo.h>
+1
View File
@@ -21,6 +21,7 @@
#include <base_units.h>
#include <optional>
#include <board.h>
#include <board_stackup_manager/stackup_predefined_prms.h>
#include <build_version.h>
#include <callback_gal.h>
+2
View File
@@ -25,6 +25,8 @@
#include <wx/log.h>
#include "footprint.h"
#include "pad.h"
#include "pcb_shape.h"
#include "odb_defines.h"
#include "pcb_track.h"
+3 -2
View File
@@ -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 <list>
#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
+2
View File
@@ -28,6 +28,8 @@
#include "odb_entity.h"
#include "wx/log.h"
#include <footprint.h>
double PCB_IO_ODBPP::m_scale = 1.0 / PCB_IU_PER_MM;
double PCB_IO_ODBPP::m_symbolScale = 1.0 / PL_IU_PER_MM;
+3 -1
View File
@@ -26,7 +26,6 @@
#include <pcb_io/pcb_io_mgr.h>
#include <pcb_io/common/plugin_common_layer_mapping.h>
#include <eda_shape.h>
#include <layer_ids.h> // PCB_LAYER_ID
#include <font/font.h>
#include <geometry/shape_segment.h>
@@ -34,6 +33,7 @@
#include <memory>
#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
+1
View File
@@ -26,6 +26,7 @@
#include <wx/uri.h>
#include <config.h>
#include <footprint.h>
#include <kiway_player.h>
#include <wildcards_and_files_ext.h>
#include <libraries/library_table.h>
+1
View File
@@ -31,6 +31,7 @@
#include <common.h>
#include <core/mirror.h>
#include <eda_draw_frame.h>
#include <footprint.h>
#include <pcb_draw_panel_gal.h>
#include <pcb_painter.h>
#include <plotters/plotter.h>
+4
View File
@@ -25,13 +25,17 @@
#include <cstdio>
#include <memory>
#include <mutex>
#include <wx/log.h>
#include <board.h>
#include <board_design_settings.h>
#include <component_classes/component_class.h>
#include <drc/drc_rtree.h>
#include <drc/drc_engine.h>
#include <footprint.h>
#include <lset.h>
#include <pad.h>
#include <pcb_track.h>
#include <pcb_group.h>
#include <geometry/shape_segment.h>
+1
View File
@@ -39,6 +39,7 @@
#include <gestfich.h>
#include <paths.h>
#include <pcbnew_settings.h>
#include <footprint.h>
#include <footprint_editor_settings.h>
#include <settings/settings_manager.h>
#include <settings/cvpcb_settings.h>
+1
View File
@@ -36,6 +36,7 @@
#include <drc/drc_report.h>
#include <drawing_sheet/ds_data_model.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <footprint.h>
#include <jobs/job_fp_export_svg.h>
#include <jobs/job_fp_upgrade.h>
#include <jobs/job_export_pcb_ipc2581.h>
+1 -2
View File
@@ -85,6 +85,7 @@ class BASE_SET {};
#include <exporters/gendrill_excellon_writer.h>
#include <exporters/gendrill_gerber_writer.h>
#include <exporters/gerber_jobfile_writer.h>
#include <footprint.h>
#include <pcb_io/pcb_io_mgr.h>
#include <pcb_io/pcb_io.h>
@@ -149,5 +150,3 @@ HANDLE_EXCEPTIONS(WriteDRCReport)
%include plugins.i
%include units.i
%include version.i
+1 -1
View File
@@ -23,6 +23,7 @@
*/
#include <pcb_edit_frame.h>
#include <board.h>
#include <footprint.h>
#include <ratsnest/ratsnest_data.h>
@@ -41,4 +42,3 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus )
if( aDisplayStatus )
SetMsgPanel( m_pcb );
}
+1 -1
View File
@@ -41,6 +41,7 @@ using namespace std::placeholders;
#include <algorithm>
#include <cassert>
#include <limits>
#include <list>
#include <delaunator.hpp>
@@ -678,4 +679,3 @@ bool RN_NET::NearestBicoloredPair( RN_NET* aOtherNet, VECTOR2I& aPos1, VECTOR2I&
return rv;
}
+2
View File
@@ -27,6 +27,8 @@
#include "pns_solid.h"
#include "pns_topology.h"
#include <board_connected_item.h>
#include <length_delay_calculation/tuning_profile_parameters_iface.h>
namespace PNS {
+3 -5
View File
@@ -26,15 +26,13 @@
#define TEARDROP_H
#include <tool/tool_manager.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <zone.h>
#include <drc/drc_rtree.h>
#include "teardrop_parameters.h"
class BOARD;
class PCB_TRACK;
class ZONE;
// A class to store tracks grouped by layer and netcode
class TRACK_BUFFER
+1
View File
@@ -32,6 +32,7 @@
#include <board.h>
#include <board_commit.h>
#include <footprint.h>
#include <collectors.h>
#include <bitmaps.h>
#include <pcb_edit_frame.h>
+1
View File
@@ -26,6 +26,7 @@
#include <array_options.h>
#include <array_pad_number_provider.h>
#include <dialogs/dialog_create_array.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_generator.h>
#include <pcb_group.h>
+3 -1
View File
@@ -21,8 +21,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "tools/board_inspection_tool.h"
#include <bitmaps.h>
#include <collectors.h>
#include <footprint.h>
#include <pcb_group.h>
#include <tool/tool_manager.h>
#include <tools/pcb_selection_tool.h>
@@ -40,7 +43,6 @@
#include <kiplatform/ui.h>
#include <status_popup.h>
#include <string_utils.h>
#include <tools/board_inspection_tool.h>
#include <footprint_library_adapter.h>
#include <pcb_shape.h>
#include <widgets/appearance_controls.h>
+5 -2
View File
@@ -23,12 +23,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "tools/board_reannotate_tool.h"
#include <wx/filedlg.h>
#include <footprint.h>
#include <pcb_group.h>
#include <refdes_utils.h>
#include <string_utils.h>
#include <tool/tool_manager.h>
#include <wx/filedlg.h>
#include <tools/board_reannotate_tool.h>
BOARD_REANNOTATE_TOOL::BOARD_REANNOTATE_TOOL() :
+1
View File
@@ -71,6 +71,7 @@
#include <footprint.h>
#include <macros.h>
#include <gal/painter.h>
#include <pad.h>
#include <pcb_edit_frame.h>
#include <pcb_group.h>
#include <pcb_point.h>
+1
View File
@@ -30,6 +30,7 @@
#include <tools/drc_tool.h>
#include <kiface_base.h>
#include <dialog_drc.h>
#include <footprint.h>
#include <board_commit.h>
#include <board_design_settings.h>
#include <progress_reporter.h>
+1
View File
@@ -43,6 +43,7 @@
#include <pcb_table.h>
#include <pcb_generator.h>
#include <zone.h>
#include <pad.h>
#include <pcb_edit_frame.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <kiway.h>
+1
View File
@@ -31,6 +31,7 @@
#include <board.h>
#include <board_commit.h>
#include <collectors.h>
#include <footprint.h>
#include <gal/graphics_abstraction_layer.h>
#include <geometry/geometry_utils.h>
#include <pad.h>
+1 -4
View File
@@ -38,20 +38,17 @@
#include <geometry/shape_utils.h>
#include <pcb_group.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>
#include <component_classes/component_class.h>
#include <connectivity/connectivity_data.h>
#include <connectivity/topo_match.h>
#include <optional>
#include <algorithm>
#include <pcbnew_scripting_helpers.h>
#include <pcb_track.h>
#include <tool/tool_manager.h>
#include <tools/pcb_picker_tool.h>
#include <random>
#include <chrono>
#include <atomic>
#include <thread>
#include <core/profile.h>
#include <thread_pool.h>
#include <widgets/wx_progress_reporters.h>
+2 -2
View File
@@ -33,12 +33,12 @@
#include <tools/pcb_picker_tool.h>
#include <connectivity/topo_match.h>
#include <pad.h>
#include <footprint.h>
#include <reporter.h>
#include <zone_settings.h>
class wxWindow;
class EDA_ITEM;
class FOOTPRINT;
struct REPEAT_LAYOUT_OPTIONS
{
+30
View File
@@ -29,6 +29,7 @@
#include <algorithm>
#include <advanced_config.h>
#include <board_item.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <footprint.h>
@@ -472,6 +473,35 @@ VECTOR2I PCB_GRID_HELPER::SnapToPad( const VECTOR2I& aMousePos, std::deque<PAD*>
}
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<BOARD_ITEM*>( eda_item );
if( item == aRemovedItem || item->GetParentFootprint() == aRemovedItem )
{
m_snapItem = std::nullopt;
break;
}
}
}
}
}
void PCB_GRID_HELPER::OnBoardItemsRemoved( BOARD& aBoard, std::vector<BOARD_ITEM*>& 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<BOARD_ITEM*>& aItems,
GRID_HELPER_GRIDS aGrid,
+4 -27
View File
@@ -30,11 +30,11 @@
#include <pcb_item_containers.h>
#include <tool/grid_helper.h>
#include <board.h>
#include <footprint.h>
#include <geometry/intersection.h>
#include <geometry/nearest.h>
#include <board.h>
class LSET;
class SHAPE_ARC;
@@ -73,32 +73,9 @@ public:
VECTOR2I SnapToPad( const VECTOR2I& aMousePos, std::deque<PAD*>& 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<BOARD_ITEM*>( 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<BOARD_ITEM*>& 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<BOARD_ITEM*>& aBoardItems ) override;
/**
* Chooses the "best" snap anchor around the given point, optionally taking layers from
+2 -1
View File
@@ -24,7 +24,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <limits>
#include <cmath>
#include <functional>
#include <stack>
@@ -34,6 +33,8 @@ using namespace std::placeholders;
#include <macros.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_point.h>
#include <pcb_table.h>
#include <pcb_tablecell.h>
+2
View File
@@ -26,9 +26,11 @@
#include <wx/clipbrd.h>
#include <3d_viewer/eda_3d_viewer_frame.h>
#include <footprint.h>
#include <footprint_editor_settings.h>
#include <gal/graphics_abstraction_layer.h>
#include <kiplatform/ui.h>
#include <pad.h>
#include <pcb_base_frame.h>
#include <preview_items/ruler_item.h>
#include <preview_items/two_point_geom_manager.h>
+1
View File
@@ -36,6 +36,7 @@
#include <reporter.h>
#include <thread_pool.h>
#include <lset.h>
#include <pad.h>
#include <pcb_track.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>

Some files were not shown because too many files have changed in this diff Show More