Files
OrcaSlicer-bambulab/src/slic3r/GUI/GUI_ObjectManipulation.hpp
T

70 lines
1.9 KiB
C++
Raw Normal View History

2018-10-04 16:43:10 +02:00
#ifndef slic3r_GUI_ObjectManipulation_hpp_
#define slic3r_GUI_ObjectManipulation_hpp_
#include <memory>
2018-11-09 18:39:07 +01:00
#include "GUI_ObjectSettings.hpp"
#include "GLCanvas3D.hpp"
2018-10-04 16:43:10 +02:00
2018-11-23 11:54:06 +01:00
class wxStaticText;
2018-10-04 16:43:10 +02:00
namespace Slic3r {
namespace GUI {
class ObjectManipulation : public OG_Settings
{
Vec3d cache_position { 0., 0., 0. };
Vec3d cache_rotation { 0., 0., 0. };
Vec3d cache_scale { 100., 100., 100. };
Vec3d cache_size { 0., 0., 0. };
wxStaticText* m_move_Label = nullptr;
wxStaticText* m_scale_Label = nullptr;
wxStaticText* m_rotate_Label = nullptr;
// Needs to be updated from OnIdle?
bool m_dirty = false;
// Cached labels for the delayed update, not localized!
std::string m_new_move_label_string;
std::string m_new_rotate_label_string;
std::string m_new_scale_label_string;
Vec3d m_new_position;
Vec3d m_new_rotation;
Vec3d m_new_scale;
Vec3d m_new_size;
bool m_new_enabled;
2018-10-04 16:43:10 +02:00
public:
ObjectManipulation(wxWindow* parent);
~ObjectManipulation() {}
2018-11-09 18:39:07 +01:00
void Show(const bool show) override;
bool IsShown() override;
void UpdateAndShow(const bool show) override;
void update_settings_value(const GLCanvas3D::Selection& selection);
2018-10-04 16:43:10 +02:00
// Called from the App to update the UI if dirty.
void update_if_dirty();
private:
void reset_settings_value();
// update size values after scale unit changing or "gizmos"
void update_size_value(const Vec3d& size);
2018-10-04 16:43:10 +02:00
// update rotation value after "gizmos"
void update_rotation_value(const Vec3d& rotation);
// change values
void change_position_value(const Vec3d& position);
void change_rotation_value(const Vec3d& rotation);
void change_scale_value(const Vec3d& scale);
void change_size_value(const Vec3d& size);
2018-10-04 16:43:10 +02:00
};
}}
#endif // slic3r_GUI_ObjectManipulation_hpp_