drc_proto: migrated GetEffectiveShape(s) to SHAPE_COMPOUND

This commit is contained in:
Tomasz Wlostowski 2020-07-23 01:05:37 +02:00
parent 89a953e039
commit cf0bb60fbb
3 changed files with 16 additions and 5 deletions

View File

@ -23,9 +23,11 @@
#include <fctsys.h>
#include <drc_proto/drc_rule.h>
#include <class_board.h>
#include <class_board_item.h>
#include <drc_proto/drc_rule.h>
#include <pcb_expr_evaluator.h>
@ -77,6 +79,8 @@ bool test::DRC_RULE_CONDITION::Compile()
m_compileError = compiler.GetErrorStatus();
printf( "Fail: %s (pos: %d)\n", (const char *) m_compileError.message.c_str(), m_compileError.srcPos );
return false;
}

View File

@ -325,7 +325,9 @@ void test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc( TRACK* aRefSeg, TRACK
int clearanceAllowed = minClearance - bds.GetDRCEpsilon();
int actual;
if( pad->Collide( &refSeg, minClearance - bds.GetDRCEpsilon(), &actual ) )
auto padShape = pad->GetEffectiveShape();
if( padShape->Collide( &refSeg, minClearance - bds.GetDRCEpsilon(), &actual ) )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_CLEARANCE );
@ -593,7 +595,9 @@ bool test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc( D_PAD* aRefPad, D
int clearanceAllowed = minClearance - m_drcEngine->GetDesignSettings()->GetDRCEpsilon();
int actual;
if( aRefPad->Collide( pad, clearanceAllowed, &actual ) )
auto refPadShape = aRefPad->GetEffectiveShape();
if( refPadShape->Collide( pad->GetEffectiveShape().get(), clearanceAllowed, &actual ) )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_CLEARANCE );
wxString msg;

View File

@ -9,6 +9,7 @@
#include <geometry/seg.h>
#include <geometry/shape_poly_set.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_segment.h>
#include <drc_proto/drc_engine.h>
#include <drc_proto/drc_item.h>
@ -200,8 +201,9 @@ bool test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc( D_PAD* aRefPad,
drc_dbg(1,"check pad %p rule '%s' cl %d\n", pad, (const char*) rule->GetName().c_str(), minClearance );
auto refPadShape = aRefPad->GetEffectiveShape();
// fixme: pad stacks...
if( aRefPad->Collide( pad->GetEffectiveHoleShape(), minClearance, &actual ) )
if( refPadShape->Collide( pad->GetEffectiveHoleShape(), minClearance, &actual ) )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_HOLE_CLEARANCE );
@ -230,7 +232,8 @@ bool test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc( D_PAD* aRefPad,
drc_dbg(1,"check pad %p rule '%s' cl %d\n", aRefPad, (const char*) rule->GetName().c_str(), minClearance );
if( pad->Collide( aRefPad->GetEffectiveHoleShape(), minClearance, &actual ) )
auto padShape = pad->GetEffectiveShape();
if( padShape->Collide( aRefPad->GetEffectiveHoleShape(), minClearance, &actual ) )
{
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_HOLE_CLEARANCE );
wxString msg;