KiCad PCB EDA Suite
drc_engine.cpp File Reference
#include <atomic>
#include <reporter.h>
#include <progress_reporter.h>
#include <string_utils.h>
#include <board_design_settings.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 <drc/drc_item.h>
#include <drc/drc_cache_generator.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <thread_pool.h>
#include <zone.h>

Go to the source code of this file.

Macros

#define ERROR_LIMIT   199
 
#define EXTENDED_ERROR_LIMIT   499
 
#define REPORT(s)   { if( aReporter ) { aReporter->Report( s ); } }
 
#define UNITS   aReporter ? aReporter->GetUnits() : EDA_UNITS::MILLIMETRES
 
#define REPORT_VALUE(v)   MessageTextFromValue( UNITS, v )
 

Functions

void drcPrintDebugMessage (int level, const wxString &msg, const char *function, int line)
 
static bool isKeepoutZone (const BOARD_ITEM *aItem, bool aCheckFlags)
 

Macro Definition Documentation

◆ ERROR_LIMIT

#define ERROR_LIMIT   199

Definition at line 48 of file drc_engine.cpp.

◆ EXTENDED_ERROR_LIMIT

#define EXTENDED_ERROR_LIMIT   499

Definition at line 49 of file drc_engine.cpp.

◆ REPORT

#define REPORT (   s)    { if( aReporter ) { aReporter->Report( s ); } }

Definition at line 608 of file drc_engine.cpp.

◆ REPORT_VALUE

#define REPORT_VALUE (   v)    MessageTextFromValue( UNITS, v )

Definition at line 610 of file drc_engine.cpp.

◆ UNITS

#define UNITS   aReporter ? aReporter->GetUnits() : EDA_UNITS::MILLIMETRES

Definition at line 609 of file drc_engine.cpp.

Function Documentation

◆ drcPrintDebugMessage()

void drcPrintDebugMessage ( int  level,
const wxString &  msg,
const char *  function,
int  line 
)

Definition at line 52 of file drc_engine.cpp.

53{
54 wxString valueStr;
55
56 if( wxGetEnv( wxT( "DRC_DEBUG" ), &valueStr ) )
57 {
58 int setLevel = wxAtoi( valueStr );
59
60 if( level <= setLevel )
61 printf( "%-30s:%d | %s\n", function, line, (const char *) msg.c_str() );
62 }
63}

◆ isKeepoutZone()

static bool isKeepoutZone ( const BOARD_ITEM aItem,
bool  aCheckFlags 
)
static

Definition at line 99 of file drc_engine.cpp.

100{
101 if( !aItem )
102 return false;
103
104 if( aItem->Type() != PCB_ZONE_T && aItem->Type() != PCB_FP_ZONE_T )
105 return false;
106
107 const ZONE* zone = static_cast<const ZONE*>( aItem );
108
109 if( !zone->GetIsRuleArea() )
110 return false;
111
112 if( aCheckFlags )
113 {
114 if( !zone->GetDoNotAllowTracks()
115 && !zone->GetDoNotAllowVias()
116 && !zone->GetDoNotAllowPads()
117 && !zone->GetDoNotAllowCopperPour()
118 && !zone->GetDoNotAllowFootprints() )
119 {
120 return false;
121 }
122 }
123
124 return true;
125}
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
Handle a list of polygons defining a copper zone.
Definition: zone.h:58
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: zone.h:698
bool GetDoNotAllowVias() const
Definition: zone.h:700
bool GetDoNotAllowPads() const
Definition: zone.h:702
bool GetDoNotAllowTracks() const
Definition: zone.h:701
bool GetDoNotAllowFootprints() const
Definition: zone.h:703
bool GetDoNotAllowCopperPour() const
Definition: zone.h:699
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:114
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
Definition: typeinfo.h:102

References ZONE::GetDoNotAllowCopperPour(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetIsRuleArea(), PCB_FP_ZONE_T, PCB_ZONE_T, and EDA_ITEM::Type().

Referenced by DRC_ENGINE::EvalRules(), and DRC_ENGINE::loadImplicitRules().