KiCad PCB EDA Suite
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 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __PNS_ROUTING_SETTINGS
23 #define __PNS_ROUTING_SETTINGS
24 
25 #include <cstdio>
26 
28 
29 #include "time_limit.h"
30 
31 class DIRECTION_45;
32 class TOOL_SETTINGS;
33 
34 namespace PNS {
35 
38 {
43 };
44 
47 {
48  OE_LOW = 0,
49  OE_MEDIUM = 1,
50  OE_FULL = 2
51 };
52 
54 enum class CORNER_MODE
55 {
56  MITERED_90,
57  MITERED_45,
58  ROUNDED_90,
59  ROUNDED_45
60 };
61 
69 {
70 public:
71  ROUTING_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
72 
74  PNS_MODE Mode() const { return m_routingMode; }
75 
77  void SetMode( PNS_MODE aMode ) { m_routingMode = aMode; }
78 
81 
84 
86  bool ShoveVias() const { return m_shoveVias; }
87 
89  void SetShoveVias( bool aShoveVias ) { m_shoveVias = aShoveVias; }
90 
92  bool RemoveLoops() const { return m_removeLoops; }
93 
95  void SetRemoveLoops( bool aRemoveLoops ) { m_removeLoops = aRemoveLoops; }
96 
98  bool SuggestFinish() { return m_suggestFinish; }
99 
101  void SetSuggestFinish( bool aSuggestFinish ) { m_suggestFinish = aSuggestFinish; }
102 
104  bool SmartPads() const { return m_smartPads; }
105 
107  void SetSmartPads( bool aSmartPads ) { m_smartPads = aSmartPads; }
108 
110  bool FollowMouse() const
111  {
112  return m_followMouse && !( Mode() == RM_MarkObstacles );
113  }
114 
117 
119  void SetSmoothDraggedSegments( bool aSmooth ) { m_smoothDraggedSegments = aSmooth; }
120 
122  bool JumpOverObstacles() const { return m_jumpOverObstacles; }
123 
125  void SetJumpOverObstacles( bool aJumpOverObstacles ) { m_jumpOverObstacles = aJumpOverObstacles; }
126 
127  void SetStartDiagonal( bool aStartDiagonal ) { m_startDiagonal = aStartDiagonal; }
128 
129  bool CanViolateDRC() const { return m_canViolateDRC; }
130  void SetCanViolateDRC( bool aViolate ) { m_canViolateDRC = aViolate; }
131 
132  bool GetFreeAngleMode() const { return m_freeAngleMode; }
133 
134  void SetFreeAngleMode( bool aEnable ) { m_freeAngleMode = aEnable; }
135 
136  const DIRECTION_45 InitialDirection() const;
137 
138  int ShoveIterationLimit() const;
139  TIME_LIMIT ShoveTimeLimit() const;
140 
143 
144  void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; }
145  bool InlineDragEnabled() const { return m_inlineDragEnabled; }
146 
147  void SetSnapToTracks( bool aSnap ) { m_snapToTracks = aSnap; }
148  void SetSnapToPads( bool aSnap ) { m_snapToPads = aSnap; }
149 
150  bool GetSnapToTracks() const { return m_snapToTracks; }
151  bool GetSnapToPads() const { return m_snapToPads; }
152 
154  void SetCornerMode( CORNER_MODE aMode ) { m_cornerMode = aMode; }
155 
157  void SetOptimizeDraggedTrack( bool aEnable ) { m_optimizeDraggedTrack = aEnable; }
158 
159  bool GetAutoPosture() const { return m_autoPosture; }
160  void SetAutoPosture( bool aEnable ) { m_autoPosture = aEnable; }
161 
162  bool GetFixAllSegments() const { return m_fixAllSegments; }
163  void SetFixAllSegments( bool aEnable ) { m_fixAllSegments = aEnable; }
164 
165 private:
182 
184 
187 
192 };
193 
194 }
195 
196 #endif
void SetOptimizerEffort(PNS_OPTIMIZATION_EFFORT aEffort)
Sets the optimizer effort. Bigger means cleaner traces, but slower routing.
bool SmartPads() const
Returns true if Smart Pads (optimized connections) is enabled.
void SetMode(PNS_MODE aMode)
Sets the routing mode.
const DIRECTION_45 InitialDirection() const
void SetFreeAngleMode(bool aEnable)
PNS_MODE
Routing modes
void SetSuggestFinish(bool aSuggestFinish)
Enables displaying suggestions for finishing the currently placed track.
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
void SetRemoveLoops(bool aRemoveLoops)
Enables/disables loop (redundant track) removal.
void SetCornerMode(CORNER_MODE aMode)
void SetInlineDragEnabled(bool aEnable)
void SetSmartPads(bool aSmartPads)
Enables/disables Smart Pads (optimized connections).
H/V/45 with filleted corners.
Ignore collisions, mark obstacles
void SetOptimizeDraggedTrack(bool aEnable)
CORNER_MODE
What kind of corners to create in the line placers
bool RemoveLoops() const
Returns true if loop (redundant track) removal is on.
bool FollowMouse() const
Returns true if follow mouse mode is active (permanently on for the moment).
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
void SetAutoPosture(bool aEnable)
DIRECTION_45.
Definition: direction45.h:37
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const
Returns the optimizer effort. Bigger means cleaner traces, but slower routing.
void SetShoveVias(bool aShoveVias)
Enables/disables shoving vias.
bool SmoothDraggedSegments() const
Returns true if smoothing segments durign dragging is enabled.
PNS_MODE Mode() const
Returns the routing mode.
void SetSnapToPads(bool aSnap)
void SetStartDiagonal(bool aStartDiagonal)
void SetCanViolateDRC(bool aViolate)
void SetSnapToTracks(bool aSnap)
H/V with filleted corners (not yet implemented)
Only walkaround
H/V only (90-degree corners) (not yet implemented)
bool SuggestFinish()
Returns true if suggesting the finish of currently placed track is on.
CORNER_MODE GetCornerMode() const
bool JumpOverObstacles() const
Returns true if jumping over unmovable obstacles is on.
PNS_OPTIMIZATION_EFFORT
Optimization effort
ROUTING_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
bool ShoveVias() const
Returns true if shoving vias is enbled.
bool GetOptimizeDraggedTrack() const
H/V/45 with mitered corners (default)
void SetSmoothDraggedSegments(bool aSmooth)
Enables/disabled smoothing segments during dragging.
void SetJumpOverObstacles(bool aJumpOverObstacles)
Enables/disables jumping over unmovable obstacles.
Push and Shove diff pair dimensions (gap) settings dialog.
void SetFixAllSegments(bool aEnable)
TIME_LIMIT ShoveTimeLimit() const
TIME_LIMIT WalkaroundTimeLimit() const