KiCad PCB EDA Suite
Loading...
Searching...
No Matches
router_tool.h
Go to the documentation of this file.
1
/*
2
* KiRouter - a push-and-(sometimes-)shove PCB router
3
*
4
* Copyright (C) 2013-2017 CERN
5
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6
* Author: Tomasz Wlostowski <
[email protected]
>
7
* Author: Maciej Suminski <
[email protected]
>
8
*
9
* This program is free software: you can redistribute it and/or modify it
10
* under the terms of the GNU General Public License as published by the
11
* Free Software Foundation, either version 3 of the License, or (at your
12
* option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License along
20
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
*/
22
23
#ifndef __ROUTER_TOOL_H
24
#define __ROUTER_TOOL_H
25
26
#include "
pns_tool_base.h
"
27
28
class
PCB_SELECTION_TOOL
;
29
30
class
ROUTER_TOOL
:
public
PNS::TOOL_BASE
31
{
32
public
:
33
ROUTER_TOOL
();
34
~ROUTER_TOOL
();
35
36
bool
Init
()
override
;
37
void
Reset
(
RESET_REASON
aReason )
override
;
38
39
int
MainLoop
(
const
TOOL_EVENT
& aEvent );
40
int
RouteSelected
(
const
TOOL_EVENT
& aEvent );
41
42
int
InlineBreakTrack
(
const
TOOL_EVENT
& aEvent );
43
bool
CanInlineDrag
(
int
aDragMode );
44
int
InlineDrag
(
const
TOOL_EVENT
& aEvent );
45
46
int
SelectCopperLayerPair
(
const
TOOL_EVENT
& aEvent );
47
int
DpDimensionsDialog
(
const
TOOL_EVENT
& aEvent );
48
int
SettingsDialog
(
const
TOOL_EVENT
& aEvent );
49
int
ChangeRouterMode
(
const
TOOL_EVENT
& aEvent );
50
int
CycleRouterMode
(
const
TOOL_EVENT
& aEvent );
51
int
CustomTrackWidthDialog
(
const
TOOL_EVENT
& aEvent );
52
53
PNS::PNS_MODE
GetRouterMode
();
54
61
bool
RoutingInProgress
();
62
63
void
setTransitions
()
override
;
64
65
// A filter for narrowing a collection representing a simple corner
66
// or a non-fanout-via to a single PCB_TRACK item.
67
static
void
NeighboringSegmentFilter
(
const
VECTOR2I
& aPt,
GENERAL_COLLECTOR
& aCollector,
68
PCB_SELECTION_TOOL
* aSelTool );
69
70
void
UpdateMessagePanel
();
71
72
private
:
73
void
performRouting
();
74
void
performDragging
(
int
aMode =
PNS::DM_ANY
);
75
void
breakTrack
();
76
77
void
handleCommonEvents
(
TOOL_EVENT
& evt );
78
int
handleLayerSwitch
(
const
TOOL_EVENT
& aEvent,
bool
aForceVia );
79
80
int
getStartLayer
(
const
PNS::ITEM
* aItem );
81
void
switchLayerOnViaPlacement
();
82
void
updateSizesAfterLayerSwitch
(
PCB_LAYER_ID
targetLayer,
const
VECTOR2I
& aPos );
83
84
int
onLayerCommand
(
const
TOOL_EVENT
& aEvent );
85
int
onViaCommand
(
const
TOOL_EVENT
& aEvent );
86
int
onTrackViaSizeChanged
(
const
TOOL_EVENT
& aEvent );
87
88
bool
prepareInteractive
();
89
bool
finishInteractive
();
90
void
saveRouterDebugLog
();
91
92
private
:
93
std::shared_ptr<ACTION_MENU>
m_diffPairMenu
;
94
std::shared_ptr<ACTION_MENU>
m_trackViaMenu
;
95
96
int
m_lastTargetLayer
;
97
PCB_LAYER_ID
m_originalActiveLayer
;
98
99
bool
m_inRouterTool
;
// Re-entrancy guard
100
};
101
102
#endif
GENERAL_COLLECTOR
Used when the right click button is pressed, or when the select tool is in effect.
Definition:
collectors.h:204
PCB_SELECTION_TOOL
The selection tool: currently supports:
Definition:
pcb_selection_tool.h:65
PNS::ITEM
Base class for PNS router board items.
Definition:
pns_item.h:97
PNS::TOOL_BASE
Definition:
pns_tool_base.h:45
ROUTER_TOOL
Definition:
router_tool.h:31
ROUTER_TOOL::~ROUTER_TOOL
~ROUTER_TOOL()
Definition:
router_tool.cpp:466
ROUTER_TOOL::onViaCommand
int onViaCommand(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:828
ROUTER_TOOL::ROUTER_TOOL
ROUTER_TOOL()
Definition:
router_tool.cpp:211
ROUTER_TOOL::InlineDrag
int InlineDrag(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:2073
ROUTER_TOOL::m_trackViaMenu
std::shared_ptr< ACTION_MENU > m_trackViaMenu
Definition:
router_tool.h:94
ROUTER_TOOL::setTransitions
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
Definition:
router_tool.cpp:2667
ROUTER_TOOL::onTrackViaSizeChanged
int onTrackViaSizeChanged(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:2515
ROUTER_TOOL::CustomTrackWidthDialog
int CustomTrackWidthDialog(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:2497
ROUTER_TOOL::NeighboringSegmentFilter
static void NeighboringSegmentFilter(const VECTOR2I &aPt, GENERAL_COLLECTOR &aCollector, PCB_SELECTION_TOOL *aSelTool)
Definition:
router_tool.cpp:1977
ROUTER_TOOL::GetRouterMode
PNS::PNS_MODE GetRouterMode()
Definition:
router_tool.cpp:1549
ROUTER_TOOL::saveRouterDebugLog
void saveRouterDebugLog()
Definition:
router_tool.cpp:580
ROUTER_TOOL::performDragging
void performDragging(int aMode=PNS::DM_ANY)
Definition:
router_tool.cpp:1849
ROUTER_TOOL::m_originalActiveLayer
PCB_LAYER_ID m_originalActiveLayer
Definition:
router_tool.h:97
ROUTER_TOOL::onLayerCommand
int onLayerCommand(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:822
ROUTER_TOOL::CycleRouterMode
int CycleRouterMode(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1531
ROUTER_TOOL::m_inRouterTool
bool m_inRouterTool
Definition:
router_tool.h:99
ROUTER_TOOL::handleLayerSwitch
int handleLayerSwitch(const TOOL_EVENT &aEvent, bool aForceVia)
Definition:
router_tool.cpp:846
ROUTER_TOOL::prepareInteractive
bool prepareInteractive()
Definition:
router_tool.cpp:1192
ROUTER_TOOL::getStartLayer
int getStartLayer(const PNS::ITEM *aItem)
Definition:
router_tool.cpp:682
ROUTER_TOOL::switchLayerOnViaPlacement
void switchLayerOnViaPlacement()
Definition:
router_tool.cpp:700
ROUTER_TOOL::RouteSelected
int RouteSelected(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1568
ROUTER_TOOL::finishInteractive
bool finishInteractive()
Definition:
router_tool.cpp:1266
ROUTER_TOOL::ChangeRouterMode
int ChangeRouterMode(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1520
ROUTER_TOOL::m_diffPairMenu
std::shared_ptr< ACTION_MENU > m_diffPairMenu
Definition:
router_tool.h:93
ROUTER_TOOL::handleCommonEvents
void handleCommonEvents(TOOL_EVENT &evt)
Definition:
router_tool.cpp:655
ROUTER_TOOL::Init
bool Init() override
Init() is called once upon a registration of the tool.
Definition:
router_tool.cpp:471
ROUTER_TOOL::InlineBreakTrack
int InlineBreakTrack(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:2435
ROUTER_TOOL::performRouting
void performRouting()
Definition:
router_tool.cpp:1285
ROUTER_TOOL::RoutingInProgress
bool RoutingInProgress()
Returns whether routing is currently active.
Definition:
router_tool.cpp:1555
ROUTER_TOOL::breakTrack
void breakTrack()
Definition:
router_tool.cpp:1561
ROUTER_TOOL::UpdateMessagePanel
void UpdateMessagePanel()
Definition:
router_tool.cpp:2536
ROUTER_TOOL::MainLoop
int MainLoop(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1699
ROUTER_TOOL::CanInlineDrag
bool CanInlineDrag(int aDragMode)
Definition:
router_tool.cpp:2050
ROUTER_TOOL::SettingsDialog
int SettingsDialog(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1508
ROUTER_TOOL::DpDimensionsDialog
int DpDimensionsDialog(const TOOL_EVENT &aEvent)
Definition:
router_tool.cpp:1488
ROUTER_TOOL::m_lastTargetLayer
int m_lastTargetLayer
Definition:
router_tool.h:96
ROUTER_TOOL::updateSizesAfterLayerSwitch
void updateSizesAfterLayerSwitch(PCB_LAYER_ID targetLayer, const VECTOR2I &aPos)
Definition:
router_tool.cpp:720
ROUTER_TOOL::SelectCopperLayerPair
int SelectCopperLayerPair(const TOOL_EVENT &aEvent)
Definition:
sel_layer.cpp:337
TOOL_BASE::RESET_REASON
RESET_REASON
Determine the reason of reset for a tool.
Definition:
tool_base.h:78
TOOL_EVENT
Generic, UI-independent tool event.
Definition:
tool_event.h:167
VECTOR2< int >
Reset
void Reset() override
PCB_LAYER_ID
PCB_LAYER_ID
A quick note on layer IDs:
Definition:
layer_ids.h:60
PNS::PNS_MODE
PNS_MODE
< Routing modes
Definition:
pns_routing_settings.h:40
PNS::DM_ANY
@ DM_ANY
Definition:
pns_router.h:77
pns_tool_base.h
src
pcbnew
router
router_tool.h
Generated on Sun Dec 3 2023 00:04:40 for KiCad PCB EDA Suite by
1.9.5