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
36namespace PNS {
37
38class ROUTER;
39class SHOVE;
40class OPTIMIZER;
41
46{
47public:
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
97protected:
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:56
int Net() const
Definition: pns_item.h:152
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:61
Represent a set of meanders fitted over a single or two lines.
Definition: pns_meander.h:386
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
TUNING_STATUS
< Result of the length tuning operation
Single track length matching/meandering tool.
virtual const wxString TuningInfo(EDA_UNITS aUnits) const override
Return a string describing the status and length of the tuned traces.
virtual bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Function FixRoute()
TUNING_STATUS m_lastStatus
virtual bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
virtual long long int origPathLength() const
current routing start point (end of tail, beginning of head)
int CurrentLayer() const override
Function CurrentLayer()
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
bool AbortPlacement() override
bool HasPlacedAnything() const override
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Function CurrentNode()
LINKED_ITEM * m_initialSegment
SHAPE_LINE_CHAIN m_finalShape
const ITEM_SET Traces() override
Function Traces()
MEANDER_PLACER(ROUTER *aRouter)
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength)
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
VECTOR2I m_currentStart
Current world state.
virtual TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
virtual bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Function Start()
const std::vector< int > CurrentNets() const override
Function CurrentNets()
void setWorld(NODE *aWorld)
bool CommitPlacement() override
long long int m_lastLength
The geometry of a single meander.
Definition: pns_meander.h:111
Keep the router "world" - i.e.
Definition: pns_node.h:150
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
EDA_UNITS
Definition: eda_units.h:39
Push and Shove diff pair dimensions (gap) settings dialog.