52 virtual bool Run()
override;
54 virtual const wxString
GetName()
const override 56 return "courtyard_clearance";
61 return "Tests footprints' courtyard clearance";
77 const int delta = 100;
80 if( !
reportPhase(
_(
"Checking footprint courtyard definitions..." ) ) )
99 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
100 drcItem->SetItems( footprint );
105 footprint->BuildPolyCourtyards( &errorHandler );
107 else if( footprint->GetPolyCourtyardFront().OutlineCount() == 0
108 && footprint->GetPolyCourtyardBack().OutlineCount() == 0 )
114 drcItem->SetItems( footprint );
119 footprint->GetPolyCourtyardFront().BuildBBoxCaches();
120 footprint->GetPolyCourtyardBack().BuildBBoxCaches();
128 const int delta = 100;
130 if( !
reportPhase(
_(
"Checking footprints for overlapping courtyards..." ) ) )
173 if( clearance >= 0 && footprintFront.
Collide( &testFront, clearance, &actual, &pos ) )
179 m_msg.Printf(
_(
"(%s clearance %s; actual %s)" ),
184 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) +
m_msg );
188 drce->SetItems( footprint,
test );
200 if( clearance >= 0 && footprintBack.
Collide( &testBack, clearance, &actual, &pos ) )
206 m_msg.Printf(
_(
"(%s clearance %s; actual %s)" ),
211 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) +
m_msg );
215 drce->SetItems( footprint,
test );
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
DRC_TEST_PROVIDER_COURTYARD_CLEARANCE()
const BOX2I BBoxFromCaches() const
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULUS > dummy
bool IsErrorLimitExceeded(int error_code)
virtual bool Run() override
Runs this provider against the given PCB with configured options (if any).
virtual bool reportProgress(int aCount, int aSize, int aDelta)
virtual const wxString GetName() const override
int GetNumPhases() const override
bool Intersects(const BOX2< Vec > &aRect) const
Function Intersects.
DRC_RULE * GetParentRule() const
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
virtual bool reportPhase(const wxString &aStageName)
Represent a set of closed polygons.
FOOTPRINTS & Footprints()
void testFootprintCourtyardDefinitions()
void testCourtyardClearances()
#define MALFORMED_COURTYARDS
EDA_UNITS userUnits() const
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintId, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
virtual ~DRC_TEST_PROVIDER_COURTYARD_CLEARANCE()
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, wxPoint aMarkerPos)
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
const MINOPTMAX< int > & GetValue() const
virtual const wxString GetDescription() const override
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const wxPoint &pt)> OUTLINE_ERROR_HANDLER
virtual void reportAux(wxString fmt,...)