KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 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 ITEM_SET TunedPath() override;
78
80 const VECTOR2I& CurrentStart() const override;
81
83 const VECTOR2I& CurrentEnd() const override;
84
86 const std::vector<NET_HANDLE> CurrentNets() const override
87 {
88 return std::vector<NET_HANDLE> (1, m_originLine.Net() );
89 }
90
92 int CurrentLayer() const override;
93
95 long long int TuningResult() const override;
96
98 TUNING_STATUS TuningStatus() const override;
99
101 bool CheckFit ( MEANDER_SHAPE* aShape ) override;
102
103protected:
104 bool doMove( const VECTOR2I& aP, ITEM* aEndItem, long long int aTargetLength,
105 long long int aTargetMin, long long int aTargetMax );
106
107 virtual long long int origPathLength() const;
108
111
114
118
122
125
126 long long int m_lastLength;
128};
129
130}
131
132#endif // __PNS_MEANDER_PLACER_H
Base class for PNS router board items.
Definition: pns_item.h:97
virtual NET_HANDLE Net() const
Definition: pns_item.h:197
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:62
Represent a set of meanders fitted over a single or two lines.
Definition: pns_meander.h:425
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 bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Function FixRoute()
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength, long long int aTargetMin, long long int aTargetMax)
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()
const VECTOR2I & CurrentStart() const override
Function CurrentStart()
bool AbortPlacement() override
bool HasPlacedAnything() const override
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Function CurrentNode()
LINKED_ITEM * m_initialSegment
Total length added by pad to die size.
const std::vector< NET_HANDLE > CurrentNets() const override
Function CurrentNets()
SHAPE_LINE_CHAIN m_finalShape
const ITEM_SET TunedPath() override
const ITEM_SET Traces() override
Function Traces()
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
VECTOR2I m_currentStart
Current world state.
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()
long long int TuningResult() const override
Return the resultant length or skew of the tuned traces.
bool CommitPlacement() override
long long int m_lastLength
The geometry of a single meander.
Definition: pns_meander.h:128
Keep the router "world" - i.e.
Definition: pns_node.h:231
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Push and Shove diff pair dimensions (gap) settings dialog.