Make sure pair caches are layer-specific where they need to be.
This commit is contained in:
parent
86944c4f9f
commit
909358e643
|
@ -426,7 +426,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
|
||||||
|
|
||||||
reportAux( wxT( "Testing %d tracks & vias..." ), m_board->Tracks().size() );
|
reportAux( wxT( "Testing %d tracks & vias..." ), m_board->Tracks().size() );
|
||||||
|
|
||||||
std::unordered_map<PTR_PTR_CACHE_KEY, int> checkedPairs;
|
std::unordered_map<PTR_PTR_CACHE_KEY, LSET> checkedPairs;
|
||||||
|
|
||||||
for( PCB_TRACK* track : m_board->Tracks() )
|
for( PCB_TRACK* track : m_board->Tracks() )
|
||||||
{
|
{
|
||||||
|
@ -454,13 +454,15 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
|
||||||
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
||||||
std::swap( a, b );
|
std::swap( a, b );
|
||||||
|
|
||||||
if( checkedPairs.find( { a, b } ) != checkedPairs.end() )
|
auto it = checkedPairs.find( { a, b } );
|
||||||
|
|
||||||
|
if( it != checkedPairs.end() && it->second.test( layer ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkedPairs[ { a, b } ] = 1;
|
checkedPairs[ { a, b } ].set( layer );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -154,7 +154,7 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run()
|
||||||
return true;
|
return true;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
std::unordered_map<PTR_PTR_CACHE_KEY, int> checkedPairs;
|
std::unordered_map<PTR_PTR_CACHE_KEY, LSET> checkedPairs;
|
||||||
progressDelta = 100;
|
progressDelta = 100;
|
||||||
ii = 0;
|
ii = 0;
|
||||||
|
|
||||||
|
@ -191,13 +191,15 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run()
|
||||||
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
||||||
std::swap( a, b );
|
std::swap( a, b );
|
||||||
|
|
||||||
if( checkedPairs.find( { a, b } ) != checkedPairs.end() )
|
auto it = checkedPairs.find( { a, b } );
|
||||||
|
|
||||||
|
if( it != checkedPairs.end() && it->second.test( layer ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkedPairs[ { a, b } ] = 1;
|
checkedPairs[ { a, b } ].set( layer );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -100,7 +100,7 @@ private:
|
||||||
std::unique_ptr<DRC_RTREE> m_tesselatedTree;
|
std::unique_ptr<DRC_RTREE> m_tesselatedTree;
|
||||||
std::unique_ptr<DRC_RTREE> m_itemTree;
|
std::unique_ptr<DRC_RTREE> m_itemTree;
|
||||||
|
|
||||||
std::unordered_map<PTR_PTR_LAYER_CACHE_KEY, int> m_checkedPairs;
|
std::unordered_map<PTR_PTR_CACHE_KEY, LSET> m_checkedPairs;
|
||||||
|
|
||||||
// Shapes used to define solder mask apertures don't have nets, so we assign them the
|
// Shapes used to define solder mask apertures don't have nets, so we assign them the
|
||||||
// first object+net that bridges their aperture (after which any other nets will generate
|
// first object+net that bridges their aperture (after which any other nets will generate
|
||||||
|
@ -455,13 +455,15 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems( BOARD_ITEM* aItem,
|
||||||
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
if( static_cast<void*>( a ) > static_cast<void*>( b ) )
|
||||||
std::swap( a, b );
|
std::swap( a, b );
|
||||||
|
|
||||||
if( m_checkedPairs.find( { a, b, aTargetLayer } ) != m_checkedPairs.end() )
|
auto it = m_checkedPairs.find( { a, b } );
|
||||||
|
|
||||||
|
if( it != m_checkedPairs.end() && it->second.test( aTargetLayer ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_checkedPairs[ { a, b, aTargetLayer } ] = 1;
|
m_checkedPairs[ { a, b } ].set( aTargetLayer );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue