Browse Source

Performance.

revert-0c36e162
Jeff Young 6 months ago
parent
commit
96491132ce
  1. 19
      pcbnew/board.cpp
  2. 11
      pcbnew/board.h
  3. 4
      pcbnew/tools/pcb_selection_tool.cpp

19
pcbnew/board.cpp

@ -2243,25 +2243,6 @@ PAD* BOARD::GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const
}
PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, const 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, const LSET& aLayerSet ) const
{
// Search aPadList for aPosition

11
pcbnew/board.h

@ -1125,17 +1125,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, const LSET& aLayerMask ) const;
/**
* Locate the pad connected at \a aPosition on \a aLayer starting at list position
* \a aPad

4
pcbnew/tools/pcb_selection_tool.cpp

@ -2817,7 +2817,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 )
{
@ -3906,7 +3906,7 @@ void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aColle
}
auto visibleLayers =
[&]()
[&]() -> LSET
{
if( m_isFootprintEditor )
{

Loading…
Cancel
Save