router: take holes into account when building the restricted items set for collision search
This commit is contained in:
parent
7804c2177c
commit
61391e3984
|
@ -332,7 +332,7 @@ NODE::OPT_OBSTACLE NODE::NearestObstacle( const LINE* aLine,
|
||||||
|
|
||||||
for( const OBSTACLE& obstacle : obstacleList )
|
for( const OBSTACLE& obstacle : obstacleList )
|
||||||
{
|
{
|
||||||
if( aOpts.m_restrictedSet && aOpts.m_restrictedSet->count( obstacle.m_item ) == 0 )
|
if( aOpts.m_restrictedSet && !aOpts.m_restrictedSet->empty() && aOpts.m_restrictedSet->count( obstacle.m_item ) == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int clearance =
|
int clearance =
|
||||||
|
|
|
@ -68,11 +68,18 @@ NODE::OPT_OBSTACLE WALKAROUND::nearestObstacle( const LINE& aPath )
|
||||||
void WALKAROUND::RestrictToSet( bool aEnabled, const std::set<ITEM*>& aSet )
|
void WALKAROUND::RestrictToSet( bool aEnabled, const std::set<ITEM*>& aSet )
|
||||||
{
|
{
|
||||||
m_restrictedVertices.clear();
|
m_restrictedVertices.clear();
|
||||||
|
m_restrictedSet.clear();
|
||||||
|
|
||||||
if( aEnabled )
|
if( aEnabled )
|
||||||
m_restrictedSet = aSet;
|
{
|
||||||
else
|
for( auto item : aSet )
|
||||||
m_restrictedSet.clear();
|
{
|
||||||
|
m_restrictedSet.insert( item );
|
||||||
|
|
||||||
|
if ( item->HasHole() )
|
||||||
|
m_restrictedSet.insert( item->Hole() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for( auto item : aSet )
|
for( auto item : aSet )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue