Minor fixes (PNS).

This commit is contained in:
Maciej Suminski 2015-08-12 21:12:13 +02:00
parent 127fcfa7c9
commit 6989af7904
3 changed files with 40 additions and 5 deletions

View File

@ -53,7 +53,7 @@ public:
PNS_OBJECT():
m_owner( NULL ) {}
~PNS_OBJECT() {};
virtual ~PNS_OBJECT() {}
/**
* Functon SetOwner()

View File

@ -71,7 +71,14 @@ PNS_ITEMSET& PNS_ITEMSET::FilterLayers( int aStart, int aEnd, bool aInvert )
BOOST_FOREACH( PNS_ITEM* item, m_items )
if( item->Layers().Overlaps( l ) ^ aInvert )
{
newItems.push_back( item );
}
else
{
if( item->BelongsTo( this ) )
item->SetOwner( NULL );
}
m_items = newItems;
@ -86,8 +93,15 @@ PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask, bool aInvert )
BOOST_FOREACH( PNS_ITEM* item, m_items )
{
if( item->OfKind( aKindMask ) ^ aInvert )
{
newItems.push_back( item );
}
else
{
if( item->BelongsTo( this ) )
item->SetOwner( NULL );
}
}
m_items = newItems;
@ -102,8 +116,15 @@ PNS_ITEMSET& PNS_ITEMSET::FilterMarker( int aMarker, bool aInvert )
BOOST_FOREACH( PNS_ITEM* item, m_items )
{
if( item->Marker() & aMarker )
{
newItems.push_back( item );
}
else
{
if( item->BelongsTo( this ) )
item->SetOwner( NULL );
}
}
m_items = newItems;
@ -118,8 +139,15 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
BOOST_FOREACH( PNS_ITEM* item, m_items )
{
if( ( item->Net() == aNet ) ^ aInvert )
{
newItems.push_back( item );
}
else
{
if( item->BelongsTo( this ) )
item->SetOwner( NULL );
}
}
m_items = newItems;
@ -133,7 +161,14 @@ PNS_ITEMSET& PNS_ITEMSET::ExcludeItem( const PNS_ITEM* aItem )
BOOST_FOREACH( PNS_ITEM* item, m_items )
{
if( item != aItem )
if( item == aItem )
{
if( item->BelongsTo( this ) )
item->SetOwner( NULL );
break;
}
newItems.push_back( item );
}

View File

@ -41,7 +41,7 @@ PNS_LINE::PNS_LINE( const PNS_LINE& aOther ) :
m_net = aOther.m_net;
m_movable = aOther.m_movable;
m_layers = aOther.m_layers;
m_owner = NULL;
m_owner = aOther.m_owner;
m_via = aOther.m_via;
m_hasVia = aOther.m_hasVia;
m_marker = aOther.m_marker;
@ -146,7 +146,7 @@ PNS_SEGMENT* PNS_SEGMENT::Clone() const
s->m_layers = m_layers;
s->m_marker = m_marker;
s->m_rank = m_rank;
s->m_owner = m_owner;
s->m_owner = NULL;
return s;
}