Horizon
src
canvas
canvas_patch.hpp
1
#pragma once
2
#include "canvas.hpp"
3
#include "clipper/clipper.hpp"
4
5
namespace
horizon
{
6
class
CanvasPatch
:
public
Canvas
{
7
public
:
8
class
PatchKey
{
9
public
:
10
PatchType type;
11
int
layer;
12
UUID
net;
13
bool
operator<(
const
PatchKey
&other)
const
14
{
15
if
(type < other.type)
16
return
true
;
17
else
if
(type > other.type)
18
return
false
;
19
20
if
(layer < other.layer)
21
return
true
;
22
else
if
(layer > other.layer)
23
return
false
;
24
25
return
net < other.net;
26
}
27
};
28
std::map<PatchKey, ClipperLib::Paths> patches;
29
std::set<std::tuple<int, Coordi, Coordi>> text_extents;
30
void
append_polygon(
const
Polygon
&poly);
31
32
CanvasPatch
();
33
void
push()
override
34
{
35
}
36
void
request_push()
override
;
37
38
private
:
39
const
Net
*net =
nullptr
;
40
PatchType patch_type = PatchType::OTHER;
41
virtual
void
img_net(
const
Net
*net)
override
;
42
virtual
void
img_polygon(
const
Polygon
&poly,
bool
tr)
override
;
43
virtual
void
img_hole(
const
class
Hole
&hole)
override
;
44
virtual
void
img_patch_type(PatchType type)
override
;
45
virtual
void
img_text(
const
Text
&txt, std::pair<Coordf, Coordf> &extents)
override
;
46
};
47
}
// namespace horizon
horizon::Polygon
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition:
polygon.hpp:27
horizon::CanvasPatch
Definition:
canvas_patch.hpp:6
horizon::Canvas
Definition:
canvas.hpp:20
horizon::Text
Used wherever a user-editable text is needed.
Definition:
text.hpp:19
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition:
uuid.hpp:16
horizon
Definition:
block.cpp:9
horizon::CanvasPatch::PatchKey
Definition:
canvas_patch.hpp:8
horizon::Net
Definition:
net.hpp:16
horizon::Hole
A hole with diameter and position, that's it.
Definition:
hole.hpp:19
Generated by
1.8.13