Cleanup includes in board.h and footprint.h

This commit is contained in:
Ian McInerney 2021-06-03 19:05:43 +01:00
parent 2de010f08b
commit 4f05262705
40 changed files with 136 additions and 38 deletions

View File

@ -27,6 +27,7 @@
#include <algorithm>
#include <iterator>
#include <drc/drc_rtree.h>
#include <pcb_base_frame.h>
#include <reporter.h>
#include <board_commit.h>
@ -186,6 +187,21 @@ void BOARD::ClearProject()
}
void BOARD::IncrementTimeStamp()
{
m_timeStamp++;
{
std::unique_lock<std::mutex> cacheLock( m_CachesMutex );
m_InsideAreaCache.clear();
m_InsideCourtyardCache.clear();
m_InsideFCourtyardCache.clear();
m_InsideBCourtyardCache.clear();
}
m_CopperZoneRTrees.clear();
}
std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions()
{
for( PCB_MARKER* marker : GetBoard()->Markers() )
@ -813,6 +829,15 @@ void BOARD::DeleteMARKERs( bool aWarningsAndErrors, bool aExclusions )
}
void BOARD::DeleteAllFootprints()
{
for( FOOTPRINT* footprint : m_footprints )
delete footprint;
m_footprints.clear();
}
BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const
{
if( aID == niluuid )

View File

@ -27,20 +27,22 @@
#include <board_design_settings.h>
#include <board_item_container.h>
#include <footprint.h>
#include <common.h> // Needed for stl hash extensions
#include <convert_drawsegment_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
#include <layers_id_colors_and_visibility.h>
#include <netinfo.h>
#include <pcb_item_containers.h>
#include <pcb_plot_params.h>
#include <title_block.h>
#include <tools/pcb_selection.h>
#include <drc/drc_rtree.h>
class BOARD_COMMIT;
class DRC_RTREE;
class PCB_BASE_FRAME;
class PCB_EDIT_FRAME;
class PICKED_ITEMS_LIST;
class BOARD;
class FOOTPRINT;
class ZONE;
class TRACK;
class PAD;
@ -168,12 +170,6 @@ public:
};
DECL_VEC_FOR_SWIG( MARKERS, PCB_MARKER* )
DECL_VEC_FOR_SWIG( ZONES, ZONE* )
DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
// Dequeue rather than Vector just so we can use moveUnflaggedItems in pcbnew_control.cpp
DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* )
/**
* Flags to specify how the board is being used.
*/
@ -268,20 +264,7 @@ public:
*/
BOARD_USE GetBoardUse() const { return m_boardUse; }
void IncrementTimeStamp()
{
m_timeStamp++;
{
std::unique_lock<std::mutex> cacheLock( m_CachesMutex );
m_InsideAreaCache.clear();
m_InsideCourtyardCache.clear();
m_InsideFCourtyardCache.clear();
m_InsideBCourtyardCache.clear();
}
m_CopperZoneRTrees.clear();
}
void IncrementTimeStamp();
int GetTimeStamp() { return m_timeStamp; }
@ -387,13 +370,7 @@ public:
/**
* Removes all footprints from the deque and frees the memory associated with them
*/
void DeleteAllFootprints()
{
for( FOOTPRINT* footprint : m_footprints )
delete footprint;
m_footprints.clear();
}
void DeleteAllFootprints();
/**
* @return null if aID is null. Returns an object of Type() == NOT_USED if

View File

@ -34,6 +34,7 @@
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <zone.h>
#include <collectors.h>
#include <eda_dde.h>
#include <kiface_i.h>

View File

@ -29,6 +29,7 @@
#include <base_units.h>
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <confirm.h>
#include <dialog_board_statistics_base.h>

View File

@ -23,6 +23,7 @@
#include <dialog_cleanup_graphics.h>
#include <board_commit.h>
#include <footprint.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <graphics_cleaner.h>

View File

@ -28,6 +28,7 @@
#include <footprint.h>
#include <pcb_text.h>
#include <fp_text.h>
#include <zone.h>
#include <dialog_find.h>
#include <kicad_string.h>
#include <pcb_edit_frame.h>

View File

@ -25,6 +25,7 @@
#include <widgets/appearance_controls.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <footprint.h>
#include <pcb_marker.h>
#include <drc/drc_results_provider.h>
#include <footprint_edit_frame.h>

View File

@ -27,6 +27,7 @@
#include <dialogs/dialog_track_via_properties.h>
#include <pcb_layer_box_selector.h>
#include <tools/pcb_selection_tool.h>
#include <footprint.h>
#include <track.h>
#include <pcb_edit_frame.h>
#include <confirm.h>

View File

@ -26,6 +26,7 @@
#include <bitmaps.h>
#include <board_commit.h>
#include <footprint.h>
#include <track.h>
#include <pad.h>
#include <pcb_edit_frame.h>

View File

@ -27,12 +27,14 @@
#include <widgets/progress_reporter.h>
#include <kicad_string.h>
#include <drc/drc_engine.h>
#include <drc/drc_rtree.h>
#include <drc/drc_rule_parser.h>
#include <drc/drc_rule.h>
#include <drc/drc_rule_condition.h>
#include <drc/drc_test_provider.h>
#include <track.h>
#include <footprint.h>
#include <track.h>
#include <zone.h>
#include <geometry/shape.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_null.h>

View File

@ -27,7 +27,9 @@
#include <eda_rect.h>
#include <board_item.h>
#include <fp_text.h>
#include <track.h>
#include <memory>
#include <unordered_set>
#include <set>
#include <vector>

View File

@ -23,9 +23,11 @@
#include <common.h>
#include <board.h>
#include <footprint.h>
#include <pcb_shape.h>
#include <pad.h>
#include <track.h>
#include <zone.h>
#include <geometry/seg.h>
#include <geometry/shape_poly_set.h>

View File

@ -25,6 +25,7 @@
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h>
#include <footprint.h>
/*
Couartyard clearance. Tests for malformed component courtyards and overlapping footprints.

View File

@ -34,6 +34,7 @@
#include <connectivity/connectivity_data.h>
#include <connectivity/from_to_cache.h>
#include <view/view_overlay.h>
/*
Differential pair gap/coupling test.

View File

@ -26,6 +26,7 @@
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider.h>
#include <zone.h>
/*
"Disallow" test. Goes through all items, matching types/conditions drop errors.

View File

@ -21,6 +21,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <drc/drc_item.h>

View File

@ -22,6 +22,7 @@
*/
#include <common.h>
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <geometry/shape_segment.h>

View File

@ -23,6 +23,7 @@
#include <common.h>
#include <board.h>
#include <footprint.h>
#include <pcb_shape.h>
#include <geometry/seg.h>

View File

@ -36,6 +36,7 @@
#include <pcb_edit_frame.h>
#include <pgm_base.h>
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <pcbplot.h>
#include <gendrill_gerber_writer.h>

View File

@ -37,7 +37,9 @@
#include <pcb_text.h>
#include <pcb_marker.h>
#include <pcb_group.h>
#include <track.h>
#include <footprint.h>
#include <zone.h>
#include <view/view.h>
#include <geometry/shape_null.h>
#include <i18n_utility.h>

View File

@ -37,8 +37,8 @@
#include <zones.h>
#include <convert_drawsegment_list_to_polygon.h>
#include <pcb_item_containers.h>
#include <fp_text.h>
#include <zone.h>
#include <functional>
class LINE_READER;
@ -98,11 +98,6 @@ public:
bool m_Show; ///< Include model in rendering
};
DECL_DEQ_FOR_SWIG( PADS, PAD* )
DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
DECL_VEC_FOR_SWIG( FP_GROUPS, PCB_GROUP* )
DECL_DEQ_FOR_SWIG( FOOTPRINTS, FOOTPRINT* )
class FOOTPRINT : public BOARD_ITEM_CONTAINER
{

View File

@ -32,6 +32,7 @@
#include <pcb_shape.h>
#include <pcb_text.h>
#include <fp_text.h>
#include <zone.h>
#include <locale_io.h>
#include <netinfo.h>
#include <plugins/kicad/pcb_parser.h>

View File

@ -32,7 +32,9 @@
#include <widgets/msgpanel.h>
#include <base_units.h>
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <pad.h>
/*********************************************************/

View File

@ -40,6 +40,7 @@
#include <dialogs/dialog_grid_settings.h>
#include <dialogs/eda_view_switcher.h>
#include <wildcards_and_files_ext.h>
#include <collectors.h>
PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,

View File

@ -25,6 +25,7 @@
#include <cstdio>
#include <memory>
#include <board.h>
#include <drc/drc_rtree.h>
#include <track.h>
#include <pcb_group.h>
#include <geometry/shape_segment.h>

View File

@ -0,0 +1,58 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PCB_ITEM_CONTAINERS_H_
#define PCB_ITEM_CONTAINERS_H_
#include <macros_swig.h>
// Board-level items
class FOOTPRINT;
class TRACK;
class PCB_GROUP;
class PCB_MARKER;
class ZONE;
DECL_VEC_FOR_SWIG( MARKERS, PCB_MARKER* )
DECL_VEC_FOR_SWIG( ZONES, ZONE* )
DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
DECL_DEQ_FOR_SWIG( FOOTPRINTS, FOOTPRINT* )
// Dequeue rather than Vector just so we can use moveUnflaggedItems in pcbnew_control.cpp
DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* )
// Shared with board and footprint
class BOARD_ITEM;
DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
// Footprint-level items
class FP_ZONE;
class PAD;
DECL_DEQ_FOR_SWIG( PADS, PAD* )
DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
DECL_VEC_FOR_SWIG( FP_GROUPS, PCB_GROUP* )
#endif // PCB_ITEM_CONTAINERS_H_

View File

@ -29,6 +29,7 @@
#include <bitmaps.h>
#include <board.h>
#include <core/mirror.h>
#include <footprint.h>
#include <pcb_text.h>
#include <pcb_painter.h>
#include <trigo.h>

View File

@ -35,6 +35,7 @@
#include <fp_shape.h>
#include <fp_text.h>
#include <zone.h>
#include <board_stackup_manager/stackup_predefined_prms.h>

View File

@ -29,6 +29,7 @@
#include <cadstar_pcb_archive_parser.h>
#include <cadstar_pcb_archive_plugin.h>
#include <board.h>
#include <footprint.h>
#include <set>
class BOARD;

View File

@ -41,11 +41,13 @@
#include <board.h>
#include <board_item.h>
#include <convert_to_biu.h>
#include <footprint.h>
#include <fp_shape.h>
#include <pad_shapes.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <track.h>
#include <zone.h>
#include <common.h>
#include <geometry/shape_arc.h>
#include <kicad_string.h>

View File

@ -33,6 +33,7 @@
#include <math/util.h> // for KiROUND
#include <fp_shape.h>
#include <pcb_polygon.h>
#include <zone.h>
namespace PCAD2KICAD {

View File

@ -30,6 +30,7 @@ using namespace std::placeholders;
#include <footprint.h>
#include <fp_shape.h>
#include <pad.h>
#include <zone.h>
#include <pcb_edit_frame.h>
#include <pcbnew_id.h>
#include <dialogs/dialog_pns_settings.h>

View File

@ -35,6 +35,7 @@
#include <bitmaps.h>
#include <painter.h>
#include <board.h>
#include <footprint.h>
#include <fp_shape.h>
#include <pcb_group.h>
#include <pcb_text.h>

View File

@ -35,6 +35,7 @@
#include <bitmaps.h>
#include <footprint.h>
#include <pcb_group.h>
#include <zone.h>
#include <project.h>
#include <fp_lib_table.h>
#include <dialogs/dialog_cleanup_graphics.h>

View File

@ -21,7 +21,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <footprint.h>
#include <track.h>
#include <zone.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/edit_tool.h>

View File

@ -31,7 +31,8 @@
#include <bitmaps.h>
#include <dialogs/dialog_group_properties.h>
#include <pcb_group.h>
#include <collectors.h>
#include <footprint.h>
class GROUP_CONTEXT_MENU : public ACTION_MENU
{

View File

@ -35,6 +35,7 @@ using namespace std::placeholders;
#include <board_commit.h>
#include <bitmaps.h>
#include <confirm.h>
#include <collectors.h>
POSITION_RELATIVE_TOOL::POSITION_RELATIVE_TOOL() :

View File

@ -27,6 +27,7 @@
#include <tool/tool_manager.h>
#include <zone.h>
#include <pcb_shape.h>
#include <footprint.h>
#include <fp_shape.h>
#include <board_commit.h>
#include <pcb_painter.h>

View File

@ -35,6 +35,7 @@
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <zone.h>
void process( const BOARD_CONNECTED_ITEM* item, int net )

View File

@ -32,6 +32,7 @@
#include <qa_utils/utility_registry.h>
#include <board.h>
#include <zone.h>
#include <profile.h>
#include <atomic>