Horizon
tool_drag_keep_slope.hpp
1 #pragma once
2 #include "board/track.hpp"
3 #include "core.hpp"
4 #include <deque>
5 
6 namespace horizon {
7 
8 class ToolDragKeepSlope : public ToolBase {
9 public:
10  ToolDragKeepSlope(Core *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14  bool is_specific() override
15  {
16  return true;
17  }
18 
19 private:
20  class TrackInfo {
21  public:
22  Track *track = nullptr; // the track itself
23  Track *track_from = nullptr;
24  Track *track_to = nullptr;
25  Coordi pos_from2;
26  Coordi pos_to2;
27  Coordi pos_from_orig;
28  Coordi pos_to_orig;
29  TrackInfo(Track *tr, Track *fr, Track *to);
30  // TrackInfo(Track *a, Track *b, Track *c): track(a), track_from(b),
31  // track_to(c) {}
32  };
33 
34  std::deque<TrackInfo> track_info;
35  Coordi pos_orig;
36 };
37 } // namespace horizon
horizon::ToolDragKeepSlope::is_specific
bool is_specific() override
Definition: tool_drag_keep_slope.hpp:14
horizon::ToolDragKeepSlope
Definition: tool_drag_keep_slope.hpp:8
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:72
horizon::ToolDragKeepSlope::can_begin
bool can_begin() override
Definition: tool_drag_keep_slope.cpp:11
horizon::Track
Definition: track.hpp:17
horizon::ToolDragKeepSlope::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_drag_keep_slope.cpp:40
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::ToolBase
Common interface for all Tools.
Definition: core.hpp:141
horizon::ToolDragKeepSlope::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_drag_keep_slope.cpp:90
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: core.hpp:26