Performance.

This commit is contained in:
Jeff Young 2025-03-23 20:33:22 +00:00
parent d205a136a9
commit 0a4533703c
34 changed files with 73 additions and 74 deletions

View File

@ -780,7 +780,7 @@ LSET GERBVIEW_FRAME::GetVisibleLayers() const
} }
void GERBVIEW_FRAME::SetVisibleLayers( LSET aLayerMask ) void GERBVIEW_FRAME::SetVisibleLayers( const LSET& aLayerMask )
{ {
if( GetCanvas() ) if( GetCanvas() )
{ {

View File

@ -117,7 +117,7 @@ public:
* *
* @param aLayerMask The new set of visible layers * @param aLayerMask The new set of visible layers
*/ */
void SetVisibleLayers( LSET aLayerMask ); void SetVisibleLayers( const LSET& aLayerMask );
/** /**
* Test whether a given layer is visible. * Test whether a given layer is visible.

View File

@ -583,7 +583,7 @@ public:
* *
* @param aMask = The new bit-mask of enabled layers. * @param aMask = The new bit-mask of enabled layers.
*/ */
void SetEnabledLayers( LSET aMask ); void SetEnabledLayers( const LSET& aMask );
/** /**
* Test whether a given layer \a aLayerId is enabled. * Test whether a given layer \a aLayerId is enabled.

View File

@ -337,7 +337,8 @@ public:
* @param aDlgPosition is the position of dialog (default is centered). * @param aDlgPosition is the position of dialog (default is centered).
* @return the selected layer id. * @return the selected layer id.
*/ */
PCB_LAYER_ID SelectOneLayer( PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask = LSET(), PCB_LAYER_ID SelectOneLayer( PCB_LAYER_ID aDefaultLayer,
const LSET& aNotAllowedLayersMask = LSET(),
wxPoint aDlgPosition = wxDefaultPosition ); wxPoint aDlgPosition = wxDefaultPosition );
/** /**

View File

@ -117,7 +117,7 @@ public:
void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; } void SetLayerName( const wxString& aLayerName ) { m_layerName = aLayerName; }
LSET GetPrintLayers() const { return m_printLayers; } 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. * Clear the list of active layers.

View File

@ -251,7 +251,7 @@ bool AR_AUTOPLACER::fillMatrix()
} }
void AR_AUTOPLACER::addFpBody( const VECTOR2I& aStart, const VECTOR2I& aEnd, LSET aLayerMask ) void AR_AUTOPLACER::addFpBody( const VECTOR2I& aStart, const VECTOR2I& aEnd, const LSET& aLayerMask )
{ {
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack // Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
if( aLayerMask[ F_Cu ] ) if( aLayerMask[ F_Cu ] )

View File

@ -114,7 +114,7 @@ private:
const PAD* nearestPad( FOOTPRINT* aRefFP, PAD* aRefPad, const VECTOR2I& aOffset ); const PAD* nearestPad( FOOTPRINT* aRefFP, PAD* aRefPad, const VECTOR2I& aOffset );
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack // Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
void addFpBody( const VECTOR2I& aStart, const VECTOR2I& aEnd, LSET aLayerMask ); void addFpBody( const VECTOR2I& aStart, const VECTOR2I& aEnd, const LSET& aLayerMask );
// Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack // Add a polygonal shape (rectangle) to m_fpAreaFront and/or m_fpAreaBack
void addPad( PAD* aPad, int aClearance ); void addPad( PAD* aPad, int aClearance );

View File

@ -437,8 +437,8 @@ void AR_MATRIX::traceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int lay
} }
void AR_MATRIX::traceFilledCircle( void AR_MATRIX::traceFilledCircle( int cx, int cy, int radius, const LSET& aLayerMask, int color,
int cx, int cy, int radius, LSET aLayerMask, int color, AR_MATRIX::CELL_OP op_logic ) AR_MATRIX::CELL_OP op_logic )
{ {
int row, col; int row, col;
int ux0, uy0, ux1, uy1; int ux0, uy0, ux1, uy1;
@ -602,7 +602,7 @@ void AR_MATRIX::traceArc( int ux0, int uy0, int ux1, int uy1, const EDA_ANGLE& a
void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double angle, void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double angle,
LSET aLayerMask, int color, AR_MATRIX::CELL_OP op_logic ) const LSET& aLayerMask, int color, AR_MATRIX::CELL_OP op_logic )
{ {
int row, col; int row, col;
int cx, cy; // Center of rectangle int cx, cy; // Center of rectangle
@ -689,7 +689,7 @@ void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double
} }
void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, LSET aLayerMask, void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, const LSET& aLayerMask,
int color, AR_MATRIX::CELL_OP op_logic ) int color, AR_MATRIX::CELL_OP op_logic )
{ {
int row, col; int row, col;
@ -793,8 +793,8 @@ void AR_MATRIX::TraceSegmentPcb( PCB_SHAPE* aShape, int aColor, int aMargin,
* (aKeepOut ... 0). The decreasing value depends on the distance to the first rectangle * (aKeepOut ... 0). The decreasing value depends on the distance to the first rectangle
* Therefore the cost is high in rect x0,y0 to x1,y1, and decrease outside this rectangle * Therefore the cost is high in rect x0,y0 to x1,y1, and decrease outside this rectangle
*/ */
void AR_MATRIX::CreateKeepOutRectangle( void AR_MATRIX::CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, int marge,
int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut, LSET aLayerMask ) int aKeepOut, const LSET& aLayerMask )
{ {
int row, col; int row, col;
int row_min, row_max, col_min, col_max, pmarge; int row_min, row_max, col_min, col_max, pmarge;

View File

@ -112,14 +112,14 @@ public:
void TraceSegmentPcb( PCB_SHAPE* aShape, int aColor, int aMargin, AR_MATRIX::CELL_OP op_logic ); void TraceSegmentPcb( PCB_SHAPE* aShape, int aColor, int aMargin, AR_MATRIX::CELL_OP op_logic );
void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut, void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut,
LSET aLayerMask ); const LSET& aLayerMask );
void PlacePad( PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic ); void PlacePad( PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic );
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double angle, LSET aLayerMask, void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, double angle, const LSET& aLayerMask,
int color, AR_MATRIX::CELL_OP op_logic ); int color, AR_MATRIX::CELL_OP op_logic );
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, LSET aLayerMask, int color, void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, const LSET& aLayerMask, int color,
AR_MATRIX::CELL_OP op_logic ); AR_MATRIX::CELL_OP op_logic );
private: private:
@ -129,7 +129,7 @@ private:
void traceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int layer, int color, void traceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int layer, int color,
AR_MATRIX::CELL_OP op_logic ); AR_MATRIX::CELL_OP op_logic );
void traceFilledCircle( int cx, int cy, int radius, LSET aLayerMask, int color, void traceFilledCircle( int cx, int cy, int radius, const LSET& aLayerMask, int color,
AR_MATRIX::CELL_OP op_logic ); AR_MATRIX::CELL_OP op_logic );
void traceArc( int ux0, int uy0, int ux1, int uy1, const EDA_ANGLE& arcAngle, int lg, void traceArc( int ux0, int uy0, int ux1, int uy1, const EDA_ANGLE& arcAngle, int lg,

View File

@ -841,7 +841,7 @@ LSET BOARD::GetVisibleLayers() const
} }
void BOARD::SetEnabledLayers( LSET aLayerSet ) void BOARD::SetEnabledLayers( const LSET& aLayerSet )
{ {
GetDesignSettings().SetEnabledLayers( aLayerSet ); GetDesignSettings().SetEnabledLayers( aLayerSet );
} }
@ -853,7 +853,7 @@ bool BOARD::IsLayerEnabled( PCB_LAYER_ID aLayer ) const
} }
void BOARD::SetVisibleLayers( LSET aLayerSet ) void BOARD::SetVisibleLayers( const LSET& aLayerSet )
{ {
if( m_project ) if( m_project )
m_project->GetLocalSettings().m_VisibleLayers = aLayerSet; m_project->GetLocalSettings().m_VisibleLayers = aLayerSet;
@ -2209,17 +2209,14 @@ int BOARD::SetAreasNetCodesFromNetNames()
} }
PAD* BOARD::GetPad( const VECTOR2I& aPosition, LSET aLayerSet ) const PAD* BOARD::GetPad( const VECTOR2I& aPosition, const LSET& aLayerSet ) const
{ {
if( !aLayerSet.any() )
aLayerSet = LSET::AllCuMask();
for( FOOTPRINT* footprint : m_footprints ) for( FOOTPRINT* footprint : m_footprints )
{ {
PAD* pad = nullptr; PAD* pad = nullptr;
if( footprint->HitTest( aPosition ) ) if( footprint->HitTest( aPosition ) )
pad = footprint->GetPad( aPosition, aLayerSet ); pad = footprint->GetPad( aPosition, aLayerSet.any() ? aLayerSet : LSET::AllCuMask() );
if( pad ) if( pad )
return pad; return pad;
@ -2239,7 +2236,7 @@ PAD* BOARD::GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const
} }
PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, LSET aLayerSet ) const PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, const LSET& aLayerSet ) const
{ {
for( FOOTPRINT* footprint : Footprints() ) for( FOOTPRINT* footprint : Footprints() )
{ {
@ -2258,7 +2255,7 @@ PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, LSET aLayerSet ) const
} }
PAD* BOARD::GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerSet ) const PAD* BOARD::GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, const LSET& aLayerSet ) const
{ {
// Search aPadList for aPosition // Search aPadList for aPosition
// aPadList is sorted by X then Y values, and a fast binary search is used // aPadList is sorted by X then Y values, and a fast binary search is used
@ -2398,9 +2395,9 @@ std::tuple<int, double, double> BOARD::GetTrackLength( const PCB_TRACK& aTrack )
double length = 0.0; double length = 0.0;
double package_length = 0.0; double package_length = 0.0;
auto connectivity = GetBoard()->GetConnectivity(); auto connectivity = GetBoard()->GetConnectivity();
BOARD_STACKUP& stackup = GetDesignSettings().GetStackupDescriptor(); BOARD_STACKUP& stackup = GetDesignSettings().GetStackupDescriptor();
bool useHeight = GetDesignSettings().m_UseHeightForLengthCalcs; bool useHeight = GetDesignSettings().m_UseHeightForLengthCalcs;
for( BOARD_CONNECTED_ITEM* item : connectivity->GetConnectedItems( &aTrack, EXCLUDE_ZONES ) ) for( BOARD_CONNECTED_ITEM* item : connectivity->GetConnectedItems( &aTrack, EXCLUDE_ZONES ) )
{ {

View File

@ -616,7 +616,7 @@ public:
* *
* @param aLayerMask the new bit-mask of enabled layers. * @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 ); } void SetLayerSet( const LSET& aLayerMask ) override { SetEnabledLayers( aLayerMask ); }
/** /**
@ -649,7 +649,7 @@ public:
* *
* @param aLayerMask is the new bit-mask of visible layers. * @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 // these 2 functions are not tidy at this time, since there are PCB_LAYER_IDs that
// are not stored in the bitmap. // are not stored in the bitmap.
@ -1110,7 +1110,7 @@ public:
* @param aLayerMask A layer or layers to mask the 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. * @return A pointer to a PAD object if found or NULL if not found.
*/ */
PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) const; PAD* GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
PAD* GetPad( const VECTOR2I& aPosition ) const PAD* GetPad( const VECTOR2I& aPosition ) const
{ {
return GetPad( aPosition, LSET().set() ); return GetPad( aPosition, LSET().set() );
@ -1134,7 +1134,7 @@ public:
* @param aLayerMask A layer or layers to mask the 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. * @return A pointer to a PAD object if found or NULL if not found.
*/ */
PAD* GetPadFast( const VECTOR2I& aPosition, LSET aLayerMask ) const; PAD* GetPadFast( const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
/** /**
* Locate the pad connected at \a aPosition on \a aLayer starting at list position * Locate the pad connected at \a aPosition on \a aLayer starting at list position
@ -1150,7 +1150,7 @@ public:
* @param aLayerMask A layer or layers to mask the hit test. * @param aLayerMask A layer or layers to mask the hit test.
* @return a PAD object pointer to the connected pad. * @return a PAD object pointer to the connected pad.
*/ */
PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, LSET aLayerMask ) const; PAD* GetPad( std::vector<PAD*>& aPadList, const VECTOR2I& aPosition, const LSET& aLayerMask ) const;
/** /**
* First empties then fills the vector with all pads and sorts them by increasing x * First empties then fills the vector with all pads and sorts them by increasing x

View File

@ -1473,16 +1473,16 @@ void BOARD_DESIGN_SETTINGS::SetUserDefinedLayerCount( int aNewLayerCount )
} }
void BOARD_DESIGN_SETTINGS::SetEnabledLayers( LSET aMask ) void BOARD_DESIGN_SETTINGS::SetEnabledLayers( const LSET& aMask )
{ {
m_enabledLayers = aMask;
// Ensures mandatory back and front layers are always enabled regardless of board file // Ensures mandatory back and front layers are always enabled regardless of board file
// configuration. // configuration.
aMask.set( B_Cu ).set( F_Cu ) m_enabledLayers.set( B_Cu ).set( F_Cu )
.set( B_CrtYd ).set( F_CrtYd ) .set( B_CrtYd ).set( F_CrtYd )
.set( Edge_Cuts ) .set( Edge_Cuts )
.set( Margin ); .set( Margin );
m_enabledLayers = aMask;
// update layer counts to ensure their consistency with m_EnabledLayers // update layer counts to ensure their consistency with m_EnabledLayers
LSET copperLayers = aMask; LSET copperLayers = aMask;

View File

@ -1349,7 +1349,7 @@ void PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom( BOARD* aBoard )
} }
void PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged( LSET aNewLayerSet ) void PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged( const LSET& aNewLayerSet )
{ {
// Can be called spuriously from events before the layers page is even created // Can be called spuriously from events before the layers page is even created
if( !m_panelLayers->IsInitialized() ) if( !m_panelLayers->IsInitialized() )

View File

@ -103,7 +103,7 @@ public:
* Rebuild the Layer Stack Panel if the new layer set differs * Rebuild the Layer Stack Panel if the new layer set differs
* from the current layet set * from the current layet set
*/ */
void OnLayersOptionsChanged( LSET aNewLayerSet ); void OnLayersOptionsChanged( const LSET& aNewLayerSet );
/// @return the number of copper layers configured for the board stackup /// @return the number of copper layers configured for the board stackup
int GetCopperLayerCount() const; int GetCopperLayerCount() const;

View File

@ -327,7 +327,7 @@ public:
* @param aVisibleLayerMask is the current visible layers (bit mask). * @param aVisibleLayerMask is the current visible layers (bit mask).
* @param aPreferredLayer is the layer to search first. * @param aPreferredLayer is the layer to search first.
*/ */
GENERAL_COLLECTORS_GUIDE( LSET aVisibleLayerMask, PCB_LAYER_ID aPreferredLayer, GENERAL_COLLECTORS_GUIDE( const LSET& aVisibleLayerMask, PCB_LAYER_ID aPreferredLayer,
KIGFX::VIEW* aView ) KIGFX::VIEW* aView )
{ {
static const VECTOR2I one( 1, 1 ); static const VECTOR2I one( 1, 1 );
@ -375,7 +375,7 @@ public:
{ {
m_visibleLayers.set( aLayerId, isVisible ); m_visibleLayers.set( aLayerId, isVisible );
} }
void SetLayerVisibleBits( LSET aLayerBits ) { m_visibleLayers = aLayerBits; } void SetLayerVisibleBits( const LSET& aLayerBits ) { m_visibleLayers = aLayerBits; }
/** /**
* @return int - the preferred layer for HitTest()ing. * @return int - the preferred layer for HitTest()ing.

View File

@ -151,7 +151,7 @@ void DRC_TEST_PROVIDER::reportRuleStatistics()
} }
int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes, LSET aLayers, int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes, const LSET& aLayers,
const std::function<bool( BOARD_ITEM*)>& aFunc ) const std::function<bool( BOARD_ITEM*)>& aFunc )
{ {
BOARD *brd = m_drcEngine->GetBoard(); BOARD *brd = m_drcEngine->GetBoard();

View File

@ -102,7 +102,7 @@ public:
virtual const wxString GetDescription() const; virtual const wxString GetDescription() const;
protected: protected:
int forEachGeometryItem( const std::vector<KICAD_T>& aTypes, LSET aLayers, int forEachGeometryItem( const std::vector<KICAD_T>& aTypes, const LSET& aLayers,
const std::function<bool(BOARD_ITEM*)>& aFunc ); const std::function<bool(BOARD_ITEM*)>& aFunc );
// Do not use a wxString with a vararg list: it is a complex thing and can create issues. // Do not use a wxString with a vararg list: it is a complex thing and can create issues.

View File

@ -107,7 +107,7 @@ static wxString escapeString( const wxString& aString )
} }
static std::string fmt_mask( LSET aSet ) static std::string fmt_mask( const LSET& aSet )
{ {
return ( aSet & LSET::AllCuMask() ).to_string(); return ( aSet & LSET::AllCuMask() ).to_string();
} }

View File

@ -1454,7 +1454,7 @@ const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText ) const
} }
const BOX2I FOOTPRINT::GetLayerBoundingBox( LSET aLayers ) const const BOX2I FOOTPRINT::GetLayerBoundingBox( const LSET& aLayers ) const
{ {
std::vector<PCB_TEXT*> texts; std::vector<PCB_TEXT*> texts;
const BOARD* board = GetBoard(); const BOARD* board = GetBoard();
@ -1943,7 +1943,7 @@ PAD* FOOTPRINT::FindPadByNumber( const wxString& aPadNumber, PAD* aSearchAfterMe
} }
PAD* FOOTPRINT::GetPad( const VECTOR2I& aPosition, LSET aLayerMask ) PAD* FOOTPRINT::GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask )
{ {
for( PAD* pad : m_pads ) for( PAD* pad : m_pads )
{ {

View File

@ -144,7 +144,7 @@ public:
} }
LSET GetPrivateLayers() const { return m_privateLayers; } LSET GetPrivateLayers() const { return m_privateLayers; }
void SetPrivateLayers( LSET aLayers ) { m_privateLayers = aLayers; } void SetPrivateLayers( const LSET& aLayers ) { m_privateLayers = aLayers; }
///< @copydoc BOARD_ITEM_CONTAINER::Add() ///< @copydoc BOARD_ITEM_CONTAINER::Add()
void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT, void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
@ -199,7 +199,7 @@ public:
/** /**
* Return the bounding box of the footprint on a given set of layers * Return the bounding box of the footprint on a given set of layers
*/ */
const BOX2I GetLayerBoundingBox( LSET aLayers ) const; const BOX2I GetLayerBoundingBox( const LSET& aLayers ) const;
VECTOR2I GetCenter() const override { return GetBoundingBox( false ).GetCenter(); } VECTOR2I GetCenter() const override { return GetBoundingBox( false ).GetCenter(); }
@ -769,7 +769,7 @@ public:
* @param aLayerMask A layer or layers to mask the hit test. * @param aLayerMask A layer or layers to mask the hit test.
* @return A pointer to a #PAD object if found otherwise NULL. * @return A pointer to a #PAD object if found otherwise NULL.
*/ */
PAD* GetPad( const VECTOR2I& aPosition, LSET aLayerMask = LSET::AllLayersMask() ); PAD* GetPad( const VECTOR2I& aPosition, const LSET& aLayerMask = LSET::AllLayersMask() );
std::vector<const PAD*> GetPads( const wxString& aPadNumber, std::vector<const PAD*> GetPads( const wxString& aPadNumber,
const PAD* aIgnore = nullptr ) const; const PAD* aIgnore = nullptr ) const;

View File

@ -110,7 +110,7 @@ void GRID_CELL_LAYER_RENDERER::Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC&
// Note: this implementation is an adaptation of wxGridCellChoiceEditor // Note: this implementation is an adaptation of wxGridCellChoiceEditor
GRID_CELL_LAYER_SELECTOR::GRID_CELL_LAYER_SELECTOR( PCB_BASE_FRAME* aFrame, LSET aMask, GRID_CELL_LAYER_SELECTOR::GRID_CELL_LAYER_SELECTOR( PCB_BASE_FRAME* aFrame, const LSET& aMask,
bool aShowNonActivated ) : bool aShowNonActivated ) :
m_frame( aFrame ), m_frame( aFrame ),
m_mask( aMask ), m_mask( aMask ),

View File

@ -56,7 +56,7 @@ private:
class GRID_CELL_LAYER_SELECTOR : public wxGridCellEditor class GRID_CELL_LAYER_SELECTOR : public wxGridCellEditor
{ {
public: public:
GRID_CELL_LAYER_SELECTOR( PCB_BASE_FRAME* aFrame, LSET forbiddenLayers, GRID_CELL_LAYER_SELECTOR( PCB_BASE_FRAME* aFrame, const LSET& forbiddenLayers,
bool aShowNonActivated = false ); bool aShowNonActivated = false );
wxGridCellEditor* Clone() const override; wxGridCellEditor* Clone() const override;

View File

@ -330,7 +330,7 @@ PCB_LAYER_ID PAD::GetPrincipalLayer() const
} }
bool PAD::FlashLayer( LSET aLayers ) const bool PAD::FlashLayer( const LSET& aLayers ) const
{ {
for( PCB_LAYER_ID layer : aLayers.Seq() ) for( PCB_LAYER_ID layer : aLayers.Seq() )
{ {

View File

@ -814,7 +814,7 @@ public:
* @return true if connected by pad or track (or optionally zone) on any of the associated * @return true if connected by pad or track (or optionally zone) on any of the associated
* layers * layers
*/ */
bool FlashLayer( LSET aLayers ) const; bool FlashLayer( const LSET& aLayers ) const;
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override; bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override; bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;

View File

@ -54,7 +54,7 @@ public:
void SetBoardFrame( PCB_BASE_FRAME* aFrame ); void SetBoardFrame( PCB_BASE_FRAME* aFrame );
// SetLayerSet allows disabling some layers, which are not shown in list // SetLayerSet allows disabling some layers, which are not shown in list
void SetNotAllowedLayerSet( LSET aMask ) { m_layerMaskDisable = aMask; } void SetNotAllowedLayerSet( const LSET& aMask ) { m_layerMaskDisable = aMask; }
// If the UNDEFINED_LAYER should be selectable, give it a name here. Usually either // If the UNDEFINED_LAYER should be selectable, give it a name here. Usually either
// INDETERMINATE_STATE or INDETERMINATE_ACTION. // INDETERMINATE_STATE or INDETERMINATE_ACTION.

View File

@ -163,11 +163,11 @@ public:
void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; } void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; }
bool GetSubtractMaskFromSilk() const { return m_subtractMaskFromSilk; } bool GetSubtractMaskFromSilk() const { return m_subtractMaskFromSilk; }
void SetLayerSelection( LSET aSelection ) { m_layerSelection = aSelection; } void SetLayerSelection( const LSET& aSelection ) { m_layerSelection = aSelection; }
LSET GetLayerSelection() const { return m_layerSelection; } LSET GetLayerSelection() const { return m_layerSelection; }
void SetPlotOnAllLayersSequence( LSEQ aSeq ) { m_plotOnAllLayersSequence = aSeq; } void SetPlotOnAllLayersSequence( LSEQ aSeq ) { m_plotOnAllLayersSequence = aSeq; }
LSEQ GetPlotOnAllLayersSequence() const { return m_plotOnAllLayersSequence; } LSEQ GetPlotOnAllLayersSequence() const { return m_plotOnAllLayersSequence; }
void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; } void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; }
bool GetUseAuxOrigin() const { return m_useAuxOrigin; } bool GetUseAuxOrigin() const { return m_useAuxOrigin; }

View File

@ -1344,7 +1344,7 @@ void PCB_VIA::SanitizeLayers()
} }
bool PCB_VIA::FlashLayer( LSET aLayers ) const bool PCB_VIA::FlashLayer( const LSET& aLayers ) const
{ {
for( size_t ii = 0; ii < aLayers.size(); ++ii ) for( size_t ii = 0; ii < aLayers.size(); ++ii )
{ {

View File

@ -634,7 +634,7 @@ public:
* @return true if connected by pad or track (or optionally zone) on any of the associated * @return true if connected by pad or track (or optionally zone) on any of the associated
* layers. * layers.
*/ */
bool FlashLayer( LSET aLayers ) const; bool FlashLayer( const LSET& aLayers ) const;
/** /**
* Return the top-most and bottom-most connected layers. * Return the top-most and bottom-most connected layers.

View File

@ -83,7 +83,7 @@ public:
} }
// Basic functions to plot a board item // Basic functions to plot a board item
void SetLayerSet( LSET aLayerMask ) { m_layerMask = aLayerMask; } void SetLayerSet( const LSET& aLayerMask ) { m_layerMask = aLayerMask; }
void PlotFootprintGraphicItems( const FOOTPRINT* aFootprint ); void PlotFootprintGraphicItems( const FOOTPRINT* aFootprint );
void PlotFootprintTextItems( const FOOTPRINT* aFootprint ); void PlotFootprintTextItems( const FOOTPRINT* aFootprint );
@ -215,7 +215,7 @@ void PlotOneBoardLayer( BOARD* aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer,
* SetDrillMarksType( DrillMarksType aVal ) * SetDrillMarksType( DrillMarksType aVal )
* aVal = no hole, small hole, actual hole size * aVal = no hole, small hole, actual hole size
*/ */
void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ); const PCB_PLOT_PARAMS& aPlotOpt );
/** /**
@ -226,7 +226,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
* @param aLayerMask is the mask to define the layers to plot. * @param aLayerMask is the mask to define the layers to plot.
* @param aPlotOpt is the plot options. Has meaning for some formats only. * @param aPlotOpt is the plot options. Has meaning for some formats only.
*/ */
void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ); const PCB_PLOT_PARAMS& aPlotOpt );
/** /**

View File

@ -90,7 +90,7 @@ void PlotPolySet( BOARD* aBoard, PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlot
* Solder mask layers have a minimum thickness value and cannot be drawn like standard layers, * Solder mask layers have a minimum thickness value and cannot be drawn like standard layers,
* unless the minimum thickness is 0. * unless the minimum thickness is 0.
*/ */
void PlotSolderMaskLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotSolderMaskLayer( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ) const PCB_PLOT_PARAMS& aPlotOpt )
{ {
if( aBoard->GetDesignSettings().m_SolderMaskMinWidth == 0 ) if( aBoard->GetDesignSettings().m_SolderMaskMinWidth == 0 )
@ -109,7 +109,7 @@ void PlotSolderMaskLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
} }
void PlotClippedSilkLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotClippedSilkLayer( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ) const PCB_PLOT_PARAMS& aPlotOpt )
{ {
SHAPE_POLY_SET silkscreen, solderMask; SHAPE_POLY_SET silkscreen, solderMask;
@ -329,7 +329,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer,
/** /**
* Plot any layer EXCEPT a solder-mask with an enforced minimum width. * Plot any layer EXCEPT a solder-mask with an enforced minimum width.
*/ */
void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ) const PCB_PLOT_PARAMS& aPlotOpt )
{ {
BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt ); BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
@ -840,7 +840,7 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
/** /**
* Plot outlines. * Plot outlines.
*/ */
void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt ) const PCB_PLOT_PARAMS& aPlotOpt )
{ {
BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt ); BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );

View File

@ -299,7 +299,8 @@ void PCB_ONE_LAYER_SELECTOR::OnRightGridCellClick( wxGridEvent& event )
} }
PCB_LAYER_ID PCB_BASE_FRAME::SelectOneLayer( PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask, PCB_LAYER_ID PCB_BASE_FRAME::SelectOneLayer( PCB_LAYER_ID aDefaultLayer,
const LSET& aNotAllowedLayersMask,
wxPoint aDlgPosition ) wxPoint aDlgPosition )
{ {
PCB_ONE_LAYER_SELECTOR dlg( this, aDefaultLayer, aNotAllowedLayersMask, true ); PCB_ONE_LAYER_SELECTOR dlg( this, aDefaultLayer, aNotAllowedLayersMask, true );

View File

@ -71,7 +71,7 @@ public:
/** /**
* Set the tool's snap layer set. * Set the tool's snap layer set.
*/ */
inline void SetLayerSet( LSET aLayerSet ) { m_layerMask = aLayerSet; } inline void SetLayerSet( const LSET& aLayerSet ) { m_layerMask = aLayerSet; }
int SelectPointInteractively( const TOOL_EVENT& aEvent ); int SelectPointInteractively( const TOOL_EVENT& aEvent );
int SelectItemInteractively( const TOOL_EVENT& aEvent ); int SelectItemInteractively( const TOOL_EVENT& aEvent );

View File

@ -1294,7 +1294,7 @@ void APPEARANCE_CONTROLS::SetObjectVisible( GAL_LAYER_ID aLayer, bool isVisible
} }
void APPEARANCE_CONTROLS::setVisibleLayers( LSET aLayers ) void APPEARANCE_CONTROLS::setVisibleLayers( const LSET& aLayers )
{ {
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView(); KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();

View File

@ -333,7 +333,7 @@ private:
void onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, bool isFinal ); void onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool isVisible, bool isFinal );
void setVisibleLayers( LSET aLayers ); void setVisibleLayers( const LSET& aLayers );
void setVisibleObjects( GAL_SET aObjects ); void setVisibleObjects( GAL_SET aObjects );