KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_utils.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
25
26#pragma once
27
28#include <functional>
29
30#include <wx/string.h>
31
32#include <geometry/eda_angle.h>
33#include <math/vector2d.h>
34#include <pad_utils.h>
35
36class BOARD_ITEM;
37class FOOTPRINT;
38class PAD;
39class UNITS_PROVIDER;
40
41
58bool ComputeFootprintShift( const FOOTPRINT& aExisting, const FOOTPRINT& aNew, VECTOR2I& aShift,
59 EDA_ANGLE& aAngleShift );
60
61
63{
64
65using PAD_CHECK_HANDLER = std::function<void( const PAD&, const PAD_UTILS::PAD_CHECK_RESULT& )>;
66
67
74void CheckFootprintAttributes( const FOOTPRINT& aFootprint,
75 const std::function<void( const wxString& )>& aErrorHandler );
76
77
86void CheckPads( const FOOTPRINT& aFootprint, const UNITS_PROVIDER& aUnitsProvider,
87 const PAD_CHECK_HANDLER& aErrorHandler );
88
89
93void CheckShortingPads( const FOOTPRINT& aFootprint,
94 const std::function<void( const PAD*, const PAD*, int aErrorCode,
95 const VECTOR2I& )>& aErrorHandler );
96
97
102void CheckNetTies( const FOOTPRINT& aFootprint,
103 const std::function<void( const BOARD_ITEM*, const BOARD_ITEM*,
104 const BOARD_ITEM*, const VECTOR2I& )>& aErrorHandler );
105
106
111void CheckNetTiePadGroups( const FOOTPRINT& aFootprint,
112 const std::function<void( const wxString& )>& aErrorHandler );
113
114
118void CheckClippedSilk( const FOOTPRINT& aFootprint,
119 const std::function<void( BOARD_ITEM*, BOARD_ITEM*,
120 const VECTOR2I& )>& aErrorHandler );
121
122} // namespace FOOTPRINT_UTILS
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:85
Definition pad.h:61
bool ComputeFootprintShift(const FOOTPRINT &aExisting, const FOOTPRINT &aNew, VECTOR2I &aShift, EDA_ANGLE &aAngleShift)
Compute position and angle shift between two footprints.
void CheckClippedSilk(const FOOTPRINT &aFootprint, const std::function< void(BOARD_ITEM *, BOARD_ITEM *, const VECTOR2I &)> &aErrorHandler)
Check for silkscreen graphics clipped by solder mask apertures.
void CheckFootprintAttributes(const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler)
Check that the footprint's SMD/through-hole attribute matches its pads.
void CheckNetTies(const FOOTPRINT &aFootprint, const std::function< void(const BOARD_ITEM *, const BOARD_ITEM *, const BOARD_ITEM *, const VECTOR2I &)> &aErrorHandler)
Check for un-allowed shorting of pads in net-tie footprints.
void CheckShortingPads(const FOOTPRINT &aFootprint, const std::function< void(const PAD *, const PAD *, int aErrorCode, const VECTOR2I &)> &aErrorHandler)
Check for overlapping, different-numbered, non-net-tie pads.
void CheckPads(const FOOTPRINT &aFootprint, const UNITS_PROVIDER &aUnitsProvider, const PAD_CHECK_HANDLER &aErrorHandler)
Run non-board-specific DRC checks on footprint's pads.
std::function< void(const PAD &, const PAD_UTILS::PAD_CHECK_RESULT &)> PAD_CHECK_HANDLER
void CheckNetTiePadGroups(const FOOTPRINT &aFootprint, const std::function< void(const wxString &)> &aErrorHandler)
Sanity check net-tie pad groups.
A single finding from CheckPad().
Definition pad_utils.h:107
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708