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 
60 {
61 public:
62  ROUTING_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
63 
65  PNS_MODE Mode() const { return m_routingMode; }
66 
68  void SetMode( PNS_MODE aMode ) { m_routingMode = aMode; }
69 
72 
75 
77  bool ShoveVias() const { return m_shoveVias; }
78 
80  void SetShoveVias( bool aShoveVias ) { m_shoveVias = aShoveVias; }
81 
83  bool RemoveLoops() const { return m_removeLoops; }
84 
86  void SetRemoveLoops( bool aRemoveLoops ) { m_removeLoops = aRemoveLoops; }
87 
89  bool SuggestFinish() { return m_suggestFinish; }
90 
92  void SetSuggestFinish( bool aSuggestFinish ) { m_suggestFinish = aSuggestFinish; }
93 
95  bool SmartPads() const { return m_smartPads; }
96 
98  void SetSmartPads( bool aSmartPads ) { m_smartPads = aSmartPads; }
99 
101  bool FollowMouse() const
102  {
103  return m_followMouse && !( Mode() == RM_MarkObstacles );
104  }
105 
108 
110  void SetSmoothDraggedSegments( bool aSmooth ) { m_smoothDraggedSegments = aSmooth; }
111 
113  bool JumpOverObstacles() const { return m_jumpOverObstacles; }
114 
116  void SetJumpOverObstacles( bool aJumpOverObstacles ) { m_jumpOverObstacles = aJumpOverObstacles; }
117 
118  void SetStartDiagonal( bool aStartDiagonal ) { m_startDiagonal = aStartDiagonal; }
119 
120  bool CanViolateDRC() const { return m_canViolateDRC; }
121  void SetCanViolateDRC( bool aViolate ) { m_canViolateDRC = aViolate; }
122 
123  bool GetFreeAngleMode() const { return m_freeAngleMode; }
124 
125  void SetFreeAngleMode( bool aEnable ) { m_freeAngleMode = aEnable; }
126 
127  const DIRECTION_45 InitialDirection() const;
128 
129  int ShoveIterationLimit() const;
130  TIME_LIMIT ShoveTimeLimit() const;
131 
134 
135  void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; }
136  bool InlineDragEnabled() const { return m_inlineDragEnabled; }
137 
138  void SetSnapToTracks( bool aSnap ) { m_snapToTracks = aSnap; }
139  void SetSnapToPads( bool aSnap ) { m_snapToPads = aSnap; }
140 
141  bool GetSnapToTracks() const { return m_snapToTracks; }
142  bool GetSnapToPads() const { return m_snapToPads; }
143 
144  bool GetRounded() const { return m_roundedCorners; }
145  void SetRounded( bool aRound ) { m_roundedCorners = aRound; }
146 
148  void SetOptimizeDraggedTrack( bool aEnable ) { m_optimizeDraggedTrack = aEnable; }
149 
150  void SetMinRadius( int aRadius )
151  {
152  m_minRadius = aRadius;
153 
154  if( m_maxRadius < m_minRadius )
156  }
157 
158  void SetMaxRadius( int aRadius )
159  {
160  m_maxRadius = aRadius;
161 
162  if( m_maxRadius < m_minRadius )
164  }
165 
166  int GetMinRadius() const { return m_minRadius; }
167  int GetMaxRadius() const { return m_maxRadius; }
168 
169 private:
185 
188 
191 
196 };
197 
198 }
199 
200 #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 SetRounded(bool aRound)
void SetMode(PNS_MODE aMode)
Sets the routing mode.
void SetMinRadius(int aRadius)
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 SetInlineDragEnabled(bool aEnable)
void SetSmartPads(bool aSmartPads)
Enables/disables Smart Pads (optimized connections).
Ignore collisions, mark obstacles
void SetOptimizeDraggedTrack(bool aEnable)
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 SetMaxRadius(int aRadius)
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)
Only walkaround
bool SuggestFinish()
Returns true if suggesting the finish of currently placed track is on.
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
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.
TIME_LIMIT ShoveTimeLimit() const
TIME_LIMIT WalkaroundTimeLimit() const