KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2024 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_router.h"
29#include "pns_algo_base.h"
30#include "pns_itemset.h"
31#include "pns_layerset.h"
32
33
34namespace PNS {
35
36class NODE;
37
43class DRAG_ALGO : public ALGO_BASE
44{
45public:
46 DRAG_ALGO( ROUTER* aRouter ) :
47 ALGO_BASE( aRouter ),
48 m_world( nullptr )
49 {
50 }
51
53 {
54 }
55
61 virtual void SetWorld( NODE* aWorld )
62 {
63 m_world = aWorld;
64 }
65
72 virtual bool Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) = 0;
73
80 virtual bool Drag( const VECTOR2I& aP ) = 0;
81
89 virtual bool FixRoute( bool aForceCommit ) = 0;
90
96 virtual NODE* CurrentNode() const = 0;
97
103 virtual const std::vector<NET_HANDLE> CurrentNets() const = 0;
104
110 virtual int CurrentLayer() const = 0;
111
117 virtual const ITEM_SET Traces() = 0;
118
119 virtual void SetMode( PNS::DRAG_MODE aDragMode ){};
120
121 virtual PNS::DRAG_MODE Mode() const = 0;
122
123 virtual bool GetForceMarkObstaclesMode( bool* aDragStatus ) const = 0;
124
125protected:
127
128};
129
130
131} // namespace PNS
132
133#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:44
virtual bool GetForceMarkObstaclesMode(bool *aDragStatus) const =0
virtual void SetMode(PNS::DRAG_MODE aDragMode)
virtual bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives)=0
Function Start()
virtual bool FixRoute(bool aForceCommit)=0
Function FixRoute()
virtual bool Drag(const VECTOR2I &aP)=0
Function Drag()
virtual const ITEM_SET Traces()=0
Function Traces()
DRAG_ALGO(ROUTER *aRouter)
Definition: pns_drag_algo.h:46
virtual void SetWorld(NODE *aWorld)
Function SetWorld()
Definition: pns_drag_algo.h:61
virtual const std::vector< NET_HANDLE > CurrentNets() const =0
Function CurrentNets()
virtual PNS::DRAG_MODE Mode() const =0
virtual int CurrentLayer() const =0
Function CurrentLayer()
virtual NODE * CurrentNode() const =0
Function CurrentNode()
Keep the router "world" - i.e.
Definition: pns_node.h:207
Push and Shove diff pair dimensions (gap) settings dialog.
DRAG_MODE
Definition: pns_router.h:71