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 
27 #include "time_limit.h"
28 
29 class DIRECTION_45;
30 class TOOL_SETTINGS;
31 
32 namespace PNS {
33 
36 {
41 };
42 
45 {
46  OE_LOW = 0,
47  OE_MEDIUM = 1,
48  OE_FULL = 2
49 };
50 
58 {
59 public:
61 
62  void Load( const TOOL_SETTINGS& where );
63  void Save( TOOL_SETTINGS& where ) const;
64 
66  PNS_MODE Mode() const { return m_routingMode; }
67 
69  void SetMode( PNS_MODE aMode ) { m_routingMode = aMode; }
70 
73 
76 
78  bool ShoveVias() const { return m_shoveVias; }
79 
81  void SetShoveVias( bool aShoveVias ) { m_shoveVias = aShoveVias; }
82 
84  bool RemoveLoops() const { return m_removeLoops; }
85 
87  void SetRemoveLoops( bool aRemoveLoops ) { m_removeLoops = aRemoveLoops; }
88 
90  bool SuggestFinish() { return m_suggestFinish; }
91 
93  void SetSuggestFinish( bool aSuggestFinish ) { m_suggestFinish = aSuggestFinish; }
94 
96  bool SmartPads() const { return m_smartPads; }
97 
99  void SetSmartPads( bool aSmartPads ) { m_smartPads = aSmartPads; }
100 
102  bool FollowMouse() const
103  {
104  return m_followMouse && !( Mode() == RM_MarkObstacles );
105  }
106 
109 
111  void SetSmoothDraggedSegments( bool aSmooth ) { m_smoothDraggedSegments = aSmooth; }
112 
114  bool JumpOverObstacles() const { return m_jumpOverObstacles; }
115 
117  void SetJumpOverObstacles( bool aJumpOverObstacles ) { m_jumpOverObstacles = aJumpOverObstacles; }
118 
119  void SetStartDiagonal( bool aStartDiagonal ) { m_startDiagonal = aStartDiagonal; }
120 
121  bool CanViolateDRC() const { return m_canViolateDRC; }
122  void SetCanViolateDRC( bool aViolate ) { m_canViolateDRC = aViolate; }
123 
124  bool GetFreeAngleMode() const { return m_freeAngleMode; }
125 
126  void SetFreeAngleMode( bool aEnable ) { m_freeAngleMode = aEnable; }
127 
128  const DIRECTION_45 InitialDirection() const;
129 
130  int ShoveIterationLimit() const;
131  TIME_LIMIT ShoveTimeLimit() const;
132 
135 
136  void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; }
137  bool InlineDragEnabled() const { return m_inlineDragEnabled; }
138 
139 private:
151 
154 
159 };
160 
161 }
162 
163 #endif
void SetOptimizerEffort(PNS_OPTIMIZATION_EFFORT aEffort)
Sets the optimizer effort. Bigger means cleaner traces, but slower routing.
TIME_LIMIT ShoveTimeLimit() const
PNS_MODE Mode() const
Returns the routing mode.
bool SmoothDraggedSegments() const
Returns true if smoothing segments durign dragging is enabled.
Class ROUTING_SETTINGS.
bool FollowMouse() const
Returns true if follow mouse mode is active (permanently on for the moment).
void SetMode(PNS_MODE aMode)
Sets the routing mode.
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const
Returns the optimizer effort. Bigger means cleaner traces, but slower routing.
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 (automatic neckdown).
Ignore collisions, mark obstacles
TIME_LIMIT WalkaroundTimeLimit() const
int WalkaroundIterationLimit() const
Class DIRECTION_45.
Definition: direction45.h:33
void SetShoveVias(bool aShoveVias)
Enables/disables shoving vias.
void Load(const TOOL_SETTINGS &where)
void SetStartDiagonal(bool aStartDiagonal)
void SetCanViolateDRC(bool aViolate)
bool ShoveVias() const
Returns true if shoving vias is enbled.
Only walkaround
const DIRECTION_45 InitialDirection() const
bool RemoveLoops() const
Returns true if loop (redundant track) removal is on.
bool JumpOverObstacles() const
Returns true if jumping over unmovable obstacles is on.
bool SuggestFinish()
Returns true if suggesting the finish of currently placed track is on.
bool SmartPads() const
Returns true if Smart Pads (automatic neckdown) is enabled.
PNS_OPTIMIZATION_EFFORT
Optimization effort
void Save(TOOL_SETTINGS &where) 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.