KiCad PCB EDA Suite
pns_dragger.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_DRAGGER_H
23 #define __PNS_DRAGGER_H
24 
25 #include <math/vector2d.h>
26 
27 #include "pns_node.h"
28 #include "pns_via.h"
29 #include "pns_line.h"
30 #include "pns_algo_base.h"
31 #include "pns_itemset.h"
32 
33 namespace PNS {
34 
35 class ROUTER;
36 class SHOVE;
37 class OPTIMIZER;
38 
44 class DRAGGER : public ALGO_BASE
45 {
46 public:
47  DRAGGER( ROUTER* aRouter );
48  ~DRAGGER();
49 
55  void SetWorld( NODE* aWorld );
56 
63  bool Start( const VECTOR2I& aP, ITEM* aStartItem );
64 
71  bool Drag( const VECTOR2I& aP );
72 
80  bool FixRoute();
81 
88  NODE* CurrentNode() const;
89 
95  const ITEM_SET Traces();
96 
98  virtual LOGGER* Logger() override;
99 
100  void SetMode( int aDragMode );
101 
102 private:
103 
104 
105  bool dragMarkObstacles( const VECTOR2I& aP );
106  bool dragShove(const VECTOR2I& aP );
107  bool startDragSegment( const VECTOR2D& aP, SEGMENT* aSeg );
108  bool startDragVia( const VECTOR2D& aP, VIA* aVia );
109  void dumbDragVia( VIA* aVia, NODE* aNode, const VECTOR2I& aP );
110 
113  int m_mode;
125 };
126 
127 }
128 
129 #endif
Class ITEM.
Definition: pns_item.h:53
ITEM_SET m_draggedItems
Definition: pns_dragger.h:123
VIA * m_initialVia
Definition: pns_dragger.h:122
virtual LOGGER * Logger() override
Returns the logger object, allowing to dump geometry to a file.
Class NODE.
Definition: pns_node.h:137
NODE * m_world
Definition: pns_dragger.h:111
PNS_MODE
Routing modes
Class SHOVE.
Definition: pns_shove.h:46
DRAGGER(ROUTER *aRouter)
Definition: pns_dragger.cpp:28
Class ALGO_BASE.
Definition: pns_algo_base.h:39
bool m_dragStatus
Definition: pns_dragger.h:119
bool startDragSegment(const VECTOR2D &aP, SEGMENT *aSeg)
Definition: pns_dragger.cpp:57
LINE m_draggedLine
Definition: pns_dragger.h:114
LINE m_lastValidDraggedLine
Definition: pns_dragger.h:116
void dumbDragVia(VIA *aVia, NODE *aNode, const VECTOR2I &aP)
bool Drag(const VECTOR2I &aP)
Function Drag()
VIA * m_draggedVia
Definition: pns_dragger.h:115
void SetWorld(NODE *aWorld)
Function SetWorld()
Definition: pns_dragger.cpp:51
const ITEM_SET Traces()
Function Traces()
SHOVE * m_shove
Definition: pns_dragger.h:117
bool startDragVia(const VECTOR2D &aP, VIA *aVia)
Definition: pns_dragger.cpp:96
int m_draggedSegmentIndex
Definition: pns_dragger.h:118
bool FixRoute()
Function FixRoute()
Class DRAGGER.
Definition: pns_dragger.h:44
ITEM_SET m_origViaConnections
Definition: pns_dragger.h:121
bool Start(const VECTOR2I &aP, ITEM *aStartItem)
Function Start()
void SetMode(int aDragMode)
NODE * m_lastNode
Definition: pns_dragger.h:112
NODE * CurrentNode() const
Function CurrentNode()
bool dragShove(const VECTOR2I &aP)
PNS_MODE m_currentMode
Definition: pns_dragger.h:120
bool dragMarkObstacles(const VECTOR2I &aP)
bool m_freeAngleMode
Definition: pns_dragger.h:124
Push and Shove diff pair dimensions (gap) settings dialog.