KiCad PCB EDA Suite
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 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>
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"
36 #include "pns_diff_pair.h"
37 #include "pns_debug_decorator.h"
38 
39 namespace PNS {
40 
41 class ROUTER;
42 
50 {
51 public:
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 
84  bool CommitPlacement() override;
85 
87  bool AbortPlacement() override;
88 
90  bool HasPlacedAnything() const override;
91 
92  const LINE Trace() const;
93 
99  NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
100 
101  const ITEM_SET Traces() override;
102 
103  const VECTOR2I& CurrentEnd() const override;
104 
106  const std::vector<int> CurrentNets() const override;
107 
108  int CurrentLayer() const override;
109 
110  long long int totalLength();
111 
112  const wxString TuningInfo( EDA_UNITS aUnits ) const override;
113  TUNING_STATUS TuningStatus() const override;
114 
115  bool CheckFit( MEANDER_SHAPE* aShape ) override;
116 
117 
118 private:
119  friend class MEANDER_SHAPE;
120 
121  void meanderSegment( const SEG& aBase );
122 
123 // void addMeander ( PNS_MEANDER *aM );
124 // void addCorner ( const VECTOR2I& aP );
125 
126  const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
127  bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
128 
129  void setWorld( NODE* aWorld );
130  void release();
131 
132  long long int origPathLength() const;
133 
136 
139 
142 
145 
149 
150  long long int m_lastLength;
154 };
155 
156 }
157 
158 #endif // __PNS_DP_MEANDER_PLACER_H
EDA_UNITS
Definition: common.h:196
ITEM.
Definition: pns_item.h:53
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Function FixRoute()
NODE.
Definition: pns_node.h:145
MEANDER_SETTINGS.
Definition: pns_meander.h:107
void meanderSegment(const SEG &aBase)
const std::vector< int > CurrentNets() const override
Function CurrentNets()
NODE * m_currentNode
Current world state
VECTOR2I m_currentStart
current routing start point (end of tail, beginning of head)
TUNING_STATUS
Result of the length tuning operation
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Function Start()
bool CheckFit(MEANDER_SHAPE *aShape) override
Function CheckFit()
bool pairOrientation(const DIFF_PAIR::COUPLED_SEGMENTS &aPair)
const SEG baselineSegment(const DIFF_PAIR::COUPLED_SEGMENTS &aCoupledSegs)
const ITEM_SET Traces() override
Function Traces()
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
std::vector< COUPLED_SEGMENTS > COUPLED_SEGMENTS_VEC
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Function CurrentNode()
long long int origPathLength() const
void setWorld(NODE *aWorld)
long long int totalLength()
MEANDERED_LINE.
Definition: pns_meander.h:398
Definition: seg.h:39
DIFF_PAIR.
const wxString TuningInfo(EDA_UNITS aUnits) const override
Function TuningInfo()
TUNING_STATUS TuningStatus() const override
Function TuningStatus()
SHAPE_LINE_CHAIN.
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
int CurrentLayer() const override
Function CurrentLayer()
DP_MEANDER_PLACER(ROUTER *aRouter)
bool HasPlacedAnything() const override
Push and Shove diff pair dimensions (gap) settings dialog.
DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments