diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 9e3c4bbaa9..cece55cfbd 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -752,22 +752,29 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID LAYER_aPCB, bool isEnabled ) switch( LAYER_aPCB ) { case LAYER_RATSNEST: - + { + bool visible = IsElementVisible( LAYER_RATSNEST ); // we must clear or set the CH_VISIBLE flags to hide/show ratsnest // because we have a tool to show/hide ratsnest relative to a pad or a module // so the hide/show option is a per item selection - if( IsElementVisible( LAYER_RATSNEST ) ) - { - for( unsigned ii = 0; ii < GetRatsnestsCount(); ii++ ) - m_FullRatsnest[ii].m_Status |= CH_VISIBLE; - } - else - { - for( unsigned ii = 0; ii < GetRatsnestsCount(); ii++ ) - m_FullRatsnest[ii].m_Status &= ~CH_VISIBLE; - } - break; + for ( int net = 1; net < GetNetCount(); net++ ) + GetConnectivity()->GetRatsnestForNet( net )->SetVisible( visible ); + for ( auto track : Tracks() ) + track->SetLocalRatsnestVisible( isEnabled ); + for( auto mod : Modules() ) + for ( auto pad : mod->PadsIter() ) + pad->SetLocalRatsnestVisible( isEnabled ); + for( int i = 0; iSetLocalRatsnestVisible( isEnabled ); + } + + m_Status_Pcb = 0; + + break; + } default: ; } diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 53adebf93e..a92dd608a7 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -92,7 +92,7 @@ TOOL_ACTION PCB_ACTIONS::drawVia( "pcbnew.InteractiveDrawing.via", AS_GLOBAL, 0, _( "Add Vias" ), _( "Add free-stanging vias" ), NULL, AF_ACTIVATE ); -TOOL_ACTION PCB_ACTIONS::drawKeepout( "pcbnew.InteractiveDrawing.keepout", +TOOL_ACTION PCB_ACTIONS::drawZoneKeepout( "pcbnew.InteractiveDrawing.keepout", AS_GLOBAL, 0, _( "Add Keepout Area" ), _( "Add a keepout area" ), NULL, AF_ACTIVATE ); @@ -1464,8 +1464,8 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) // layer pair is B_Cu and F_Cu. via->SetLayerPair( B_Cu, F_Cu ); - LAYER_ID first_layer = m_frame->GetActiveLayer(); - LAYER_ID last_layer; + PCB_LAYER_ID first_layer = m_frame->GetActiveLayer(); + PCB_LAYER_ID last_layer; // prepare switch to new active layer: if( first_layer != m_frame->GetScreen()->m_Route_Layer_TOP ) @@ -1482,7 +1482,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) case VIA_MICROVIA: // from external to the near neighbor inner layer { - LAYER_ID last_inner_layer = ToLAYER_ID( ( m_board->GetCopperLayerCount() - 2 ) ); + PCB_LAYER_ID last_inner_layer = ToLAYER_ID( ( m_board->GetCopperLayerCount() - 2 ) ); if( first_layer == B_Cu ) last_layer = last_inner_layer; diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 22d9abe099..2f0aebb8b0 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -488,7 +488,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) controls->SetSnapping( false ); controls->SetAutoPan( false ); controls->CaptureCursor( false ); - + view->Remove( &preview ); m_frame->SetNoToolSelected(); @@ -1110,6 +1110,7 @@ int PCB_EDITOR_CONTROL::ShowLocalRatsnest( const TOOL_EVENT& aEvent ) int PCB_EDITOR_CONTROL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ) { + return 0; /* SELECTION_TOOL* selTool = m_toolMgr->GetTool(); const SELECTION& selection = selTool->GetSelection(); RN_DATA* ratsnest = getModel()->GetRatsnest(); diff --git a/pcbnew/tools/pcb_editor_control.h b/pcbnew/tools/pcb_editor_control.h index 4e330b2689..3c734707c2 100644 --- a/pcbnew/tools/pcb_editor_control.h +++ b/pcbnew/tools/pcb_editor_control.h @@ -105,6 +105,9 @@ public: ///> Updates ratsnest for selected items. int UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ); + ///> Shows local ratsnest of a component + int ShowLocalRatsnest( const TOOL_EVENT& aEvent ); + ///> Sets up handlers for various events. void SetTransitions() override; diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 51f92df33e..eef9d8c7ed 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -839,7 +839,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent ) // rebuild nets and ratsnest before any use of nets board->BuildListOfNets(); board->SynchronizeNetsAndNetClasses(); - board->GetRatsnest()->ProcessBoard(); + board->GetConnectivity()->Build( board ); m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );