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 <[email protected]>
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
33namespace PNS {
34
35class NODE;
36
42class DRAG_ALGO : public ALGO_BASE
43{
44public:
45 DRAG_ALGO( ROUTER* aRouter ) :
46 ALGO_BASE( aRouter ),
47 m_world( nullptr )
48 {
49 }
50
52 {
53 }
54
60 virtual void SetWorld( NODE* aWorld )
61 {
62 m_world = aWorld;
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
95 virtual NODE* CurrentNode() const = 0;
96
102 virtual const std::vector<int> CurrentNets() const = 0;
103
109 virtual int CurrentLayer() const = 0;
110
116 virtual const ITEM_SET Traces() = 0;
117
118 virtual void SetMode( int aDragMode ) {};
119
120protected:
122
123};
124
125
126} // namespace PNS
127
128#endif
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition: pns_algo_base.h:43
DRAG_ALGO.
Definition: pns_drag_algo.h:43
virtual bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives)=0
Function Start()
virtual const std::vector< int > CurrentNets() const =0
Function CurrentNets()
virtual bool Drag(const VECTOR2I &aP)=0
Function Drag()
virtual void SetMode(int aDragMode)
virtual const ITEM_SET Traces()=0
Function Traces()
DRAG_ALGO(ROUTER *aRouter)
Definition: pns_drag_algo.h:45
virtual void SetWorld(NODE *aWorld)
Function SetWorld()
Definition: pns_drag_algo.h:60
virtual int CurrentLayer() const =0
Function CurrentLayer()
virtual bool FixRoute()=0
Function FixRoute()
virtual NODE * CurrentNode() const =0
Function CurrentNode()
Keep the router "world" - i.e.
Definition: pns_node.h:150
Push and Shove diff pair dimensions (gap) settings dialog.