router: fixes for disappearing segments after shoving & assertion in PNS_NODE destructor
This commit is contained in:
parent
463b8b4127
commit
5bbf980ec7
|
@ -71,7 +71,7 @@ public:
|
|||
m_tag.net = aB.m_tag.net;
|
||||
m_linkedItems = aB.m_linkedItems;
|
||||
m_layers = aB.m_layers;
|
||||
m_locked = false;
|
||||
m_locked = aB.m_locked;
|
||||
}
|
||||
|
||||
PNS_ITEM* Clone( ) const
|
||||
|
@ -194,6 +194,9 @@ public:
|
|||
|
||||
m_layers.Merge( aJoint.m_layers );
|
||||
|
||||
if( aJoint.IsLocked() )
|
||||
m_locked = true;
|
||||
|
||||
BOOST_FOREACH( PNS_ITEM* item, aJoint.LinkList() )
|
||||
{
|
||||
m_linkedItems.Add( item );
|
||||
|
|
|
@ -871,6 +871,10 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
|
|||
{
|
||||
m_lastNode->Add( pl.Via().Clone() );
|
||||
Router()->CommitRouting( m_lastNode );
|
||||
|
||||
m_lastNode = NULL;
|
||||
m_currentNode = NULL;
|
||||
|
||||
m_idle = true;
|
||||
}
|
||||
|
||||
|
@ -913,6 +917,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
|
|||
Router()->CommitRouting( m_lastNode );
|
||||
|
||||
m_lastNode = NULL;
|
||||
m_currentNode = NULL;
|
||||
|
||||
if( !realEnd )
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ PNS_NODE* PNS_NODE::Branch()
|
|||
|
||||
TRACE( 0, "PNS_NODE::branch %p (parent %p)", child % this );
|
||||
|
||||
m_children.push_back( child );
|
||||
m_children.insert( child );
|
||||
|
||||
child->m_depth = m_depth + 1;
|
||||
child->m_parent = this;
|
||||
|
@ -145,15 +145,7 @@ void PNS_NODE::unlinkParent()
|
|||
if( isRoot() )
|
||||
return;
|
||||
|
||||
for( std::vector<PNS_NODE*>::iterator i = m_parent->m_children.begin();
|
||||
i != m_parent->m_children.end(); ++i )
|
||||
{
|
||||
if( *i == this )
|
||||
{
|
||||
m_parent->m_children.erase( i );
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_parent->m_children.erase( this );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1125,7 +1117,7 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded )
|
|||
void PNS_NODE::releaseChildren()
|
||||
{
|
||||
// copy the kids as the PNS_NODE destructor erases the item from the parent node.
|
||||
std::vector<PNS_NODE*> kids = m_children;
|
||||
std::set<PNS_NODE*> kids = m_children;
|
||||
|
||||
BOOST_FOREACH( PNS_NODE* node, kids )
|
||||
{
|
||||
|
|
|
@ -383,6 +383,11 @@ public:
|
|||
|
||||
PNS_ITEM* FindItemByParent( const BOARD_CONNECTED_ITEM *aParent );
|
||||
|
||||
bool HasChildren() const
|
||||
{
|
||||
return !m_children.empty();
|
||||
}
|
||||
|
||||
private:
|
||||
struct OBSTACLE_VISITOR;
|
||||
typedef boost::unordered_multimap<PNS_JOINT::HASH_TAG, PNS_JOINT> JOINT_MAP;
|
||||
|
@ -454,7 +459,7 @@ private:
|
|||
PNS_NODE* m_root;
|
||||
|
||||
///> list of nodes branched from this one
|
||||
std::vector<PNS_NODE*> m_children;
|
||||
std::set<PNS_NODE*> m_children;
|
||||
|
||||
///> hash of root's items that have been changed in this node
|
||||
boost::unordered_set<PNS_ITEM*> m_override;
|
||||
|
|
|
@ -963,7 +963,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
|
|||
}
|
||||
}
|
||||
else
|
||||
{ // "forward" collisoins
|
||||
{ // "forward" collisions
|
||||
switch( ni->Kind() )
|
||||
{
|
||||
case PNS_ITEM::SEGMENT:
|
||||
|
@ -1098,17 +1098,23 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
|
|||
}
|
||||
|
||||
if( !pushLine( head ) )
|
||||
{
|
||||
delete m_currentNode;
|
||||
m_currentNode = parent;
|
||||
|
||||
return SH_INCOMPLETE;
|
||||
}
|
||||
|
||||
st = shoveMainLoop();
|
||||
|
||||
|
||||
if( ( st == SH_OK || st == SH_HEAD_MODIFIED ) )
|
||||
if( st == SH_OK )
|
||||
{
|
||||
runOptimizer( m_currentNode );
|
||||
|
||||
if( m_newHead && st == SH_OK )
|
||||
{
|
||||
st = SH_HEAD_MODIFIED;
|
||||
if( m_newHead )
|
||||
st = m_currentNode->CheckColliding( &(*m_newHead) ) ? SH_INCOMPLETE : SH_HEAD_MODIFIED;
|
||||
else
|
||||
st = m_currentNode->CheckColliding( &head ) ? SH_INCOMPLETE : SH_OK;
|
||||
}
|
||||
|
||||
m_currentNode->RemoveByMarker( MK_HEAD );
|
||||
|
|
Loading…
Reference in New Issue