KiCad PCB EDA Suite
pns_placement_algo.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 <[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_PLACEMENT_ALGO_H
23#define __PNS_PLACEMENT_ALGO_H
24
25#include <math/vector2d.h>
26
27#include "pns_algo_base.h"
28#include "pns_sizes_settings.h"
29#include "pns_itemset.h"
30
31namespace PNS {
32
33class ROUTER;
34class ITEM;
35class NODE;
36
46{
47public:
48 PLACEMENT_ALGO( ROUTER* aRouter ) :
49 ALGO_BASE( aRouter ) {};
50
51 virtual ~PLACEMENT_ALGO () {};
52
59 virtual bool Start( const VECTOR2I& aP, ITEM* aStartItem ) = 0;
60
68 virtual bool Move( const VECTOR2I& aP, ITEM* aEndItem ) = 0;
69
79 virtual bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) = 0;
80
81 virtual bool UnfixRoute() { return false; };
82
83 virtual bool CommitPlacement() { return false; };
84
85 virtual bool AbortPlacement() { return false; };
86
87 virtual bool HasPlacedAnything() const { return false; }
88
94 virtual bool ToggleVia( bool aEnabled )
95 {
96 return false;
97 }
98
104 virtual bool IsPlacingVia() const
105 {
106 return false;
107 }
108
114 virtual bool SetLayer( int aLayer )
115 {
116 return false;
117 }
118
124 virtual const ITEM_SET Traces() = 0;
125
132 virtual const VECTOR2I& CurrentEnd() const = 0;
133
139 virtual const std::vector<int> CurrentNets() const = 0;
140
146 virtual int CurrentLayer() const = 0;
147
153 virtual NODE* CurrentNode( bool aLoopsRemoved = false ) const = 0;
154
160 virtual void FlipPosture()
161 {
162 }
163
171 virtual void UpdateSizes( const SIZES_SETTINGS& aSizes )
172 {
173 }
174
182 virtual void SetOrthoMode ( bool aOrthoMode )
183 {
184 }
185
191 virtual void GetModifiedNets( std::vector<int> &aNets ) const
192 {
193 }
194
195
196};
197
198}
199
200#endif
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition: pns_algo_base.h:43
Base class for PNS router board items.
Definition: pns_item.h:56
Keep the router "world" - i.e.
Definition: pns_node.h:150
virtual NODE * CurrentNode(bool aLoopsRemoved=false) const =0
Function CurrentNode()
virtual bool IsPlacingVia() const
Function IsPlacingVia()
virtual bool UnfixRoute()
virtual bool CommitPlacement()
virtual const std::vector< int > CurrentNets() const =0
Function CurrentNets()
virtual void FlipPosture()
Function FlipPosture()
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
virtual const ITEM_SET Traces()=0
Function Traces()
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem)=0
Function Start()
virtual bool HasPlacedAnything() const
PLACEMENT_ALGO(ROUTER *aRouter)
virtual bool AbortPlacement()
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem)=0
Function Move()
virtual int CurrentLayer() const =0
Function CurrentLayer()
virtual void SetOrthoMode(bool aOrthoMode)
Function SetOrthoMode()
virtual void GetModifiedNets(std::vector< int > &aNets) const
Function GetModifiedNets.
virtual bool ToggleVia(bool aEnabled)
Function ToggleVia()
virtual bool SetLayer(int aLayer)
Function SetLayer()
virtual void UpdateSizes(const SIZES_SETTINGS &aSizes)
Function UpdateSizes()
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
Function FixRoute()
Push and Shove diff pair dimensions (gap) settings dialog.