KiCad PCB EDA Suite
pns_meander_placer.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_MEANDER_PLACER_H
23 #define __PNS_MEANDER_PLACER_H
24 
25 #include <math/vector2d.h>
26 
27 #include <geometry/shape.h>
29 
30 #include "pns_node.h"
31 #include "pns_via.h"
32 #include "pns_line.h"
33 #include "pns_placement_algo.h"
34 #include "pns_meander.h"
36 
37 namespace PNS {
38 
39 class ROUTER;
40 class SHOVE;
41 class OPTIMIZER;
42 
49 {
50 public:
51 
52  MEANDER_PLACER( ROUTER* aRouter );
53  virtual ~MEANDER_PLACER();
54 
56  virtual bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
57 
59  virtual bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
60 
62  virtual bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem ) override;
63 
65  NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
66 
68  const ITEM_SET Traces() override;
69 
71  const VECTOR2I& CurrentEnd() const override;
72 
74  const std::vector<int> CurrentNets() const override
75  {
76  return std::vector<int> (1, m_originLine.Net() );
77  }
78 
80  int CurrentLayer() const override;
81 
83  virtual const wxString TuningInfo() const override;
84 
86  virtual TUNING_STATUS TuningStatus() const override;
87 
89  bool CheckFit ( MEANDER_SHAPE* aShape ) override;
90 
91 protected:
92 
93  bool doMove( const VECTOR2I& aP, ITEM* aEndItem, int aTargetLength );
94 
95  void setWorld( NODE* aWorld );
96 
97  virtual int origPathLength() const;
98 
101 
104 
107 
111 
115 
118 };
119 
120 }
121 
122 #endif // __PNS_MEANDER_PLACER_H
Class ITEM.
Definition: pns_item.h:53
Class MEANDER_PLACER_BASE.
Class NODE.
Definition: pns_node.h:137
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Function Start()
Class MEANDER_SETTINGS.
Definition: pns_meander.h:104
TUNING_STATUS m_lastStatus
MEANDER_PLACER(ROUTER *aRouter)
virtual int origPathLength() const
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
TUNING_STATUS
Result of the length tuning operation
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Function CurrentNode()
const std::vector< int > CurrentNets() const override
Function CurrentNets()
virtual const wxString TuningInfo() const override
Function TuningInfo()
const ITEM_SET Traces() override
Function Traces()
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, int aTargetLength)
Class MEANDER_PLACER.
Class MEANDERED_LINE.
Definition: pns_meander.h:395
int CurrentLayer() const override
Function CurrentLayer()
VECTOR2I m_currentStart
current routing start point (end of tail, beginning of head)
NODE * m_world
pointer to world to search colliding items
void setWorld(NODE *aWorld)
bool CheckFit(MEANDER_SHAPE *aShape) override
Function CheckFit()
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem) override
Function FixRoute()
NODE * m_currentNode
Current world state
Class SHAPE_LINE_CHAIN.
int Net() const
Function Net()
Definition: pns_item.h:177
SHAPE_LINE_CHAIN m_finalShape
Push and Shove diff pair dimensions (gap) settings dialog.
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
virtual TUNING_STATUS TuningStatus() const override
Function TuningStatus()