56 virtual bool Run()
override;
58 virtual const wxString
GetName()
const override 60 return wxT(
"silk_to_mask" );
65 return wxT(
"Tests for silkscreen being clipped by solder mask" );
88 reportAux( wxT(
"Silkscreen clipping violations ignored. Tests not run." ) );
100 if( !
reportPhase(
_(
"Checking silkscreen for potential soldermask clipping..." ) ) )
110 if( item->IsOnLayer( layer ) )
111 maskTree.
Insert( item, layer );
122 if( item->IsOnLayer( layer ) )
123 silkTree.
Insert( item, layer );
129 auto checkClearance =
143 aRefItem->parent, aTestItem->parent,
148 if( minClearance < 0 )
154 if( aRefItem->shape->Collide( aTestItem->shape, minClearance, &actual, &pos ) )
158 if( minClearance > 0 )
160 m_msg.Printf(
_(
"(%s clearance %s; actual %s)" ),
161 constraint.GetName(),
165 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) +
m_msg );
168 drce->SetItems( aRefItem->parent, aTestItem->parent );
169 drce->SetViolatingRule( constraint.GetParentRule() );
173 *aCollisionDetected =
true;
182 reportAux(
_(
"Testing %d mask apertures against %d silkscreen features."), numMask, numSilk );
184 const std::vector<DRC_RTREE::LAYER_PAIR> layerPairs =
191 const int delta = 250;
194 [&](
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.
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...
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const wxPoint &aMarkerPos)
bool IsErrorLimitExceeded(int error_code)
virtual ~DRC_TEST_PROVIDER_SILK_TO_MASK()
virtual bool reportProgress(int aCount, int aSize, int aDelta)
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > LAYER_PAIR
virtual const wxString GetDescription() const override
virtual void reportRuleStatistics()
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
LSET is a set of PCB_LAYER_IDs.
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
virtual bool reportPhase(const wxString &aStageName)
virtual const wxString GetName() const override
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
EDA_UNITS userUnits() const
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out #DRC_ITEMs and po...
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
PCB_LAYER_ID
A quick note on layer IDs:
void Insert(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer, int aWorstClearance=0)
Insert an item into the tree on a particular layer with an optional worst clearance.
virtual int GetNumPhases() const override
Implement an R-tree for fast spatial and layer indexing of connectable items.
DRC_TEST_PROVIDER_SILK_TO_MASK()
virtual void reportAux(wxString fmt,...)