76 const VECTOR2I& aMarkerPos,
int aMarkerLayer,
77 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
79 item->SetViolatingTest(
this );
80 m_drcEngine->ReportViolation( item, aMarkerPos, aMarkerLayer, aPathGenerator );
94 aMarker->
SetPath( { ptAShape }, ptA, ptB );
133 if( ( aCount % aDelta ) == 0 || aCount == aSize - 1 )
135 if( !
m_drcEngine->ReportProgress(
static_cast<double>( aCount ) / aSize ) )
151 const std::function<
bool(
BOARD_ITEM*)>& aFunc )
154 std::bitset<MAX_STRUCT_TYPE_ID> typeMask;
157 if( aTypes.size() == 0 )
160 typeMask[ i ] =
true;
165 typeMask[ aType ] =
true;
170 if( (item->GetLayerSet() & aLayers).any() )
192 if( (item->GetLayerSet() & aLayers).any() )
264 if( ( item->GetLayerSet() & aLayers ).any() )
278 for(
PCB_FIELD* field : footprint->GetFields() )
280 if( ( field->GetLayerSet() & aLayers ).any() )
282 if( !aFunc( field ) )
292 for(
PAD*
pad : footprint->Pads() )
295 if(
pad->HasHole() || (
pad->GetLayerSet() & aLayers ).any() )
305 for(
BOARD_ITEM* dwg : footprint->GraphicalItems() )
307 if( (dwg->GetLayerSet() & aLayers).any() )
342 for(
ZONE* zone : footprint->Zones() )
344 if( (zone->GetLayerSet() & aLayers).any() )
356 if( !aFunc( footprint ) )
371 if( !field->IsVisible() )
385 if( constraint_str == actual_str )
392 return wxString::Format( aFormatString, aSource, std::move( constraint_str ), std::move( actual_str ) );
401 if( constraint_str == actual_str )
408 return wxString::Format( aFormatString, aSource, std::move( constraint_str ), std::move( 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...
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Information pertinent to a Pcbnew printed circuit board.
const ZONES & Zones() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const DRAWINGS & Drawings() const
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)
void reportTwoShapeGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const SHAPE *aShape1, const SHAPE *aShape2, PCB_LAYER_ID aLayer, int aDistance)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, const LSET &aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
void reportTwoItemGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const BOARD_ITEM *aItem1, const BOARD_ITEM *aItem2, PCB_LAYER_ID aLayer, int aDistance)
void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::function< void(PCB_MARKER *)> &aPathGenerator=[](PCB_MARKER *){})
void reportTwoPointGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const VECTOR2I &ptA, const VECTOR2I &ptB, PCB_LAYER_ID aLayer)
static std::vector< KICAD_T > s_allBasicItems
bool isInvisibleText(const BOARD_ITEM *aItem) const
virtual const wxString GetName() const
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
void SetStart(const VECTOR2I &aStart)
void SetEnd(const VECTOR2I &aEnd)
LSET is a set of PCB_LAYER_IDs.
void SetPath(const std::vector< PCB_SHAPE > &aShapes, const VECTOR2I &aStart, const VECTOR2I &aEnd)
An abstract shape on 2D plane.
bool NearestPoints(const SHAPE *aOther, VECTOR2I &aPtThis, VECTOR2I &aPtOther) const
Return the two points that mark the closest distance between this shape and aOther.
UNITS_PROVIDER(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits)
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.
EDA_DATA_TYPE
The type of unit.
PCB_LAYER_ID
A quick note on layer IDs:
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_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ 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_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I