Horizon
tool_map_pin.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 class ToolMapPin : public ToolBase {
6 public:
7  ToolMapPin(IDocument *c, ToolID tid);
8  ToolResponse begin(const ToolArgs &args) override;
9  ToolResponse update(const ToolArgs &args) override;
10  bool can_begin() override;
11  ~ToolMapPin();
12 
13 private:
14  std::vector<std::pair<const class Pin *, bool>> pins;
15  unsigned int pin_index = 0;
16  class SymbolPin *pin = nullptr;
17  SymbolPin *pin_last = nullptr;
18  SymbolPin *pin_last2 = nullptr;
19  void create_pin(const UUID &uu);
20  bool can_autoplace() const;
21  void update_tip();
22  class CanvasAnnotation *annotation = nullptr;
23  void update_annotation();
24 };
25 } // namespace horizon
horizon::IDocument
Definition: idocument.hpp:5
horizon::CanvasAnnotation
Definition: annotation.hpp:7
horizon::ToolMapPin::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_map_pin.cpp:145
horizon::SymbolPin
Definition: symbol.hpp:22
horizon::ToolMapPin::can_begin
bool can_begin() override
Definition: tool_map_pin.cpp:18
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:136
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::ToolMapPin::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_map_pin.cpp:39
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:48
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:22
horizon::ToolMapPin
Definition: tool_map_pin.hpp:5