Horizon
Loading...
Searching...
No Matches
tool_place_via.hpp
1#pragma once
2#include "core/tool.hpp"
3#include "tool_place_junction.hpp"
4#include "board/board_junction.hpp"
5#include <forward_list>
6
7namespace horizon {
8
9class ToolPlaceVia : public ToolPlaceJunctionT<class BoardJunction> {
10public:
11 using ToolPlaceJunctionT<BoardJunction>::ToolPlaceJunctionT;
12 bool can_begin() override;
13 std::set<InToolActionID> get_actions() const override
14 {
15 using I = InToolActionID;
16 return {
17 I::LMB, I::CANCEL, I::RMB, I::EDIT, I::SELECT_VIA_DEFINITION,
18 };
19 }
20
21protected:
22 void insert_junction() override;
23 void create_attached() override;
24 void delete_attached() override;
25 bool begin_attached() override;
26 void finish() override;
27 bool update_attached(const ToolArgs &args) override;
28 class Via *via = nullptr;
29 class Net *net = nullptr;
30 std::set<UUID> nets;
31
32 std::forward_list<class Via *> vias_placed;
33 const class ViaDefinition *via_definition = nullptr;
34
35private:
36 const class BoardRules *rules = nullptr;
37 void update_tip();
38 void update_via();
39};
40} // namespace horizon
Definition board_junction.hpp:6
Definition board_rules.hpp:28
Definition net.hpp:11
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Definition tool_place_junction.hpp:57
Definition tool_place_via.hpp:9
bool can_begin() override
Definition tool_place_via.cpp:12
Definition via_definition.hpp:7
Definition via.hpp:12