58 virtual bool Run()
override;
60 virtual const wxString
GetName()
const override {
return wxT(
"library_parity" ); };
69#define TEST( a, b, msg ) \
75 if( aReporter && wxString( msg ).length() ) \
76 aReporter->Report( msg ); \
79 if( diff && !aReporter ) \
84#define TEST_PT( a, b, msg ) \
86 if( abs( a.x - b.x ) > EPSILON \
87 || abs( a.y - b.y ) > EPSILON ) \
91 if( aReporter && wxString( msg ).length() ) \
92 aReporter->Report( msg ); \
95 if( diff && !aReporter ) \
99#define EPSILON_D 0.000010
100#define TEST_D( a, b, msg ) \
102 if( abs( a - b ) > EPSILON_D ) \
106 if( aReporter && wxString( msg ).length() ) \
107 aReporter->Report( msg ); \
110 if( diff && !aReporter ) \
114#define ITEM_DESC( item ) ( item )->GetItemDescription( &g_unitsProvider, true )
115#define PAD_DESC( pad ) wxString::Format( _( "Pad %s" ), ( pad )->GetNumber() )
133 bool aAllowCuExpansion )
135 if( !aAllowCuExpansion )
137 return aItem == bLib;
142 const LSET aNonCu = aItem & nonCuMask;
143 const LSET bNonCu = bLib & nonCuMask;
145 if( aNonCu != bNonCu )
160 const LSET missingInnerInA = bInner & ~aInner;
161 if( missingInnerInA.count() )
169 const std::shared_ptr<PCB_SHAPE>& b )
174 TEST( a->GetShape(), b->GetShape(),
"" );
176 switch( a->GetShape() )
180 BOX2I aRect( a->GetStart(), a->GetEnd() - a->GetStart() );
181 BOX2I bRect( b->GetStart(), b->GetEnd() - b->GetStart() );
193 TEST_PT( a->GetStart(), b->GetStart(),
"" );
194 TEST_PT( a->GetEnd(), b->GetEnd(),
"" );
198 TEST_PT( a->GetStart(), b->GetStart(),
"" );
199 TEST_PT( a->GetEnd(), b->GetEnd(),
"" );
203 if( ( a->GetArcMid() - b->GetArcMid() ).EuclideanNorm() >
pcbIUScale.mmToIU( 0.0005 ) )
209 TEST_PT( a->GetStart(), b->GetStart(),
"" );
210 TEST_PT( a->GetEnd(), b->GetEnd(),
"" );
211 TEST_PT( a->GetBezierC1(), b->GetBezierC1(),
"" );
212 TEST_PT( a->GetBezierC2(), b->GetBezierC2(),
"" );
217 TEST_PT( a->GetEllipseCenter(), b->GetEllipseCenter(),
"" );
218 TEST( a->GetEllipseMajorRadius(), b->GetEllipseMajorRadius(),
"" );
219 TEST( a->GetEllipseMinorRadius(), b->GetEllipseMinorRadius(),
"" );
220 TEST( a->GetEllipseRotation(), b->GetEllipseRotation(),
"" );
224 TEST( a->GetEllipseStartAngle(), b->GetEllipseStartAngle(),
"" );
225 TEST( a->GetEllipseEndAngle(), b->GetEllipseEndAngle(),
"" );
231 TEST( a->GetPolyShape().TotalVertices(), b->GetPolyShape().TotalVertices(),
"" );
233 for(
int poly = 0; poly < static_cast<int>( a->GetPolyShape().CPolygons().size() ); poly++ )
238 if( aPolygon.size() == 0 || bPolygon.size() == 0
239 || !aPolygon[0].CompareGeometry( bPolygon[0],
true,
EPSILON ) )
253 TEST( a->GetStroke(), b->GetStroke(),
"" );
254 TEST( a->GetFillMode(), b->GetFillMode(),
"" );
264#define REPORT_MSG( s, p ) aReporter.Report( wxString::Format( s, p ) )
353 [](
const PAD* aPad )
356 || aPad->GetDrillSize().x == aPad->GetDrillSize().y;
359 bool circular = roundDrill( a ) && roundDrill( bLib );
360 bool halfTurnSymmetric =
true;
366 if( shape != bLib->
GetShape( layer ) )
390 wxString::Format(
_(
"%s pad to die length differs." ),
PAD_DESC( a ) ) );
392 wxString::Format(
_(
"%s position differs." ),
PAD_DESC( a ) ) );
395 wxString::Format(
_(
"%s has different numbers." ),
PAD_DESC( a ) ) );
407 bool allowExpansion =
false;
411 if( layerSettingsDiffer
419 aReporter->
Report( wxString::Format(
_(
"%s layers differ." ),
PAD_DESC( a ) ) );
425 wxString::Format(
_(
"%s pad type differs." ),
PAD_DESC( a ) ) );
427 wxString::Format(
_(
"%s fabrication property differs." ),
PAD_DESC( a ) ) );
435 aReporter->
Report( wxString::Format(
_(
"%s orientation differs." ),
PAD_DESC( a ) ) );
449 wxString::Format(
_(
"%s pad shape type differs on layer %s." ),
454 wxString::Format(
_(
"%s size differs on layer %s." ),
459 wxString::Format(
_(
"%s trapezoid delta differs on layer %s." ),
467 wxString::Format(
_(
"%s rounded corners differ on layer %s." ),
476 wxString::Format(
_(
"%s chamfered corner sizes differ on layer %s." ),
482 wxString::Format(
_(
"%s chamfered corners differ on layer %s." ),
488 wxString::Format(
_(
"%s shape offset from hole differs on layer %s." ),
494 wxString::Format(
_(
"%s drill shape differs." ),
PAD_DESC( a ) ) );
496 wxString::Format(
_(
"%s drill size differs." ),
PAD_DESC( a ) ) );
511 bool primitivesDiffer =
false;
519 primitivesDiffer =
true;
523 for(
size_t ii = 0; ii < a->
GetPrimitives( aLayer ).size(); ++ii )
528 primitivesDiffer =
true;
535 firstDifferingLayer = aLayer;
539 if( primitivesDiffer )
542 layerName = board ? board->
GetLayerName( firstDifferingLayer )
547 aReporter->
Report( wxString::Format(
_(
"%s shape primitives differ on layer %s." ),
567 wxString::Format(
_(
"%s text differs." ),
ITEM_DESC( &curr_barcode ) ) );
570 wxString::Format(
_(
"%s position differs." ),
ITEM_DESC( &curr_barcode ) ) );
573 wxString::Format(
_(
"%s width differs." ),
ITEM_DESC( &curr_barcode ) ) );
575 wxString::Format(
_(
"%s height differs." ),
ITEM_DESC( &curr_barcode ) ) );
578 wxString::Format(
_(
"%s text size differs." ),
ITEM_DESC( &curr_barcode ) ) );
581 wxString::Format(
_(
"%s code differs." ),
ITEM_DESC( &curr_barcode ) ) );
583 wxString::Format(
_(
"%s error correction level differs." ),
ITEM_DESC( &curr_barcode ) ) );
656 for(
int poly = 0; poly < static_cast<int>( aLib.
CPolygons().size() ); poly++ )
661 if( curr_polygon.size() == 0 || ref_polygon.size() == 0
662 || !curr_polygon[0].CompareGeometry( ref_polygon[0],
true,
EPSILON ) )
691 wxString::Format(
_(
"%s corner smoothing setting differs." ),
ITEM_DESC( a ) ) );
693 wxString::Format(
_(
"%s corner smoothing radius differs." ),
ITEM_DESC( a ) ) );
695 wxString::Format(
_(
"%s name differs." ),
ITEM_DESC( a ) ) );
697 wxString::Format(
_(
"%s priority differs." ),
ITEM_DESC( a ) ) );
700 wxString::Format(
_(
"%s keep-out property differs." ),
ITEM_DESC( a ) ) );
702 wxString::Format(
_(
"%s keep out zone fill setting differs." ),
ITEM_DESC( a ) ) );
704 wxString::Format(
_(
"%s keep out footprints setting differs." ),
ITEM_DESC( a ) ) );
706 wxString::Format(
_(
"%s keep out pads setting differs." ),
ITEM_DESC( a ) ) );
708 wxString::Format(
_(
"%s keep out tracks setting differs." ),
ITEM_DESC( a ) ) );
710 wxString::Format(
_(
"%s keep out vias setting differs." ),
ITEM_DESC( a ) ) );
717 innerLayerExpansionAllowed ) )
723 aReporter->
Report( wxString::Format(
_(
"%s layers differ." ),
ITEM_DESC( a ) ) );
732 wxString::Format(
_(
"%s pad connection property differs." ),
ITEM_DESC( a ) ) );
734 wxString::Format(
_(
"%s local clearance differs." ),
ITEM_DESC( a ) ) );
736 wxString::Format(
_(
"%s thermal relief gap differs." ),
ITEM_DESC( a ) ) );
738 wxString::Format(
_(
"%s thermal relief spoke width differs." ),
ITEM_DESC( a ) ) );
741 wxString::Format(
_(
"%s min thickness differs." ),
ITEM_DESC( a ) ) );
744 wxString::Format(
_(
"%s remove islands setting differs." ),
ITEM_DESC( a ) ) );
746 wxString::Format(
_(
"%s minimum island size setting differs." ),
ITEM_DESC( a ) ) );
749 wxString::Format(
_(
"%s fill type differs." ),
ITEM_DESC( a ) ) );
751 wxString::Format(
_(
"%s hatch width differs." ),
ITEM_DESC( a ) ) );
753 wxString::Format(
_(
"%s hatch gap differs." ),
ITEM_DESC( a ) ) );
755 wxString::Format(
_(
"%s hatch orientation differs." ),
ITEM_DESC( a ) ) );
757 wxString::Format(
_(
"%s hatch smoothing level differs." ),
ITEM_DESC( a ) ) );
759 wxString::Format(
_(
"%s hatch smoothing amount differs." ),
ITEM_DESC( a ) ) );
761 wxString::Format(
_(
"%s minimum hatch hole setting differs." ),
ITEM_DESC( a ) ) );
770 wxString::Format(
_(
"%s outline corner count differs." ),
ITEM_DESC( a ) ) );
774 for(
int poly = 0; !cornersDiffer && poly < aLibOutline.
OutlineCount(); poly++ )
779 if( aPolygon.size() != bPolygon.size() )
781 cornersDiffer =
true;
785 for(
size_t contour = 0; contour < aPolygon.size() && !cornersDiffer; contour++ )
787 if( !aPolygon[contour].CompareGeometry( bPolygon[contour],
true,
EPSILON ) )
788 cornersDiffer =
true;
797 aReporter->
Report( wxString::Format(
_(
"%s corners differ." ),
ITEM_DESC( a ) ) );
814 wxString::Format(
_(
"Footprint stackup mode differs." ) ) );
819 TEST( aLayers, bLayers,
820 wxString::Format(
_(
"Footprint layers differ." ) ) );
843 bool mismatch =
false;
846 const LSET onlyInFp = fpLayers & ~brdLayers;
848 if( onlyInFp.count() )
852 aReporter->
Report( wxString::Format(
_(
"Footprint has %lu layers not on board: %s" ), onlyInFp.count(),
859 if( cuOnlyInBoard.count() )
863 aReporter->
Report( wxString::Format(
_(
"Board has %lu copper layers not in footprint: %s" ),
864 cuOnlyInBoard.count(),
878 std::unique_ptr<FOOTPRINT> temp(
static_cast<FOOTPRINT*
>( aLibFP->
Clone() ) );
896 for(
BOARD_ITEM* item : temp->GraphicalItems() )
897 item->NormalizeForCompare();
901 temp->SetParent(
nullptr );
908#define TEST_ATTR( a, b, attr, msg ) TEST( ( a & attr ), ( b & attr ), msg )
911 _(
"Footprint types differ." ) );
914 wxString::Format(
_(
"'%s' settings differ." ),
915 _(
"Allow bridged solder mask apertures between pads" ) ) );
921 wxString::Format(
_(
"'%s' settings differ." ),
922 _(
"Not in schematic" ) ) );
925 wxString::Format(
_(
"'%s' settings differ." ),
926 _(
"Exclude from position files" ) ) );
929 wxString::Format(
_(
"'%s' settings differ." ),
930 _(
"Exclude from bill of materials" ) ) );
933 wxString::Format(
_(
"'%s' settings differ." ),
934 _(
"Exclude from simulation" ) ) );
937 wxString::Format(
_(
"'%s' settings differ." ),
938 _(
"Do not populate" ) ) );
941#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
942#define CHECKPOINT { if( diff && !aReporter ) return diff; }
947 REPORT(
_(
"Footprint stackup differs." ) );
965 REPORT(
_(
"Pad clearance overridden." ) );
972 REPORT(
_(
"Solder mask expansion overridden." ) );
980 REPORT(
_(
"Solder paste absolute clearance overridden." ) );
987 REPORT(
_(
"Solder paste relative clearance overridden." ) );
994 REPORT(
_(
"Zone connection overridden." ) );
999 _(
"Net tie pad groups differ." ) );
1004 _(
"Net tie pad groups differ." ) );
1026 dummy.SetParentGroup(
nullptr );
1027 dummy.SetParent(
nullptr );
1030 board->UncacheItemSubtreeById(
dummy );
1033 item->NormalizeForCompare();
1035 std::set<BOARD_ITEM*, FOOTPRINT::cmp_drawings> aShapes;
1036 std::copy_if(
dummy.GraphicalItems().begin(),
dummy.GraphicalItems().end(),
1037 std::inserter( aShapes, aShapes.begin() ),
1040 return item->Type() == PCB_SHAPE_T;
1043 std::set<BOARD_ITEM*, FOOTPRINT::cmp_drawings> bShapes;
1045 std::inserter( bShapes, bShapes.begin() ),
1048 return item->Type() == PCB_SHAPE_T;
1051 if( aShapes.size() != bShapes.size() )
1054 REPORT(
_(
"Graphic item count differs." ) );
1058 for(
auto aIt = aShapes.begin(), bIt = bShapes.begin(); aIt != aShapes.end(); aIt++, bIt++ )
1075 std::set<BOARD_ITEM*, FOOTPRINT::cmp_drawings> aBarcodes;
1076 std::copy_if(
dummy.GraphicalItems().begin(),
dummy.GraphicalItems().end(),
1077 std::inserter( aBarcodes, aBarcodes.begin() ),
1080 return item->Type() == PCB_BARCODE_T;
1083 std::set<BOARD_ITEM*, FOOTPRINT::cmp_drawings> bBarcodes;
1085 std::inserter( bBarcodes, bBarcodes.begin() ),
1088 return item->Type() == PCB_BARCODE_T;
1091 if( aBarcodes.size() != bBarcodes.size() )
1094 REPORT(
_(
"Barcode count differs." ) );
1098 for(
auto aIt = aBarcodes.begin(), bIt = bBarcodes.begin(); aIt != aBarcodes.end(); aIt++, bIt++ )
1115 std::set<PAD*, FOOTPRINT::cmp_pads> aPads(
Pads().begin(),
Pads().
end() );
1116 std::set<PAD*, FOOTPRINT::cmp_pads> bLibPads( aLibFP->
Pads().begin(), aLibFP->
Pads().end() );
1118 if( aPads.size() != bLibPads.size() )
1121 REPORT(
_(
"Pad count differs." ) );
1125 for(
auto aIt = aPads.begin(), bLibIt = bLibPads.begin(); aIt != aPads.end(); aIt++, bLibIt++ )
1136 std::set<ZONE*, FOOTPRINT::cmp_zones> aZones(
Zones().begin(),
Zones().
end() );
1137 std::set<ZONE*, FOOTPRINT::cmp_zones> bZones( aLibFP->
Zones().begin(), aLibFP->
Zones().end() );
1139 if( aZones.size() != bZones.size() )
1142 REPORT(
_(
"Rule area count differs." ) );
1146 for(
auto aIt = aZones.begin(), bIt = bZones.begin(); aIt != aZones.end(); aIt++, bIt++ )
1161 REPORT_AUX(
_(
"No project loaded, skipping library parity tests." ) );
1165 if( !
reportPhase(
_(
"Loading footprint library table..." ) ) )
1168 std::map<LIB_ID, std::shared_ptr<FOOTPRINT>> libFootprintCache;
1173 const int progressDelta = 250;
1175 if( !
reportPhase(
_(
"Checking board footprints against library..." ) ) )
1189 LIB_ID fpID = footprint->GetFPID();
1194 if( libName.IsEmpty() )
1200 if( std::optional<LIBRARY_TABLE_ROW*> optRow = adapter->
GetRow( libName ); optRow )
1201 libTableRow = *optRow;
1208 msg.Printf(
_(
"The current configuration does not include the footprint library '%s'" ),
1210 drcItem->SetErrorMessage( msg );
1211 drcItem->SetItems( footprint );
1217 else if( !adapter->
HasLibrary( libName,
true ) )
1222 msg.Printf(
_(
"The footprint library '%s' is not enabled in the current configuration" ),
1224 drcItem->SetErrorMessage( msg );
1225 drcItem->SetItems( footprint );
1236 msg.Printf(
_(
"The footprint library '%s' was not found at '%s'" ),
1239 drcItem->SetErrorMessage( msg );
1240 drcItem->SetItems( footprint );
1247 auto cacheIt = libFootprintCache.find( fpID );
1248 std::shared_ptr<FOOTPRINT> libFootprint;
1250 if( cacheIt != libFootprintCache.end() )
1252 libFootprint = cacheIt->second;
1258 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
1261 libFootprintCache[ fpID ] = libFootprint;
1273 msg.Printf(
_(
"Footprint '%s' not found in library '%s'" ),
1276 drcItem->SetErrorMessage( msg );
1277 drcItem->SetItems( footprint );
1286 msg.Printf(
_(
"Footprint '%s' does not match copy in library '%s'" ),
1289 drcItem->SetErrorMessage( msg );
1290 drcItem->SetItems( footprint );
constexpr EDA_IU_SCALE pcbIUScale
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsOnCopperLayer() const
Information pertinent to a Pcbnew printed circuit board.
const FOOTPRINTS & Footprints() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
PROJECT * GetProject() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
constexpr const Vec GetEnd() const
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr const Vec & GetOrigin() const
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
virtual ~DRC_TEST_PROVIDER_LIBRARY_PARITY()=default
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual const wxString GetName() const override
DRC_TEST_PROVIDER_LIBRARY_PARITY()
virtual bool reportPhase(const wxString &aStageName)
void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::function< void(PCB_MARKER *)> &aPathGenerator=[](PCB_MARKER *){})
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
int GetEllipseMinorRadius() const
const VECTOR2I & GetEllipseCenter() const
EDA_ANGLE GetEllipseEndAngle() const
FILL_T GetFillMode() const
int GetEllipseMajorRadius() const
EDA_ANGLE GetEllipseRotation() const
EDA_ANGLE GetEllipseStartAngle() const
wxString SHAPE_T_asString() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
bool IsLibraryLoaded(const wxString &aNickname)
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
std::optional< LIBRARY_TABLE_ROW * > GetRow(const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
std::optional< wxString > GetFullURI(LIBRARY_TABLE_TYPE aType, const wxString &aNickname, bool aSubstituted=false)
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static const LSET & ExternalCuMask()
Return a mask holding the Front and Bottom layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
std::vector< PCB_LAYER_ID > UniqueLayers() const
PAD_PROP GetProperty() const
bool GetRemoveUnconnected() const
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives(PCB_LAYER_ID aLayer) const
Accessor to the basic shape list for custom-shaped pads.
std::optional< double > GetLocalSolderPasteMarginRatio() const
PAD_ATTRIB GetAttribute() const
const wxString & GetNumber() const
const VECTOR2I & GetDelta(PCB_LAYER_ID aLayer) const
EDA_ANGLE GetThermalSpokeAngle() const
VECTOR2I GetOffset(PCB_LAYER_ID aLayer) const
VECTOR2I GetDrillSize() const
double GetRoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
bool GetKeepTopBottom() const
VECTOR2I GetSize(PCB_LAYER_ID aLayer) const
std::optional< int > GetLocalClearance() const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
const PADSTACK & Padstack() const
PAD_DRILL_SHAPE GetDrillShape() const
int GetChamferPositions(PCB_LAYER_ID aLayer) const
std::optional< int > GetLocalSolderPasteMargin() const
std::optional< int > GetLocalSolderMaskMargin() const
EDA_ANGLE GetFPRelativeOrientation() const
double GetChamferRectRatio(PCB_LAYER_ID aLayer) const
std::optional< int > GetLocalThermalSpokeWidthOverride() const
ZONE_CONNECTION GetLocalZoneConnection() const
CUSTOM_SHAPE_ZONE_MODE GetCustomShapeInZoneOpt() const
int GetThermalGap() const
int GetLocalThermalGapOverride(wxString *aSource) const
int GetPadToDieLength() const
VECTOR2I GetPosition() const override
Get the position (center) of the barcode in internal units.
int GetHeight() const
Get the barcode height (in internal units).
BARCODE_ECC_T GetErrorCorrection() const
BARCODE_T GetKind() const
Returns the type of the barcode (QR, CODE_39, etc.).
int GetWidth() const
Get the barcode width (in internal units).
VECTOR2I GetLibraryBezierC1() const
VECTOR2I GetLibraryEnd() const
VECTOR2I GetLibraryStart() const
STROKE_PARAMS GetStroke() const override
SHAPE_POLY_SET GetLibraryPolyShape() const
VECTOR2I GetLibraryBezierC2() const
VECTOR2I GetLibraryArcMid() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Represent a set of closed polygons.
int TotalVertices() const
Return total number of vertices stored in the set.
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
int OutlineCount() const
Return the number of outlines in the set.
const POLYGON & CPolygon(int aIndex) const
const std::vector< POLYGON > & CPolygons() const
Handle a list of polygons defining a copper zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
std::optional< int > GetLocalClearance() const override
bool GetDoNotAllowVias() const
bool GetDoNotAllowPads() const
bool GetDoNotAllowTracks() const
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
long long int GetMinIslandArea() const
const wxString & GetZoneName() const
int GetMinThickness() const
ZONE_SETTINGS::CORNER_SMOOTHING GetCornerSmoothingType() const
ZONE_CONNECTION GetPadConnection() const
int GetHatchThickness() const
double GetHatchHoleMinArea() const
int GetThermalReliefSpokeWidth() const
EDA_ANGLE GetHatchOrientation() const
bool GetDoNotAllowFootprints() const
ZONE_FILL_MODE GetFillMode() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
double GetHatchSmoothingValue() const
bool GetDoNotAllowZoneFills() const
int GetHatchSmoothingLevel() const
unsigned int GetCornerRadius() const
SHAPE_POLY_SET GetLibraryOutline() const
int GetThermalReliefGap() const
unsigned GetAssignedPriority() const
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_LIB_FOOTPRINT_MISMATCH
UNITS_PROVIDER g_unitsProvider(pcbIUScale, EDA_UNITS::MM)
bool padOrientationDiffers(const PAD *a, const PAD *bLib)
bool footprintVsBoardStackup(const FOOTPRINT &aFp, const BOARD &aBoard, REPORTER *aReporter)
Report board->footprint stackup differences.
#define TEST_PT(a, b, msg)
bool padNeedsUpdate(const PAD *a, const PAD *bLib, REPORTER *aReporter)
bool primitiveNeedsUpdate(const std::shared_ptr< PCB_SHAPE > &a, const std::shared_ptr< PCB_SHAPE > &b)
static bool boardLayersMatchWithInnerLayerExpansion(const LSET &aItem, const LSET &bLib, bool aAllowCuExpansion)
bool padHasOverrides(const PAD *a, const PAD *b, REPORTER &aReporter)
bool shapeNeedsUpdate(const PCB_SHAPE &curr_shape, const PCB_SHAPE &ref_shape)
bool zoneNeedsUpdate(const ZONE *a, const ZONE *b, REPORTER *aReporter)
bool barcodeNeedsUpdate(const PCB_BARCODE &curr_barcode, const PCB_BARCODE &ref_barcode)
#define TEST_ATTR(a, b, attr, msg)
#define TEST_D(a, b, msg)
bool stackupNeedsUpdate(const FOOTPRINT &a, const FOOTPRINT &b, REPORTER *aReporter)
Compare the stackup related settings of two footprints.
LSET getBoardNormalizedLayerSet(const BOARD_ITEM *aLibItem, const BOARD *aBoard)
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
wxString AccumulateNames(const LSEQ &aLayers, const BOARD *aBoard)
Accumulate layer names from a layer set into a comma separated string.
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
BARCODE class definition.
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
VECTOR2< int32_t > VECTOR2I