48 m_drcEngine( nullptr )
76 const VECTOR2I& aMarkerPos,
int aMarkerLayer )
78 if( item->GetViolatingRule() )
81 item->SetViolatingTest(
this );
88 if( ( aCount % aDelta ) == 0 || aCount == aSize - 1 )
108 va_start( vargs, fmt );
110 str.PrintfV( fmt, vargs );
118 auto it =
m_stats.find( ruleToTest );
140 for(
const std::pair<const DRC_RULE* const, int>& stat :
m_stats )
153 const std::function<
bool(
BOARD_ITEM*)>& aFunc )
156 std::bitset<MAX_STRUCT_TYPE_ID> typeMask;
159 if( aTypes.size() == 0 )
162 typeMask[ i ] =
true;
167 typeMask[ aType ] =
true;
172 if( (item->GetLayerSet() & aLayers).any() )
194 if( (item->GetLayerSet() & aLayers).any() )
238 if( ( item->GetLayerSet() & aLayers ).any() )
252 if( ( footprint->Reference().GetLayerSet() & aLayers ).any() )
254 if( !aFunc( &footprint->Reference() ) )
260 if( ( footprint->Value().GetLayerSet() & aLayers ).any() )
262 if( !aFunc( &footprint->Value() ) )
271 for(
PAD*
pad : footprint->Pads() )
274 if(
pad->HasHole() || (
pad->GetLayerSet() & aLayers ).any() )
284 for(
BOARD_ITEM* dwg : footprint->GraphicalItems() )
286 if( (dwg->GetLayerSet() & aLayers).any() )
321 for(
ZONE* zone : footprint->Zones() )
323 if( (zone->GetLayerSet() & aLayers).any() )
335 if( !aFunc( footprint ) )
348 if(
const PCB_TEXT*
text = dyn_cast<const PCB_TEXT*>( aItem ) )
350 if( !
text->IsVisible() )
359 int aConstraint,
int aActual )
364 if( constraint_str == actual_str )
371 return wxString::Format( aFormatString, aSource, constraint_str, actual_str );
constexpr EDA_IU_SCALE pcbIUScale
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINTS & Footprints()
DRC_RULE * GetParentRule() const
bool ReportProgress(double aProgress)
void ReportViolation(const std::shared_ptr< DRC_ITEM > &aItem, const VECTOR2I &aPos, int aMarkerLayer)
void ReportAux(const wxString &aStr)
bool ReportPhase(const wxString &aMessage)
std::vector< DRC_TEST_PROVIDER * > m_providers
~DRC_TEST_PROVIDER_REGISTRY()
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
static std::vector< KICAD_T > s_allBasicItemsButZones
virtual bool reportPhase(const wxString &aStageName)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
virtual bool reportProgress(int aCount, int aSize, int aDelta)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
static std::vector< KICAD_T > s_allBasicItems
virtual const wxString GetDescription() const
bool isInvisibleText(const BOARD_ITEM *aItem) const
std::unordered_map< const DRC_RULE *, int > m_stats
void reportAux(const wxString &aMsg)
virtual void accountCheck(const DRC_RULE *ruleToTest)
virtual const wxString GetName() const
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, int aConstraint, int aActual)
virtual void reportRuleStatistics()
LSET is a set of PCB_LAYER_IDs.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aValue in internal units into a united string.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
Handle a list of polygons defining a copper zone.
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)