1 #pragma once
2 #include <gtkmm.h>
3 #include "pool/package.hpp"
4 #include "util/xyz_container.hpp"
5 #include <glm/glm.hpp>
6 
7 namespace horizon {
8 
9 
10 class PlaceModelBox : public Gtk::Box {
11 public:
12     PlaceModelBox(class ImpPackage &aimp);
13     void handle_pick(const glm::dvec3 &p);
14     void init(const Package::Model &model);
15 
16 private:
17     ImpPackage &imp;
18     Gtk::Button *pick1_button;
19     Gtk::Button *pick2_button;
20     Gtk::Button *pick_cancel_button;
21     Gtk::Label *pick_state_label;
22     Gtk::Button *reset_button;
23     Gtk::Button *move_button;
24 
25     std::array<int64_t, 3> shift_init;
26 
27     XYZContainer<class SpinButtonDim *> sp_from;
28 
29     XYZContainer<Gtk::CheckButton *> cb_to;
30     XYZContainer<class SpinButtonDim *> sp_to;
31 
32     enum class PickState { IDLE, PICK_1, PICK_2_1, PICK_2_2 };
33     PickState pick_state = PickState::IDLE;
34     void update_pick_state();
35     void start_pick(PickState which);
36     void do_move();
37     void reset();
38 };
39 
40 } // namespace horizon
41