23#include <wx/filedlg.h>
25#include <wx/hyperlink.h>
34using namespace std::placeholders;
105using namespace KIGFX;
109 const std::vector<PENDING_STACK_EXPANSION>& aPending )
111 if( aPreRoute.count( aVia->
m_Uuid ) )
117 if( !exp.m_Pos || *exp.m_Pos != aVia->
GetPosition() )
126 return &exp.m_Preset;
139 if( aCurrent == aStart )
143 if( aCurrent == aEnd )
155class UI_UPDATE_INTERVAL_GUARD
158 UI_UPDATE_INTERVAL_GUARD(
long aNewInterval ) :
159 m_saved( wxUpdateUIEvent::GetUpdateInterval() )
161 wxUpdateUIEvent::SetUpdateInterval( aNewInterval );
164 ~UI_UPDATE_INTERVAL_GUARD()
166 wxUpdateUIEvent::SetUpdateInterval( m_saved );
201 .Name(
"pcbnew.InteractiveRouter.PlaceVia" )
203 .DefaultHotkey(
'V' )
204 .LegacyHotkeyName(
"Add Through Via" )
205 .FriendlyName(
_(
"Place Through Via" ) )
206 .Tooltip(
_(
"Adds a through-hole via at the end of currently routed track." ) )
212 .Name(
"pcbnew.InteractiveRouter.PlaceBlindVia" )
215 .LegacyHotkeyName(
"Add Blind/Buried Via" )
216 .FriendlyName(
_(
"Place Blind/Buried Via" ) )
217 .Tooltip(
_(
"Adds a blind or buried via at the end of currently routed track.") )
223 .Name(
"pcbnew.InteractiveRouter.PlaceMicroVia" )
225 .DefaultHotkey(
MD_CTRL +
'V' )
226 .LegacyHotkeyName(
"Add MicroVia" )
227 .FriendlyName(
_(
"Place Microvia" ) )
228 .Tooltip(
_(
"Adds a microvia at the end of currently routed track." ) )
235 .Name(
"pcbnew.InteractiveRouter.PlaceViaStack" )
238 .FriendlyName(
_(
"Place Microvia Stack at Track End" ) )
239 .Tooltip(
_(
"Drops the active microvia stack preset at the end of the currently routed track "
240 "and continues on the target layer." ) )
245 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceVia" )
247 .DefaultHotkey(
'<' )
248 .LegacyHotkeyName(
"Select Layer and Add Through Via" )
249 .FriendlyName(
_(
"Select Layer and Place Through Via..." ) )
250 .Tooltip(
_(
"Select a layer, then add a through-hole via at the end of currently routed track." ) )
256 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia" )
258 .DefaultHotkey(
MD_ALT +
'<' )
259 .LegacyHotkeyName(
"Select Layer and Add Blind/Buried Via" )
260 .FriendlyName(
_(
"Select Layer and Place Blind/Buried Via..." ) )
261 .Tooltip(
_(
"Select a layer, then add a blind or buried via at the end of currently routed track." ) )
267 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceMicroVia" )
269 .FriendlyName(
_(
"Select Layer and Place Micro Via..." ) )
270 .Tooltip(
_(
"Select a layer, then add a micro via at the end of currently routed track." ) )
276 .Name(
"pcbnew.InteractiveRouter.CustomTrackViaSize" )
278 .DefaultHotkey(
'Q' )
279 .LegacyHotkeyName(
"Custom Track/Via Size" )
280 .FriendlyName(
_(
"Custom Track/Via Size..." ) )
281 .Tooltip(
_(
"Shows a dialog for changing the track width and via size." ) )
285 .Name(
"pcbnew.InteractiveRouter.SwitchPosture" )
287 .DefaultHotkey(
'/' )
288 .LegacyHotkeyName(
"Switch Track Posture" )
289 .FriendlyName(
_(
"Switch Track Posture" ) )
290 .Tooltip(
_(
"Switches posture of the currently routed track." ) )
295 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingToNext" )
297 .DefaultHotkey(
MD_CTRL +
'/' )
298 .FriendlyName(
_(
"Track Corner Mode Switch" ) )
299 .Tooltip(
_(
"Switches between sharp/rounded and 45°/90° corners when routing tracks." ) )
304 .Name(
"pcbnew.InteractiveRouter.SwitchRounding45" )
306 .DefaultHotkey(
MD_CTRL +
'W' )
307 .FriendlyName(
_(
"Track Corner Mode 45" ) )
308 .Tooltip(
_(
"Switch to 45° corner when routing tracks." ) ) );
311 .Name(
"pcbnew.InteractiveRouter.SwitchRounding90" )
314 .FriendlyName(
_(
"Track Corner Mode 90" ) )
315 .Tooltip(
_(
"Switch to 90° corner when routing tracks." ) ) );
318 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingArc45" )
321 .FriendlyName(
_(
"Track Corner Mode Arc 45" ) )
322 .Tooltip(
_(
"Switch to arc 45° corner when routing tracks." ) ) );
325 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingArc90" )
327 .DefaultHotkey(
MD_ALT +
'W' )
328 .FriendlyName(
_(
"Track Corner Mode Arc 90" ) )
329 .Tooltip(
_(
"Switch to arc 90° corner when routing tracks." ) ) );
332#define _(s) wxGetTranslation((s))
355 SetTitle(
_(
"Select Track/Via Width" ) );
374 _(
"Route using the width of the starting track." ), wxITEM_CHECK );
379 _(
"Use track and via sizes from the net class" ), wxITEM_CHECK );
384 _(
"Specify custom track and via sizes" ), wxITEM_CHECK );
395 msg =
_(
"Track netclass width" );
397 msg.Printf(
_(
"Track %s" ),
m_frame.MessageTextFromValue( width ) );
400 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
411 msg =
_(
"Via netclass values" );
414 if(
via.m_Drill > 0 )
416 msg.Printf(
_(
"Via %s, hole %s" ),
417 m_frame.MessageTextFromValue(
via.m_Diameter ),
418 m_frame.MessageTextFromValue(
via.m_Drill ) );
422 msg.Printf(
_(
"Via %s" ),
423 m_frame.MessageTextFromValue(
via.m_Diameter ) );
428 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
436 int id = aEvent.GetId();
488 SetTitle(
_(
"Select Differential Pair Dimensions" ) );
504 _(
"Use differential pair dimensions from the net class" ), wxITEM_CHECK );
509 _(
"Specify custom differential pair dimensions" ), wxITEM_CHECK );
522 if( diffPair.
m_Gap <= 0 )
526 msg.Printf(
_(
"Width %s" ),
531 msg.Printf(
_(
"Width %s, via gap %s" ),
540 msg.Printf(
_(
"Width %s, gap %s" ),
546 msg.Printf(
_(
"Width %s, gap %s, via gap %s" ),
554 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
562 int id = aEvent.GetId();
606 auto& menu =
m_menu->GetMenu();
607 menu.SetUntranslatedTitle(
_HKI(
"Interactive Router" ) );
627 auto notRoutingCond =
630 return !
m_router->RoutingInProgress();
633 auto inRouteSelected =
642 std::vector<PNS::NET_HANDLE> currentNets =
m_router->GetCurrentNets();
644 if( currentNets.empty() || currentNets[0] ==
nullptr )
651 RN_NET* ratsnest =
board->GetConnectivity()->GetRatsnestForNet( currentNet );
653 return ratsnest && !ratsnest->
GetEdges().empty();
658 menu.AddSeparator( 1 );
661 menu.AddSeparator( haveHighlight, 2 );
689 submenuCornerMode->
SetTitle(
_(
"Track Corner Mode" ) );
699 menu.AddMenu( submenuCornerMode );
702 auto cornerMode45Cond =
708 auto cornerMode90Cond =
714 auto cornerModeArc45Cond =
720 auto cornerModeArc90Cond =
726#define CHECK( x ) ACTION_CONDITIONS().Check( x )
766 static size_t lastLoggerSize = 0;
767 static wxString mruPath;
772 if( !logger || logger->GetEvents().size() == 0
773 || logger->GetEvents().size() == lastLoggerSize )
778 if( !testCaseDir.IsEmpty() )
785 wxFileName
path = wxFileName::DirName( testCaseDir );
789 if(
path.DirExists() )
791 doExit = !
IsOK(
frame(), wxString::Format(
_(
"Test case in directory %s already exists. Overwrite?"),
path.GetFullPath() ) );
795 path.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
798 path.SetName( wxT(
"pns") );
799 logPath =
path.GetFullPath();
808 lastLoggerSize = logger->GetEvents().size();
814 if ( mruPath.IsEmpty() )
819 wxFileDialog dlg(
frame(),
_(
"Save router log" ), mruPath,
"pns.log",
821 wxFD_OVERWRITE_PROMPT | wxFD_SAVE );
825 if( dlg.ShowModal() != wxID_OK )
827 lastLoggerSize = logger->GetEvents().size();
831 logPath = dlg.GetPath();
835 wxFileName fname_log( logPath );
836 mruPath = fname_log.GetPath();
837 fname_log.SetExt(
"log" );
838 wxLogTrace( wxT(
"PNS" ), wxT(
"save log to: %s" ), fname_log.GetFullPath() );
840 wxFileName fname_dump( fname_log );
841 fname_dump.SetExt(
"dump" );
843 wxFileName fname_settings( fname_log );
844 fname_settings.SetExt(
"settings" );
846 FILE* settings_f = wxFopen( fname_settings.GetAbsolutePath(),
"wb" );
850 DisplayError(
frame(), wxString::Format(
_(
"Unable to write '%s'." ), fname_settings.GetAbsolutePath() ) );
854 std::string settingsStr =
m_router->Settings().FormatAsString();
855 fprintf( settings_f,
"%s\n", settingsStr.c_str() );
856 fclose( settings_f );
863 pcb_io.
SaveBoard( fname_dump.GetAbsolutePath(), *
m_iface->GetBoard(),
nullptr );
872 wxString srcRules = editFrame->GetBoard()->GetDesignRulesPath();
874 if( !srcRules.IsEmpty() && wxFileName::FileExists( srcRules ) )
876 wxFileName fname_rules( fname_dump );
878 wxCopyFile( srcRules, fname_rules.GetAbsolutePath() );
883 std::vector<PNS::ITEM*> removed;
887 for(
auto item : removed )
892 wxASSERT_MSG( item->Parent() !=
nullptr,
"removed an item with no parent uuid?" );
904 logData.
m_Events = logger->GetEvents();
906 FILE* log_f = wxFopen( fname_log.GetAbsolutePath(),
"wb" );
912 fname_log.GetAbsolutePath() ) );
916 fprintf( log_f,
"%s\n", logString.c_str().AsChar() );
952 bool asChanged =
false;
1007 int startLayer =
m_iface->GetPNSLayerFromBoardLayer( tl );
1013 return m_iface->GetBoardLayerFromPNSLayer( ls.
Start() );
1022 int activeLayer =
m_iface->GetPNSLayerFromBoardLayer(
frame()->GetActiveLayer() );
1023 int currentLayer =
m_router->GetCurrentLayer();
1025 if( currentLayer != activeLayer )
1026 m_router->SwitchLayer( activeLayer );
1028 std::optional<int> newLayer =
m_router->Sizes().PairedLayer( currentLayer );
1031 newLayer =
m_router->Sizes().GetLayerTop();
1033 m_router->SwitchLayer( *newLayer );
1044 std::vector<PNS::NET_HANDLE> nets =
m_router->GetCurrentNets();
1048 std::shared_ptr<DRC_ENGINE>& drcEngine = bds.
m_DRCEngine;
1054 dummyTrack.
SetLayer( targetLayer );
1077 if( !constraint.
IsNull() )
1105 dummyTrackB.
SetLayer( targetLayer );
1113 if( !constraint.
IsNull() )
1132 if( !constraint.
IsNull() )
1166 wxASSERT_MSG(
false, wxT(
"Unhandled via type" ) );
1190 frame()->SetActiveLayer(
1214 if( presets.empty() )
1216 frame()->GetInfoBar()->ShowMessageFor(
1217 _(
"No microvia stack presets defined. Add one in Board Setup, Microvia Stacks." ), 3000,
1218 wxICON_INFORMATION );
1222 int idx = std::clamp( bds.
GetViaStackIndex(), 0, (
int) presets.size() - 1 );
1234 frame()->GetInfoBar()->ShowMessageFor(
_(
"The microvia stack preset layers are not present on this board." ),
1235 3000, wxICON_ERROR );
1243 frame()->GetInfoBar()->ShowMessageFor(
1244 wxString::Format(
_(
"The microvia stack runs between %s and %s. Route on one of those layers "
1248 3000, wxICON_ERROR );
1263 if( traces.
Size() > 0 )
1267 if( line->PointCount() > 0 )
1268 head = line->CLine().CLastPoint();
1274 frame()->GetInfoBar()->ShowMessageFor(
_(
"Could not end the track here for a microvia stack." ), 3000,
1292 if( !
m_router->GetCurrentNets().empty() )
1295 net = ni->GetNetCode();
1344 m_iface->GetPNSLayerFromBoardLayer( targetLayer ) );
1351 if(
m_router->RoutingInProgress() )
1369 if( traces.
Size() == 0 )
1376 if( line->EndsWithVia() )
1420 size_t target_idx = 0;
1422 for(
size_t i = 0; i < layers.size(); i++ )
1424 if( layers[i] == currentLayer )
1431 target_idx = ( idx + 1 ) % layers.size();
1434 for(
size_t i = 0; i < layers.size() - 1; i++ )
1438 targetLayer = layers[target_idx];
1443 if( target_idx >= layers.size() )
1458 size_t target_idx = 0;
1460 for(
size_t i = 0; i < layers.size(); i++ )
1462 if( layers[i] == currentLayer )
1469 target_idx = ( idx > 0 ) ? ( idx - 1 ) : ( layers.size() - 1 );
1471 for(
size_t i = 0; i < layers.size() - 1; i++ )
1475 targetLayer = layers[target_idx];
1479 if( target_idx > 0 )
1482 target_idx = layers.size() - 1;
1504 if( !enabledLayers.test( targetLayer ) )
1510 if( targetLayer == currentLayer )
1530 bool selectLayer =
false;
1535 const int actViaFlags = aEvent.
Parameter<
int>();
1550 endPoint =
frame()->GetCanvas()->ClientToScreen( endPoint );
1556 not_allowed_ly.
set( currentLayer );
1558 targetLayer =
frame()->SelectOneLayer(
static_cast<PCB_LAYER_ID>( currentLayer ),
1559 not_allowed_ly, endPoint );
1570 if( currentLayer == targetLayer )
1581 && ( ( targetLayer ==
B_Cu && currentLayer ==
F_Cu )
1582 || ( targetLayer ==
F_Cu && currentLayer ==
B_Cu ) ) )
1597 if( !
m_router->GetNearestRatnestAnchor( otherEnd, otherEndLayers, otherEndItem ) )
1600 currentLayer = pairTop;
1601 targetLayer = pairBottom;
1608 const std::optional<int> pairedLayerPns =
m_router->Sizes().PairedLayer(
m_router->GetCurrentLayer() );
1616 const bool otherEndIsThrough =
1617 otherEndLayers == allCopperLayers
1618 || ( otherEndItem && otherEndItem->
HasHole()
1619 && otherEndItem->
Hole()->
Layers() == allCopperLayers );
1621 if( otherEndIsThrough )
1625 if( currentLayer == pairBottom )
1626 targetLayer = pairTop;
1627 else if( currentLayer == pairTop )
1628 targetLayer = pairBottom;
1630 targetLayer = pairTop;
1632 else if( currentLayer == otherEndLayerPcbId && pairedLayerPns.has_value() )
1636 targetLayer =
m_iface->GetBoardLayerFromPNSLayer( *pairedLayerPns );
1640 targetLayer =
m_iface->GetBoardLayerFromPNSLayer( otherEndLayers.
Start() );
1646 if( currentLayer == pairTop || currentLayer == pairBottom )
1650 currentLayer = pairTop;
1651 targetLayer = pairBottom;
1657 targetLayer = pairTop;
1661 if( currentLayer == targetLayer )
1664 infobar->
ShowMessageFor(
_(
"Via needs 2 different layers." ), 5000, wxICON_ERROR,
1665 WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
1680 if( !
m_router->GetCurrentNets().empty() )
1688 if( !constraint.
IsNull() )
1694 if( !constraint.
IsNull() )
1705 m_iface->GetPNSLayerFromBoardLayer( targetLayer ) );
1712 if(
m_router->RoutingInProgress() )
1738 int pnsLayer =
m_iface->GetPNSLayerFromBoardLayer( pcbLayer );
1749 if( !
getView()->IsLayerVisible( pcbLayer ) )
1757 m_iface->SetStartLayerFromPCBNew( pcbLayer );
1759 frame()->GetBoard()->GetDesignSettings().m_TempOverrideTrackWidth =
false;
1762 m_iface->GetPNSLayerFromBoardLayer(
frame()->GetScreen()->m_Route_Layer_BOTTOM ) );
1792 m_router->ClearViewDecorations();
1803 frame()->UndoRedoBlock(
true );
1839 frame()->UndoRedoBlock(
false );
1861 auto syncRouterAndFrameLayer =
1864 int pnsLayer =
m_router->GetCurrentLayer();
1870 if( !
getView()->IsLayerVisible( pcbLayer ) )
1885 if( startWithVia && !startReachesViaTarget )
1892 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
1898 m_toolMgr->GetView()->SyncLayerVisibilityCache();
1903 if( !
m_router->RoutingInProgress() )
1905 if( evt->IsCancelInteractive() )
1922 if( std::optional<VECTOR2I> last =
m_router->UndoLastSegment() )
1925 evt->SetMousePosition( last.value() );
1936 bool* autoRouted = evt->Parameter<
bool*>();
1943 if( autoRouted !=
nullptr )
1952 if( autoRouted !=
nullptr )
1954 *autoRouted =
false;
1964 bool needsAppend =
m_router->Placer()->HasPlacedAnything();
1968 syncRouterAndFrameLayer();
1980 frame()->ShowInfoBarError(
m_router->FailureReason(),
true );
1989 bool needLayerSwitch =
m_router->IsPlacingVia();
1990 bool forceCommit =
false;
2000 if( needLayerSwitch )
2010 syncRouterAndFrameLayer();
2051 bool forceFinish =
true;
2052 bool forceCommit =
false;
2058 || evt->IsActivate()
2064 if( evt->IsActivate() && !evt->IsMoveTool() )
2071 else if( evt->IsUndoRedo() )
2089 evt->SetPassEvent();
2110 if( settingsDlg.
ShowModal() == wxID_OK )
2142 settings.SetMode( mode );
2170 return m_router->Settings().Mode();
2176 return m_router->RoutingInProgress();
2210 if(
m_router->RoutingInProgress() )
2234 controls->ForceCursorPosition(
false );
2239 std::vector<BOARD_CONNECTED_ITEM*> itemList;
2246 itemList.push_back(
pad );
2254 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
frame->GetBoard()->GetConnectivity();
2257 bool groupStart =
true;
2265 RN_NET* net = connectivity->GetRatsnestForNet( item->GetNetCode() );
2270 std::vector<std::shared_ptr<const CN_ANCHOR>> anchors;
2274 std::shared_ptr<const CN_ANCHOR> target = edge.GetTargetNode();
2275 std::shared_ptr<const CN_ANCHOR>
source = edge.GetSourceNode();
2277 if( !
source ||
source->Dirty() || !target || target->Dirty() )
2280 if(
source->Parent() == item )
2281 anchors.push_back(
source );
2282 else if( target->Parent() == item )
2283 anchors.push_back( target );
2287 for( std::shared_ptr<const CN_ANCHOR>
anchor : anchors )
2296 if(
frame->GetActiveLayer() != originalLayer )
2297 frame->SetActiveLayer( originalLayer );
2304 bool autoRouted =
false;
2349 std::vector<BOARD_CONNECTED_ITEM*> trackItems;
2357 if( trackItems.empty() )
2367 int dpSkipped = std::erase_if( trackItems,
2375 frame->ShowInfoBarMsg(
_(
"Differential pair members cannot be optimized." ) );
2377 bool groupStart =
true;
2395 branch->
Remove( originalLine );
2397 PNS::LINE optimizedLine( originalLine );
2406 if(
m_router->Settings().GetRestrictAngles() )
2428 branch->
Add( optimizedLine );
2449 if(
m_router->RoutingInProgress() )
2472 controls->ForceCursorPosition(
false );
2488 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2490 if( !evt->IsDrag() )
2493 if( evt->IsCancelInteractive() )
2497 else if( evt->IsActivate() )
2499 if( evt->IsMoveTool() || evt->IsEditorTool() )
2502 frame->PushTool( originalEvent );
2533 evt->SetPassEvent(
false );
2542 if( evt->HasPosition() )
2556 else if( evt->IsKeyPressed() )
2561 evt->SetPassEvent();
2569 evt->SetPassEvent();
2595 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
2596 wxOK | wxCANCEL | wxICON_WARNING );
2597 dlg.SetOKLabel(
_(
"Drag Anyway" ) );
2608 if( !
m_router->FailureReason().IsEmpty() )
2609 frame()->ShowInfoBarError(
m_router->FailureReason(),
true );
2619 frame()->UndoRedoBlock(
true );
2621 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
2627 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2640 if( dragger->GetForceMarkObstaclesMode( &dragStatus ) )
2647 hint.Printf(
_(
"(%s to commit anyway.)" ),
2651 statusItem->
SetMessage(
_(
"Track violates DRC." ) );
2661 bool forceFinish =
false;
2662 bool forceCommit = evt->Modifier(
MD_CTRL );
2672 || evt->IsActivate() )
2677 if( evt->IsActivate() && !evt->IsMoveTool() )
2682 else if( evt->IsUndoRedo() )
2710 evt->SetPassEvent();
2715 evt->SetPassEvent();
2724 if(
m_router->RoutingInProgress() )
2730 frame()->UndoRedoBlock(
false );
2757 if( vias + traces == 0 )
2771 for(
int i = 0; !reference && i < aCollector.
GetCount(); i++ )
2772 reference =
dynamic_cast<PCB_TRACK*
>( aCollector[i] );
2786 refPoint = reference->
GetEnd();
2790 for(
int i = 0; i < aCollector.
GetCount(); i++ )
2794 if( neighbor && neighbor != reference )
2799 if( neighbor->
GetStart() != refPoint && neighbor->
GetEnd() != refPoint )
2806 aCollector.
Append( reference );
2836 std::copy( aOriginalSelection.
Items().begin(), aOriginalSelection.
Items().end(), std::back_inserter( selItems ) );
2852 std::deque<EDA_ITEM*> selectedItems =
selection.GetItems();
2864 std::set<FOOTPRINT*> footprints;
2867 footprints.insert(
static_cast<FOOTPRINT*
>( item ) );
2872 for(
int idx = 1; idx <
selection.Size(); ++idx )
2874 if( !
selection.GetItem( idx )->IsBOARD_ITEM() )
2889 bool wasLocked =
false;
2906 bool showCourtyardConflicts =
frame()->GetPcbNewSettings()->m_ShowCourtyardCollisions;
2908 std::shared_ptr<DRC_ENGINE> drcEngine =
m_toolMgr->GetTool<
DRC_TOOL>()->GetDRCEngine();
2912 std::vector<BOARD_ITEM*> dynamicItems;
2913 std::unique_ptr<CONNECTIVITY_DATA> dynamicData =
nullptr;
2915 std::vector<PNS::ITEM*> leaderSegments;
2916 bool singleFootprintDrag =
false;
2923 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2925 if( !footprints.empty() )
2927 if( footprints.size() == 1 )
2928 singleFootprintDrag =
true;
2930 if( showCourtyardConflicts )
2940 itemsToDrag.
Add( solid );
2944 if( connectivityData->GetRatsnestForPad(
pad ).size() > 0 )
2945 dynamicItems.push_back(
pad );
2952 itemsToDrag.
Add( solid );
2958 || shape->GetLayer() ==
Margin
2962 itemsToDrag.
Add( solid );
2966 if( showCourtyardConflicts )
2970 dynamicData = std::make_unique<CONNECTIVITY_DATA>(
board()->GetConnectivity(), dynamicItems,
true );
2971 connectivityData->BlockRatsnestItems( dynamicItems );
2975 for(
const EDA_ITEM* selItem : selectedItems )
2977 if( !selItem->IsBOARD_ITEM() )
2990 itemsToDrag.
Add( pnsItem );
3002 if( itemsToDrag.
Count() >= 1 )
3008 int layer =
m_iface->GetPNSLayerFromBoardLayer( activeLayer );
3010 SEG::ecoord closestDistSq = std::numeric_limits<SEG::ecoord>::max();
3014 const SHAPE* shape = pitem->Shape( layer );
3021 if( distSq < closestDistSq )
3023 closestDistSq = distSq;
3024 closestItem = pitem;
3034 if( closestItem->
Net() )
3039 if( !footprints.empty() && singleFootprintDrag )
3050 tweakedMousePos =
footprint->GetPosition();
3065 int dragMode = aEvent.
Parameter<
int> ();
3067 bool dragStarted =
m_router->StartDragging( p, itemsToDrag, dragMode );
3074 if( !footprints.empty() )
3075 connectivityData->ClearLocalRatsnest();
3089 frame()->UndoRedoBlock(
true );
3110 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
3112 bool hasMouseMoved =
false;
3113 bool hasMultidragCancelled =
false;
3119 m_toolMgr->GetView()->SyncLayerVisibilityCache();
3123 if( evt->IsCancelInteractive()
3125 || evt->IsActivate() )
3130 hasMultidragCancelled =
true;
3134 else if( evt->IsMotion()
3138 hasMouseMoved =
true;
3144 if( !footprints.empty() )
3153 previewItem =
static_cast<BOARD_ITEM*
>( drawing->Clone() );
3154 previewItem->
Move( offset );
3163 &&
pad->GetDrillSize().x == 0 )
3166 previewItem->
Move( offset );
3179 previewItem->
Move( offset );
3184 previewItem->
Move( offset );
3188 if( showCourtyardConflicts )
3192 if( showCourtyardConflicts )
3194 courtyardClearanceDRC.
Run();
3202 dynamicData->Move( offset - lastOffset );
3203 lastOffset = offset;
3204 connectivityData->ComputeLocalRatsnest( dynamicItems, dynamicData.get(), offset );
3211 if( dragger->GetForceMarkObstaclesMode( &dragStatus ) )
3219 statusItem->
SetMessage(
_(
"Track violates DRC." ) );
3227 else if( hasMouseMoved && ( evt->IsMouseUp(
BUT_LEFT )
3231 bool forceFinish =
false;
3232 bool forceCommit = evt->Modifier(
MD_CTRL );
3236 leaderSegments =
m_router->GetLastCommittedLeaderSegments();
3240 else if( evt->IsUndoRedo() )
3268 evt->SetPassEvent();
3273 evt->SetPassEvent();
3279 if( !footprints.empty() )
3296 connectivityData->ClearLocalRatsnest();
3302 if(
m_router->RoutingInProgress() )
3306 if( itemsToDrag.
Size() && hasMultidragCancelled )
3310 else if( leaderSegments.size() )
3312 std::vector<EDA_ITEM*> newItems;
3315 newItems.push_back( lseg->Parent() );
3323 frame()->UndoRedoBlock(
false );
3347 m_toolMgr->GetView()->SyncLayerVisibilityCache();
3375 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
3376 wxOK | wxCANCEL | wxICON_WARNING );
3377 dlg.SetOKLabel(
_(
"Break Track" ) );
3386 frame()->UndoRedoBlock(
true );
3389 if(
m_router->RoutingInProgress() )
3392 frame()->UndoRedoBlock(
false );
3420 if( !
m_router->GetCurrentNets().empty() )
3439 std::vector<MSG_PANEL_ITEM> items;
3446 std::vector<PNS::NET_HANDLE> nets =
m_router->GetCurrentNets();
3447 wxString description;
3453 wxASSERT( nets.size() >= 2 );
3460 description = wxString::Format(
_(
"Routing Diff Pair: %s" ),
3467 if( *netclassA == *netclassB )
3473 secondary = wxString::Format(
_(
"Resolved Netclass: %s" ),
3476 else if( !nets.empty() && nets[0] )
3480 description = wxString::Format(
_(
"Routing Track: %s" ),
3483 secondary = wxString::Format(
3484 _(
"Resolved Netclass: %s" ),
3489 description =
_(
"Routing Track" );
3490 secondary =
_(
"(no net)" );
3493 items.emplace_back( description, secondary );
3495 wxString cornerMode;
3497 if(
m_router->Settings().GetFreeAngleMode() )
3499 cornerMode =
_(
"Free-angle" );
3503 switch(
m_router->Settings().GetCornerMode() )
3513 items.emplace_back(
_(
"Corner Style" ), cornerMode );
3515 switch(
m_router->Settings().Mode() )
3523 items.emplace_back(
_(
"Mode" ), mode );
3525#define FORMAT_VALUE( x ) frame()->MessageTextFromValue( x )
3529 items.emplace_back( wxString::Format(
_(
"Track Width: %s" ),
3531 wxString::Format(
_(
"(from %s)" ),
3534 items.emplace_back( wxString::Format(
_(
"Min Clearance: %s" ),
3536 wxString::Format(
_(
"(from %s)" ),
3539 items.emplace_back( wxString::Format(
_(
"Diff Pair Gap: %s" ),
3541 wxString::Format(
_(
"(from %s)" ),
3545 wxASSERT( traces.
Count() == 2 );
3548 traces[1],
m_router->GetCurrentLayer(), &constraint ) )
3550 items.emplace_back( wxString::Format(
_(
"DP Max Uncoupled-length: %s" ),
3552 wxString::Format(
_(
"(from %s)" ),
3558 items.emplace_back( wxString::Format(
_(
"Track Width: %s" ),
3560 wxString::Format(
_(
"(from %s)" ),
3563 items.emplace_back( wxString::Format(
_(
"Min Clearance: %s" ),
3565 wxString::Format(
_(
"(from %s)" ),
3571 frame()->SetMsgPanel( items );
std::function< void(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)> CLIENT_SELECTION_FILTER
@ switch_corner_rounding_shape
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
static TOOL_ACTION cancelInteractive
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION pasteSpecial
static TOOL_ACTION cursorDblClick
static TOOL_ACTION doDelete
static TOOL_ACTION cursorClick
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION refreshPreview
static TOOL_ACTION finishInteractive
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void SetLayerVisible(int aLayer, bool isVisible)
Manually update visibility for a given layer.
BASE_SET & set(size_t pos)
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
virtual void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
NETINFO_ITEM * GetNet() const
Return NETINFO_ITEM object for a given item.
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
void SetCustomDiffPairWidth(int aWidth)
Sets custom track width for differential pairs (i.e.
int GetCurrentViaSize() const
void SetViaSizeIndex(int aIndex)
Set the current via size list index to aIndex.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
bool m_UseConnectedTrackWidth
int GetTrackWidthIndex() const
int GetViaSizeIndex() const
int GetDiffPairIndex() const
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
void SetDiffPairIndex(int aIndex)
bool m_TempOverrideTrackWidth
void SetCustomDiffPairGap(int aGap)
Sets custom gap for differential pairs (i.e.
bool UseNetClassVia() const
Return true if netclass values should be used to obtain appropriate via size.
int GetViaStackIndex() const
bool UseNetClassTrack() const
Return true if netclass values should be used to obtain appropriate track width.
bool UseNetClassDiffPair() const
Return true if netclass values should be used to obtain appropriate diff pair dimensions.
void SetTrackWidthIndex(int aIndex)
Set the current track width list index to aIndex.
int GetCopperLayerCount() const
void UseCustomDiffPairDimensions(bool aEnabled)
Enables/disables custom differential pair dimensions.
std::vector< int > m_TrackWidthList
int GetCurrentViaDrill() const
std::vector< VIA_STACK_PRESET > m_ViaStackPresets
std::vector< VIA_DIMENSION > m_ViasDimensionsList
void SetCustomDiffPairViaGap(int aGap)
Sets custom via gap for differential pairs (i.e.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetLocked(bool aLocked) override
bool IsLocked() const override
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
Information pertinent to a Pcbnew printed circuit board.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
CN_EDGE represents a point-to-point connection, whether realized or unrealized (ie: tracks etc.
void Empty()
Clear the list.
int GetCount() const
Return the number of objects in the list.
int CountType(KICAD_T aType)
Count the number of items matching aType.
void Append(EDA_ITEM *item)
Add an item to the end of the list.
PNS::LOGGER::TEST_CASE_TYPE getTestCaseType() const
const wxString & getTestCaseName() const
Implementing DIALOG_TRACK_VIA_SIZE_BASE.
@ ROUNDED_90
H/V with filleted corners.
@ MITERED_90
H/V only (90-degree corners)
@ ROUNDED_45
H/V/45 with filleted corners.
@ MITERED_45
H/V/45 with mitered corners (default)
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
std::vector< FOOTPRINT * > m_FpInMove
void ClearConflicts(KIGFX::VIEW *aView)
void UpdateConflicts(KIGFX::VIEW *aView, bool aHighlightMoved)
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, INFOBAR_MESSAGE_TYPE aType=INFOBAR_MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
Used when the right click button is pressed, or when the select tool is in effect.
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
Abstract interface for drawing on a 2D-surface.
BOX2D GetVisibleWorldExtents() const
bool GetGridSnapping() const
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual void WarpMouseCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
void ShowPreview(bool aShow=true)
virtual int GetTopLayer() const
GAL * GetGAL() const
Return the GAL this view is using to draw graphical primitives.
void Hide(VIEW_ITEM *aItem, bool aHide=true, bool aHideOverlay=false)
Temporarily hide the item in the view (e.g.
void AddToPreview(VIEW_ITEM *aItem, bool aTakeOwnership=true)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
A collection of nets and the parameters used to route or test these nets.
bool HasuViaDrill() const
const wxString GetHumanReadableName() const
Gets the consolidated name of this netclass (which may be an aggregate).
bool HasuViaDiameter() const
int GetuViaDiameter() const
Handle the data for a net.
const wxString & GetNetname() const
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
static TOOL_ACTION_GROUP layerDirectSwitchActions()
static TOOL_ACTION layerToggle
static TOOL_ACTION drag45Degree
static TOOL_ACTION layerInner12
static TOOL_ACTION routerUndoLastSegment
static TOOL_ACTION layerInner8
static TOOL_ACTION layerInner3
static TOOL_ACTION layerPrev
static TOOL_ACTION routerSettingsDialog
Activation of the Push and Shove settings dialogs.
static TOOL_ACTION layerInner2
static TOOL_ACTION routerAttemptFinish
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
static TOOL_ACTION trackViaSizeChanged
static TOOL_ACTION layerChanged
static TOOL_ACTION layerInner25
static TOOL_ACTION breakTrack
Break a single track into two segments at the cursor.
static TOOL_ACTION routerRouteSelectedFromEnd
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
static TOOL_ACTION routerWalkaroundMode
static TOOL_ACTION routerShoveMode
static TOOL_ACTION layerInner24
static TOOL_ACTION properties
Activation of the edit tool.
static TOOL_ACTION layerInner29
static TOOL_ACTION routerOptimizeSelected
static TOOL_ACTION routerAutorouteSelected
static TOOL_ACTION layerInner11
static TOOL_ACTION routerDiffPairDialog
static TOOL_ACTION routerContinueFromEnd
static TOOL_ACTION layerInner16
static TOOL_ACTION layerInner26
static TOOL_ACTION layerInner18
static TOOL_ACTION layerInner14
static TOOL_ACTION selectLayerPair
static TOOL_ACTION layerInner6
static TOOL_ACTION dragFreeAngle
static TOOL_ACTION clearHighlight
static TOOL_ACTION layerInner22
static TOOL_ACTION layerInner5
static TOOL_ACTION layerInner20
static TOOL_ACTION layerInner7
static TOOL_ACTION layerInner27
static TOOL_ACTION cancelCurrentItem
static TOOL_ACTION layerInner1
static TOOL_ACTION layerInner10
static TOOL_ACTION layerInner15
static TOOL_ACTION layerInner17
static TOOL_ACTION layerBottom
static TOOL_ACTION layerInner19
static TOOL_ACTION layerInner9
static TOOL_ACTION routerInlineDrag
Activation of the Push and Shove router (inline dragging mode)
static TOOL_ACTION layerInner30
static TOOL_ACTION layerTop
static TOOL_ACTION cycleRouterMode
static TOOL_ACTION layerInner4
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION layerInner13
static TOOL_ACTION layerInner21
static TOOL_ACTION layerNext
static TOOL_ACTION routerRouteSelected
static TOOL_ACTION placeViaStack
static TOOL_ACTION layerInner23
static TOOL_ACTION layerInner28
Common, abstract interface for edit frames.
APPEARANCE_CONTROLS * GetAppearancePanel()
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual PCB_LAYER_ID GetActiveLayer() const
The main frame for Pcbnew.
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
static int ExpandMultiHopMicrovias(BOARD *aBoard, BOARD_COMMIT *aCommit, const std::function< const VIA_STACK_PRESET *(PCB_VIA *)> &aMatcher=nullptr)
Replace loose microvias spanning more than one hop with stacks of single hop microvias.
static std::set< KIID > CollectExpandableMicrovias(BOARD *aBoard)
Ids of the vias ExpandMultiHopMicrovias would consider right now.
static const wxString GENERATOR_TYPE
PCB_LAYER_ID BottomLayer() const
VECTOR2I GetPosition() const override
void SetPosition(const VECTOR2I &aPoint) override
void SetSizeFromRules(int aDiameter, int aDrill)
Give the via a uniform padstack sized from its diameter and hole rules.
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
int GetWidth() const override
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
int Count(int aKindMask=-1) const
void Add(const LINE &aLine)
std::vector< ITEM * > & Items()
Base class for PNS router board items.
const PNS_LAYER_RANGE & Layers() const
virtual NET_HANDLE Net() const
bool OfKind(int aKindMask) const
virtual HOLE * Hole() const
virtual bool HasHole() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
bool CompareGeometry(const LINE &aOther)
Return true if the line is geometrically identical as line aOther.
virtual void ClearLinks()
Erase the linking information. Used to detach the line from the owning node.
static wxString FormatLogFileAsJSON(const LOG_DATA &aLogData)
Keep the router "world" - i.e.
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
OPT_OBSTACLE CheckColliding(const ITEM *aItem, int aKindMask=ITEM::ANY_T)
Check if the item collides with anything else in the world, and if found, returns the obstacle.
RULE_RESOLVER * GetRuleResolver() const
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false, bool aAllowSegmentSizeMismatch=true)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
void Remove(ARC *aArc)
Remove an item from this branch.
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I &aV=VECTOR2I(0, 0))
A quick shortcut to optimize a line without creating and setting up an optimizer.
@ SMART_PADS
Reroute pad exits.
@ FANOUT_CLEANUP
Simplify pad-pad and pad-via connections if possible.
@ MERGE_SEGMENTS
Reduce corner cost iteratively.
@ MERGE_COLINEAR
Merge co-linear segments.
@ MERGE_OBTUSE
Reduce corner cost by merging obtuse segments.
@ REQUIRE_OBTUSE_ANGLES
Try to prevent 90-degree or acute corners in a drag.
Contain all persistent settings of the router, such as the mode, optimization effort,...
void SetMode(PNS_MODE aMode)
Set the routing mode.
PNS_MODE Mode() const
Return the routing mode.
virtual bool QueryConstraint(CONSTRAINT_TYPE aType, const ITEM *aItemA, const ITEM *aItemB, int aLayer, CONSTRAINT *aConstraint)=0
virtual NET_HANDLE DpCoupledNet(NET_HANDLE aNet)=0
void SetViaType(VIATYPE aViaType)
void SetTrackWidth(int aWidth)
int DiffPairWidth() const
void SetDiffPairWidth(int aWidth)
void SetDiffPairWidthSource(const wxString &aSource)
void SetDiffPairGapSource(const wxString &aSource)
void SetDiffPairGap(int aGap)
void SetViaDrill(int aDrill)
wxString GetClearanceSource() const
wxString GetDiffPairGapSource() const
wxString GetDiffPairWidthSource() const
void AddLayerPair(int aL1, int aL2)
void SetClearance(int aClearance)
bool TrackWidthIsExplicit() const
void SetViaDiameter(int aDiameter)
void SetClearanceSource(const wxString &aSource)
wxString GetWidthSource() const
void SetWidthSource(const wxString &aSource)
int DiffPairViaGap() const
Represent a contiguous set of PCB layers.
bool Overlaps(const PNS_LAYER_RANGE &aOther) const
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
Container for project specific data.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
virtual PROJECT_FILE & GetProjectFile() const
Describe ratsnest for a single net.
const std::vector< CN_EDGE > & GetEdges() const
void SetMessage(const wxString &aStatus)
void SetHint(const wxString &aHint)
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I::extended_type ecoord
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
std::deque< EDA_ITEM * > & Items()
An abstract shape on 2D plane.
virtual SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const
A modified version of the wxInfoBar class that allows us to:
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
Handle a list of polygons defining a copper zone.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
#define ROUTER_TRANSIENT
transient items that should NOT be cached
#define ENDPOINT
ends. (Used to support dragging.)
std::uint32_t EDA_ITEM_FLAGS
#define STARTPOINT
When a line is selected, these flags indicate which.
a few functions useful in geometry calculations.
VECTOR2< ret_type > GetClampedCoords(const VECTOR2< in_type > &aCoords, pad_type aPadding=1u)
Clamp a vector to values that can be negated, respecting numeric limits of coordinates data type with...
wxString m_RouterTestCaseDirectory
Router test case directory.
static const std::string DesignRulesFileExtension
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
std::optional< wxString > fileHashMMH3(const wxString &aFilePath)
Calculates an MMH3 hash of a given file.
The Cairo implementation of the graphics abstraction layer.
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ PNS_MODE_ROUTE_DIFF_PAIR
@ ID_POPUP_PCB_SELECT_WIDTH1
@ ID_POPUP_PCB_SELECT_DIFFPAIR16
@ ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES
@ ID_POPUP_PCB_SELECT_WIDTH16
@ ID_POPUP_PCB_SELECT_AUTO_WIDTH
@ ID_POPUP_PCB_SELECT_CUSTOM_WIDTH
@ ID_POPUP_PCB_SELECT_DIFFPAIR1
@ ID_POPUP_PCB_SELECT_USE_NETCLASS_DIFFPAIR
@ ID_POPUP_PCB_SELECT_VIASIZE1
@ ID_POPUP_PCB_SELECT_CUSTOM_DIFFPAIR
@ ID_POPUP_PCB_SELECT_VIASIZE16
Class that computes missing connections on a PCB.
std::vector< EDA_ITEM * > EDA_ITEMS
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
Container to handle a stock of specific differential pairs each with unique track width,...
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
std::optional< wxString > m_BoardHash
std::optional< TEST_CASE_TYPE > m_TestCaseType
std::vector< ITEM * > m_AddedItems
std::vector< EVENT_ENTRY > m_Events
std::set< KIID > m_RemovedItems
std::vector< ITEM * > m_Heads
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
A named microvia stack definition, chosen while routing instead of entering the values each time.
PCB_LAYER_ID m_StartLayer
HYPERLINK_DV_RENDERER::RUN RUN
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
wxPoint ToWxPoint(const VECTOR2I &aSize)
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
Definition of file extensions used in Kicad.