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 The 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
20 * along with this program. If not, see <https://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
45
53
57
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
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
155 bool GetRestrictAngles() const { return m_restrictAngles; }
156 void SetRestrictAngles( bool aEnable ) { m_restrictAngles = aEnable; }
157
159
162
166
169
170private:
188
190
193
201
204};
205
206}
207
208#endif
Represent route directions & corner angles in a 45-degree metric.
Definition direction45.h:37
CORNER_MODE
Corner modes.
Definition direction45.h:67
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
NESTED_SETTINGS(const std::string &aName, int aSchemaVersion, JSON_SETTINGS *aParent, const std::string &aPath, bool aLoadFromFile=true)
bool GetOptimizeEntireDraggedTrack() const
const DIRECTION_45 InitialDirection() const
bool RemoveLoops() const
Return true if loop (redundant track) removal is on.
void SetCornerMode(DIRECTION_45::CORNER_MODE aMode)
double DiffPairWidthToMiterRatio() const
void SetShoveVias(bool aShoveVias)
Enable/disable shoving vias.
TIME_LIMIT ShoveTimeLimit() const
bool SmoothDraggedSegments() const
Return true if smoothing segments during dragging is enabled.
void SetAutoPosture(bool aEnable)
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
bool FollowMouse() const
Return true if follow mouse mode is active (permanently on for the moment).
void SetSmoothDraggedSegments(bool aSmooth)
Enable/disable smoothing segments during dragging.
void SetOptimizeEntireDraggedTrack(bool aEnable)
bool ShoveVias() const
Return true if shoving vias is enabled.
void SetKeepDPCouplingWhenDragging(bool aSet)
DIRECTION_45::CORNER_MODE m_cornerMode
void SetRestrictAngles(bool aEnable)
void SetSnapToTracks(bool aSnap)
bool SmartPads() const
Return true if Smart Pads (optimized connections) is enabled.
void SetSuggestFinish(bool aSuggestFinish)
Enable displaying suggestions for finishing the currently placed track.
bool SuggestFinish()
Return true if suggesting the finish of currently placed track is on.
double DiffPairGapCouplingRecognitionThreshold() const
double WalkaroundHugLengthThreshold() const
void SetMode(PNS_MODE aMode)
Set the routing mode.
void SetAllowDRCViolations(bool aViolate)
void SetJumpOverObstacles(bool aJump)
TIME_LIMIT WalkaroundTimeLimit() const
bool GetKeepDPCouplingWhenDragging() const
double DiffPairGapPickupRatioThreshold() const
bool JumpOverObstacles() const
Return true if jumping over unmovable obstacles is on.
void SetViaForcePropIterationLimit(int aLimit)
void SetStartDiagonal(bool aStartDiagonal)
void SetFreeAngleMode(bool aEnable)
ROUTING_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
bool GetAllowDRCViolationsSetting() const
PNS_MODE Mode() const
Return the routing mode.
void SetSmartPads(bool aSmartPads)
Enable/disable Smart Pads (optimized connections).
void SetOptimizerEffort(PNS_OPTIMIZATION_EFFORT aEffort)
Set the optimizer effort. Bigger means cleaner traces, but slower routing.
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
DIRECTION_45::CORNER_MODE GetCornerMode() const
void SetFixAllSegments(bool aEnable)
void SetRemoveLoops(bool aRemoveLoops)
Enable/disable loop (redundant track) removal.
Push and Shove diff pair dimensions (gap) settings dialog.
PNS_OPTIMIZATION_EFFORT
Optimization effort.
PNS_MODE
Routing modes.
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ RM_Shove
Only shove.