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, 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
virtual bool SetLayer(int aLayer)
Function SetLayer()
ITEM.
Definition: pns_item.h:53
NODE.
Definition: pns_node.h:145
virtual const ITEM_SET Traces()=0
Function Traces()
virtual void SetOrthoMode(bool aOrthoMode)
Function SetOrthoMode()
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()
virtual bool CommitPlacement()
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem)=0
Function Start()
virtual bool IsPlacingVia() const
Function IsPlacingVia()
virtual const std::vector< int > CurrentNets() const =0
Function CurrentNets()
virtual bool AbortPlacement()
virtual void GetModifiedNets(std::vector< int > &aNets) const
Function GetModifiedNets.
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem)=0
Function Move()
virtual bool HasPlacedAnything() const
virtual bool ToggleVia(bool aEnabled)
Function ToggleVia()
PLACEMENT_ALGO(ROUTER *aRouter)
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
Function FixRoute()
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
virtual bool UnfixRoute()
Push and Shove diff pair dimensions (gap) settings dialog.
virtual void FlipPosture()
Function FlipPosture()
virtual void UpdateSizes(const SIZES_SETTINGS &aSizes)
Function UpdateSizes()