Horizon
horizon-eda-1.3.0
src
board
track.hpp
1
#pragma once
2
#include "block/net.hpp"
3
#include "board_package.hpp"
4
#include "common/common.hpp"
5
#include "common/junction.hpp"
6
#include "nlohmann/json_fwd.hpp"
7
#include "util/uuid.hpp"
8
#include "util/uuid_ptr.hpp"
9
#include <fstream>
10
#include <map>
11
#include <vector>
12
13
namespace
horizon {
14
using
json
=
nlohmann::json
;
15
16
class
Track
{
17
public
:
18
Track
(
const
UUID
&uu,
const
json
&j,
class
Board
*brd =
nullptr
);
19
Track
(
const
UUID
&uu);
20
21
void
update_refs(
class
Board
&brd);
22
UUID
get_uuid()
const
;
23
bool
coord_on_line(
const
Coordi
&coord)
const
;
24
25
UUID
uuid;
26
uuid_ptr<Net>
net =
nullptr
;
27
int
layer = 0;
28
uint64_t
width = 0;
29
bool
width_from_rules =
true
;
30
31
bool
locked =
false
;
32
33
class
Connection
{
34
public
:
35
Connection
()
36
{
37
}
38
Connection
(
const
json
&j,
Board
*brd =
nullptr
);
39
Connection
(
Junction
*j);
40
Connection
(
BoardPackage
*pkg,
Pad
*pad);
41
uuid_ptr<Junction>
junc =
nullptr
;
42
uuid_ptr<BoardPackage>
package
= nullptr;
43
uuid_ptr<Pad>
pad =
nullptr
;
44
bool
operator<(
const
Track::Connection
&other)
const
;
45
bool
operator==(
const
Track::Connection
&other)
const
;
46
47
void
connect(
Junction
*j);
48
void
connect(
BoardPackage
*pkg,
Pad
*pad);
49
UUIDPath<2>
get_pad_path()
const
;
50
bool
is_junc()
const
;
51
bool
is_pad()
const
;
52
UUID
get_net_segment()
const
;
53
void
update_refs(
class
Board
&brd);
54
Coordi
get_position()
const
;
55
LayerRange
get_layer()
const
;
56
Net
*get_net();
57
58
json
serialize()
const
;
59
};
60
61
Connection
from;
62
Connection
to;
63
64
json
serialize()
const
;
65
};
66
}
// namespace horizon
horizon::LayerRange
Definition:
layer_range.hpp:7
horizon::uuid_ptr
Definition:
uuid_ptr.hpp:8
horizon::Pad
Definition:
pad.hpp:15
horizon::Board
Definition:
board.hpp:42
horizon::Net
Definition:
net.hpp:15
horizon::Coord< int64_t >
horizon::BoardPackage
Definition:
board_package.hpp:15
horizon::Track
Definition:
track.hpp:16
horizon::UUIDPath< 2 >
horizon::Junction
A Junction is a point in 2D-Space.
Definition:
junction.hpp:22
nlohmann::basic_json
a class to store JSON values
Definition:
json.hpp:166
horizon::Track::Connection
Definition:
track.hpp:33
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition:
uuid.hpp:16
nlohmann::json
basic_json<> json
default JSON class
Definition:
json_fwd.hpp:61
libzip::uint64_t
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition:
zip.hpp:108
Generated by
1.8.20