Horizon
tool_align_and_distribute.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_helper_save_placements.hpp"
4 
5 namespace horizon {
6 
8 public:
9  using ToolBase::ToolBase;
10  ToolResponse begin(const ToolArgs &args) override;
11  ToolResponse update(const ToolArgs &args) override;
12  bool can_begin() override;
13  bool is_specific() override
14  {
15  return true;
16  }
17  std::set<InToolActionID> get_actions() const override
18  {
19  return {};
20  }
21 
22  enum class Operation {
23  RESET,
24  DISTRIBUTE_ORIGIN_HORIZONTAL,
25  DISTRIBUTE_ORIGIN_VERTICAL,
26  ALIGN_ORIGIN_TOP,
27  ALIGN_ORIGIN_LEFT,
28  ALIGN_ORIGIN_RIGHT,
29  ALIGN_ORIGIN_BOTTOM,
30  ALIGN_BBOX_TOP,
31  ALIGN_BBOX_LEFT,
32  ALIGN_BBOX_RIGHT,
33  ALIGN_BBOX_BOTTOM,
34  DISTRIBUTE_EQUIDISTANT_HORIZONTAL,
35  DISTRIBUTE_EQUIDISTANT_VERTICAL,
36  };
37 
38 
39 private:
40  class AlignAndDistributeWindow *win = nullptr;
41  void align(Coordi::type Coordi::*cp, const int64_t PlacementInfo::*pp, int64_t pp_sign);
42  void distribute(Coordi::type Coordi::*cp);
43  void distribute_equi(Coordi::type Coordi::*cp, const int64_t PlacementInfo::*pp1,
44  const int64_t PlacementInfo::*pp2);
45 };
46 } // namespace horizon
Definition: tool_align_and_distribute.hpp:7
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_align_and_distribute.cpp:24
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_align_and_distribute.cpp:17
bool is_specific() override
Definition: tool_align_and_distribute.hpp:13
bool can_begin() override
Definition: tool_align_and_distribute.cpp:12
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_helper_save_placements.hpp:9
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool_pub.hpp:40
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103