Performance.
This commit is contained in:
@@ -774,7 +774,7 @@ LSET GERBVIEW_FRAME::GetVisibleLayers() const
|
||||
}
|
||||
|
||||
|
||||
void GERBVIEW_FRAME::SetVisibleLayers( LSET aLayerMask )
|
||||
void GERBVIEW_FRAME::SetVisibleLayers( const LSET& aLayerMask )
|
||||
{
|
||||
if( GetCanvas() )
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
*
|
||||
* @param aLayerMask The new set of visible layers
|
||||
*/
|
||||
void SetVisibleLayers( LSET aLayerMask );
|
||||
void SetVisibleLayers( const LSET& aLayerMask );
|
||||
|
||||
/**
|
||||
* Test whether a given layer is visible.
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; }
|
||||
|
||||
LSET GetPrintLayers() const { return m_printLayers; }
|
||||
void SetPrintLayers( LSET aLayerSet ) { m_printLayers = aLayerSet; }
|
||||
void SetPrintLayers( const LSET& aLayerSet ) { m_printLayers = aLayerSet; }
|
||||
|
||||
/**
|
||||
* Clear the list of active layers.
|
||||
|
||||
+2
-21
@@ -848,7 +848,7 @@ const LSET& BOARD::GetVisibleLayers() const
|
||||
}
|
||||
|
||||
|
||||
void BOARD::SetEnabledLayers( LSET aLayerSet )
|
||||
void BOARD::SetEnabledLayers( const LSET& aLayerSet )
|
||||
{
|
||||
GetDesignSettings().SetEnabledLayers( aLayerSet );
|
||||
}
|
||||
@@ -860,7 +860,7 @@ bool BOARD::IsLayerEnabled( PCB_LAYER_ID aLayer ) const
|
||||
}
|
||||
|
||||
|
||||
void BOARD::SetVisibleLayers( LSET aLayerSet )
|
||||
void BOARD::SetVisibleLayers( const LSET& aLayerSet )
|
||||
{
|
||||
if( m_project )
|
||||
m_project->GetLocalSettings().m_VisibleLayers = aLayerSet;
|
||||
@@ -2227,25 +2227,6 @@ PAD* BOARD::GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const
|
||||
}
|
||||
|
||||
|
||||
PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, LSET aLayerSet ) const
|
||||
{
|
||||
for( FOOTPRINT* footprint : Footprints() )
|
||||
{
|
||||
for( PAD* pad : footprint->Pads() )
|
||||
{
|
||||
if( pad->GetPosition() != aPosition )
|
||||
continue;
|
||||
|
||||
// Pad found, it must be on the correct layer
|
||||
if( ( pad->GetLayerSet() & aLayerSet ).any() )
|
||||
return pad;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
PAD* BOARD::GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerSet ) const
|
||||
{
|
||||
// Search aPadList for aPosition
|
||||
|
||||
+2
-13
@@ -615,7 +615,7 @@ public:
|
||||
*
|
||||
* @param aLayerMask the new bit-mask of enabled layers.
|
||||
*/
|
||||
void SetEnabledLayers( LSET aLayerMask );
|
||||
void SetEnabledLayers( const LSET& aLayerMask );
|
||||
void SetLayerSet( const LSET& aLayerMask ) override { SetEnabledLayers( aLayerMask ); }
|
||||
|
||||
/**
|
||||
@@ -648,7 +648,7 @@ public:
|
||||
*
|
||||
* @param aLayerMask is the new bit-mask of visible layers.
|
||||
*/
|
||||
void SetVisibleLayers( LSET aLayerMask );
|
||||
void SetVisibleLayers( const LSET& aLayerMask );
|
||||
|
||||
// these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
|
||||
// are not stored in the bitmap.
|
||||
@@ -1118,17 +1118,6 @@ public:
|
||||
*/
|
||||
PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const;
|
||||
|
||||
/**
|
||||
* Return pad found at \a aPosition on \a aLayerMask using the fast search method.
|
||||
* <p>
|
||||
* The fast search method only works if the pad list has already been built.
|
||||
* </p>
|
||||
* @param aPosition A VECTOR2I object containing the position to hit test.
|
||||
* @param aLayerMask A layer or layers to mask the hit test.
|
||||
* @return A pointer to a PAD object if found or NULL if not found.
|
||||
*/
|
||||
PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const;
|
||||
|
||||
/**
|
||||
* Locate the pad connected at \a aPosition on \a aLayer starting at list position
|
||||
* \a aPad
|
||||
|
||||
@@ -2801,7 +2801,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
|
||||
const PCB_DISPLAY_OPTIONS& options = frame()->GetDisplayOptions();
|
||||
|
||||
auto visibleLayers =
|
||||
[&]()
|
||||
[&]() -> LSET
|
||||
{
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
@@ -3890,7 +3890,7 @@ void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aColle
|
||||
}
|
||||
|
||||
auto visibleLayers =
|
||||
[&]()
|
||||
[&]() -> LSET
|
||||
{
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user