23 #include <wx/hyperlink.h> 27 using namespace std::placeholders;
63 using namespace KIGFX;
91 _(
"Finish Track" ),
_(
"Stops laying the current track." ),
97 _(
"Auto-finish Track" ),
_(
"Automatically finishes laying the current track." ) );
102 _(
"Place Through Via" ),
103 _(
"Adds a through-hole via at the end of currently routed track." ),
109 _(
"Place Blind/Buried Via" ),
110 _(
"Adds a blind or buried via at the end of currently routed track."),
116 _(
"Place Microvia" ),
_(
"Adds a microvia at the end of currently routed track." ),
120 "pcbnew.InteractiveRouter.SelLayerAndPlaceVia",
123 _(
"Select Layer and Place Through Via..." ),
124 _(
"Select a layer, then add a through-hole via at the end of currently routed track." ),
129 "pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia",
132 _(
"Select Layer and Place Blind/Buried Via..." ),
133 _(
"Select a layer, then add a blind or buried via at the end of currently routed track." ),
138 "pcbnew.InteractiveRouter.SelLayerAndPlaceMicroVia",
141 _(
"Select Layer and Place Micro Via..." ),
142 _(
"Select a layer, then add a micro via at the end of currently routed track." ),
149 _(
"Custom Track/Via Size..." ),
150 _(
"Shows a dialog for changing the track width and via size." ),
156 _(
"Switch Track Posture" ),
157 _(
"Switches posture of the currently routed track." ),
163 _(
"Track Corner Mode" ),
164 _(
"Switches between sharp/rounded and 45°/90° corners when routing tracks." ),
168 #define _(s) wxGetTranslation((s)) 186 SetTitle(
_(
"Select Track/Via Width" ) );
206 _(
"Route using the width of the starting track." ), wxITEM_CHECK );
211 _(
"Use track and via sizes from the net class" ), wxITEM_CHECK );
216 _(
"Specify custom track and via sizes" ), wxITEM_CHECK );
227 msg =
_(
"Track netclass width" );
232 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
243 msg =
_(
"Via netclass values" );
246 if(
via.m_Drill > 0 )
247 msg.Printf(
_(
"Via %s, drill %s" ),
255 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
263 int id = aEvent.GetId();
315 SetTitle(
_(
"Select Differential Pair Dimensions" ) );
332 _(
"Use differential pair dimensions from the net class" ), wxITEM_CHECK );
337 _(
"Specify custom differential pair dimensions" ), wxITEM_CHECK );
350 if( diffPair.
m_Gap <= 0 )
354 msg.Printf(
_(
"Width %s" ),
359 msg.Printf(
_(
"Width %s, via gap %s" ),
368 msg.Printf(
_(
"Width %s, gap %s" ),
374 msg.Printf(
_(
"Width %s, gap %s, via gap %s" ),
382 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
390 int id = aEvent.GetId();
435 menu.
SetTitle(
_(
"Interactive Router" ) );
445 auto notRoutingCond =
513 wxString cwd = wxGetCwd();
515 wxFileName fname_log( cwd );
516 fname_log.SetName(
"pns.log" );
518 wxFileName fname_dump( cwd );
519 fname_dump.SetName(
"pns.dump" );
521 wxString msg =
wxString::Format(
_(
"Event file: %s\nBoard dump: %s" ), fname_log.GetFullPath(), fname_log.GetFullPath() );
523 int rv =
OKOrCancelDialog(
nullptr,
_(
"Save router log"),
_(
"Would you like to save the router\nevent log for debugging purposes?"), msg,
_(
"OK"),
_(
"Cancel") );
528 FILE *f = fopen( fname_log.GetFullPath().c_str(),
"wb" );
531 fprintf(f,
"config %d %d %d %d\n",
538 const auto& events = logger->GetEvents();
540 for(
auto evt : events)
542 fprintf( f,
"event %d %d %d %s\n", evt.p.x, evt.p.y, evt.type,
543 static_cast<const char*>( evt.uuid.AsString().c_str() ) );
632 wxASSERT_MSG(
false, wxT(
"Unhandled via type" ) );
740 for(
size_t i = 0; i < layers.size(); i++ )
749 idx = ( idx + 1 ) % layers.size();
750 targetLayer = layers[idx];
759 for(
size_t i = 0; i < layers.size(); i++ )
768 idx = ( idx > 0 ) ? ( idx - 1 ) : ( layers.size() - 1 );
769 targetLayer = layers[idx];
780 if( targetLayer == currentLayer )
800 bool selectLayer =
false;
805 const int actViaFlags = aEvent.
Parameter<intptr_t>();
821 not_allowed_ly.set( currentLayer );
827 int previous_layer = currentLayer ==
B_Cu ? layerCount - 2
830 int next_layer = currentLayer >= layerCount-2 ?
B_Cu 835 if( previous_layer >=
F_Cu && previous_layer != currentLayer )
836 not_allowed_ly.reset( previous_layer );
838 if( next_layer != currentLayer )
839 not_allowed_ly.reset( next_layer );
843 not_allowed_ly, endPoint );
854 if( currentLayer == targetLayer )
869 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
870 _(
"Show board setup" ),
873 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
874 [&]( wxHyperlinkEvent& aEvent )
876 getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog(
_(
"Constraints" ) );
882 infobar->
ShowMessageFor(
_(
"Blind/buried vias must first be enabled in " 883 "Board Setup > Design Rules > Constraints." ),
891 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
892 _(
"Show board setup" ), wxEmptyString );
894 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
895 [&]( wxHyperlinkEvent& aEvent )
897 getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog(
_(
"Constraints" ) );
904 "Board Setup > Design Rules > Constraints." ),
912 && ( ( targetLayer ==
B_Cu && currentLayer ==
F_Cu )
913 || ( targetLayer ==
F_Cu && currentLayer ==
B_Cu ) ) )
926 currentLayer = pairTop;
927 targetLayer = pairBottom;
933 if( pairTop > pairBottom ) std::swap( pairTop, pairBottom );
935 if( currentLayer == pairTop && pairBottom == pairTop+1 )
937 targetLayer = pairBottom;
939 else if( currentLayer == pairBottom && pairBottom == pairTop+1 )
941 targetLayer = pairTop;
943 else if( currentLayer ==
F_Cu || currentLayer ==
In1_Cu )
953 else if( currentLayer ==
B_Cu || currentLayer == layerCount - 2 )
969 if( currentLayer == pairTop || currentLayer == pairBottom )
973 currentLayer = pairTop;
974 targetLayer = pairBottom;
980 targetLayer = pairTop;
984 if( currentLayer == targetLayer )
987 infobar->
ShowMessageFor(
_(
"Blind/buried via need 2 different layers." ),
996 wxFAIL_MSG( wxT(
"unexpected via type" ) );
1019 if( !constraint.
IsNull() )
1025 if( !constraint.
IsNull() )
1071 if( !
getView()->IsLayerVisible( routingLayer ) )
1088 sizes.AddLayerPair(
frame()->GetScreen()->m_Route_Layer_TOP,
1089 frame()->GetScreen()->m_Route_Layer_BOTTOM );
1162 if( evt->IsCancelInteractive() )
1170 if( evt->IsMotion() )
1185 bool forceFinish = evt->Modifier(
MD_SHIFT );
1192 if( needLayerSwitch )
1199 editFrame->SetActiveLayer( routingLayer );
1201 if( !
getView()->IsLayerVisible( routingLayer ) )
1203 editFrame->GetAppearancePanel()->SetLayerVisible( routingLayer,
true );
1204 editFrame->GetCanvas()->Refresh();
1241 else if( evt->IsCancelInteractive() || evt->IsActivate()
1242 || evt->IsUndoRedo()
1248 if( evt->IsActivate() && !evt->IsMoveTool() )
1259 evt->SetPassEvent();
1274 if( settingsDlg.ShowModal() == wxID_OK )
1293 settingsDlg.ShowModal();
1392 if( !evt->IsDrag() )
1395 if( evt->IsCancelInteractive() )
1400 else if( evt->IsActivate() )
1402 if( evt->IsMoveTool() )
1421 else if( evt->IsMotion() )
1439 evt->SetPassEvent(
false );
1447 if( evt->HasPosition() )
1464 else if( evt->IsKeyPressed() )
1469 evt->SetPassEvent();
1477 evt->SetPassEvent();
1503 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
1504 wxOK | wxCANCEL | wxICON_WARNING );
1505 dlg.SetOKLabel(
_(
"Drag Anyway" ) );
1549 if( evt->IsMotion() )
1554 else if( evt->IsClick(
BUT_LEFT ) )
1563 else if( evt->IsCancelInteractive() || evt->IsActivate() || evt->IsUndoRedo() )
1568 if( evt->IsActivate() && !evt->IsMoveTool() )
1575 evt->SetPassEvent();
1608 if( arcs > 0 || vias > 1 || traces > 2 || vias + traces < 1 )
1614 for(
int i = 0; !reference && i < aCollector.
GetCount(); i++ )
1615 reference = dynamic_cast<PCB_TRACK*>( aCollector[i] );
1619 wxPoint refPoint( aPt.
x, aPt.
y );
1625 refPoint = reference->
GetEnd();
1629 for(
int i = 0; i < aCollector.
GetCount(); i++ )
1631 PCB_TRACK* neighbor = dynamic_cast<PCB_TRACK*>( aCollector[i] );
1633 if( neighbor && neighbor != reference )
1638 if( neighbor->
GetStart() != refPoint && neighbor->
GetEnd() != refPoint )
1645 aCollector.
Append( reference );
1665 if( item->
IsType( footprints ) )
1700 bool wasLocked =
false;
1719 std::vector<BOARD_ITEM*> dynamicItems;
1720 std::unique_ptr<CONNECTIVITY_DATA> dynamicData =
nullptr;
1725 footprint = static_cast<const FOOTPRINT*>(item);
1732 itemsToDrag.
Add( solid );
1736 if( connectivityData->GetRatsnestForPad(
pad ).size() > 0 )
1737 dynamicItems.push_back(
pad );
1741 dynamicData = std::make_unique<CONNECTIVITY_DATA>( dynamicItems,
true );
1742 connectivityData->BlockRatsnestItems( dynamicItems );
1749 itemsToDrag.
Add( startItem );
1790 int dragMode = aEvent.
Parameter<int64_t> ();
1826 bool hasMouseMoved =
false;
1832 if( evt->IsCancelInteractive() )
1839 else if( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) )
1841 hasMouseMoved =
true;
1855 previewItem = static_cast<BOARD_ITEM*>( drawing->Clone() );
1859 FP_SHAPE* shape = static_cast<FP_SHAPE*>( previewItem );
1860 shape->FP_SHAPE::Move( fp_offset );
1864 previewItem->
Move( offset );
1874 &&
pad->GetDrillSize().x == 0 )
1876 previewItem = static_cast<BOARD_ITEM*>(
pad->Clone() );
1877 previewItem->
Move( offset );
1890 previewItem->
Move( offset );
1895 previewItem->
Move( offset );
1901 previewItem = static_cast<BOARD_ITEM*>( zone->Clone() );
1902 previewItem->
Move( offset );
1908 dynamicData->Move( offset - lastOffset );
1909 lastOffset = offset;
1910 connectivityData->ComputeDynamicRatsnest( dynamicItems, dynamicData.get(), offset );
1913 else if( hasMouseMoved && ( evt->IsMouseUp(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
1931 evt->SetPassEvent();
1936 evt->SetPassEvent();
1959 connectivityData->ClearDynamicRatsnest();
2016 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
2017 wxOK | wxCANCEL | wxICON_WARNING );
2018 dlg.SetOKLabel(
_(
"Break Track" ) );
2042 if( sizeDlg.ShowModal() == wxID_OK )
2084 std::vector<MSG_PANEL_ITEM> items;
2091 wxString description = isDiffPair ?
_(
"Routing Diff Pair: %s" ) :
_(
"Routing Track: %s" );
2094 wxASSERT( netInfo );
2101 items.emplace_back(
_(
"Routing Track" ),
_(
"(no net)" ) );
2104 wxString cornerMode;
2108 cornerMode =
_(
"Free-angle" );
2114 case DIRECTION_45::CORNER_MODE::MITERED_45: cornerMode =
_(
"45-degree" );
break;
2115 case DIRECTION_45::CORNER_MODE::ROUNDED_45: cornerMode =
_(
"45-degree rounded" );
break;
2116 case DIRECTION_45::CORNER_MODE::MITERED_90: cornerMode =
_(
"90-degree" );
break;
2117 case DIRECTION_45::CORNER_MODE::ROUNDED_90: cornerMode =
_(
"90-degree rounded" );
break;
2122 items.emplace_back(
_(
"Corner Style" ), cornerMode );
2126 int width = isDiffPair ? sizes.DiffPairWidth() : sizes.TrackWidth();
2149 items.emplace_back(
_(
"Diff Pair Gap" ),
void Empty()
Clear the list.
static TOOL_ACTION selectionClear
Clear the current selection.
const wxString & FailureReason() const
PCB_LAYER_ID SelectOneLayer(PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
Show the dialog box for a layer selection.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
static TOOL_ACTION layerBottom
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Base class for PNS router board items.
bool GetFreeAngleMode() const
static TOOL_ACTION layerInner26
Contain all persistent settings of the router, such as the mode, optimization effort,...
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void SetMode(PNS_MODE aMode)
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
void SetTrackWidthIndex(unsigned aIndex)
Set the current track width list index to aIndex.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
void SetStartLayer(int aLayer)
static TOOL_ACTION layerNext
PNS::RULE_RESOLVER * GetRuleResolver() override
static TOOL_ACTION layerInner2
static TOOL_ACTION selectLayerPair
#define STARTPOINT
When a line is selected, these flags indicate which.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
int GetCurrentViaDrill() const
#define LEGACY_HK_NAME(x)
The Cairo implementation of the graphics abstraction layer.
static TOOL_ACTION layerInner5
DIRECTION_45::CORNER_MODE GetCornerMode() const
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
const wxPoint & GetEnd() const
void SetCustomDiffPairViaGap(int aGap)
Sets custom via gap for differential pairs (i.e.
This file is part of the common library.
static TOOL_ACTION layerInner6
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
static TOOL_ACTION routerDiffPairDialog
wxString GetNetClassName() const
std::vector< int > m_TrackWidthList
static TOOL_ACTION layerInner7
static TOOL_ACTION layerInner8
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
static TOOL_ACTION layerInner21
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
static TOOL_ACTION routerUndoLastSegment
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
Function SetLayerPair For a via m_layer contains the top layer, the other layer is in m_bottomLayer.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void ClearViewDecorations()
static TOOL_ACTION dragFreeAngle
virtual void Save(const wxString &aFileName, BOARD *aBoard, const PROPERTIES *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be u...
void UseCustomDiffPairDimensions(bool aEnabled)
Enables/disables custom differential pair dimensions.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static TOOL_ACTION cancelInteractive
static TOOL_ACTION properties
Activation of the edit tool.
int DiffPairWidth() const
bool IsPlacingVia() const
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
class PCB_ARC, an arc track segment on a copper layer
bool Overlaps(const LAYER_RANGE &aOther) const
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
const std::vector< int > GetCurrentNets() const
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
static TOOL_ACTION trackViaSizeChanged
bool m_ShowModuleRatsnest
static TOOL_ACTION drag45Degree
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.
class FP_SHAPE, a footprint edge
std::uint32_t EDA_ITEM_FLAGS
virtual void SetLocked(bool aLocked)
Modify the 'lock' status for of the item.
void UndoRedoBlock(bool aBlock=true)
Enable/disable undo and redo operations.
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.
#define ENDPOINT
ends. (Used to support dragging.)
void SetViaDrill(int aDrill)
bool m_ShowRouterDebugGraphics
Show PNS router debug graphics.
int CountType(KICAD_T aType)
Count the number of items matching aType.
virtual bool IsLocked() const
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
APPEARANCE_CONTROLS * GetAppearancePanel()
static TOOL_ACTION layerInner3
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
void Add(const LINE &aLine)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
static TOOL_ACTION layerInner24
bool m_UseConnectedTrackWidth
Container to handle a stock of specific differential pairs each with unique track width,...
static TOOL_ACTION layerInner11
bool RemoveLoops() const
Enable/disable loop (redundant track) removal.
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
void ToggleViaPlacement()
class PCB_TRACK, a track segment (segment on a copper layer)
static TOOL_ACTION layerTop
void ShowPreview(bool aShow=true)
void Append(EDA_ITEM *item)
Add an item to the end of the list.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
virtual PCB_LAYER_ID GetActiveLayer() const
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_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...
static TOOL_ACTION layerInner23
void SetViaSizeIndex(unsigned aIndex)
Set the current via size list index to aIndex.
int GetCount() const
Return the number of objects in the list.
bool GetGridSnapping() const
void SetAuxAxes(bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0))
static TOOL_ACTION routerSettingsDialog
Activation of the Push and Shove settings dialogs.
LSET is a set of PCB_LAYER_IDs.
static TOOL_ACTION layerInner13
void BreakSegment(ITEM *aItem, const VECTOR2I &aP)
static TOOL_ACTION layerPrev
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
virtual void Move(const wxPoint &aMoveVector)
Move this object.
unsigned GetViaSizeIndex() const
static TOOL_ACTION layerInner25
static TOOL_ACTION layerInner18
virtual int GetTopLayer() const
bool UseNetClassVia() const
Return true if netclass values should be used to obtain appropriate via size.
void SetCustomDiffPairWidth(int aWidth)
Sets custom track width for differential pairs (i.e.
bool FixRoute(const VECTOR2I &aP, ITEM *aItem, bool aForceFinish=false)
unsigned GetTrackWidthIndex() const
void SetVisibleViewArea(const BOX2I &aExtents)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
static TOOL_ACTION layerInner30
static TOOL_ACTION layerInner29
const wxString & GetNetname() const
PNS_MODE Mode() const
Set the routing mode.
An interface for classes handling user events controlling the view behavior such as zooming,...
PCB_LAYER_ID m_Route_Layer_BOTTOM
static TOOL_ACTION layerInner10
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
static LSET AllLayersMask()
bool m_BlindBuriedViaAllowed
true to allow blind/buried vias
Handle a list of polygons defining a copper zone.
void SetDiffPairIndex(unsigned aIndex)
bool GetFixAllSegments() const
void SetViaType(VIATYPE aViaType)
static TOOL_ACTION cycleRouterMode
void SetCustomDiffPairGap(int aGap)
Sets custom gap for differential pairs (i.e.
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
bool m_TempOverrideTrackWidth
static TOOL_ACTION routerWalkaroundMode
void Move(const VECTOR2I &aP, ITEM *aItem)
static TOOL_ACTION layerInner15
static TOOL_ACTION routerInlineDrag
Activation of the Push and Shove router (inline dragging mode)
bool StartRouting(const VECTOR2I &aP, ITEM *aItem, int aLayer)
VECTOR2D ToScreen(const VECTOR2D &aCoord, bool aAbsolute=true) const
Convert a world space point/vector to a point/vector in screen space coordinates.
static TOOL_ACTION layerInner28
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
static TOOL_ACTION layerInner27
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void SetViaType(VIATYPE aViaType)
bool Empty() const
Checks if there is anything selected.
static TOOL_ACTION layerInner17
class FOOTPRINT, a footprint
static TOOL_ACTION breakTrack
Break a single track into two segments at the cursor.
static TOOL_ACTION layerInner20
static TOOL_ACTION pasteSpecial
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
A modified version of the wxInfoBar class that allows us to:
static const KICAD_T DraggableItems[]
A scan list for items that can be dragged.
static TOOL_ACTION layerInner22
int GetCurrentViaSize() const
Handle the data for a net.
static TOOL_ACTION layerChanged
VECTOR2< T > Rotate(double aAngle) const
Rotate the vector by a given angle.
void UpdateSizes(const SIZES_SETTINGS &aSizes)
Applies stored settings.
void SetUseGrid(bool aSnapToGrid)
Ignore collisions, mark obstacles.
void SetMode(ROUTER_MODE aMode)
Common, abstract interface for edit frames.
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ITEM_FLAGS IsPointOnEnds(const wxPoint &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
Used when the right click button is pressed, or when the select tool is in effect.
static TOOL_ACTION layerInner14
static TOOL_ACTION layerInner9
bool StartDragging(const VECTOR2I &aP, ITEM *aItem, int aDragMode=DM_ANY)
bool OfKind(int aKindMask) const
Return true if the item's type matches the mask aKindMask.
bool SwitchLayer(int layer)
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
The main frame for Pcbnew.
int Size() const
Returns the number of selected parts.
int DiffPairViaGap() const
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
static TOOL_ACTION layerInner16
BOX2D GetVisibleWorldExtents() const
std::vector< VIA_DIMENSION > m_ViasDimensionsList
PnsKind Kind() const
Return the type (kind) of the item.
WX_INFOBAR * GetInfoBar()
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Implementing DIALOG_TRACK_VIA_SIZE_BASE.
static TOOL_ACTION layerInner4
class PCB_VIA, a via (like a track segment on a copper layer)
unsigned GetDiffPairIndex() const
void SetLayerVisible(LAYER_NUM aLayer, bool isVisible)
void AddLayerPair(int aL1, int aL2)
const Vec & GetSize() const
bool m_MicroViasAllowed
true to allow micro vias
const Vec & GetOrigin() const
bool RoutingInProgress() const
static TOOL_ACTION layerInner19
void SetViaDiameter(int aDiameter)
static FILENAME_RESOLVER * resolver
static TOOL_ACTION layerInner1
bool ImportSizes(PNS::SIZES_SETTINGS &aSizes, PNS::ITEM *aStartItem, int aNet) override
static TOOL_ACTION routerShoveMode
int GetCopperLayerCount() const
OPT< int > PairedLayer(int aLayerId)
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
ROUTING_SETTINGS & Settings()
PCB_LAYER_ID ToLAYER_ID(int aLayer)
std::shared_ptr< DRC_ENGINE > m_DRCEngine
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
Represent a contiguous set of PCB layers.
const LAYER_RANGE & Layers() const
PCB_LAYER_ID m_Route_Layer_TOP
const wxPoint & GetStart() const
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
static TOOL_ACTION layerInner12
KICAD_T Type() const
Returns the type of object.
Abstract interface for drawing on a 2D-surface.
Container for design settings for a BOARD object.
static TOOL_ACTION layerToggle
int GetCurrentLayer() const
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)