Horizon
tool_draw_dimension.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_helper_restrict.hpp"
4 
5 namespace horizon {
7 public:
8  ToolDrawDimension(IDocument *c, ToolID tid);
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 {
16  I::LMB, I::CANCEL, I::RMB, I::RESTRICT, I::DIMENSION_MODE, I::ENTER_DATUM,
17  };
18  }
19 
20 private:
21  class Dimension *temp = nullptr;
22  void update_tip();
23 
24  enum class State { P0, P1, LABEL };
25  State state = State::P0;
26 };
27 } // namespace horizon
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolDrawDimension::can_begin
bool can_begin() override
Definition: tool_draw_dimension.cpp:14
horizon::ToolDrawDimension
Definition: tool_draw_dimension.hpp:6
horizon::ToolHelperRestrict
Definition: tool_helper_restrict.hpp:6
horizon::Dimension
Definition: dimension.hpp:12
horizon::ToolDrawDimension::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_dimension.cpp:78
horizon::ToolDrawDimension::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_dimension.cpp:19
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:121
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:23