KiCad PCB EDA Suite
pns_drag_algo.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  * 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_DRAG_ALGO_H
23 #define __PNS_DRAG_ALGO_H
24 
25 #include <memory>
26 #include <math/vector2d.h>
27 
28 #include "pns_algo_base.h"
29 #include "pns_itemset.h"
30 #include "pns_layerset.h"
31 
32 
33 namespace PNS {
34 
35 class NODE;
36 
42 class DRAG_ALGO : public ALGO_BASE
43 {
44 public:
45  DRAG_ALGO( ROUTER* aRouter ) :
46  ALGO_BASE( aRouter ), m_world( nullptr )
47  {
48  }
49 
51  {
52  }
53 
59  virtual void SetWorld( NODE* aWorld )
60  {
61  m_world = aWorld;
62  }
63 
64 
71  virtual bool Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) = 0;
72 
79  virtual bool Drag( const VECTOR2I& aP ) = 0;
80 
88  virtual bool FixRoute() = 0;
89 
96  virtual NODE* CurrentNode() const = 0;
97 
103  virtual const ITEM_SET Traces() = 0;
104 
105  virtual void SetMode( int aDragMode ) {};
106 
107 protected:
108  NODE* m_world;
109 
110 };
111 
112 
113 } // namespace PNS
114 
115 #endif
NODE.
Definition: pns_node.h:145
DRAG_ALGO.
Definition: pns_drag_algo.h:42
ALGO_BASE.
Definition: pns_algo_base.h:39
DRAG_ALGO(ROUTER *aRouter)
Definition: pns_drag_algo.h:45
virtual NODE * CurrentNode() const =0
Function CurrentNode()
virtual bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives)=0
Function Start()
virtual bool FixRoute()=0
Function FixRoute()
virtual const ITEM_SET Traces()=0
Function Traces()
virtual bool Drag(const VECTOR2I &aP)=0
Function Drag()
virtual void SetMode(int aDragMode)
Push and Shove diff pair dimensions (gap) settings dialog.
virtual void SetWorld(NODE *aWorld)
Function SetWorld()
Definition: pns_drag_algo.h:59