Performance.

This commit is contained in:
Jeff Young
2025-04-07 17:36:32 +01:00
parent c65d27dae1
commit 6ec1585c58
6 changed files with 9 additions and 39 deletions
+1 -1
View File
@@ -774,7 +774,7 @@ LSET GERBVIEW_FRAME::GetVisibleLayers() const
}
void GERBVIEW_FRAME::SetVisibleLayers( LSET aLayerMask )
void GERBVIEW_FRAME::SetVisibleLayers( const LSET& aLayerMask )
{
if( GetCanvas() )
{
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
+2 -2
View File
@@ -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 )
{