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-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * @author Tomasz Wlostowski <[email protected]>
8  *
9  * This program is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the
11  * Free Software Foundation, either version 3 of the License, or (at your
12  * option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef __PNS_MEANDER_PLACER_H
24 #define __PNS_MEANDER_PLACER_H
25 
26 #include <math/vector2d.h>
27 
29 
30 #include "pns_node.h"
31 #include "pns_line.h"
32 #include "pns_placement_algo.h"
33 #include "pns_meander.h"
35 
36 namespace PNS {
37 
38 class ROUTER;
39 class SHOVE;
40 class OPTIMIZER;
41 
46 {
47 public:
48 
49  MEANDER_PLACER( ROUTER* aRouter );
50  virtual ~MEANDER_PLACER();
51 
53  virtual bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
54 
56  virtual bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
57 
59  virtual bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
60 
62  bool CommitPlacement() override;
63 
65  bool AbortPlacement() override;
66 
68  bool HasPlacedAnything() const override;
69 
71  NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
72 
74  const ITEM_SET Traces() override;
75 
77  const VECTOR2I& CurrentEnd() const override;
78 
80  const std::vector<int> CurrentNets() const override
81  {
82  return std::vector<int> (1, m_originLine.Net() );
83  }
84 
86  int CurrentLayer() const override;
87 
89  virtual const wxString TuningInfo( EDA_UNITS aUnits ) const override;
90 
92  virtual TUNING_STATUS TuningStatus() const override;
93 
95  bool CheckFit ( MEANDER_SHAPE* aShape ) override;
96 
97 protected:
98  bool doMove( const VECTOR2I& aP, ITEM* aEndItem, long long int aTargetLength );
99 
100  void setWorld( NODE* aWorld );
101 
102  virtual long long int origPathLength() const;
103 
106 
109 
113 
117 
118  long long int m_lastLength;
120 };
121 
122 }
123 
124 #endif // __PNS_MEANDER_PLACER_H
Base class for PNS router board items.
Definition: pns_item.h:55
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Function FixRoute()
Keep the router "world" - i.e.
Definition: pns_node.h:146
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Function Start()
The geometry of a single meander.
Definition: pns_meander.h:110
TUNING_STATUS m_lastStatus
MEANDER_PLACER(ROUTER *aRouter)
long long int m_lastLength
LINKED_ITEM * m_initialSegment
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:60
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()
int Net() const
Definition: pns_item.h:152
const ITEM_SET Traces() override
Function Traces()
bool AbortPlacement() override
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength)
bool CommitPlacement() override
Single track length matching/meandering tool.
bool HasPlacedAnything() const override
Represent a set of meanders fitted over a single or two lines.
Definition: pns_meander.h:385
int CurrentLayer() const override
Function CurrentLayer()
EDA_UNITS
Definition: eda_units.h:38
VECTOR2I m_currentStart
Current world state.
void setWorld(NODE *aWorld)
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
SHAPE_LINE_CHAIN m_finalShape
Push and Shove diff pair dimensions (gap) settings dialog.
virtual long long int origPathLength() const
current routing start point (end of tail, beginning of head)
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
virtual TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
virtual const wxString TuningInfo(EDA_UNITS aUnits) const override
Return a string describing the status and length of the tuned traces.