Moved GetLayerSet() to BOARD_ITEM.

This commit is contained in:
Maciej Suminski 2015-06-04 14:54:07 +02:00
parent a12ea29de8
commit 42215f2388
5 changed files with 14 additions and 21 deletions

View File

@ -125,10 +125,18 @@ public:
/** /**
* Function GetLayer * Function GetLayer
* returns the layer this item is on. * returns the primary layer this item is on.
*/ */
LAYER_ID GetLayer() const { return m_Layer; } LAYER_ID GetLayer() const { return m_Layer; }
/**
* Function GetLayerSet
* returns a "layer mask", which is a bitmap of all layers on which the
* TRACK segment or VIA physically resides.
* @return int - a layer mask, see layers_id_colors_visibility.h.
*/
virtual LSET GetLayerSet() const { return LSET( m_Layer ); }
/** /**
* Function SetLayer * Function SetLayer
* sets the layer this item is on. * sets the layer this item is on.

View File

@ -317,23 +317,22 @@ bool BOARD::SetLayerDescr( LAYER_ID aIndex, const LAYER& aLayer )
#include <stdio.h> #include <stdio.h>
const LAYER_ID BOARD::GetLayerID(wxString aLayerName) const const LAYER_ID BOARD::GetLayerID( const wxString& aLayerName ) const
{ {
// Look for the BOARD specific copper layer names // Look for the BOARD specific copper layer names
for( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer ) for( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer )
{ {
if ( IsCopperLayer( layer ) && if ( IsCopperLayer( layer ) && ( m_Layer[ layer ].m_name == aLayerName ) )
( m_Layer[ layer ].m_name == aLayerName) )
{ {
return ToLAYER_ID( layer ); return ToLAYER_ID( layer );
} }
} }
// Otherwise fall back to the system standard layer names // Otherwise fall back to the system standard layer names
for ( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer ) for( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer )
{ {
if ( GetStandardLayerName( ToLAYER_ID( layer ) ) == aLayerName ) if( GetStandardLayerName( ToLAYER_ID( layer ) ) == aLayerName )
{ {
return ToLAYER_ID( layer ); return ToLAYER_ID( layer );
} }

View File

@ -641,7 +641,7 @@ public:
* @return LAYER_ID - the layer id, which for copper layers may * @return LAYER_ID - the layer id, which for copper layers may
* be custom, else standard. * be custom, else standard.
*/ */
const LAYER_ID GetLayerID( wxString aLayerName ) const; const LAYER_ID GetLayerID( const wxString& aLayerName ) const;
/** /**
* Function GetLayerName * Function GetLayerName

View File

@ -403,12 +403,6 @@ LSET VIA::GetLayerSet() const
} }
LSET TRACK::GetLayerSet() const
{
return LSET( m_Layer );
}
void VIA::SetLayerPair( LAYER_ID aTopLayer, LAYER_ID aBottomLayer ) void VIA::SetLayerPair( LAYER_ID aTopLayer, LAYER_ID aBottomLayer )
{ {
if( GetViaType() == VIA_THROUGH ) if( GetViaType() == VIA_THROUGH )

View File

@ -182,14 +182,6 @@ public:
int aClearanceValue, int aClearanceValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ) const; double aCorrectionFactor ) const;
/**
* Function GetLayerMask
* returns a "layer mask", which is a bitmap of all layers on which the
* TRACK segment or VIA physically resides.
* @return int - a layer mask, see pcbstruct.h's LAYER_BACK, etc.
*/
virtual LSET GetLayerSet() const;
/** /**
* Function IsPointOnEnds * Function IsPointOnEnds
* returns STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if * returns STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if