KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_dp_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_DP_MEANDER_PLACER_H
24#define __PNS_DP_MEANDER_PLACER_H
25
26#include <math/vector2d.h>
27
28#include <geometry/shape.h>
30
31#include "pns_node.h"
32#include "pns_via.h"
33#include "pns_line.h"
34#include "pns_placement_algo.h"
35#include "pns_meander.h"
37#include "pns_diff_pair.h"
38#include "pns_debug_decorator.h"
39
40namespace PNS {
41
42class ROUTER;
43
49{
50public:
51 DP_MEANDER_PLACER( ROUTER* aRouter );
53
58 bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
59
64 bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
65
74 bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
75
77 bool CommitPlacement() override;
78
80 bool AbortPlacement() override;
81
83 bool HasPlacedAnything() const override;
84
85 const LINE Trace() const;
86
87 const DIFF_PAIR& GetOriginPair();
88
92 NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
93
94 const ITEM_SET Traces() override;
95
96 const ITEM_SET TunedPath() override;
97
99 const VECTOR2I& CurrentStart() const override;
100
102 const VECTOR2I& CurrentEnd() const override;
103
105 const std::vector<NET_HANDLE> CurrentNets() const override;
106
107 int CurrentLayer() const override;
108
109 long long int totalLength();
110
111 long long int TuningResult() const override;
112 TUNING_STATUS TuningStatus() const override;
113
114 bool CheckFit( MEANDER_SHAPE* aShape ) override;
115
116
117private:
118 friend class MEANDER_SHAPE;
119
120 void meanderSegment( const SEG& aBase );
121
122// void addMeander ( PNS_MEANDER *aM );
123// void addCorner ( const VECTOR2I& aP );
124
125 const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
126 bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
127
128 void setWorld( NODE* aWorld );
129 void release();
130
131 long long int origPathLength() const;
132
135
138
141
144
148
149 long long int m_lastLength;
153};
154
155}
156
157#endif // __PNS_DP_MEANDER_PLACER_H
Basic class for a differential pair.
std::vector< COUPLED_SEGMENTS > COUPLED_SEGMENTS_VEC
Differential Pair length-matching/meandering tool.
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
void meanderSegment(const SEG &aBase)
const ITEM_SET Traces() override
Function Traces()
bool pairOrientation(const DIFF_PAIR::COUPLED_SEGMENTS &aPair)
void setWorld(NODE *aWorld)
long long int TuningResult() const override
Return the resultant length or skew of the tuned traces.
VECTOR2I m_currentStart
Current world state.
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Commit the currently routed track to the parent node, taking aP as the final end point and aEndItem a...
long long int totalLength()
int CurrentLayer() const override
Function CurrentLayer()
TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
const SEG baselineSegment(const DIFF_PAIR::COUPLED_SEGMENTS &aCoupledSegs)
const DIFF_PAIR & GetOriginPair()
const ITEM_SET TunedPath() override
bool HasPlacedAnything() const override
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Move the end of the currently routed trace to the point aP, taking aEndItem as anchor (if not NULL).
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments
const VECTOR2I & CurrentStart() const override
Function CurrentStart()
long long int origPathLength() const
Current routing start point (end of tail, beginning of head).
const std::vector< NET_HANDLE > CurrentNets() const override
Function CurrentNets()
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
Base class for PNS router board items.
Definition: pns_item.h:97
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:424
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
The geometry of a single meander.
Definition: pns_meander.h:127
Keep the router "world" - i.e.
Definition: pns_node.h:207
Definition: seg.h:42
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.