router: allow caller to override the 'safety' length limit in WALKAROUND
This commit is contained in:
parent
363d606503
commit
70bca1b2d5
|
@ -173,7 +173,7 @@ const WALKAROUND::RESULT WALKAROUND::Route( const LINE& aInitialPath )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Safety valve
|
// Safety valve
|
||||||
if( path_cw.Line().Length() > lengthLimit && path_ccw.Line().Length() > lengthLimit )
|
if( m_lengthLimitOn && path_cw.Line().Length() > lengthLimit && path_ccw.Line().Length() > lengthLimit )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
m_iteration++;
|
m_iteration++;
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
m_iteration = 0;
|
m_iteration = 0;
|
||||||
m_forceCw = false;
|
m_forceCw = false;
|
||||||
m_forceLongerPath = false;
|
m_forceLongerPath = false;
|
||||||
|
m_lengthLimitOn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~WALKAROUND() {};
|
~WALKAROUND() {};
|
||||||
|
@ -111,6 +112,11 @@ public:
|
||||||
|
|
||||||
const RESULT Route( const LINE& aInitialPath );
|
const RESULT Route( const LINE& aInitialPath );
|
||||||
|
|
||||||
|
void SetLengthLimit( bool aEnable )
|
||||||
|
{
|
||||||
|
m_lengthLimitOn = aEnable;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void start( const LINE& aInitialPath );
|
void start( const LINE& aInitialPath );
|
||||||
|
|
||||||
|
@ -129,6 +135,7 @@ private:
|
||||||
std::set<ITEM*> m_restrictedSet;
|
std::set<ITEM*> m_restrictedSet;
|
||||||
std::vector<VECTOR2I> m_restrictedVertices;
|
std::vector<VECTOR2I> m_restrictedVertices;
|
||||||
bool m_forceLongerPath;
|
bool m_forceLongerPath;
|
||||||
|
bool m_lengthLimitOn;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue