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
* returns the layer this item is on.
* returns the primary layer this item is on.
*/
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
* 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>
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
for( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer )
{
if ( IsCopperLayer( layer ) &&
( m_Layer[ layer ].m_name == aLayerName) )
if ( IsCopperLayer( layer ) && ( m_Layer[ layer ].m_name == aLayerName ) )
{
return ToLAYER_ID( layer );
}
}
// 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 );
}

View File

@ -641,7 +641,7 @@ public:
* @return LAYER_ID - the layer id, which for copper layers may
* be custom, else standard.
*/
const LAYER_ID GetLayerID( wxString aLayerName ) const;
const LAYER_ID GetLayerID( const wxString& aLayerName ) const;
/**
* 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 )
{
if( GetViaType() == VIA_THROUGH )

View File

@ -182,14 +182,6 @@ public:
int aClearanceValue,
int aCircleToSegmentsCount,
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
* returns STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if