57 virtual bool Run()
override;
59 virtual const wxString
GetName()
const override 61 return "silk_clearance";
66 return "Tests for overlapping silkscreen features.";
86 const int delta = 2000;
90 reportAux(
"Overlapping silk violations ignored. Tests not run." );
104 if( !
reportPhase(
_(
"Checking silkscreen for overlapping items..." ) ) )
126 auto addToTargetTree =
132 targetTree.
Insert( item );
136 auto checkClearance =
147 aRefItem->parent, aTestItem->parent,
150 if( constraint.IsNull() )
155 if( minClearance < 0 )
163 PCB_SHAPE* refGraphic = dynamic_cast<PCB_SHAPE*>( aRefItem->parent );
164 PCB_SHAPE* testGraphic = dynamic_cast<PCB_SHAPE*>( aTestItem->parent );
166 if( refGraphic && testGraphic )
171 if( refParentFP == testParentFP )
175 if( aRefItem->shape->Collide( aTestItem->shape, minClearance, &actual, &pos ) )
179 if( minClearance > 0 )
181 m_msg.Printf(
_(
"(%s clearance %s; actual %s)" ),
182 constraint.GetParentRule()->m_Name,
186 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) +
m_msg );
189 drcItem->SetItems( aRefItem->parent, aTestItem->parent );
190 drcItem->SetViolatingRule( constraint.GetParentRule() );
194 *aCollisionDetected =
true;
211 reportAux(
_(
"Testing %d silkscreen features against %d board items."),
215 const std::vector<DRC_RTREE::LAYER_PAIR> layerPairs =
238 [&](
int aCount,
int aSize ) ->
bool
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
virtual bool Run() override
Runs this provider against the given PCB with configured options (if any).
virtual ~DRC_TEST_PROVIDER_SILK_CLEARANCE()
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
bool isInvisibleText(const BOARD_ITEM *aItem) const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULUS > dummy
bool IsErrorLimitExceeded(int error_code)
virtual bool reportProgress(int aCount, int aSize, int aDelta)
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > LAYER_PAIR
static LSET FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
virtual void reportRuleStatistics()
void Insert(BOARD_ITEM *aItem, int aWorstClearance=0, int aLayer=UNDEFINED_LAYER)
Function Insert() Inserts an item into the tree.
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
virtual const wxString GetName() const override
virtual int GetNumPhases() const override
LSET is a set of PCB_LAYER_IDs.
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
size_t size() const
Returns the number of items in the tree.
virtual bool reportPhase(const wxString &aStageName)
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)
DRC_TEST_PROVIDER_SILK_CLEARANCE()
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, wxPoint aMarkerPos)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
DRC_TEST_PROVIDER is a base class that represents a DRC "provider" which runs some DRC functions over...
int QueryCollidingPairs(DRC_RTREE *aRefTree, std::vector< LAYER_PAIR > aLayerPairs, std::function< bool(const LAYER_PAIR &, ITEM_WITH_SHAPE *, ITEM_WITH_SHAPE *, bool *aCollision)> aVisitor, int aMaxClearance, std::function< bool(int, int)> aProgressReporter) const
const MINOPTMAX< int > & GetValue() const
Information pertinent to a Pcbnew printed circuit board.
static std::vector< KICAD_T > s_allBasicItems
static LSET BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
DRC_RTREE - Implements an R-tree for fast spatial and layer indexing of connectable items.
BOARD_ITEM_CONTAINER * GetParent() const
virtual const wxString GetDescription() const override
virtual void reportAux(wxString fmt,...)