48 m_drcEngine( nullptr ),
77 const VECTOR2I& aMarkerPos,
int aMarkerLayer )
80 if( item->GetViolatingRule() )
83 item->SetViolatingTest(
this );
90 if( ( aCount % aDelta ) == 0 || aCount == aSize - 1 )
110 va_start( vargs, fmt );
112 str.PrintfV( fmt, vargs );
120 auto it =
m_stats.find( ruleToTest );
142 for(
const std::pair<const DRC_RULE* const, int>& stat :
m_stats )
155 const std::function<
bool(
BOARD_ITEM*)>& aFunc )
158 std::bitset<MAX_STRUCT_TYPE_ID> typeMask;
161 if( aTypes.size() == 0 )
164 typeMask[ i ] =
true;
169 typeMask[ aType ] =
true;
174 if( (item->GetLayerSet() & aLayers).any() )
196 if( (item->GetLayerSet() & aLayers).any() )
240 if( ( item->GetLayerSet() & aLayers ).any() )
254 for(
PCB_FIELD* field : footprint->GetFields() )
256 if( ( field->GetLayerSet() & aLayers ).any() )
258 if( !aFunc( field ) )
268 for(
PAD*
pad : footprint->Pads() )
271 if(
pad->HasHole() || (
pad->GetLayerSet() & aLayers ).any() )
281 for(
BOARD_ITEM* dwg : footprint->GraphicalItems() )
283 if( (dwg->GetLayerSet() & aLayers).any() )
318 for(
ZONE* zone : footprint->Zones() )
320 if( (zone->GetLayerSet() & aLayers).any() )
332 if( !aFunc( footprint ) )
347 if( !
text->IsVisible() )
356 double aConstraint,
double aActual )
361 if( constraint_str == actual_str )
368 return wxString::Format( aFormatString, aSource, constraint_str, actual_str );
377 if( constraint_str == actual_str )
384 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.
const ZONES & Zones() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const DRAWINGS & Drawings() const
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...
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual)
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 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
virtual void reportRuleStatistics()
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
LSET is a set of PCB_LAYER_IDs.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
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_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ 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)