Horizon
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,
18 I::CANCEL,
19 I::RMB,
20 I::EDIT,
21 };
22 }
23
24protected:
25 void insert_junction() override;
26 void create_attached() override;
27 void delete_attached() override;
28 bool begin_attached() override;
29 void finish() override;
30 bool update_attached(const ToolArgs &args) override;
31 class Via *via = nullptr;
32 class Net *net = nullptr;
33 std::set<UUID> nets;
34
35 std::forward_list<class Via *> vias_placed;
36
37private:
38 const class BoardRules *rules = nullptr;
39 void update_tip();
40};
41} // namespace horizon
Definition: board_junction.hpp:6
Definition: board_rules.hpp:27
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:11
Definition: via.hpp:12