Browse Source

Moved GetLayerSet() to BOARD_ITEM.

pull/5/head
Maciej Suminski 11 years ago
parent
commit
42215f2388
  1. 10
      include/class_board_item.h
  2. 5
      pcbnew/class_board.cpp
  3. 2
      pcbnew/class_board.h
  4. 6
      pcbnew/class_track.cpp
  5. 8
      pcbnew/class_track.h

10
include/class_board_item.h

@ -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.

5
pcbnew/class_board.cpp

@ -317,14 +317,13 @@ 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 );
}

2
pcbnew/class_board.h

@ -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

6
pcbnew/class_track.cpp

@ -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 )

8
pcbnew/class_track.h

@ -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

Loading…
Cancel
Save