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

View File

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