mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
WIP on structuring arrange inputs
This commit is contained in:
parent
96f6fd2d9f
commit
19e6bf58dd
8 changed files with 298 additions and 146 deletions
|
@ -611,9 +611,38 @@ public:
|
|||
|
||||
int get_move_volume_id() const { return m_mouse.drag.move_volume_idx; }
|
||||
int get_first_hover_volume_idx() const { return m_hover_volume_idxs.empty() ? -1 : m_hover_volume_idxs.front(); }
|
||||
|
||||
class WipeTowerInfo: public arr::Arrangeable {
|
||||
Vec2d m_pos = {std::nan(""), std::nan("")};
|
||||
Vec2d m_bb_size;
|
||||
double m_rotation;
|
||||
friend class GLCanvas3D;
|
||||
public:
|
||||
|
||||
inline operator bool() const
|
||||
{
|
||||
return std::isnan(m_pos.x()) || std::isnan(m_pos.y());
|
||||
}
|
||||
|
||||
arr::WipeTowerInfo get_wipe_tower_info() const;
|
||||
void arrange_wipe_tower(const arr::WipeTowerInfo& wti) const;
|
||||
virtual void set_arrange_result(Vec2d offset, double rotation_rads) final;
|
||||
|
||||
virtual Polygon get_arrange_polygon() const final
|
||||
{
|
||||
Polygon p({
|
||||
{coord_t(0), coord_t(0)},
|
||||
{scaled(m_bb_size(X)), coord_t(0)},
|
||||
{scaled(m_bb_size)},
|
||||
{coord_t(0), scaled(m_bb_size(Y))},
|
||||
{coord_t(0), coord_t(0)},
|
||||
});
|
||||
|
||||
p.rotate(m_rotation);
|
||||
p.translate(scaled(m_pos));
|
||||
return p;
|
||||
}
|
||||
};
|
||||
|
||||
WipeTowerInfo get_wipe_tower_info() const;
|
||||
|
||||
// Returns the view ray line, in world coordinate, at the given mouse position.
|
||||
Linef3 mouse_ray(const Point& mouse_pos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue