PCB Environment 2
Loading...
Searching...
No Matches
RouteTracker.hpp
1
2#ifndef GYM_PCB_LOADERS_ROUTETRACKER_H
3#define GYM_PCB_LOADERS_ROUTETRACKER_H
4
5#include "AShape.hpp"
6#include "Via.hpp"
7#include "Loaders/Factory.hpp"
8
9class Net;
10class Pin;
11
12class RouteTracker
13{
14public:
15 RouteTracker(Net&, const std::vector<WideSegment_25>&, const std::vector<Via>&);
16 bool run();
17private:
18 Net &mNet;
19 const std::vector<WideSegment_25> &mSegs;
20 const std::vector<Via> &mVias;
21 std::map<Point_25, std::set<const Via *>> mPoint2Vias;
22 std::vector<std::list<WideSegment_25>> mTracks;
23 std::map<Point_2, std::set<uint>> mPoint2Tracks;
24 std::map<Point_25, Pin *> mPt2Pin;
25 void stitchTracks();
26 void mergeTracks(uint t, uint u);
27 void eraseFront(uint t);
28 void eraseBack(uint t);
29 void erasedFromTrack(const WideSegment_25&, uint t);
30 uint tryAppend(std::set<uint>&, const WideSegment_25&, uint except = std::numeric_limits<uint>::max());
31 bool tryAppend(uint track, const WideSegment_25&);
32 bool tryConnectTracks(uint t, uint u);
33 bool canAddVia(const Point_25 &v, int z) const;
34 void makeConnections();
35 void addConnection(Pin *, std::vector<WideSegment_25>&, std::vector<Via>&, Pin *);
36 Pin *getPin(const Point_25&) const;
37};
38inline Pin *RouteTracker::getPin(const Point_25 &v) const
39{
40 auto I = mPt2Pin.find(v);
41 if (I != mPt2Pin.end())
42 return I->second;
43 return 0;
44}
45
46#endif // GYM_PCB_LOADERS_ROUTETRACKER_H
Definition Net.hpp:19
Definition Pin.hpp:18
Definition Geometry.hpp:131
Definition AShape.hpp:332