Horizon
Loading...
Searching...
No Matches
tool_draw_track.hpp
1#pragma once
2#include "core/tool.hpp"
3
4namespace horizon {
5
6class ToolDrawTrack : public ToolBase {
7public:
8 using ToolBase::ToolBase;
9 ToolResponse begin(const ToolArgs &args) override;
10 ToolResponse update(const ToolArgs &args) override;
11 bool can_begin() override;
12 std::set<InToolActionID> get_actions() const override
13 {
14 using I = InToolActionID;
15 return {I::LMB, I::CANCEL, I::RMB, I::TOGGLE_ARC, I::FLIP_ARC};
16 }
17
18private:
19 enum class ArcMode { OFF, NEXT, CURRENT };
20 ArcMode arc_mode = ArcMode::OFF;
21 class BoardJunction *temp_junc = 0;
22 class Track *temp_track = 0;
23 void create_temp_track();
24 class BoardRules *rules;
25
26 void update_tip();
27 ToolResponse finish();
28};
29} // namespace horizon
Definition board_junction.hpp:6
Definition board_rules.hpp:28
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Common interface for all Tools.
Definition tool_pub.hpp:94
Definition tool_draw_track.hpp:6
bool can_begin() override
Definition tool_draw_track.cpp:10
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_draw_track.cpp:40
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_draw_track.cpp:15
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40
Definition track.hpp:14