Horizon
pns_placement_algo.h
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 
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
PNS::PLACEMENT_ALGO::Start
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem)=0
Function Start()
PNS::PLACEMENT_ALGO::Move
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem)=0
Function Move()
PNS::PLACEMENT_ALGO::CurrentNode
virtual NODE * CurrentNode(bool aLoopsRemoved=false) const =0
Function CurrentNode()
PNS::PLACEMENT_ALGO::CurrentEnd
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
PNS::SIZES_SETTINGS
Definition: pns_sizes_settings.h:37
PNS::PLACEMENT_ALGO::UpdateSizes
virtual void UpdateSizes(const SIZES_SETTINGS &aSizes)
Function UpdateSizes()
Definition: pns_placement_algo.h:163
PNS::PLACEMENT_ALGO::SetLayer
virtual bool SetLayer(int aLayer)
Function SetLayer()
Definition: pns_placement_algo.h:106
VECTOR2< int >
PNS::PLACEMENT_ALGO::FlipPosture
virtual void FlipPosture()
Function FlipPosture()
Definition: pns_placement_algo.h:152
PNS::PLACEMENT_ALGO::FixRoute
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
Function FixRoute()
PNS::PLACEMENT_ALGO::Traces
virtual const ITEM_SET Traces()=0
Function Traces()
PNS::PLACEMENT_ALGO::CurrentNets
virtual const std::vector< int > CurrentNets() const =0
Function CurrentNets()
PNS::PLACEMENT_ALGO::SetOrthoMode
virtual void SetOrthoMode(bool aOrthoMode)
Function SetOrthoMode()
Definition: pns_placement_algo.h:174
PNS::PLACEMENT_ALGO::GetModifiedNets
virtual void GetModifiedNets(std::vector< int > &aNets) const
Function GetModifiedNets.
Definition: pns_placement_algo.h:183
PNS::ITEM_SET
Definition: pns_itemset.h:40
PNS::ITEM
Class ITEM.
Definition: pns_item.h:55
PNS::PLACEMENT_ALGO::ToggleVia
virtual bool ToggleVia(bool aEnabled)
Function ToggleVia()
Definition: pns_placement_algo.h:86
PNS::NODE
Class NODE.
Definition: pns_node.h:138
PNS::PLACEMENT_ALGO::CurrentLayer
virtual int CurrentLayer() const =0
Function CurrentLayer()
PNS::PLACEMENT_ALGO::IsPlacingVia
virtual bool IsPlacingVia() const
Function IsPlacingVia()
Definition: pns_placement_algo.h:96