Move ratsnest exclusion processing to a post-pass.

Also fixes a few cases where we were unnecessarily rebuilding
connectivity more than once for an operation.
This commit is contained in:
Jeff Young
2022-09-29 17:08:49 +01:00
parent bb63e1a2ff
commit d67437a2aa
25 changed files with 164 additions and 237 deletions
+8 -5
View File
@@ -34,7 +34,6 @@
#include <tools/pcb_tool_base.h>
#include <tools/pcb_actions.h>
#include <connectivity/connectivity_data.h>
#include <pcbnew_settings.h>
#include <functional>
using namespace std::placeholders;
@@ -501,6 +500,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
connectivity->PropagateNets( this, PROPAGATE_MODE::RESOLVE_CONFLICTS );
connectivity->RecalculateRatsnest( this );
board->UpdateRatsnestExclusions();
connectivity->ClearLocalRatsnest();
}
@@ -593,10 +593,10 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const
void BOARD_COMMIT::Revert()
{
PICKED_ITEMS_LIST undoList;
KIGFX::VIEW* view = m_toolMgr->GetView();
BOARD* board = (BOARD*) m_toolMgr->GetModel();
auto connectivity = board->GetConnectivity();
PICKED_ITEMS_LIST undoList;
KIGFX::VIEW* view = m_toolMgr->GetView();
BOARD* board = (BOARD*) m_toolMgr->GetModel();
std::shared_ptr<CONNECTIVITY_DATA> connectivity = board->GetConnectivity();
std::vector<BOARD_ITEM*> bulkAddedItems;
std::vector<BOARD_ITEM*> bulkRemovedItems;
@@ -664,7 +664,10 @@ void BOARD_COMMIT::Revert()
board->OnItemsChanged( itemsChanged );
if ( !m_isFootprintEditor )
{
connectivity->RecalculateRatsnest();
board->UpdateRatsnestExclusions();
}
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
selTool->RebuildSelection();