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 <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_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 
31 namespace PNS {
32 
33 class ROUTER;
34 class ITEM;
35 class NODE;
36 
45 class PLACEMENT_ALGO : public ALGO_BASE
46 {
47 public:
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 ) = 0;
80 
86  virtual bool ToggleVia( bool aEnabled )
87  {
88  return false;
89  }
90 
96  virtual bool IsPlacingVia() const
97  {
98  return false;
99  }
100 
106  virtual bool SetLayer( int aLayer )
107  {
108  return false;
109  }
110 
116  virtual const ITEM_SET Traces() = 0;
117 
124  virtual const VECTOR2I& CurrentEnd() const = 0;
125 
131  virtual const std::vector<int> CurrentNets() const = 0;
132 
138  virtual int CurrentLayer() const = 0;
139 
145  virtual NODE* CurrentNode( bool aLoopsRemoved = false ) const = 0;
146 
152  virtual void FlipPosture()
153  {
154  }
155 
163  virtual void UpdateSizes( const SIZES_SETTINGS& aSizes )
164  {
165  }
166 
174  virtual void SetOrthoMode ( bool aOrthoMode )
175  {
176  }
177 
183  virtual void GetModifiedNets( std::vector<int> &aNets ) const
184  {
185  }
186 };
187 
188 }
189 
190 #endif
virtual bool SetLayer(int aLayer)
Function SetLayer()
Class ITEM.
Definition: pns_item.h:53
Class NODE.
Definition: pns_node.h:137
virtual const ITEM_SET Traces()=0
Function Traces()
virtual bool IsPlacingVia() const
Function IsPlacingVia()
virtual void SetOrthoMode(bool aOrthoMode)
Function SetOrthoMode()
Class ALGO_BASE.
Definition: pns_algo_base.h:39
virtual int CurrentLayer() const =0
Function CurrentLayer()
virtual NODE * CurrentNode(bool aLoopsRemoved=false) const =0
Function CurrentNode()
Class PLACEMENT_ALGO.
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem)=0
Function FixRoute()
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem)=0
Function Start()
virtual const std::vector< int > CurrentNets() const =0
Function CurrentNets()
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem)=0
Function Move()
virtual bool ToggleVia(bool aEnabled)
Function ToggleVia()
PLACEMENT_ALGO(ROUTER *aRouter)
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
Push and Shove diff pair dimensions (gap) settings dialog.
virtual void FlipPosture()
Function FlipPosture()
virtual void UpdateSizes(const SIZES_SETTINGS &aSizes)
Function UpdateSizes()
virtual void GetModifiedNets(std::vector< int > &aNets) const
Function GetModifiedNets.