KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_rule.cpp
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
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU 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, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
24
25
#include <
board.h
>
26
#include <
board_item.h
>
27
#include <
drc/drc_rule.h
>
28
#include <
drc/drc_rule_condition.h
>
29
30
31
DRC_RULE::DRC_RULE
() :
32
m_Unary
( false ),
33
m_Implicit
( false ),
34
m_ImplicitItemId
( 0 ),
35
m_LayerCondition
(
LSET
::AllLayersMask() ),
36
m_Condition
( nullptr ),
37
m_Severity
(
RPT_SEVERITY_UNDEFINED
)
38
{
39
}
40
41
42
DRC_RULE::DRC_RULE
(
const
wxString& aName ) :
43
m_Unary
( false ),
44
m_Implicit
( false ),
45
m_ImplicitItemId
( 0 ),
46
m_Name
( aName ),
47
m_LayerCondition
(
LSET
::AllLayersMask() ),
48
m_Condition
( nullptr ),
49
m_Severity
(
RPT_SEVERITY_UNDEFINED
)
50
{
51
}
52
53
54
DRC_RULE::~DRC_RULE
()
55
{
56
delete
m_Condition
;
57
}
58
59
60
void
DRC_RULE::AddConstraint
(
DRC_CONSTRAINT
& aConstraint )
61
{
62
aConstraint.
SetParentRule
(
this
);
63
m_Constraints
.push_back( aConstraint );
64
}
65
66
67
std::optional<DRC_CONSTRAINT>
DRC_RULE::FindConstraint
(
DRC_CONSTRAINT_T
aType )
68
{
69
for
(
DRC_CONSTRAINT
& c :
m_Constraints
)
70
{
71
if
( c.m_Type == aType )
72
return
c;
73
}
74
75
return
std::optional<DRC_CONSTRAINT>();
76
}
board.h
board_item.h
DRC_CONSTRAINT
Definition
drc_rule.h:136
DRC_CONSTRAINT::SetParentRule
void SetParentRule(DRC_RULE *aParentRule)
Definition
drc_rule.h:169
DRC_RULE::m_Severity
SEVERITY m_Severity
Definition
drc_rule.h:131
DRC_RULE::m_Unary
bool m_Unary
Definition
drc_rule.h:123
DRC_RULE::m_Condition
DRC_RULE_CONDITION * m_Condition
Definition
drc_rule.h:129
DRC_RULE::m_LayerCondition
LSET m_LayerCondition
Definition
drc_rule.h:128
DRC_RULE::m_ImplicitItemId
KIID m_ImplicitItemId
Definition
drc_rule.h:125
DRC_RULE::DRC_RULE
DRC_RULE()
Definition
drc_rule.cpp:31
DRC_RULE::m_Constraints
std::vector< DRC_CONSTRAINT > m_Constraints
Definition
drc_rule.h:130
DRC_RULE::m_Implicit
bool m_Implicit
Definition
drc_rule.h:124
DRC_RULE::m_Name
wxString m_Name
Definition
drc_rule.h:126
DRC_RULE::AddConstraint
void AddConstraint(DRC_CONSTRAINT &aConstraint)
Definition
drc_rule.cpp:60
DRC_RULE::~DRC_RULE
virtual ~DRC_RULE()
Definition
drc_rule.cpp:54
DRC_RULE::FindConstraint
std::optional< DRC_CONSTRAINT > FindConstraint(DRC_CONSTRAINT_T aType)
Definition
drc_rule.cpp:67
LSET
LSET is a set of PCB_LAYER_IDs.
Definition
lset.h:37
drc_rule.h
DRC_CONSTRAINT_T
DRC_CONSTRAINT_T
Definition
drc_rule.h:47
drc_rule_condition.h
RPT_SEVERITY_UNDEFINED
@ RPT_SEVERITY_UNDEFINED
Definition
report_severity.h:27
src
pcbnew
drc
drc_rule.cpp
Generated on Tue Oct 14 2025 00:08:15 for KiCad PCB EDA Suite by
1.13.2