KiCad PCB EDA Suite
pns_topology.h
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2015 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_TOPOLOGY_H
23 #define __PNS_TOPOLOGY_H
24 
25 #include <vector>
26 #include <set>
27 
28 #include "pns_itemset.h"
29 
30 namespace PNS {
31 
32 class NODE;
33 class SEGMENT;
34 class JOINT;
35 class ITEM;
36 class SOLID;
37 class DIFF_PAIR;
38 
39 class TOPOLOGY
40 {
41 public:
42  typedef std::set<JOINT*> JOINT_SET;
43 
44  TOPOLOGY( NODE* aNode ):
45  m_world( aNode ) {};
46 
47  ~TOPOLOGY() {};
48 
49  bool SimplifyLine( LINE *aLine );
50  ITEM* NearestUnconnectedItem( JOINT* aStart, int* aAnchor = NULL, int aKindMask = ITEM::ANY_T );
51  bool LeadingRatLine( const LINE* aTrack, SHAPE_LINE_CHAIN& aRatLine );
52 
53  const JOINT_SET ConnectedJoints( JOINT* aStart );
54  const ITEM_SET ConnectedItems( JOINT* aStart, int aKindMask = ITEM::ANY_T );
55  const ITEM_SET ConnectedItems( ITEM* aStart, int aKindMask = ITEM::ANY_T );
56  int64_t ShortestConnectionLength( ITEM* aFrom, ITEM* aTo );
57 
58  const ITEM_SET AssembleTrivialPath( ITEM* aStart );
59  const DIFF_PAIR AssembleDiffPair( SEGMENT* aStart );
60 
61  int DpCoupledNet( int aNet );
62  int DpNetPolarity( int aNet );
63  const LINE DpCoupledLine( LINE* aLine );
64  bool AssembleDiffPair( ITEM* aStart, DIFF_PAIR& aPair );
65 
66  const std::set<ITEM*> AssembleCluster( ITEM* aStart, int aLayer );
67 
68 private:
69  bool followTrivialPath( LINE* aLine, bool aLeft, ITEM_SET& aSet, std::set<ITEM*>& aVisited );
70 
72 };
73 
74 }
75 
76 #endif
const JOINT_SET ConnectedJoints(JOINT *aStart)
Class ITEM.
Definition: pns_item.h:53
int64_t ShortestConnectionLength(ITEM *aFrom, ITEM *aTo)
TOPOLOGY(NODE *aNode)
Definition: pns_topology.h:44
Class NODE.
Definition: pns_node.h:137
bool followTrivialPath(LINE *aLine, bool aLeft, ITEM_SET &aSet, std::set< ITEM * > &aVisited)
const ITEM_SET ConnectedItems(JOINT *aStart, int aKindMask=ITEM::ANY_T)
const DIFF_PAIR AssembleDiffPair(SEGMENT *aStart)
ITEM * NearestUnconnectedItem(JOINT *aStart, int *aAnchor=NULL, int aKindMask=ITEM::ANY_T)
const LINE DpCoupledLine(LINE *aLine)
const std::set< ITEM * > AssembleCluster(ITEM *aStart, int aLayer)
Class JOINT.
Definition: pns_joint.h:43
const ITEM_SET AssembleTrivialPath(ITEM *aStart)
int DpCoupledNet(int aNet)
bool LeadingRatLine(const LINE *aTrack, SHAPE_LINE_CHAIN &aRatLine)
NODE * m_world
Definition: pns_topology.h:71
bool SimplifyLine(LINE *aLine)
Class DIFF_PAIR.
Class SHAPE_LINE_CHAIN.
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
int DpNetPolarity(int aNet)
Push and Shove diff pair dimensions (gap) settings dialog.
std::set< JOINT * > JOINT_SET
Definition: pns_topology.h:42