Horizon
pns_dp_meander_placer.h
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_DP_MEANDER_PLACER_H
23#define __PNS_DP_MEANDER_PLACER_H
24
25#include <math/vector2d.h>
26
27#include <geometry/shape.h>
28#include <geometry/shape_line_chain.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"
35#include "pns_meander_placer_base.h"
36#include "pns_diff_pair.h"
37#include "pns_debug_decorator.h"
38
39namespace PNS {
40
41class ROUTER;
42
50{
51public:
52 DP_MEANDER_PLACER( ROUTER* aRouter );
54
61 bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
62
70 bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
71
81 bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
82
83 const LINE Trace() const;
84
90 NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
91
92 const ITEM_SET Traces() override;
93
94 const VECTOR2I& CurrentEnd() const override;
95
97 const std::vector<int> CurrentNets() const override;
98
99 int CurrentLayer() const override;
100
101 int totalLength();
102
103 const std::string TuningInfo() const override;
104 TUNING_STATUS TuningStatus() const override;
105
106 bool CheckFit( MEANDER_SHAPE* aShape ) override;
107
108
109private:
110 friend class MEANDER_SHAPE;
111
112 void meanderSegment( const SEG& aBase );
113
114// void addMeander ( PNS_MEANDER *aM );
115// void addCorner ( const VECTOR2I& aP );
116
117 const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
118 bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
119
120 void setWorld( NODE* aWorld );
121 void release();
122
123 int origPathLength() const;
124
126 NODE* m_world;
127
129 VECTOR2I m_currentStart;
130
132 NODE* m_currentNode;
133
134 DIFF_PAIR m_originPair;
135 DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments;
136
137 LINE m_currentTraceN, m_currentTraceP;
138 ITEM_SET m_tunedPath, m_tunedPathP, m_tunedPathN;
139
140 SHAPE_LINE_CHAIN m_finalShapeP, m_finalShapeN;
141 MEANDERED_LINE m_result;
142 SEGMENT* m_initialSegment;
143
144 int m_lastLength;
145 TUNING_STATUS m_lastStatus;
146};
147
148}
149
150#endif // __PNS_DP_MEANDER_PLACER_H
Class DIFF_PAIR.
Definition: pns_diff_pair.h:265
Class DP_MEANDER_PLACER.
Definition: pns_dp_meander_placer.h:50
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Function Start()
Definition: pns_dp_meander_placer.cpp:70
bool CheckFit(MEANDER_SHAPE *aShape) override
Function CheckFit()
Definition: pns_dp_meander_placer.cpp:318
const ITEM_SET Traces() override
Function Traces()
Definition: pns_dp_meander_placer.cpp:336
const std::string TuningInfo() const override
Function TuningInfo()
Definition: pns_dp_meander_placer.cpp:362
const std::vector< int > CurrentNets() const override
Function CurrentNets()
Definition: pns_dp_meander_placer.cpp:397
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Function FixRoute()
Definition: pns_dp_meander_placer.cpp:304
int CurrentLayer() const override
Function CurrentLayer()
Definition: pns_dp_meander_placer.cpp:356
TUNING_STATUS TuningStatus() const override
Function TuningStatus()
Definition: pns_dp_meander_placer.cpp:392
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
Definition: pns_dp_meander_placer.cpp:164
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
Definition: pns_dp_meander_placer.cpp:350
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Function CurrentNode()
Definition: pns_dp_meander_placer.cpp:61
Definition: pns_itemset.h:40
Class ITEM.
Definition: pns_item.h:55
Definition: pns_line.h:61
Class MEANDERED_LINE.
Definition: pns_meander.h:396
Class MEANDER_PLACER_BASE.
Definition: pns_meander_placer_base.h:49
TUNING_STATUS
‍Result of the length tuning operation
Definition: pns_meander_placer_base.h:52
Class MEANDER_SETTINGS.
Definition: pns_meander.h:105
Class NODE.
Definition: pns_node.h:138
Definition: pns_router.h:113
Definition: pns_segment.h:39
Definition: seg.h:37
Class SHAPE_LINE_CHAIN.
Definition: shape_line_chain.h:50
Definition: pns_diff_pair.h:268