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 ) 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 wxString TuningInfo() const override;
104  TUNING_STATUS TuningStatus() const override;
105 
106  bool CheckFit( MEANDER_SHAPE* aShape ) override;
107 
108 
109 private:
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 
119  void setWorld( NODE* aWorld );
120  void release();
121 
122  int origPathLength() const;
123 
126 
129 
132 
135 
138 
142 
145 };
146 
147 }
148 
149 #endif // __PNS_DP_MEANDER_PLACER_H
Class ITEM.
Definition: pns_item.h:53
Class MEANDER_PLACER_BASE.
Class NODE.
Definition: pns_node.h:137
Class MEANDER_SETTINGS.
Definition: pns_meander.h:104
void meanderSegment(const SEG &aBase)
const std::vector< int > CurrentNets() const override
Function CurrentNets()
NODE * m_currentNode
Current world state
NODE * m_world
pointer to world to search colliding items
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()
const wxString TuningInfo() const override
Function TuningInfo()
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()
void setWorld(NODE *aWorld)
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem) override
Function FixRoute()
Class MEANDERED_LINE.
Definition: pns_meander.h:395
Definition: seg.h:36
Class DIFF_PAIR.
TUNING_STATUS TuningStatus() const override
Function TuningStatus()
Class SHAPE_LINE_CHAIN.
Class DP_MEANDER_PLACER.
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Function Move()
int CurrentLayer() const override
Function CurrentLayer()
DP_MEANDER_PLACER(ROUTER *aRouter)
Push and Shove diff pair dimensions (gap) settings dialog.
DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments