KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_routing_settings.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[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 __PNS_ROUTING_SETTINGS
24#define __PNS_ROUTING_SETTINGS
25
26#include <cstdio>
27
30
31#include "time_limit.h"
32
33class DIRECTION_45;
34class TOOL_SETTINGS;
35
36namespace PNS {
37
40{
44};
45
48{
49 OE_LOW = 0,
51 OE_FULL = 2
52};
53
59{
60public:
61 ROUTING_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
62
64 PNS_MODE Mode() const { return m_routingMode; }
65
67 void SetMode( PNS_MODE aMode ) { m_routingMode = aMode; }
68
71
74
76 bool ShoveVias() const { return m_shoveVias; }
77
79 void SetShoveVias( bool aShoveVias ) { m_shoveVias = aShoveVias; }
80
82 bool RemoveLoops() const { return m_removeLoops; }
83
85 void SetRemoveLoops( bool aRemoveLoops ) { m_removeLoops = aRemoveLoops; }
86
88 bool SuggestFinish() { return m_suggestFinish; }
89
91 void SetSuggestFinish( bool aSuggestFinish ) { m_suggestFinish = aSuggestFinish; }
92
94 bool SmartPads() const { return m_smartPads; }
95
97 void SetSmartPads( bool aSmartPads ) { m_smartPads = aSmartPads; }
98
100 bool FollowMouse() const
101 {
102 return m_followMouse && !( Mode() == RM_MarkObstacles );
103 }
104
107
109 void SetSmoothDraggedSegments( bool aSmooth ) { m_smoothDraggedSegments = aSmooth; }
110
112 bool JumpOverObstacles() const { return m_jumpOverObstacles; }
113 void SetJumpOverObstacles( bool aJump ) { m_jumpOverObstacles = aJump; }
114
115 void SetStartDiagonal( bool aStartDiagonal ) { m_startDiagonal = aStartDiagonal; }
116
118 {
120 }
121
123 void SetAllowDRCViolations( bool aViolate ) { m_allowDRCViolations = aViolate; }
124
125 bool GetFreeAngleMode() const { return m_freeAngleMode; }
126
127 void SetFreeAngleMode( bool aEnable ) { m_freeAngleMode = aEnable; }
128
129 const DIRECTION_45 InitialDirection() const;
130
131 int ShoveIterationLimit() const;
133
136
137 void SetSnapToTracks( bool aSnap ) { m_snapToTracks = aSnap; }
138 void SetSnapToPads( bool aSnap ) { m_snapToPads = aSnap; }
139
140 bool GetSnapToTracks() const { return m_snapToTracks; }
141 bool GetSnapToPads() const { return m_snapToPads; }
142
145
148
149 bool GetAutoPosture() const { return m_autoPosture; }
150 void SetAutoPosture( bool aEnable ) { m_autoPosture = aEnable; }
151
152 bool GetFixAllSegments() const { return m_fixAllSegments; }
153 void SetFixAllSegments( bool aEnable ) { m_fixAllSegments = aEnable; }
154
156
159
160private:
176
178
181
186
189};
190
191}
192
193#endif
Represent route directions & corner angles in a 45-degree metric.
Definition: direction45.h:37
CORNER_MODE
Corner modes.
Definition: direction45.h:67
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
Contain all persistent settings of the router, such as the mode, optimization effort,...
bool GetOptimizeEntireDraggedTrack() const
const DIRECTION_45 InitialDirection() const
bool RemoveLoops() const
Enable/disable loop (redundant track) removal.
void SetCornerMode(DIRECTION_45::CORNER_MODE aMode)
void SetShoveVias(bool aShoveVias)
Return true if loop (redundant track) removal is on.
int ViaForcePropIterationLimit() const
TIME_LIMIT ShoveTimeLimit() const
bool SmoothDraggedSegments() const
Enable/disable smoothing segments during dragging.
void SetAutoPosture(bool aEnable)
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const
Set the optimizer effort. Bigger means cleaner traces, but slower routing.
bool FollowMouse() const
Return true if smoothing segments during dragging is enabled.
void SetSmoothDraggedSegments(bool aSmooth)
Return true if jumping over unmovable obstacles is on.
void SetOptimizeEntireDraggedTrack(bool aEnable)
bool ShoveVias() const
Enable/disable shoving vias.
DIRECTION_45::CORNER_MODE m_cornerMode
void SetSnapToTracks(bool aSnap)
bool SmartPads() const
Enable/disable Smart Pads (optimized connections).
void SetSuggestFinish(bool aSuggestFinish)
Return true if Smart Pads (optimized connections) is enabled.
bool SuggestFinish()
Enable displaying suggestions for finishing the currently placed track.
double WalkaroundHugLengthThreshold() const
void SetMode(PNS_MODE aMode)
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
void SetAllowDRCViolations(bool aViolate)
void SetJumpOverObstacles(bool aJump)
TIME_LIMIT WalkaroundTimeLimit() const
void SetSnapToPads(bool aSnap)
void SetViaForcePropIterationLimit(int aLimit)
void SetStartDiagonal(bool aStartDiagonal)
void SetFreeAngleMode(bool aEnable)
bool GetAllowDRCViolationsSetting() const
PNS_MODE Mode() const
Set the routing mode.
void SetSmartPads(bool aSmartPads)
Return true if follow mouse mode is active (permanently on for the moment).
void SetOptimizerEffort(PNS_OPTIMIZATION_EFFORT aEffort)
Return true if shoving vias is enabled.
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
DIRECTION_45::CORNER_MODE GetCornerMode() const
void SetFixAllSegments(bool aEnable)
void SetRemoveLoops(bool aRemoveLoops)
Return true if suggesting the finish of currently placed track is on.
Push and Shove diff pair dimensions (gap) settings dialog.
PNS_MODE
< Routing modes
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ RM_Shove
Only shove.