KiCad PCB EDA Suite
pns_mouse_trail_tracer.h
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2020 CERN
5  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __PNS_MOUSE_TRAIL_TRACER_H
22 #define __PNS_MOUSE_TRAIL_TRACER_H
23 
24 #include <math/vector2d.h>
25 
26 #include <geometry/direction45.h>
28 
29 namespace PNS {
30 
32 {
33 public:
36 
37  void Clear();
38 
39  void AddTrailPoint( const VECTOR2I& aP );
40 
41  void SetTolerance( int toll ) { m_tolerance = toll; }
42 
43  void SetDefaultDirections( DIRECTION_45 aInitDirection, DIRECTION_45 aLastSegDir )
44  {
45  m_direction = aInitDirection;
46  m_lastSegDirection = aLastSegDir;
47  }
48 
49  DIRECTION_45 GetPosture( const VECTOR2I& aP );
50 
51  void FlipPosture();
52 
57  void SetMouseDisabled( bool aDisabled = true ) { m_disableMouse = aDisabled; }
58 
59  bool IsManuallyForced() const { return m_manuallyForced; }
60 
62 private:
67  bool m_forced;
70 };
71 
72 } // namespace PNS
73 
74 #endif
Represent route directions & corner angles in a 45-degree metric.
Definition: direction45.h:36
void AddTrailPoint(const VECTOR2I &aP)
Represent a polyline (an zero-thickness chain of connected line segments).
void SetDefaultDirections(DIRECTION_45 aInitDirection, DIRECTION_45 aLastSegDir)
DIRECTION_45 GetPosture(const VECTOR2I &aP)
void SetMouseDisabled(bool aDisabled=true)
Disables the mouse-trail portion of the posture solver; leaving only the manual posture switch and th...
Push and Shove diff pair dimensions (gap) settings dialog.